← Back to projects

AI Football Robot / 2026

Red team

Hold the line.

Recognise the goal.
Commit to defence.

A vision-guided football robot with a deliberately defensive match strategy. Embedded perception, simple motor rules and a crowded 3v3 pitch meet in one physical experiment.

Match intention / 2 defend, 1 attacks3v3
OUR GOALOPEN PLAY
Frame from the supplied red-team match, with the red robots near the goal
Our red team, in play

Actual match footage. Our strategy puts two defenders near the goal.

See it on the pitch ↗
IntentGoal recognition & defensive play
ToolsEdge Impulse · OpenMV · MicroPython
EvidenceTraining results, controller & match footage

01 / The match strategy

Defence was
the design decision.

Our 3v3 strategy gave two robots defensive roles and one an attacking role. The defenders were intended to find our goal and occupy its left and right sides; the attacker followed the ball. The red-team footage shows that commitment to guarding the opening.

  1. 01 / FindTurn to see our goal.

    The recorded debrief describes rotating to locate the friendly goal.

  2. 02 / ApproachMove towards the opening.

    Use the detected goal and a configured threshold to decide when to stop approaching.

  3. 03 / DefendOccupy the left and right.

    Position two defenders in the opening while a third robot takes the attacking role.

Strategy described in the project debrief, 00:38–01:28. The exact goal threshold and final defender implementation are not present in the supplied controller file.

02 / Start with what the camera sees

A ball. A goal.
Another robot.

Training begins with ordinary views from the robot’s camera: the same object at different distances, angles and positions. The local capture script uses RGB565 colour and QVGA frames.

Explore the local capture folders
Original football camera capture 1 from the local training folder
Camera sample / 01
Original football camera capture 2 from the local training folder
Camera sample / 02
Original football camera capture 3 from the local training folder
Camera sample / 03
Original goal camera capture 1 from the local training folder
Camera sample / 01
Original goal camera capture 2 from the local training folder
Camera sample / 02
Original goal camera capture 3 from the local training folder
Camera sample / 03
Original robot camera capture 1 from the local training folder
Camera sample / 01
Original robot camera capture 2 from the local training folder
Camera sample / 02
Original robot camera capture 3 from the local training folder
Camera sample / 03
358local JPEGs

202 football, 72 goal and 84 robot images are present in the supplied folder. The training screenshot shows a later five-object-label model, so this local capture collection is presented as a source subset, rather than a complete training export.

01 / CaptureRGB camera frames

Collect the environment from the camera’s point of view.

02 / LabelObjects, not just scenes

The training interface shows separate ball and goal bounding boxes in a shared image.

03 / DeployDetections for control

The OpenMV controller requests detections and turns object IDs into movement decisions.

03 / What the training run tells us

Small model.
Visible evidence.

The supplied Edge Impulse screenshot records a quantized int8 model and its validation results. These numbers describe object detection on the validation set; match performance involves the controller, contact and the changing scene as well.

Validation / reported F1 score89.5%

Quantized int8 model

0.87Precision
0.92Recall
Non-background precision and recall, as shown in the supplied training result.

Where recognition varies

Per-class F1 from the validation screenshot

Ball
0.94
Goal
0.82
Goal1
0.84
Red robot
0.93
Robot1
0.95

Goal labels have the lowest F1 values in this run—an important area to improve for a goal-led strategy.

Training cycles
80
Learning rate
0.001
Validation split
20%
Augmentation
Enabled
Supplied Edge Impulse screenshot showing ball and goal1 annotations, RGB image processing, 7 ms processing time and 4 KB peak RAM for the image-processing block
Image processing & annotations ↗

The displayed 7 ms / 4 KB figures belong to the image-processing block, not the full detector or robot response.

Supplied Edge Impulse validation screenshot with 89.5 percent F1, per-class confusion matrix and quantized int8 training settings
Training & validation evidence ↗

Five object labels plus background. Open the original screenshot to inspect the matrix and training settings.

04 / Inside the controller notebook

What is visible
changes the next move.

The saved controller uses the presence of object labels to select a motor command. Explore its rule order below. It records broader movement experiments; the goal-centre and threshold-based defender described in the debrief is an implementation not included in this folder.

Choose the objects detected in a frame
Selected code branch

Turn to search

No objects detected: turn for 100 ms, then stop.

Left wheel−50
Right wheel+50
Signed PWM commands / %
Decisions on a schedule

A 400 ms interval.

The script requests detections after more than 400 ms have elapsed. This is its configured decision interval, rather than a measured inference latency.

Order is part of the policy

The first matching rule wins.

Ball + goal precedes ball + goal1, then robot1, then ball alone. A red-robot detection is recorded but has no dedicated movement branch.

What remains in the snapshot

Make fallback behaviour explicit.

If detections exist but no movement rule matches, the saved script issues no new command. A refined controller would define that state deliberately.

Inspect the saved controller ↗

05 / What the pitch teaches

Recognition is
only the beginning.

The recorded debrief reports that the two defenders fitted the goal, while the attacker moved backwards after detecting the ball. It describes a tie, with the team then conceding to their opponents. These observations turn the match into specific next steps for the design.

01

Check direction before strategy.

The debrief identifies reversed motor direction on the attacker: detecting the ball produced backward motion. A basic forward/turn check needs to come before a full match test.

02

Make room to see the goal.

From deep corners, the defenders struggled to recognise the goal. The suggested refinement was to move forward slightly before rotating to search again.

03

Keep the evidence connected.

Goal recognition, position and motor direction all affect the outcome. Future tests can connect validation scores to time covering the goal and recovery after displacement.

Project scope

Camera-data collection, Edge Impulse training, OpenMV/MicroPython control and a team match strategy. The red robot and defensive approach are identified by the designer.

The supplied folder does not include the imported detection module or trained model. The archive preserves the available source, rather than a complete deployable inference package.

← Return to the project circle