Every other model in this calculator describes a shot with a list of numbers: distance, angle, defenders in the way. Matteo Matteotti and Hadi Sotudeh took a different route in The Power of Pixels: draw the shot as a tiny picture and let a convolutional neural network decide what a goal looks like. This article explains how a football moment becomes a 30×40 image, what the network does with it, how the model performed when I re-trained it on less than half the data for my 2024 undergraduate project at UFRJ, and why it is the model most likely to disagree with the others in the simulator.
Why treat a shot as an image?
Hand-built features are opinions. When a model uses “number of defenders in the shot triangle”, somebody decided that the triangle is the shape that matters and that a defender one metre outside it is irrelevant. The Kos Angle, covered in its own article, is a very good opinion, but it is still an opinion.
A convolutional neural network (CNN) is the standard tool for learning spatial patterns without being told what to look for. CNNs take matrices or tensors as input and are built from three kinds of layers: convolutional layers, whose filters detect local patterns; pooling layers, which shrink the input and reduce overfitting; and fully connected layers, which combine what was found into a final answer. Feed the network pictures of thousands of shots labelled goal or no goal, and it can discover for itself which arrangements of bodies tend to end in the net, including arrangements no analyst thought to encode.
From freeze frame to tensor
Statsbomb’s event data includes a freeze frame for each shot: the positions of the players visible at the moment the ball was struck. Matteotti and Sotudeh convert that frame into a tensor with two channels, each a grid of 30 rows by 40 columns covering the attacking area in front of the goal.
- Channel 1, the ball: every cell is zero except one, the cell where the shot was taken. The network learns location from where that single pixel lights up.
- Channel 2, the opponents: each opponent in front of the shot activates the cell they stand in. The goalkeeper and the defenders are the content of this layer.
A single lit pixel per player would make the image extremely sparse and brittle: a defender one cell to the left would look like a completely different situation. So the authors apply a Gaussian blur to the opponent channel, spreading each player into a soft blob whose size is controlled by a parameter sigma (σ). With σ = 0 each player is a hard dot; at σ = 2 neighbouring defenders merge into a cloud. The paper illustrates the effect on Dele Alli’s goal against Crystal Palace from January 2016. Both the original model and my re-trained version use σ = 1.25.
That is the entire feature engineering. No distance, no angle, no body part, no technique. Whatever the model knows about geometry, it learned from pixels.
Two versions of the model in the simulator
Matteotti and Sotudeh did something still rare in sports analytics: they published their code together with the trained weights. That made it possible to run their model exactly as they trained it, so the simulator actually contains two CNN models.
- Original Matteotti & Sotudeh xG, the authors’ own network, trained on 56,362 open-play shots. Their dataset is broader than mine: besides European leagues it includes the Indian Super League, Major League Soccer and women’s competitions. It appears under Other information in the results.
- Matteotti & Sotudeh xG, the same architecture and hyperparameters re-trained on the 23,098-shot dataset shared by every model on this site: seven Statsbomb competitions, open play only. This is the version that sits in the main results table next to the other models, so that all of them are judged on the same data.
How much data does a CNN need?
The obvious question is whether a network trained on 41% of the shots can match one trained on all of them. On the metrics the authors reported, it very nearly can:
| Model | ROC-AUC | RMSE | Log loss |
|---|---|---|---|
| Original (56,362 shots) | 0.801 | 0.276 | 0.267 |
| Re-trained (23,098 shots) | 0.781 | 0.277 | 0.269 |
A ROC-AUC of 0.80 is honest rather than spectacular. The authors themselves note that the pixel model does not beat traditional xG models on accuracy; their argument is that it offers a different and complementary perspective. For a model that was never told what a distance or an angle is, 0.78 on less than half the data is a respectable result, and it says something about how much of xG is simply geometry that a network can rediscover.
Comparing both versions with Statsbomb
Scores on a held-out slice of the training competitions can flatter a model. For a cleaner test I downloaded the shots of La Liga 2020/21, a season neither network had seen, and compared each model’s xG with Statsbomb’s own value shot by shot.
| La Liga 2020/21 (98 goals) | Total xG | MAE | RMSE | Pearson r |
|---|---|---|---|---|
| Statsbomb (reference) | 95.3 | – | – | – |
| Original CNN | 77.3 | 0.0525 | 0.0917 | 0.82 |
| Re-trained CNN | 87.4 | 0.0625 | 0.1101 | 0.69 |
Two things stand out. First, the original network correlates well with Statsbomb (0.82) even though it never saw a single engineered feature. Second, the re-trained network correlates much less (0.69), and the gap is wider than the ROC-AUC figures suggested. Ranking shots is easier than assigning them well-calibrated probabilities, and calibration is where the smaller dataset hurts.
There is a curious detail in the totals. Over the season the original model predicts 77 goals and the re-trained one 87, against 98 real goals and 95 from Statsbomb. Both CNNs under-predict, and the reason is visible when you plot their values against Statsbomb’s: the highest Statsbomb values stand alone, with no CNN value keeping them company. Both networks, and especially the one trained on less data, are reluctant to say that a chance is very likely to be scored.
The goal-line experiment
Chapter 5 of my project makes this reluctance concrete. Build a hypothetical shot in the simulator from right on the goal line, with no goalkeeper and no defender anywhere near. Every sensible model should return something close to 1. The Karim & Marwane model says 98% and the combined model 78%. The original CNN says 67%, and the re-trained CNN says 32%.
Open the goal-line shot in the simulatorThirty-two percent for a tap-in is wrong, but it is wrong in an instructive way. A pixel model only knows situations it has seen. A shot from the goal line with an empty picture in channel 2 is almost absent from real match data, because defenders and goalkeepers are nearly always present in open play. Faced with an image unlike any in its training set, the network falls back towards the base rate of the dataset, which is low because most shots miss. The original model, having seen more than twice as many frames, has met more of these rare clear chances and climbs higher. This is the point the thesis draws from the experiment: the image approach needs a larger volume of shots before it adjusts to the clearest goal situations.
Where the pixel model disagrees with the others
Chapter 5 also replays a real Lionel Messi shot that did not go in. The Karim & Marwane model and the combined model return similar values, while the CNN returns a far lower one. The pattern recurs across many shots and it is the main reason the CNN earns its place in the simulator: it is the model most likely to break a consensus. When the feature-based models agree and the pixel model does not, the disagreement usually points at something about the arrangement of bodies that a count of defenders or a blocked angle does not capture.
The limits are real, too. The 30×40 grid is coarse: each cell covers roughly a metre and a half, so small shifts vanish. Only opponents are drawn, so teammates who could receive a pass or screen the goalkeeper are invisible. The model knows nothing about body part or technique, which the literature agrees matter a great deal. And, as shown above, it is data-hungry in exactly the situations where data is scarce.
Further reading
- The Kos Angle explained — the feature-based way of handling the same defenders.
- How xG models differ — the CNN next to Rathke, Karim & Marwane and the combined model.
- The xG glossary — ROC-AUC, log loss, RMSE and friends.
- Open the simulator, build a shot from the goal line with nobody around, and compare the Matteotti & Sotudeh xG row with the original model under Other information.
Primary source: Matteotti, M.; Sotudeh, H. (2024). The Power of Pixels: Exploring the Potential of CNNs for Expected Goals (xG) in Football. Preprint. ResearchGate. Re-training and La Liga comparison from Schlaepfer, A. (2024). Modelos de expected goals no futebol: desenvolvimento de um simulador de chutes. Undergraduate project, UFRJ.