ConstructGuard AI leverages Deep Learning, Computer Vision, and Google Gemini 2.5 Flash to automatically identify construction defects from images and generate professional inspection reports with actionable recommendations.
https://0cb1d45e.constructguard-ai.pages.dev/
https://ayushmsingh2004-constructguard-backend.hf.space/
https://ayushmsingh2004-constructguard-backend.hf.space/docs
ConstructGuard AI is an intelligent construction inspection platform designed to assist engineers, researchers, inspectors, and infrastructure professionals in identifying visible construction defects using Artificial Intelligence.
The platform combines:
- 🧠 Deep Learning Models
- 🤖 Google Gemini 2.5 Flash
- 📷 Computer Vision
- ⚡ FastAPI Backend
- 🌐 Modern React Frontend
to deliver automated defect detection and professional inspection reports.
Unlike traditional image classifiers, ConstructGuard AI first validates whether an uploaded image is genuinely related to construction or infrastructure inspection before performing any defect analysis.
- 🏗️ Construction Defect Detection
- 🤖 Gemini-Powered Image Validation
- 🧠 Multi-Model Classification Pipeline
- 📊 Severity Assessment
- 📄 AI-Generated Inspection Reports
- 🎯 Specialized Moisture & Structural Models
- 📷 Grad-CAM Visual Explanations
- 📑 PDF Report Export
- 📱 Responsive User Interface
- ☁️ Cloud Deployment
Every uploaded image is first analyzed using Google Gemini 2.5 Flash.
Gemini verifies whether the image contains:
- Buildings
- Walls
- Concrete Structures
- Infrastructure Components
- Construction Sites
- Structural Defects
If the image is unrelated to construction:
❌ Analysis Not Performed
Examples:
Valid:
- Cracks
- Buildings
- Walls
- Concrete Surfaces
Invalid:
- Humans
- Animals
- Vehicles
- Food
- Landscapes
- Random Objects
After validation:
Input Image → Router Model
The Router Model predicts:
- Moisture
- Structural
- Surface
- Healthy
Detects:
- Water Seepage
- Mold
- Algae
- Stains
Detects:
- Major Crack
- Minor Crack
- Spalling
- Peeling Paint
- Healthy Surface
Gemini 2.5 Flash generates:
- Defect Explanation
- Severity Assessment
- Risk Analysis
- Repair Recommendations
- Professional Inspection Summary
Input Image
│
▼
Google Gemini 2.5 Flash
Construction Validation
│
├────────► Invalid Image
│ │
│ ▼
│ Analysis Not Performed
│
▼
Valid Construction Image
│
▼
Router Model
│
┌───┴────┐
▼ ▼
Moisture Structural
Model Model
│ │
└────┬─────┘
▼
Google Gemini 2.5 Flash
Report Generation
│
▼
Final Inspection Report
Dataset Repository:
https://drive.google.com/drive/folders/15lIJnX8CfX38zZy8SdtKQtN-jW_hozUF?usp=drive_link
- Water Seepage
- Mold
- Algae
- Stains
- Major Crack
- Minor Crack
- Spalling
- Peeling Paint
- Healthy Surface
Dataset was curated for construction defect detection and structural inspection research.
Model Repository:
https://drive.google.com/drive/folders/1SbuypC_pil5ivAY1XNpoJo8AjghUhqSw?usp=drive_link
cg_router.keras
Routes images to specialist models.
cg_moisture_specialist.keras
Classifies:
- Water Seepage
- Mold
- Algae
- Stains
cg_structural_specialist.keras
Classifies:
- Major Crack
- Minor Crack
- Spalling
- Peeling Paint
- Healthy Surface
Frameworks:
- TensorFlow
- Keras
- OpenCV
- NumPy
- React
- Vite
- React Router
- Framer Motion
- Recharts
- jsPDF
- FastAPI
- TensorFlow
- Keras
- OpenCV
- Pillow
- NumPy
- Google Gemini 2.5 Flash
- TensorFlow
- Computer Vision
- Grad-CAM
- Cloudflare Pages
- Hugging Face Spaces
git clone https://github.com/AYUSHMSINGH2004/ConstructGuard-AI.git
cd ConstructGuard-AIpython -m venv venvWindows:
venv\Scripts\activateLinux/Mac:
source venv/bin/activateInstall dependencies:
pip install -r requirements.txtRun backend:
uvicorn app:app --reloadnpm install
npm run devGET /healthPOST /predictForm Data:
- file
- api_key
Returns:
- Defect Prediction
- Confidence Scores
- Grad-CAM Visualization
- Gemini Report
- Recommendations
graph TD
A[👤 User Uploads Image]
A --> B[🤖 Gemini 2.5 Flash Validation]
B -->|Invalid Image| C[❌ Analysis Not Performed]
B -->|Valid Construction Image| D[🧠 Router Model]
D --> E[💧 Moisture Specialist]
D --> F[🏢 Structural Specialist]
E --> G[🤖 Gemini Report Generation]
F --> G
G --> H[📄 Inspection Report]
H --> I[🌐 Frontend Dashboard]
sequenceDiagram
actor User
participant Frontend as Cloudflare Pages Frontend
participant Gemini as Gemini 2.5 Flash
participant Backend as FastAPI Backend
participant Router as Router Model
participant Moisture as Moisture Specialist
participant Structural as Structural Specialist
User->>Frontend: Upload Image
Frontend->>Backend: POST /predict
Backend->>Gemini: Validate Construction Image
alt Invalid Image
Gemini-->>Backend: Not Construction Related
Backend-->>Frontend: Analysis Not Performed
else Valid Image
Gemini-->>Backend: Construction Related
Backend->>Router: Predict Category
alt Moisture
Router-->>Backend: Moisture
Backend->>Moisture: Classification
Moisture-->>Backend: Result
else Structural
Router-->>Backend: Structural
Backend->>Structural: Classification
Structural-->>Backend: Result
end
Backend->>Gemini: Generate Report
Gemini-->>Backend: Recommendations
Backend-->>Frontend: Final Analysis
Frontend-->>User: Display Results
end
- Project Lead
- AI/ML Development
- Backend Development
- Deployment & Integration
- Testing & Validation
- Frontend Development
- Dataset Preparation
- Research & Documentation
- Backend Development
- Testing & Validation
- Mobile Application
- Multi-User Support
- Cloud Report Storage
- Real-Time Monitoring
- Project Dashboard
- Advanced Analytics
- Multi-Language Support
If you found this project useful:
- Star ⭐ the repository
- Fork 🍴 the project
- Share 📢 with others
Educational / Academic Use Only