Enterprise-grade BIM Quality Validation with ML-powered Anomaly Detection and Portfolio Analytics
The IFC Quality Intelligence Platform automatically validates IFC building models(batch processing), combining rule-based checks with machine learning to detect quality issues across different of models.
- Rule-Based Validation - 7 quality checks (missing metadata, geometry issues)
- ML Anomaly Detection - Isolation Forest with adaptive contamination for geometric outliers
- Batch Processing - Process entire directories with fault tolerance
- Portfolio Analytics - Aggregate metrics across 100s of models
- Dual Dashboards - Single model + Portfolio overview modes with ML insights
- 88 Passing Tests - Production-ready code quality
git clone https://github.com/dheerajram13/ifc-quality-intelligence.git
cd ifc-quality-intelligence
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
pip install -e .# Analyze one IFC file with ML
python examples/example_ml_anomaly_detection.py examples/ifc_files/Duplex_MEP_20110907.ifc
# Output:
# β Quality Score: 90.6/100
# β Issues: 90 (1 major, 89 minor)
# β ML Anomalies: 49 (5.1%)# Process all IFC files in a directory
python examples/example_batch_processing.py examples/ifc_files
# Creates:
# output/portfolio/
# βββ portfolio_summary.csv # One row per model
# βββ portfolio_metrics.json # Aggregate KPIs
# βββ <model_name>/
# βββ metrics.json
# βββ issues.csv
# βββ anomalies.csv
# βββ report.html# Portfolio Dashboard (NEW!)
streamlit run apps/portfolio_dashboard.py
# Access at http://localhost:85011. Portfolio Mode - Overview of 100+ models
- Portfolio KPIs (avg quality, models below threshold, total issues)
- Quality score distribution
- Top 10 offenders by critical issues
- Pareto analysis across all models
- Drilldown - Click model β view detailed charts
Portfolio Charts:
Model Drilldown View - Select a model from portfolio to see details:
2. Single Model Mode - Deep dive on one model
- Quality threshold slider (PASS/FAIL)
- Severity breakdown
- Top 20 issues table (actionable)
- Metadata completeness metrics
ML Anomaly Detection:
Actionable Tables:
# 1. Process latest models
python examples/example_batch_processing.py /path/to/models
# 2. Open dashboard
streamlit run apps/portfolio_dashboard.py
# 3. Review in 2 minutes:
# - Success rate (all processed?)
# - Avg quality (trending up?)
# - Models below threshold
# - Click worst model β see specific issues# 1. Launch dashboard
streamlit run apps/portfolio_dashboard.py
# 2. Switch to "Single Model" mode
# 3. Upload IFC file or use output folder
# 4. Check quality threshold status:
# β
PASS (Score: 92.3) β Accept
# β FAIL (Score: 67.1) β Review top issues table β Reject# Sequential (slow for 600 models)
python examples/example_batch_processing.py /models
# Parallel (4x faster - recommended)
# Edit example_batch_processing.py:
# max_workers=8
python examples/example_batch_processing.py /models
# Outputs:
# - Portfolio summary CSV (one row per model)
# - Portfolio metrics JSON (aggregate KPIs)
# - Per-model detailed reportsIFC File(s) β Batch Processor β Per-Model Pipeline:
ββ IFC Loader
ββ Geometry Features
ββ Quality Checks (7 rules)
ββ ML Anomalies
ββ Metrics
Portfolio Aggregator β Portfolio KPIs
Dashboard (Streamlit) β [Portfolio | Single Model]
score = 100 - (weighted_issues / total_elements Γ 100)
# Weights:
# critical = 3.0
# major = 2.0
# minor = 1.0| Check | Severity | Example |
|---|---|---|
| Missing Name | Major | Element without name attribute |
| Missing ObjectType | Minor | Missing type metadata |
| Duplicate GlobalId | Critical | Same ID used twice |
| Degenerate Geometry | Major | Dimension < 1mm |
| Extreme Dimensions | Critical | Dimension > 100km |
| Coordinate Anomalies | Minor | Element far from origin |
| Extreme Aspect Ratios | Minor | Very thin/flat shapes (ratio > 1000) |
- Algorithm: Isolation Forest (unsupervised)
- Features: 9 geometric properties (dims, centroids, aspect ratios)
- Contamination: 0.05 (expect 5% anomalies)
- Output: Anomaly score + probability (0-1)
ifc-quality-intelligence/
βββ src/ifcqi/
β βββ ifc_loader.py # IFC parsing
β βββ geometry.py # 3D geometry extraction
β βββ features.py # Feature engineering
β βββ checks.py # 7 quality rules
β βββ metrics.py # Scoring & KPIs
β βββ batch.py # Portfolio processing
β βββ viz.py # Plotly charts
β βββ ml/
β βββ preprocessing.py # Feature scaling
β βββ anomaly_detection.py # Isolation Forest
β
βββ apps/
β βββ dashboard.py # Single model (legacy)
β βββ portfolio_dashboard.py # Portfolio + Single (NEW!)
β
βββ examples/
β βββ example_quality_checks.py
β βββ example_ml_anomaly_detection.py
β βββ example_batch_processing.py
β
βββ tests/ # 88 tests
β βββ test_ifc_loader.py (20 tests)
β βββ test_checks.py (25 tests)
β βββ test_metrics.py (6 tests)
β βββ test_viz.py (12 tests)
β βββ test_ml.py (25 tests)
β
βββ output/
βββ portfolio/
βββ portfolio_summary.csv
βββ portfolio_metrics.json
βββ <model_name>/...
# Run all 88 tests
pytest
# Run specific module
pytest tests/test_ml.py -v
# With coverage
pytest --cov=ifcqi --cov-report=html
# Current status: β
88/88 passingElements: 973
Quality Score: 90.6/100 β
Issues: 90 (0 critical, 1 major, 89 minor)
ML Anomalies: 49 (5.1%)
Top Issues:
- 47 missing object_type
- 42 extreme aspect ratios
- 1 missing name
ML detected:
- 25 IfcFlowSegment (unusual pipe dimensions)
- 24 IfcSpace (57% of rooms - irregular shapes)
Total Models: 5
Success: 5 (100%)
Avg Quality: 70.1/100
Below Threshold: 2 (40%)
Total Issues: 1,211
Critical: 0
Major: 975
Minor: 236
ML Anomalies: 122 (4.5% avg rate)
Worst Model: Duplex_Plumbing_20121113 (score: 0.0)
Best Model: Duplex_Electrical_20121207 (score: 94.5)
Dataset Visualization:
# In portfolio_dashboard.py sidebar:
quality_threshold = 80.0 # Models below = FAIL
# Adjust based on project requirements:
# 90+ = Excellent
# 80-89 = Good
# 70-79 = Acceptable
# <70 = Needs work# In example_batch_processing.py:
max_workers = None # Sequential (safe, slow)
max_workers = 4 # Parallel (4x faster)
max_workers = 8 # Max CPU cores# Batch processing:
enable_ml = True # ML anomaly detection ON
enable_ml = False # Skip ML (faster)Duplex_MEP_20110907.ifc (973 elements):
- IFC Loading: 0.5s
- Geometry: 1.5s
- Quality Checks: 0.3s
- ML Anomalies: 2.5s
- Total: ~5s
Scaling to 600 models:
Sequential: ~50 minutes
Parallel (8): ~7 minutes
Questions?
- Check
output/portfolio/portfolio_summary.csvfor failed models - Review examples/ folder for usage patterns
- Run
pytestto verify installation
Author: Dheeraj Srirama Portfolio: dheerajsrirama.netlify.app GitHub: @dheerajram13
Built for enterprise-scale BIM quality validation
Demonstrates production ML engineering: feature extraction, validation pipelines, batch processing, portfolio analytics, and interactive dashboards for real-world AEC data.





