--- license: mit tags: - object-detection - pytorch - yolov5 - onnx - rknn - rv1106 - luckfox - aircraft-inspection - edge-ai metrics: - precision - recall - map model-index: - name: Zerodefect-1.0 results: - task: type: object-detection name: Object Detection dataset: type: custom name: Merged Aircraft Skin Defect & Corrosion Dataset metrics: - type: precision value: 0.435 name: Precision - type: recall value: 0.355 name: Recall - type: map value: 0.323 name: mAP@0.5 - type: map value: 0.238 name: mAP@0.5:0.95 --- # ZeroDefect YOLOv5 Nano — v1.0 ### Aircraft Skin Defect Detection (Edge-Deployable) A YOLOv5 Nano object detection model trained to identify surface defects on aircraft skin. Optimized for edge deployment on the **Luckfox Pico Max (RV1106 SoC, 0.5 TOPS NPU)**. --- ## Model Formats | Format | File | Size | Use Case | |--------|------|------|----------| | PyTorch | `best.pt` | ~3.8 MB | Training, fine-tuning, desktop inference | | ONNX | `best.onnx` | ~7.2 MB | Cross-platform CPU/GPU inference | | RKNN | `best.rknn` | ~2.6 MB | RV1106 NPU hardware-accelerated inference | --- ## Classes (7) | ID | Class | Description | |----|-------|-------------| | 0 | `crack` | Structural cracks, fatigue lines | | 1 | `dent` | Impact dents, surface deformations | | 2 | `corrosion` | Rust, chemical wear, oxidation | | 3 | `scratch` | Superficial scrapes, paint scratches | | 4 | `paint-peel` | Flaking paint, coating degradation | | 5 | `missing-head` | Missing rivet heads or fasteners | | 6 | `defect` | Generic surface defect anomalies | --- ## Evaluation Results **Tested on 2,139 validation images (2,215 with detect.py)** | Class | Precision | Recall | mAP@0.5 | mAP@0.5:0.95 | |-------|-----------|--------|---------|---------------| | **all** | **0.435** | **0.355** | **0.323** | **0.238** | | missing-head | 0.404 | 0.640 | 0.528 | 0.350 | | dent | 0.576 | 0.448 | 0.447 | 0.372 | | scratch | 0.509 | 0.397 | 0.363 | 0.356 | | paint-peel | 0.395 | 0.312 | 0.312 | 0.250 | | crack | 0.483 | 0.262 | 0.283 | 0.220 | | corrosion | 0.308 | 0.227 | 0.172 | 0.072 | | defect | 0.374 | 0.199 | 0.154 | 0.044 | **Inference Speed**: 2.8 ms/image (RTX 3050, batch 16) | 7.8 ms/image (single image) ### Confusion Matrix ![Confusion Matrix](evaluation/confusion_matrix.png) ### Precision-Recall Curve ![PR Curve](evaluation/PR_curve.png) ### F1-Confidence Curve ![F1 Curve](evaluation/F1_curve.png) ### Sample Detections See the `sample_detections/` folder for annotated detection results on validation images. --- ## Training Details - **Architecture**: YOLOv5 Nano (1.77M parameters, 4.2 GFLOPs) - **Epochs**: 150 - **Image Size**: 640x640 - **Batch Size**: 16 - **Dataset**: 22k+ train / 2.2k+ val images merged from 36 COCO-format Roboflow datasets - **GPU**: NVIDIA RTX 3050 6GB Laptop - **Optimizer**: SGD with cosine LR schedule - **Augmentation**: Standard YOLOv5 mosaic, mixup, HSV jitter --- ## Quick Start: ONNX Inference ```bash pip install onnxruntime opencv-python numpy python infer_onnx.py --model best.onnx --image test.jpg --conf 0.25 ``` ## Hardware Deployment (RV1106 NPU) ```bash # Push to board adb push best.rknn /userdata/ # Run on board (after cross-compiling rknn_model_zoo demo) ./rknn_yolov5_demo /userdata/best.rknn test.jpg ``` --- ## License MIT License