--- license: other license_name: commercial license_link: LICENSE tags: - object-detection - yolo - yolov8 - anomaly-detection - industrial-inspection - gas-infrastructure pipeline_tag: object-detection --- # Anomaly Detection YOLOv8s — V11 Production-grade anomaly detection model for **underground gas valve well inspection**. Identifies 6 types of structural and environmental anomalies in inspection photos. ## Model Performance | Metric | Value | |--------|-------| | **mAP50** | **65.72%** | | **mAP50-95** | **50.91%** | | Model | YOLOv8s | | Parameters | 11.1M | | Input Size | 640×640 | | Training Images | 1,512 (VLM-annotated) | | Fine-tuned from | V9 champion model | ### Per-class Performance (on V2s val set, 201 images) | Class | mAP50 | mAP50-95 | |-------|-------|----------| | Water Accumulation (积水) | 84.1% | 65.1% | | Water Seepage (渗水) | 65.2% | 47.6% | | Corrosion / Rust (腐蚀生锈) | 61.9% | 45.9% | | Coating Damage (涂层损坏) | 39.7% | 24.2% | | Wall Crack (墙体裂缝) | 69.3% | 55.3% | | Fog / Condensation (雾气结露) | 74.1% | 67.4% | ## Training History | Version | mAP50 | Training Images | Key Change | |---------|-------|-----------------|------------| | V2s | 48.2% | 512 | Baseline, VLM-annotated | | V6 | 55.71% | 1,062 | VLM-only breakthrough, fine-tuned from V2s | | V7 | 56.0% | 2,779 | Pseudo-labels added — no improvement | | V8 | 60.51% | 1,464 | Fine-tuned from V6, more VLM data | | V9 | 63.72% | 1,463 | Fine-tuned from V8, more VLM data | | **V11** | **65.72%** | **1,512** | **Fine-tuned from V9, consistent val split** | ### Key Insights - **Iterative fine-tuning works**: Each generation fine-tuned from the previous best shows consistent gains (+8.6%, +5.3%, +3.1%) - **Pseudo-labels don't help**: V7 (2,779 images with pseudo-labels) performed identically to V6 (1,062 VLM-only) - **Val split matters**: V10 used a different val split and regressed; V11 with V9's split confirmed +3.1% gain - **Weak classes need focused data**: water_seepage gained +10.4% with targeted VLM annotations; coating_damage still lags at 39.7% ## Quick Start ```bash pip install ultralytics ``` ```python from ultralytics import YOLO model = YOLO("best_v11.pt") results = model.predict(source="inspection_photo.jpg", conf=0.3) for r in results: for box in r.boxes: cls = int(box.cls[0]) conf = float(box.conf[0]) print(f"Anomaly: {model.names[cls]}, Confidence: {conf:.2f}") ``` ## Model Files | File | Format | Size | |------|--------|------| | `best_v11.pt` | PyTorch | 21.5 MB | | `best_v11.onnx` | ONNX | 42.7 MB | | `best_v11.torchscript` | TorchScript | 42.8 MB | | `best_v11.mlpackage/` | CoreML | 42.7 MB | ## Anomaly Classes & Severity | Class | Severity | Description | |-------|----------|-------------| | Water Accumulation | Medium | Standing water at well bottom | | Water Seepage | High | Water seeping through walls/joints | | Corrosion / Rust | High | Metal rust, pipe corrosion | | Coating Damage | Medium | Peeling paint, coating deterioration | | Wall Crack | Critical | Structural cracks in walls | | Fog / Condensation | Low | Condensation, moisture in air | ## Dataset Statistics (861,367 images analyzed) - 94.5% of images have at least one anomaly - Corrosion/Rust: 77.3% prevalence - Coating Damage: 67.7% prevalence - Wall Crack: 59.6% prevalence - Water Seepage: 46.1% prevalence - Water Accumulation: 44.4% prevalence - Fog Condensation: 11.0% prevalence ## Companion Model For **valve detection** (gate, globe, ball, other), see our [Valve Detection Model](https://huggingface.co/lg227210/valve-detection-yolov8s) (mAP50=92.95%). ## Resources - [Live Demo](https://huggingface.co/spaces/lg227210/valve-detection-demo) - [Anomaly Dataset](https://huggingface.co/datasets/lg227210/gas-valve-anomaly-dataset) - [Technical Blog](https://dev.to/jins_zhu_10096cef92aba38b/how-we-trained-a-92-95-map50-valve-detection-model-with-iterative-pseudo-labeling-4lhi) - [Source Code](https://github.com/zhuj92405-design/valve-detection-yolov8s2) - [Product Page](https://zhuj92405-design.github.io/valve-detection-yolov8s2/) ## License - **Non-commercial use**: Free for research, education, and personal projects - **Commercial use**: Requires a paid license. See [Product Page](https://zhuj92405-design.github.io/valve-detection-yolov8s2/) for pricing.