| --- |
| license: mit |
| tags: |
| - image-classification |
| - computer-vision |
| - defect-detection |
| - automotive |
| - pytorch |
| - timm |
| - efficientnet |
| language: |
| - ru |
| pipeline_tag: image-classification |
| --- |
| |
| # Paint Defect Detector |
|
|
| A binary image classifier that detects **paint defects** on car body panels using transfer learning with EfficientNetV2-S backbone (via imm). |
|
|
| ## Model Architecture |
|
|
| - **Backbone**: EfficientNetV2-S (pretrained, from imm) |
| - **Head**: Dropout β Linear(feat_dim, 256) β GELU β Dropout β Linear(256, 2) |
| - **Task**: Binary classification β clean vs defect |
| |
| ## Training |
| |
| - **Optimizer**: AdamW with cosine annealing LR scheduler |
| - **Loss**: CrossEntropyLoss with label smoothing |
| - **Augmentations**: Albumentations pipeline |
| - **Metrics**: AUC-ROC, F1, Accuracy |
| |
| ## Inference |
| |
| The project includes a FastAPI REST API (src/api.py) for serving predictions, and a Grad-CAM visualisation layer for model explainability. |
| |
| ## Project Structure |
| |
| ` |
| src/ |
| config.py # Hyperparameters and paths |
| dataset.py # Dataset and data loaders |
| model.py # DefectClassifier model |
| train.py # Training loop |
| infer.py # Inference utilities |
| api.py # FastAPI inference server |
| prepare_data.py # Data preparation script |
| requirements.txt |
| ` |
|
|
| ## Requirements |
|
|
| See |
| equirements.txt. Key dependencies: orch, imm, lbumentations, astapi, grad-cam. |
|
|