Neural Network Based Player Detection System

You may be wondering what this is, and why I made it. Well, it's exactly what it sounds like, a Neural Network-based player detection system for the video game Counter-Strike. It's like an aimbot, but technically it's not since it doesn't directly interact with the game in any way. In short, what this does is recognize players on the screen and classify them as either a player on the T or CT team. Why did I make this? In the spring of 2024, during my junior year of college, I was taking a computer science class called Deep Learning, which was all about neural networks and the cool things they can do. As part of the course, we had to develop a project of our choice involving neural networks to present on the final day, so as a person who loves video games and computer science, I decided to merge them into one project!

Quick Overview

Technical Approach

The project involved multiple stages, including dataset creation, model building, and evaluation. Key tools and libraries used in this project include:

Dataset Information

I created a custom dataset of nearly 4,000 images of Counter-Strike players. This dataset was annotated using LabelImg and processed through RoboFlow, which provided essential data augmentation like resizing and recoloring. The data was split into training, validation, and test sets for efficient model training.

Model Architectures

Custom Model: The custom model was designed to perform both bounding box regression and object classification. It used convolutional neural networks (CNNs) to extract features from the images, followed by layers dedicated to classification (CT or T) and localization (bounding box prediction).

YOLOv5 Model: YOLOv5 was selected for transfer learning due to its performance in real-time object detection. With a small model size, YOLOv5s (small) was ideal for the limited computational resources available, while still providing highly competitive detection accuracy.

Training and Evaluation

Custom Model: The custom model was trained over 100 epochs with various pre-processing techniques to improve accuracy, including image normalization and bounding box scaling.

YOLOv5 Model: YOLOv5 was fine-tuned with transfer learning, where I leveraged a pre-trained model to adapt it to the Counter-Strike player dataset.

During testing, both models were evaluated using standard metrics like classification accuracy and Intersection over Union (IoU) to measure how closely predicted bounding boxes matched the actual player locations.

Results

Custom Model: While the custom model performed well on training data, its accuracy on test data was limited. It struggled to detect players outside the center of the screen or partially visible players, likely due to the simplicity of the architecture and possible bias in the training data.

YOLOv5 Model: The YOLOv5 model significantly outperformed the custom model in both classification and localization. It achieved high accuracy in differentiating CT and T players but struggled with some false positives, misclassifying random objects as players.

Custom Model Architecture

Custom Model Architecture