Skip to content

sumit0804/wildfire-compliance-checker

Repository files navigation

πŸ”₯ Wildfire Compliance Checker

AI-powered compliance checking for IBHS Wildfire Prepared Home Plus designation using Claude's vision capabilities.

Overview

This tool automatically analyzes building plan PDFs and checks them against the IBHS (Insurance Institute for Business & Home Safety) Wildfire Prepared Home Plus technical standards. It uses Claude's vision API to read and interpret architectural drawings, specifications, and notes.

Features

  • βœ… Automated Plan Analysis: Reviews all plan sheets using AI vision
  • πŸ“‹ Comprehensive Checking: Covers all 32+ IBHS requirements across 16 categories
  • 🎯 Intelligent Synthesis: Aggregates findings across multiple sheets
  • πŸ“Š Detailed Reports: Generates both JSON and HTML reports
  • πŸ” Evidence Tracking: References specific plan sheet locations
  • πŸ’‘ Recommendations: Provides actionable guidance for non-compliant items
  • πŸ“ˆ Confidence Scoring: Each finding includes a confidence level

Requirements

System Requirements

  • Python 3.8+
  • poppler-utils (for PDF to image conversion)

Python Dependencies

  • anthropic (Claude API client)
  • pdf2image
  • Pillow

Installation

1. Install System Dependencies

macOS:

brew install poppler

Ubuntu/Debian:

sudo apt-get install poppler-utils

Windows: Download and install poppler from: https://github.com/oschwartz10612/poppler-windows/releases/

2. Clone Repository

git clone https://github.com/sumit0804/wildfire-compliance-checker.git
cd wildfire-compliance-checker

3. Install Python Dependencies

pip install -r requirements.txt

4. Set Up API Key

Get your Anthropic API key from: https://console.anthropic.com/

Set as environment variable:

export ANTHROPIC_API_KEY='your-api-key-here'

Or pass directly when running the tool.

Usage

Command Line Interface

Basic usage:

python compliance_checker.py /path/to/building_plans.pdf

With HTML report:

python compliance_checker.py /path/to/building_plans.pdf --html

Specify output path:

python compliance_checker.py /path/to/building_plans.pdf -o my_report.json --html

With API key:

python compliance_checker.py /path/to/building_plans.pdf --api-key sk-ant-xxxxx

Python API

from compliance_checker import WildfireComplianceChecker

# Initialize checker
checker = WildfireComplianceChecker(api_key='your-api-key')

# Run compliance check
results = checker.check_compliance(
    plan_pdf_path='path/to/plans.pdf',
    output_path='compliance_report.json'
)

# Generate HTML report
html_path = checker.generate_html_report(
    results_json_path='compliance_report.json',
    output_html_path='compliance_report.html'
)

# Access results
summary = results['summary']
print(f"Compliance Rate: {summary['compliance_rate']}")
print(f"Critical Issues: {summary['critical_issues']}")

IBHS Requirements Covered

The tool checks compliance with all IBHS Wildfire Prepared Home Plus requirements:

Building Construction (Requirements 1-11)

  1. Roof Assembly: Class A rating, noncombustible flashing, no wood shakes
  2. Gutters and Downspouts: Noncombustible materials, gutter covers
  3. Vents: ASTM E2886 compliance or mesh protection
  4. Exterior Walls: 100% noncombustible coverage
  5. Eaves and Soffits: Noncombustible enclosure
  6. Windows and Glazing: Tempered panes or fire-rated glazing
  7. Exterior Doors: Noncombustible or solid-core wood
  8. Underfloor and Projections: Noncombustible coverings
  9. Attached Decks and Stairs: All components noncombustible
  10. Additional Structures: Noncombustible within 30 feet
  11. Detached Structures: 30-foot separation, same standards

Defensible Space (Requirements 12-16)

  1. Zone 0 (0-5 feet): Clear zone, noncombustible hardscape
  2. Zone 1 (5-30 feet): Vegetation spacing, no fuel bed
  3. Fences and Gates: Noncombustible within 5 feet
  4. Propane Tanks: 30-foot separation or clearance zones
  5. Hot Tubs and Saunas: 10-foot separation, noncombustible zone

Output Format

JSON Report

