Can AI help Egypt win the world cup?
Updated: Jul 18
A look at sports engineering with AI researcher Abdelrahman Hisham
“Football is a simple game. 22 men chase a ball for 90 minutes and at the end, the Germans always win.” Said Gary Lineker in 1990, right after losing the football world cup semi final to Germany. To his credit, the German national team’s nickname is “the machines.” they are just that good, or at least they were.
This quote held on for long, with occasional revisions about the ways the Germans still won. Then the 2018 football world cup happened, and Germany had a humiliating exit in the group stage. Then again in the 2022 football world cup. So, what happened? The short answer is that everyone else got better. But wait, there’s more!
In this article, we’ll explore the invisible way that athletes have gotten better over the years: sports engineering, and all the ways AI has revolutionized this field. We will also be speaking to one of Egypt’s aspiring AI researchers in the field: Eng/ Abdelrahman Hisham.
What follows is a collaborative deep dive into the world of sports, AI, and everything in between. But first, let’s just lay down some basics about how AI can “see” things. Shall we?
How does AI “look” at sports matches?
Let’s imagine for a second you’re a sports engineer at a football team, and the coach asks you for a detailed report about 2 young stars in which the club is interested. What are you going to do? Well, the first step would be to analyze videos of their last say 40 matches and try to come up with useful insights.
This might come as a shock to you, but AI can’t really “see” in a traditional sense. However, it can “track” objects, meaning it will draw a rectangle around each object in an image and know what type of object is inside. The most famous example of this is the “You Only Look Once (YOLO)” model by Ultralytics. It’s well optimized, it’s versatile, and it’s also really easy to use and understand.
In a nutshell, we train a very large neural network on a bunch of images with rectangles drawn around each object. Then, when presented with a new image, the model can locate each new object. It can also provide information about said object. If we use the example above, the model is saying that the blue box contains a dog, the yellow box contains a bike, and the pink box contains a car.
Pictured: Multiple Object tracking using the Yolov5 model applied to one of Brazil’s worst tragedies. The 7-1 (left) and vehicle traffic (right).
A noteworthy feature of YOLO is the ability to give it new types of footage (think football matches), and it will then get better at working with this type of footage in the future. This process isn’t exclusive to just object tracking models though. It’s a popular AI technique called “fine-tuning”.
So, you grab some football datasets, train YOLO on them, and then run it through your desired matches. Ideally, this will give you raw data regarding player movement and actions. This is good progress, but so far, it’s just raw data. You’ll need another AI system to actually understand what this data means. There’s a whole field related to this process and not just in football. At this point, you might even be able to create something similar to our very own AI video analytics “AzkaVision”! Good luck though.
There’s lots of insights in this data, some of which is collected manually, but still. you can track how well these players are developing relative to historic data of older players. You can compare their defensive and offensive abilities over time, particularly in high stress situations. You can extract insights specific to football, like expected goals, expected assists(xG/ xA). on-ball-value , and so on.
This is just scratching the surface of what sports engineers do of course. There’s a lot of other AI applications even in something like refereeing. If you’re a premier league of wimbledon fan, you’re probably familiar with the “Hawk eye” system for tough calls. Or Sony's semi-automatic offside detection, which we saw in Qatar’s 2022 world cup. These systems work similarly to the human eye by using multiple cameras to measure depth.
Pictured: Examples of the hawk eye system from Wimbledon (left) and Sony’s Skeletrack system in action (right)
But wait, in this scenario, how did you even get to be a sports engineer? And what even is sports engineering exactly?
What even is sports engineering? an Interview with Eng. Abdelrahman Hisham, AI researcher at Cairo University.
An intro to sports engineering
-Before we start, why don’t you tell us a bit about yourself?
“Sure, I’m an AI researcher at the Biomedical Engineering department at Cairo university. I started my research journey working with AI and deep learning, specifically with cardiac imaging. I also was (and still am) a big sports fan. I watch a lot of matches, I play football and football-based games, and so on. I worked on a few projects related to sports alongside Dr/Khaled Elsayed. Then I decided to dedicate my master’s thesis to sports engineering, specifically in football player tracking.”
Pictured: football player tracking example. Also known as “Game State Reconstruction”
-What’s the difference between sports engineering and sports science? Which field are you in exactly?
“Sports engineering is a subset of sports science. It’s about applying engineering principles to help athletes perform better and avoid injury. This can include disciplines like: biomechanics, material science, and computer science. Sports science involves all that and other things, like: nutrition, psychology, and so on. As for the second part: I’m a sports engineer.”
-What do sports engineers use AI for?
“There’s 2 main use cases. First: we’re trying to extract useful insights from match videos. My work in this area was about solving some problems where the models get confused if two players run in front of each other. The second use case is a more holistic approach where you’re using the data from the first case to quantify how good a player is. The earlier you can scout talent, the better.”
-The age old question, can AI replace sports engineers / analysts?
“Absolutely not, It’s the same story you’ll hear from people actually working in AI. a) there’s a lot of variabilities that AI can’t really fathom no matter how good it gets. b) there’s always the need for a ‘human touch’ so to speak. In sports, and more specifically football, this is called having ‘an eye’ for talent. you can never replace that. It’s also a lot of fun.”
“However, given that AI can now help 1 person do the job of 2 or 3 people, business owners have more incentive to hire less people, or pay them less. That’s problematic, yes, but it’s a different problem than the one we’re talking about today.”
An overview of Sports engineering in MENA.
-Yes or no, will AI scout the Next Messi or Mohamed salah?
“-laughs-. Well, I can see it happening. A lot of places have AI systems that didn’t exist during Messi’s start, but there’s still a factor of access to technology. Even if there was a player as good as Messi (and that’s a big if). if he didn’t grow up near a proper sporting facility, there would be little to no chance of him being discovered. Sadly, this is often the case.”
-Speaking of access to technology, What does the market look like in the MENA region?
“It really varies, Saudi-Arabia and the UAE are leading the charge with huge investments across the board, drawing in talent from all over the world. There’s lots of success stories in other places too. The Lebanese basketball league and the Kuwait handball league are notable examples of data-driven success. On the other hand, Things are more complicated in Egypt.”
Pictured: A volleyball game between Al Ahly and AlZamalek, the two biggest clubs in Egypt. Note the lack of spectator attendance.
-What’s different about Egypt?
“There’s a few sports engineering firms that are growing right now, KoraStats and ArqamFC to name a few. However, most of this incremental growth is in football. Other sports leagues in Egypt suffer from ever shrinking budgets, because of low advertising income, which is because audiences aren’t allowed into most matches. The end result is that a sizable number of players in these sports just leave instead of waiting to be scouted. You can’t really talk about using AI when there isn’t enough money to pay the players on the court properly.”
“This might seem like a pretty bad situation, but I believe that with proper management, things can get back on the right track. The more people play and watch sports, the larger the incentive is for development”
What does the future hold?
-What would you like to say to up and coming students looking to enter the field in sports engineering?
“I would say there are lots of career opportunities in this field, both in industry and academia. This is obviously more true in countries with more developed sports industries, but as we established earlier, most countries are investing into their sports industries. It’s competitive, yes, but so are most jobs today.”
-To you, What will the future look like as technology becomes more and more intertwined with the sports world?
“I’m a little worried that managers and analysts are going to be too focused on efficiency and numbers and not talent. The good news though is that it’ll be really easy to acquire and use these systems. Add to that the fact that more and more countries are investing in sports, and you have a more level playing field. As we’ve seen in the 2023 AFCON, the era of ‘elite’ teams is over. Smaller teams are better now than ever, which is exciting. The pioneers will still have an edge, but only slightly so”
“So, yes…. If we play our cards right, invest in the right channels, and work really hard, AI can indeed help Egypt win the world cup.”
Comments