Player Detection and Recognition in CS2

Using YOLOv8 & RoboFlow


Model Description: YOLOv8 was used for player detection. Its architecture could process complex image data and perform rapid detections, making it ideal for video frame analysis in gaming scenarios.

Data Collection: Gameplay videos were recorded and converted into images using FFmpeg to maintain high image quality, capturing one frame per second, avoiding repetitions in dataset.

Data Preparation: From these frames, 218 images containing visible players were selected and resized to 640 x 640.

Data Labeling: Each selected frame was manually annotated with bounding boxes around the players using RoboFlow, which facilitated precise and efficient labeling.

Data Augmentation: To enhance the model’s robustness and to generalize better, the following augmentation techniques were applied:

Horizontal flipping to allow the model to recognize players regardless of their orientation. Zooming (up to 25%) to train the model to detect players at various scales. Brightness adjustment (ranging from -15% to +15%) to simulate different lighting conditions that might occur in gameplay. This process generated 3 augmented images per original, totaling 654 training images.

Training Set Distribution: The dataset was split into 88% training (573 images), 8% validation (54 images), and 4% test sets (27 images).


Future Work

Diverse Data: To further improve the accuracy and robustness of the model, it is important to include data from various CS2 maps and environments. Different maps include diverse backgrounds and lighting conditions, which can affect player visibility and model performance. Incorporating a broader range of scenarios will train the model to handle environmental complexities better and increase its detection accuracy.

Real-Time Deployment: Currently, the model demonstrates promising results in detecting players from static images and recorded gameplay. The next step is to deploy this model for real-time detection during live CS2 matches. This involves optimizing the model to reduce latency and ensure it operates efficiently in a live environment.