--- tags: - object-detection - computer-vision - yolo - yolov11 - defect-detection - industrial - pytorch library_name: ultralytics license: apache-2.0 datasets: - tile-defect-detection language: - en metrics: - map base_model: ultralytics/yolo11l pipeline_tag: object-detection --- # Model Card for Industrial Tile Defect Detection (YOLO11-Large) This model is a fine-tuned version of **YOLO11-Large** designed to detect minute manufacturing defects on industrial tiles. It was trained using a sliding-window tiling approach with aggressive oversampling to handle severe class imbalance. ![Ceramic Tile Defect Detection](https://cdn-uploads.huggingface.co/production/uploads/65566a3b76fe5cfa6a104d18/Pw0qkXwdf4B0WI2yP82TS.jpeg) ## Model Details ### Model Description This model solves the problem of detecting tiny defects (approx. 10-50 pixels) on massive industrial images (8192x6000 pixels). Standard resizing destroys these defects, so this model was trained on **640x640 crops** generated from the original high-resolution data. To address the rarity of specific defects (like "Halos"), the training pipeline utilized a dynamic oversampling strategy where rare defect crops were physically duplicated with random jitter, ensuring the model saw a balanced distribution of classes. - **Developed by:** Can Deniz Kocak - **Model type:** Object Detection (YOLO11) - **Finetuned from model:** `yolo11l.pt` (YOLO11 Large) - **License:** Apache 2.0 ### Model Sources - **Repository:** [huggingface.co/candenizkocak/tile-defect-detection-yolo11](https://huggingface.co/candenizkocak/tile-defect-detection-yolo11) - **Framework:** [Ultralytics YOLO](https://github.com/ultralytics/ultralytics) ## Uses ### Direct Use The model is intended for **Industrial Quality Control (QC)** systems. It accepts 640x640 image tensors. **Important:** Because the original images are high-resolution (4K/8K), this model should be used within a **Sliding Window Inference** pipeline. Running it directly on a downscaled 8000px image will result in poor performance. ### Classes Detected The model detects 6 specific defect categories: 1. **Edge defect** (ID: 0) 2. **Corner defect** (ID: 1) 3. **White spot** (ID: 2) 4. **Light patch** (ID: 3) 5. **Dark spot/patch** (ID: 4) 6. **Halo** (ID: 5) ### Out-of-Scope Use - This model is not suitable for general object detection (people, cars, etc.). - It is optimized for gray/textured industrial tile backgrounds. Using it on different materials (wood, metal) may require fine-tuning. ## How to Get Started with the Model You can use this model directly with the `ultralytics` library. ```python from ultralytics import YOLO import cv2 # Load the model model = YOLO("https://huggingface.co/candenizkocak/tile-defect-detection-yolo11/resolve/main/best.pt") # Inference on a single image (or crop) # Note: For large images, use a sliding window approach results = model.predict("path/to/tile_crop.jpg", conf=0.35) # Visualize results[0].show() ``` ## Training Details ### Training Data The dataset consists of **5,388 high-resolution industrial images**. - **Preprocessing:** Images were sliced into **640x640 tiles**. - **Augmentation:** Random crop jittering was applied to duplicate defects. ### Training Procedure To combat the massive class imbalance (e.g., ~9000 Dark Spots vs ~300 Halos), an **Aggressive Oversampling** strategy was applied during the tiling phase: | Class | Oversample Ratio | | :--- | :--- | | Dark Spot | 1x (No change) | | Light Patch | 8x | | White Spot | 4x | | Corner Defect | 4x | | Edge Defect | 15x | | **Halo** | **27x** | This ensured that the model saw approximately ~8,000 examples of *each* class during training. #### Training Hyperparameters - **Epochs:** 50 - **Batch Size:** 32 - **Image Size:** 640 - **Optimizer:** Auto (AdamW) - **Hardware:** NVIDIA A100 (80GB) ## Evaluation ### Metrics The model achieves strong performance across all classes, with particularly notable success in detecting the rare "Halo" class due to the oversampling strategy. - **mAP@50 (Mean Average Precision):** ~78% - **Recall (Dark Spots):** ~88% - **Recall (Halos):** ~74% (Significantly improved from baseline) ### Recommendations **False Positives on Background:** The model may occasionally detect defects on the black background (conveyor belt). It is highly recommended to use a **Region of Interest (ROI) filter** (such as convex hull detection on the tile) to ignore predictions outside the tile area. ## Environmental Impact - **Hardware Type:** NVIDIA A100-SXM4-80GB - **Hours used:** ~2 hours - **Cloud Provider:** Google Colab Pro+ - **Compute Region:** US-Central1 ## Technical Specifications ### Model Architecture YOLO11 employs a CSP-based backbone with an improved detect head compared to YOLOv8, offering a better trade-off between latency and accuracy for small object detection. ### Software - **Ultralytics:** 8.3.x - **PyTorch:** 2.9.x - **CUDA:** 12.x