A computer vision project for traffic sign detection using YOLOv8 and custom lightweight architecture variants.
This project compares a standard YOLOv8 baseline with several attention and feature-fusion extensions, including CBAM, LCFE, IMCMD, and YOLO-TS-style fusion. The goal is to improve small-object traffic sign detection while evaluating robustness across day and night driving conditions.
Traffic sign detection is an important perception task for autonomous driving and driver-assistance systems. Road signs are often small, visually similar, partially occluded, or affected by lighting changes, which makes detection challenging.
This project investigates:
- Whether lightweight feature-fusion modules can improve YOLOv8 traffic sign detection
- Which custom modules contribute most to detection performance
- How model performance changes between day and night conditions
- Whether higher accuracy can be achieved with fewer parameters
Traffic sign dataset
↓
Dataset configuration
↓
YOLOv8 baseline training
↓
Custom model variant training
↓
Evaluation and comparison
↓
Day/night robustness analysis
↓
Result visualization
| Variant | Description |
|---|---|
baseline |
Standard YOLOv8 training baseline |
cbam |
YOLOv8 with CBAM attention |
lcfe |
YOLOv8 with lightweight context feature enhancement |
lcfe_v2 |
Stability-improved LCFE variant |
imcmd |
Custom IMCMD feature-fusion design |
imcmd_ts |
IMCMD with YOLO-TS-style AGRFM fusion |
ts |
YOLO-TS-style ablation variant |
- YOLOv8-based traffic sign detection pipeline
- Multiple custom architecture variants for comparison
- Lightweight attention and feature-fusion experiments
- Day vs. night robustness analysis
- Ablation-style model comparison
- CLI wrappers for training, evaluation, and prediction
- Benchmark summaries and visualization charts
The project is designed around the LISA traffic sign dataset setup used in the experiments.
Expected class set:
gogoForwardgoLeftstopstopLeftwarningwarningLeft
The full dataset is not included in this repository. Dataset paths should be updated in the YAML files before training or evaluation.
Dataset configuration files:
configs/datasets/
lisa_day.yaml
lisa_night.yaml
More details are available in:
docs/dataset_card.md
The project first trains a standard YOLOv8 baseline to establish a reference point for traffic sign detection performance.
The baseline is used to evaluate whether custom modules improve accuracy, robustness, or parameter efficiency.
Several model variants are tested around the YOLOv8 framework.
The custom modules focus on:
- Strengthening feature fusion
- Improving small-object representation
- Adding lightweight attention
- Comparing accuracy vs. parameter efficiency
- Testing robustness under lighting changes
Models are evaluated using object detection metrics, with emphasis on:
- mAP@0.5
- Parameter count
- Overall model comparison
- Day vs. night performance
- Ablation-style component contribution
Results are summarized in:
docs/results.md
reports/metrics_summary.csv
reports/day_night_summary.csv
The strongest reported variant in this project is IMCMD.
| Model | mAP@0.5 | Params | Notes |
|---|---|---|---|
| IMCMD | 42.74 | 1.98M | Best overall accuracy |
| IMCMD-TS | 40.57 | 2.21M | Strong multi-scale fusion variant |
| YOLOv8s Baseline | 39.14 | 11.14M | Reference model |
| YOLO-TS | 38.10 | 13.71M | Ablation comparison |
| CCA_Light | 29.91 | - | Lightweight context baseline |
| CBAM | 11.73 | - | Attention-only comparison |
Key observations:
IMCMDachieved the best reported mAP@0.5.IMCMD-TSremained competitive and showed strong robustness behavior.- The custom variants outperformed the standard YOLOv8 baseline in this setup.
- IMCMD achieved better accuracy with substantially fewer parameters than the baseline.
The repository includes generated charts for:
- Overall model comparison
- Day vs. night robustness
- Ablation study
- Training convergence
Chart files are stored in:
charts/
Detailed result notes are available in:
docs/results.md
YOLOv8-Traffic-Sign-Detection/
├── .github/ # CI workflow
├── assets/
│ └── sample_predictions/ # Sample prediction assets
├── charts/ # Result figures used in README
├── configs/
│ ├── datasets/ # Dataset YAML files
│ └── experiments/ # Experiment presets
├── data/
│ ├── external/ # Raw datasets, not tracked
│ ├── interim/ # Intermediate assets
│ └── processed/ # Processed dataset assets
├── docs/
│ ├── dataset_card.md
│ ├── project_overview.md
│ ├── results.md
│ └── roadmap.md
├── outputs/ # Prediction outputs
├── reports/
│ ├── day_night_summary.csv
│ ├── metrics_summary.csv
│ └── metrics_summary_template.csv
├── scripts/
│ ├── train.py
│ ├── evaluate.py
│ ├── predict.py
│ └── prepare_folders.py
├── src/
│ └── yolo_traffic_sign/
│ ├── models/
│ ├── cli.py
│ ├── inference.py
│ ├── legacy.py
│ └── paths.py
├── tests/
├── pyproject.toml
├── requirements.txt
└── README.md
git clone https://github.com/zehuanyu/YOLOv8-Traffic-Sign-Detection.git
cd YOLOv8-Traffic-Sign-Detectionpy -m venv .venv
.venv\Scripts\activatepip install -r requirements.txt
pip install -e .If using GPU training, install the correct CUDA-enabled PyTorch build before installing the remaining dependencies.
py scripts/prepare_folders.pypy scripts/train.py train --variant baseline --data configs/datasets/lisa_day.yaml --epochs 100 --batch 16 --name baseline_yolov8s_100epochspy scripts/train.py train --variant imcmd --model-type small --data configs/datasets/lisa_night.yaml --epochs 100 --batch 16 --name imcmd_small_100epochspy scripts/evaluate.py --weights runs/traffic_sign/imcmd_small_100epochs/weights/best.pt --data configs/datasets/lisa_day.yamlpy scripts/predict.py predict --weights runs/traffic_sign/imcmd_small_100epochs/weights/best.pt --source assets/sample_predictions --variant imcmd --name imcmd_demoPrediction outputs are saved under:
outputs/predict/
- Root-level model scripts are preserved for compatibility with the original experiment code.
- Reusable wrapper logic is organized under
src/yolo_traffic_sign/. - Result summaries in
reports/are aligned with the charts used in the README. - Dataset YAML paths must be updated locally before training.
- Move remaining legacy modules into
src/yolo_traffic_sign/models/ - Add automated metrics export after training
- Add qualitative prediction examples to the README
- Add stricter evaluation report generation
- Release pretrained model artifacts
- Add more detailed error analysis for failure cases
Python, PyTorch, Ultralytics YOLOv8, OpenCV, Object Detection, Computer Vision, Traffic Sign Detection, Model Evaluation, Data Visualization
Zehuan Yu