{
  "project_info": {
    "plan_file": "building_plans.pdf",
    "check_date": "2025-02-07T10:30:00",
    "total_requirements": 32,
    "total_sheets": 11
  },
  "summary": {
    "total_requirements": 32,
    "compliant": 24,
    "non_compliant": 3,
    "insufficient_info": 4,
    "needs_review": 1,
    "compliance_rate": "75.0%",
    "critical_issues": 2,
    "average_confidence": "82.5%"
  },
  "findings": [
    {
      "requirement_id": "1a",
      "category": "Roof Assembly",
      "status": "COMPLIANT",
      "confidence": 0.95,
      "finding_text": "...",
      "evidence": ["Sheet 1: General Notes", "Sheet 3: Roof Plan"],
      "recommendation": null
    }
  ]
}

HTML Report

The HTML report provides:

  • Visual summary dashboard
  • Compliance rate visualization
  • Findings organized by category
  • Color-coded status indicators
  • Confidence bars
  • Evidence references
  • Actionable recommendations

How It Works

1. PDF Processing

  • Converts each PDF page to high-resolution images (200 DPI)
  • Maintains scale information for measurements

2. AI Analysis

For each requirement:

  • Claude analyzes each plan sheet with vision API
  • Searches for relevant specifications, notes, and details
  • Extracts material callouts and dimensions
  • Identifies compliance evidence

3. Synthesis

  • Aggregates findings across all sheets
  • Determines overall compliance status
  • Calculates confidence scores
  • Generates recommendations

4. Reporting

  • Compiles comprehensive JSON results
  • Generates formatted HTML report
  • Provides actionable next steps

Compliance Status Definitions

  • COMPLIANT: Clear evidence requirement is met
  • NON-COMPLIANT: Clear evidence requirement is not met
  • INSUFFICIENT_INFO: Cannot determine from available plans
  • NEEDS_REVIEW: Ambiguous or requires professional judgment

Limitations

  1. AI Interpretation: While highly accurate, AI may misinterpret complex or ambiguous drawings
  2. Professional Review: This tool supplements but does not replace professional plan review
  3. Code Versions: Checks against current IBHS Plus standards (update requirements as needed)
  4. Visual Quality: Works best with clear, high-quality scanned plans
  5. API Costs: Uses Claude's vision API which has associated costs

Best Practices

  1. Plan Quality: Ensure PDFs are clear and readable
  2. Complete Sets: Include all relevant sheets (architectural, structural, MEP, landscape)
  3. Review Results: Always review findings, especially low-confidence items
  4. Professional Verification: Have critical findings verified by professionals
  5. Multiple Passes: For complex projects, consider reviewing questionable items manually

Troubleshooting

PDF Conversion Issues

# Verify poppler installation
pdfinfo --version

# If issues persist, install latest poppler

API Errors

# Verify API key
echo $ANTHROPIC_API_KEY

# Check API quota at console.anthropic.com

Memory Issues (Large PDFs)

  • Process sheets in batches
  • Reduce DPI in convert_pdf_to_images() (currently 200)
  • Split large plan sets into multiple files

Cost Estimation

Approximate Claude API costs (as of Feb 2025):

  • Per plan sheet: ~$0.10-0.30 (depending on complexity)
  • Typical plan set (10-15 sheets): ~$2-5 total
  • Large commercial project (30+ sheets): ~$10-15

Example Projects

See the examples/ directory for:

  • Sample plan PDFs
  • Generated compliance reports
  • Common compliance issues

Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new requirements
  4. Submit a pull request

Roadmap

  • Support for other wildfire standards (CAL FIRE, ICC)
  • Measurement extraction for zone verification
  • Multi-language support
  • Web interface
  • Batch processing for multiple projects
  • Integration with plan review software

License

MIT License - see LICENSE file for details

Disclaimer

This tool is provided for informational purposes only. Compliance determinations should be verified by licensed professionals. The tool's output does not constitute professional plan review, code compliance certification, or engineering approval.

Support

Acknowledgments

  • IBHS for technical standards
  • Anthropic for Claude API
  • Building plan reviewers for domain expertise

Made with πŸ”₯ prevention in mind

About

AI-powered compliance checking for IBHS Wildfire Prepared Home Plus designation using Claude API

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors