Introduction
This project focuses on counting people using computer vision by detecting individuals in images using YOLO models. The system not only counts people but also classifies gender, identifying how many males and females are present in an image.
The main objective of this project is to analyze and compare different versions of the YOLO model, specifically YOLOv8 and YOLOv11, to determine which model performs better in terms of accuracy and performance.
YOLO Models Overview
First, gender detection is performed using the YOLOv8 model (YOLO("yolov8n.pt")). YOLO is an object detection framework used for tasks such as object detection, image segmentation, and classification. In this project, it is applied for people detection and gender classification. YOLOv8 was developed by Ultralytics and can be accessed using the ultralytics library.
YOLOv11 is also used for comparison. It performs similar tasks such as object detection and counting, but is designed with different optimizations.
Results and Observations
The results show the performance of YOLOv8 in detecting males and females. The model demonstrates good accuracy, correctly identifying most individuals in the images. For example, in one case, the model detected one female and two males successfully.
The YOLOv11 results also show gender and person detection, but with slightly different behavior. YOLOv8 produces more stable and accurate predictions, while YOLOv11 appears cleaner in training but misses some detections.
From the confusion matrices, YOLOv8 shows higher accuracy, while YOLOv11 has more missed detections and inconsistencies.
Performance Comparison
The comparison between YOLOv8 and YOLOv11 shows the following:
YOLOv8 achieves higher accuracy and better detection performance. YOLOv11 is faster and more optimized for lightweight applications. YOLOv8 is more suitable for complex tasks such as people counting and gender detection. YOLOv11 may perform better in real-time or edge-device applications due to its speed. Use Cases and Importance
This project is important for real-world applications such as:
Security and surveillance systems Smart cities and public monitoring Transportation and crowd management Emergency response systems Retail environments (e.g., malls and supermarkets)
Understanding how many people are in a specific location and their distribution can help improve safety, efficiency, and decision-making in real-time systems.
Additional Experiments
The project also includes experiments for people counting without gender classification. These results help evaluate total population detection in images.
Based on the results from Excel analysis files (YOLOv8 and YOLOv11 training logs), YOLOv8 shows higher precision and more stable loss values, while YOLOv11 shows higher loss and less stable performance.
Pros and Cons YOLOv8 High accuracy Strong performance in detection tasks Better generalization Requires more GPU resources Slower compared to lightweight models YOLOv11 Faster inference speed More lightweight and optimized for real-time use Lower computational cost Slightly lower accuracy compared to YOLOv8 Limitations
Model performance may vary depending on image quality, lighting conditions, dataset size, and training epochs. Poor image resolution or insufficient training data can reduce detection accuracy.
Training Process
Both YOLOv8 and YOLOv11 require a labeled dataset containing images with bounding boxes. The training process includes preprocessing such as resizing images and normalizing inputs. YOLOv11 may include additional optimizations depending on its architecture to improve speed and efficiency.
Conclusion
In conclusion, the choice between YOLOv8 and YOLOv11 depends on the application requirements.
If high accuracy is required, especially for security and monitoring systems, YOLOv8 is the better choice. However, if speed and lightweight performance are more important, YOLOv11 may be more suitable.
Both models are effective for real-world applications such as surveillance, smart cities, and crowd management systems. The selection of the model should depend on whether accuracy or speed is the priority.