--- title: EL Defect Detection System emoji: 🔬 colorFrom: blue colorTo: red sdk: docker pinned: false --- # 🔬 EL Defect Detection System Production-grade electroluminescence (EL) defect detection for solar PV modules. ## Features - **Upload** any EL image (full module, single cell, any brightness/size) - **Automatic grid detection** segments modules into individual cells - **Deep learning** (U-Net with ResNet encoder) detects defects per cell - **Quantitative analysis**: crack length (mm), dark area (%), severity classification - **PASS/FAIL decision** with configurable quality thresholds - **Visual overlays**: color-coded defect masks on original images - **Downloadable reports** (JSON + overlay images) ## Defect Types Detected | Color | Defect | Description | |-------|--------|-------------| | 🔴 Red | Dark/Inactive | Area disconnected from cell circuit | | 🔵 Blue | Crack | Micro-crack in silicon | | 🔷 Cyan | Cross Crack | Crack at ribbon edge (high importance) | | 🟢 Green | Busbar | Metal busbar connection (feature) | ## Architecture ``` input image → preprocessing (CLAHE) → grid detection → cell extraction → U-Net inference → mask cleaning → crack/dark analysis → PASS/FAIL ``` ## Technical Details - **Model**: U-Net with ResNet34 encoder (segmentation_models_pytorch) - **Loss**: 0.5 × Dice + 0.5 × Weighted CrossEntropy - **Dataset**: E-SCDD (snt-ubix/e-scdd) — 30 classes remapped to 5 - **Preprocessing**: CLAHE, percentile normalization, adaptive denoising - **Grid Detection**: Projection profiles + FFT periodicity + peak detection - **Crack Analysis**: Skeletonization + distance transform + false positive filtering - **Dark Detection**: Adaptive threshold (0.6 × mean intensity) ## Running Locally ```bash pip install -r requirements.txt streamlit run src/app/app.py ``` ## Training ```bash python src/train.py --encoder resnet34 --epochs 100 --batch_size 8 ```