AI Goal Tracker
AI Goal Tracker is a football goal detection system designed to automatically detect and count goals and store match history. The system uses two goals with two cameras mounted on them. Images from the cameras are sent to a Raspberry Pi 5 for the processing in real time by trained computer vision object detection AI model.
When the model detects a goal, it automatically plays a sound, shows the current score on the LCD Display, and update the scoreboard in the web interface. Users can add own their own teams, create matches with a custom duration, and pause the game. After the match, users can open the match history.
The main aim of the project to provide a portable, user-friendly, AI powered system for the players, without the need for a person to keep score manually.
Supplies
Bill of materials + my own router MikroTik hAP ac lite , Raspberry Pi 5 and Freenova project board
Building the Football Goals
For this project you need 80 screwes 3,5 x 25, 16 metal corners, 4 hinges, net.(Check blueprint in Images )
Building the Main Control Box
The laser-cut enclosure I've did from the 4mm multiplex. The main box include ports: power supply, LCD display,RGB LED , Button, ventilation. After the laser-cut , I used glue , to attched all side exept top side.Images
Wiring the Electronics
After I created my soccer goal, I connected the ESP32 Cam to my laptop via a router and started collecting data.
On the Breadboard I've created scheme with LCD Display,Button,Buzzer and RGB Led.
Roboflow Annotation
Collecting the dataset might take not a one day moreover you need to label it. It take me a 1 hour for 150 images, in final dataset I have 750 images.
I have 5 classes:
Ball inside the goals
Ball outside the goals
Ball on the goalline
Goalline
Net
Backend
For this project, I had to create a database and an API to enable communication between the backend and the frontend.
For the database, I chose PostgreSQL and used Adminer as a web-based database management tool. The database consists of four main tables: Team, Match, Goal, and Pause. These tables store all the information required to manage teams, record matches, track goals, and save match pauses.
Frontend
The frontend, just like the AI model, is one of the most important parts of the project. It represents the project and provides the main way for users to interact with the system. A well-designed and user-friendly interface makes it easy to create matches, manage teams, view the live scoreboard, and review match history.
For this project, I used Gradio to create a simple and intuitive web interface. Gradio made it possible to quickly develop a user-friendly web application that communicates with the backend and allows users to control the AI Goal Tracker from any device with a web browser.
Running the AI Goal Tracker
To start the system, plug in the power supplies for both the router and the Raspberry Pi.
Look at the LCD display on the main control box. About one minute after powering on the system, the IP address will appear on the display. Open a web browser on a device connected to the same network and enter the displayed IP address into the address bar to access the AI Goal Tracker web interface.
Using the System
At the About page you may read how to use the interface:
- Create teams
- Set match duration
- Start/Pause/End a match
- Review match history
- System/degug page