🔥 96.1% F1-score in detecting concrete cracks without labeled training data
🧠 Variational Autoencoder learns healthy infrastructure patterns
⚡ Training Pipeline - Complete notebook for model training
📊 Complete Analysis - From data preprocessing to deployment
Traditional infrastructure inspection is expensive, time-consuming, and prone to human error. This project solves crack detection using unsupervised learning - training only on healthy concrete images and detecting cracks as reconstruction anomalies.
graph LR
A[Healthy Images Only] --> B[VAE Learning] --> C[Normal Patterns] --> D[💾 Model]
graph LR
E[Test Image] --> F[Reconstruct] --> G[Compare Error] --> H{High Error?}
H -->|Yes| I[🚨 ANOMALY]
H -->|No| J[✅ NORMAL]
| 📊 Metric | 🎯 Score | 📝 Impact |
|---|---|---|
| AUC | 99.3% |
Industry-grade performance |
| Precision | 97.8% |
Minimal false alarms |
| Recall | 94.5% |
Catches nearly all cracks |
| F1-Score | 96.1% |
Balanced detection |
Key Insight: Clear separation between healthy (blue) and cracked (red) samples validates the unsupervised approach.
Visualization of test sample reconstructions.
git clone https://github.com/PratikNichite/Anomaly-Detection-for-Infrastructure-Monitoring.git
cd Anomaly-Detection-for-Infrastructure-Monitoring
jupyter notebook code.ipynb # 👈 Train model from scratchimport torch
model = VAE()
model.load_state_dict(torch.load('best_vae.pth')) # After training
# Detect cracks in new images
is_crack = error > threshold # Optimized thresholdpip install torch torchvision opencv-python matplotlib seaborn jupyterEncoder → [256×256×3] → [128×128×32] → [64×64×64] → [32×32×128] → [Latent: 128]
Decoder → [Latent: 128] → [32×32×128] → [64×64×64] → [128×128×32] → [256×256×3]
- Probabilistic modeling captures uncertainty
- Latent space representation enables anomaly scoring
- Unsupervised training eliminates labeling costs
- Reconstruction quality directly indicates anomalies
📦 Anomaly-Detection-for-Infrastructure-Monitoring
├── 📔 code.ipynb # 🌟 MAIN NOTEBOOK - Complete analysis
├── 🤖 best_vae.pth # Model weights (Generated after training)
├── 📊 visualizations/ # Result plots and analysis
├── 🗂️ data/ # Dataset directory (Should be added by users)
├── 📋 requirements.txt # Python dependencies
└── 📄 documentation.pdf # Technical documentation
✅ Unsupervised Learning Success - No manual crack labeling required
✅ High Performance - 96%+ F1-score on real infrastructure data
✅ Production Ready - Optimized model with deployment pipeline
✅ Comprehensive Analysis - End-to-end ML workflow demonstrated
✅ Scalable Solution - Can process thousands of images efficiently
This project is licensed under the MIT License - see the LICENSE file for details.

