A real-time Euro coin detection and classification system using a Hybrid Pipeline Architecture that combines YOLO11s deep learning with classical computer vision techniques for high accuracy and stability.
This system detects and classifies all 8 types of Euro coins (1c, 2c, 5c, 10c, 20c, 50c, 1€, 2€) in real-time using a custom-trained YOLO11s model combined with size refinement, color classification, and consensus voting.
- 🚀 Real-time Detection: Optimized for 20+ FPS with frame skipping
- 🎯 High Accuracy: Custom-trained YOLO11s model (99.1% mAP50)
- 🔬 Multi-method Classification: YOLO + Size + Color with consensus voting
- 📊 Temporal Smoothing: Reduces flickering with frame history tracking
- 🎨 Color Classification: Robust HSV-based color analysis
- 📏 Size-based Classification: Calibrated pixel-to-millimeter conversion
- 🖥️ Side-by-Side GUI: Camera feed + Statistics panel
- ⚙️ Calibration System: Coin-based calibration for accurate sizing
The system uses a Hybrid Pipeline that combines multiple detection methods:
Camera Frame
↓
YOLO11s Detection (Primary)
↓
Hybrid Pipeline Processing
├─► Size Refinement (Hough Circles - Optional)
├─► Color Classification (HSV Analysis)
├─► Size Classification (Calibrated)
└─► Consensus Voting (Weighted Combination)
↓
Temporal Smoothing (Frame History)
↓
Display (Camera + GUI Panel)
- CoinDetectionApp (
main.py): Main application coordinator - CoinDetector (
detector.py): YOLO11s model wrapper - HybridPipeline (
hybrid.py): Multi-method classification - Calibrator (
calibration.py): Pixel-to-mm calibration - Utils (
utils.py): Utility functions
For detailed architecture, see Report/Report.md.
Screenshots will be added to assets/screenshots/
-
Clone the repository:
git clone https://github.com/xampos101/Hybrid-Euro-Detection-System.git cd Hybrid-Euro-Detection-System -
Install dependencies:
pip install -r requirements.txt
-
Verify model file:
- Ensure
V2/model/best.ptexists (YOLO11s trained model)
- Ensure
python new_pipeline/main.pyFor best accuracy, calibrate the system first:
- Press
'2'for 2€ coin calibration - Place ONLY the selected coin in frame
- Wait for green circle
- Press
SPACEto confirm
Hybrid-Euro-Detection-System/
├── new_pipeline/ # Main pipeline code
│ ├── main.py # Application entry point
│ ├── detector.py # YOLO detection wrapper
│ ├── hybrid.py # Hybrid classification pipeline
│ ├── calibration.py # Calibration system
│ ├── utils.py # Utility functions
│ └── config.py # Configuration settings
│
├── V2/ # Models
│ └── model/
│ └── best.pt # YOLO11s trained model
│
├── Report/ # Documentation
│ ├── Report.md # Technical report
│ └── FlowDiagrams.md # Mermaid flow diagrams
│
├── docs/ # Additional documentation
│ └── training/ # Training results and plots
│
├── records/ # Demo videos
│ └── *.mp4 # Video demonstrations
│
└── assets/ # Images and screenshots
├── screenshots/ # Application screenshots
└── diagrams/ # Exported diagrams
- Architecture: YOLO11s (small variant)
- Base Model: Pretrained yolo11s.pt
- Epochs: 20
- Dataset: Custom Euro coins dataset
- Final Performance:
- Precision: 97.7%
- Recall: 97.0%
- mAP50: 99.1%
- mAP50-95: 90.7%
For detailed training information, see docs/training/training_results.md.
Demo videos are available in the records/ folder:
FINAL_RECORD.mp4- Final demonstrationRecording 2026-01-15 160914.mp4- Latest recording- Additional recordings available
See records/README.md for detailed descriptions.
-
Report/Report.md: Comprehensive technical report
- Architecture overview
- Component descriptions
- Algorithms and logic
- Configuration guide
-
Report/FlowDiagrams.md: Mermaid flow diagrams
- Main application flow
- Detection pipeline
- Consensus voting
- Temporal smoothing
- Color classification
-
docs/training/training_results.md: Training documentation
- Training configuration
- Results and metrics
- Performance analysis
All settings are in new_pipeline/config.py:
- YOLO Settings: Confidence threshold, IOU threshold, image size
- Hybrid Pipeline: Hough refinement, color thresholds
- Temporal Smoothing: History size, matching thresholds
- Performance: Frame skipping, optimization settings
'q': Quit application'd': Toggle debug mode'2': Calibrate with 2€ coin'1': Calibrate with 1€ coin'5': Calibrate with 50c coinSPACE: Confirm calibrationESC: Cancel calibration
- Python 3.8+
- OpenCV (cv2)
- NumPy
- Ultralytics YOLO
- PyTorch (CPU or CUDA)
Install all dependencies:
pip install -r requirements.txt- Detection Speed: 20+ FPS (with optimizations)
- Accuracy: 99.1% mAP50 (YOLO11s model)
- Classification: Multi-method consensus voting
- Stability: Temporal smoothing reduces flickering
- YOLO11s: Custom-trained deep learning model
- OpenCV: Image processing, Hough circles, camera capture
- NumPy: Array operations and mathematical calculations
- Ultralytics: YOLO framework
- PyTorch: Deep learning backend
The system combines:
- Deep Learning (YOLO11s): Fast and accurate detection
- Classical CV (Hough, Color): Robust classification
- Temporal Smoothing: Stability across frames
- Consensus Voting: Weighted combination for accuracy
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Ultralytics for the YOLO framework
- OpenCV community for excellent computer vision tools
- Euro coin specifications from official sources
For questions or issues, please open an issue on GitHub.
Built with ❤️ using YOLO11s and OpenCV

