A comprehensive AI-powered solution for industrial defect detection, analysis, and repair recommendations.
- CNN-based Defect Classification: ResNet/EfficientNet backbone trained on industrial defect datasets
- Grad-CAM Explainability: Visual heatmaps showing defect locations
- Google Cloud Vision OCR: Text extraction from defective items (serial numbers, labels)
- Hugging Face LLM Integration: AI-powered repair suggestions
- Streamlit UI: User-friendly interface for complete workflow
Image → CNN Classifier → Grad-CAM → Defect Label
↓
OCR API → Text Extraction
↓
Defect + OCR → LLM → Repair Suggestions
↓
Streamlit Dashboard
faultiz/
├── app/
│ ├── __init__.py
│ ├── main.py # Streamlit main app
│ └── components/ # UI components
├── models/
│ ├── __init__.py
│ ├── defect_classifier.py # CNN model
│ ├── explainer.py # Grad-CAM implementation
│ └── pretrained/ # Model weights
├── services/
│ ├── __init__.py
│ ├── ocr_service.py # Google Cloud Vision
│ ├── llm_service.py # Hugging Face LLM
│ └── inference.py # Main inference pipeline
├── utils/
│ ├── __init__.py
│ ├── image_processing.py
│ ├── config.py
│ └── data_loader.py
├── data/
│ ├── sample_images/
│ └── defect_classes.json
├── requirements.txt
├── config.yaml
└── setup.py
- Clone the repository
- Install dependencies:
pip install -r requirements.txt - Set up Google Cloud credentials
- Run the app:
streamlit run app/main.py
- Update
config.yamlwith your API keys and model paths - Place Google Cloud service account key in
credentials/
- Scratches
- Dents
- Cracks
- Corrosion
- Missing Parts
- Color Defects
- Shape Anomalies
- CNN Backbone: EfficientNet-B0 (customizable)
- LLM: Hugging Face Transformers (configurable model)
- OCR: Google Cloud Vision API
MIT License