The End of the “Star Player”: How AI is changing the world of Football

Warwick AI
Warwick Artificial Intelligence
6 min readOct 9, 2023

--

An article by Avazbek Isroilov

It is often believed that having one of the world’s most skilled players decides the fate of an entire football team. We have seen this in many modern teams, with players such as Lionel Messi, Cristiano Ronaldo, and Neymar, who seem to be the driving force leading their squad to victory. However, through artificial intelligence (AI), it has been demonstrated that this theory may not always be true. With machine learning algorithms, a team can still reach the finals in the absence of such players, provided the coaches use the available data effectively.

Approach

To maximise the information gain and quality of analysis, we are going to use machine learning and game theory in conjunction.

Machine learning (ML) allows computers to learn from experience and improve their performance on a task over time. It involves feeding a computer a large amount of data and using algorithms (e.g. K-means clustering) to identify patterns in that data.

Game theory (GT) is a branch of mathematics and economics that studies how people make decisions when interacting with others. GT models can help us predict the behaviour of individuals or groups in different scenarios and can help identify the most effective strategies to achieve our desired outcomes.

Analysis of Penalty Kicks

Game theory and machine learning converge when there is a need to make suitable decisions in a multi-agent environment — such as football with multiple players making decisions at any one time. By analysing player-specific statistics — for instance, their number of successful passes and shots from different positions — we can predict how different types of players behave or make decisions in penalty kick scenarios. This is achieved by first quantifying individual players’ playing styles, for both penalty takers and goalkeepers , grouping them into different categories using clustering techniques. This allows teams to form evidence-based predictive games for each cluster.

  1. Quantifying players’ styles:

Data is formatted to allow for easy interpretation by both coaches and machine learning systems. To do so, we use ‘player vectors’ [1] to characterise the playing styles of penalty takers using data across 18 dimensions. Each component in the ‘player vector’ corresponds to the weighting which quantifies a player’s ability in that specific technique (e.g. Center Pass: 0.2). Since ML models only require vectors which consist of numbers, the ‘player vectors’ can be analysed by machine learning algorithms while also providing a visual aspect for coaches as seen in Figure 1.

Figure 1 Example of Player Vectors. (Left) R.Lewandowski, the central striker showed high weights (red dot) for C2: close shot, C13: center dribble, and C14: Center Pass. (Right) Jesus Navas, right winger shows high weights for C8: Right Backline Cross, C12: Right flank dribble, and C18: Right flank pass. The meaning of each component of the vector can be found in a paper written by Decroos & Davis, 2019 [1].

2. Using Clustering to group common characteristics:

