Motorcycle Parts Classification (YOLOv8)
Overview
YOLOv8-based classification model trained to identify 30 motorcycle components.
- Architecture: YOLOv8n-cls
- Framework: Ultralytics YOLOv8
- Classes: 30
Supported Classes (30)
| # | Class | # | Class |
|---|---|---|---|
| 1 | cylinder_head | 16 | gear_box |
| 2 | alternator | 17 | chain |
| 3 | clutch_plate | 18 | disc |
| 4 | chain_sprocket | 19 | handlebar |
| 5 | cylinder_block | 20 | brake_clutch_lever |
| 6 | piston | 21 | brake_clutch_cable |
| 7 | crankshaft | 22 | brake_pad |
| 8 | camshaft | 23 | battery_terminal |
| 9 | spark_plug | 24 | fuse_box |
| 10 | air_fin | 25 | brake_light_switch |
| 11 | radiator | 26 | gear_lever |
| 12 | motorcycle_frame | 27 | brake_pedal |
| 13 | forks | 28 | carburetor |
| 14 | swingarm | 29 | fuel_tank |
| 15 | shock_absorbers | 30 | brake_oil_reservoir |
Dataset (Private)
- Total Images: 14,897
- Train: 11,917
- Validation: 2,980
- Classes: 30
- Avg/Class: ~400 train / 100 val
Training Details
| Parameter | Value |
|---|---|
| Framework | Ultralytics YOLOv8 |
| Base Model | yolov8n-cls.pt |
| Epochs | 50 |
| Image Size | 224×224 |
| Batch Size | 32 |
| Optimizer | AdamW (auto) |
| Hardware | Tesla T4 |
| Training Time | ~1.27 hours |
| Early Stopping | patience=15 |
Performance
| Metric | Score |
|---|---|
| Top-1 Accuracy | 94.5% |
| Top-5 Accuracy | 99.2% |
Sample Prediction
image 1/1 /content/NAR1018.jpg: 224x224 carburetor 0.98, alternator 0.01, shock_absorbers 0.00, air_fin 0.00, piston 0.00, 11.5ms Speed: 16.3ms preprocess, 11.5ms inference, 0.1ms postprocess per image at shape (1, 3, 224, 224)
Model Analysis
Confusion Matrix Insights
- Strong diagonal dominance → excellent class separation
- Minor confusion observed in:
- clutch_plate vs chain_sprocket
- piston vs cylinder_block
- Overall low misclassification rate
Download and Usage
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
# Download model
model_path = hf_hub_download(
repo_id="AswinG5/moto-parts-30cls",
filename="motopartscls.pt"
)
# Load model
model = YOLO(model_path)
# Predict
results = model("your-image-file.jpg")[0]
Use Cases
- Spare parts identification
- Garage automation
- Inventory systems
- E-commerce tagging
Limitations
- Lower performance on visually similar parts
- Classes with fewer samples:
- clutch_plate
- chain_sprocket
Dataset Disclaimer
Dataset is private and not distributed.
Contact
My Linkedin https://www.linkedin.com/in/aswin-g3/