Using a total of 635 such vectors for individual players, we divide them into 6 groups using K-means clustering [2] — which groups vectors by similar characteristics. Using Principal Component Analysis [3], we reduce the 18-dimensional player vectors to both a 3D and 2D graph, as seen in Figure 2, to be able to visualise this output. In Figure 2a, the goalkeeper (Cluster #3) suffers from insufficient data and Cluster #6 is an outlier — this cannot be inferred from the diagrams however the paper (Tuyls et al.) from which these diagrams are sourced [4] discuss this in more detail. These clusters will therefore be removed from further analysis.

Figure 2 Result of the clustering process. (a) The result of clustering is shown in 3D. (B) The result of clustering is shown in 2D with the anomalous clusters removed.

3. Game theoretic analysis:

We conduct game-theoretic analysis for each cluster. Examining the Nash strategies [5] played by each cluster gives the result seen in Figure 3. A Nash strategy involves determining the best course of action for an individual based on what they believe other players will do. Specifically, it involves identifying a set of actions that maximise the player’s expected outcome, assuming that other players will choose their best possible response.

From the analysis, penalty takers in all clusters are recommended by Nash to shoot more to their natural sides than to their non-natural sides. However, the recommended strategy for penalty takers in Cluster #1 is quite balanced between natural and non-natural shots.

Figure 3 Nash probabilities and empirical frequencies for Shot (S) and Goalkeepers (G) with Natural1 (N) and Non-Natural (NN) actions.

In addition to analysing Nash probabilities, the patterns of positions for successful goals are also visualised in Figure 4. As seen below, penalty takers in Cluster #2 in Figure 4 tend to score mostly to the bottom left corner of the goalmouth.

Figure 4 Heatmaps of goals by all kickers and kickers in individual clusters for empirical probabilities.

Generative trajectory prediction for counterfactual analysis

Generative trajectory prediction models are a type of machine learning model that aims to predict the future movements of players based on their past trajectories.

A possible way of training such a model would be to provide an input context to such a model (e.g. consisting of the positions of the ball, defenders, attackers, etc.), and subsequently predict the future trajectories of players. Figure 5a [6] shows predicted behaviours of players conditioned on such an input context. The example shown was trained using the most basic predictive model, consisting of a centralised Long-Short Term Memory (LSTMs). This takes an input of raw trajectories of players and the ball, and predicts the step-by-step change in trajectory of the defensive players as an output.

Figure 5 (a) Shows the predictions of players’ trajectories given players’ and ball’s original positions (b) Shows the situation where the ball’s trajectory is perturbed (faked) to infer the defender’s movements. This case is used for counterfactual analysis.

A key advantage of generative predictive models is that they can be used for counterfactual analysis.

Counterfactual analysis is a type of analysis that involves exploring what could have happened if things had been different in the past, allowing you to adapt your future gameplay against similar opponents.

Figure 5b illustrates an example where the trajectory of the ball is ‘faked’ to see how the defender might react. Based on the knowledge of the defenders’ movements, an educated strategy can be made to maximise the probability of a shot at the goal.

The above-mentioned approaches are one of the underlying aspects to develop an Automated Video Assistant Coach (AVAC), a system capable of processing raw broadcast video footage and accordingly advising coaching staff in pre- and post-match scenarios.

Conclusion

The integration of AI into football can be expected to transform the future of this sport, with the focus leading away from individual ‘star players’ and more towards the team as a whole. On top of this, there is potential for an entirely new role to be introduced into football teams: AI engineers working behind the scenes on the strategy of the team at every move. These engineers will employ the AVAC (Automated Video Assistant Coach) system discussed above to help the coaches plan new advanced strategies for their games, completely changing the approach to strategy in football. But is the world of football ready for this shift? Only time will tell if the teams, and importantly, the fans, will support these new changes.

References

[1] Decroos, Tom, and Jesse Davis. Player Vectors: Characterizing Soccer Players’ Playing Style from Match Event Streams. doi: www.ecmlpkdd2019.org/downloads/paper/701.pdf.

[2] Education Ecosystem (LEDU) “Understanding K-means Clustering in Machine Learning” Towards Data Science, Sept 2018 doi: https://towardsdatascience.com/understanding-k-means-clustering-in-machine-learning

[3] Casey Cheng “Principal Component Analysis (PCA) Explained Visually with Zero Math” Towards Data Science, Feb 2022 doi:https://towardsdatascience.com/principal-component-analysis-pca-explained-visually-with-zero-math

[4] Tuyls, Karl, et al. “Game Plan: What AI Can Do for Football, and What Football Can Do for AI.” Journal of Artificial Intelligence Research, vol. 71, May 2021, pp. 41–88, doi:https://doi.org/10.1613/jair.1.12505.

[5] David L. Pool and Alan K. Mackworth, “Artificial Intelligence 2E: Foundations of Computational Agents”, Cambridge University Press, 2017. doi: https://artint.info/2e/html2e/ArtInt2e.Ch11.S4.html

[6] Le, Hoang, et al. Data-Driven Ghosting Using Deep Imitation Learning. Doi: http://www.yisongyue.com/publications/ssac2017_ghosting.pdf

--

--

Warwick AI
Warwick Artificial Intelligence

Society run blog on all things artificial intelligence - written and edited by a team of researchers from Warwick AI at the University of Warwick.