Automate Health Care Information Processing With EMR Data Extraction - Our Workflow
We dive deep into the challenges we face in EMR data extraction and explain the pipelines, techniques, and models we use to solve them.
If you play any sports that involve a ball — soccer, football, golf, basketball, tennis, cricket, rugby, and more — you’ll be happy to know that artificial intelligence (AI) can help you systematically enhance your technique and grow as a player. Or if you’re a coach, AI can assist you to become more effective.
So, where can you apply AI in your favorite sport? You can use it to observe and analyze any aspect of any sport. But to help you understand its capabilities better, we’ll focus on one feature that’s useful across multiple sports — automated ball tracking.
Ball tracking records a ball's 3D position, and sometimes other attributes like speed or spin, relative to the field (or court) and the players.
By doing so, players and coaches can analyze their techniques and improve on them. Referees and umpires can give better decisions. Broadcasters like TV and YouTube sports channels can offer insights to their viewers through engrossing visualizations.
Recent advances in AI, especially the use of deep learning and deep neural networks for computer vision tasks, enable us to reliably automate ball tracking. In addition, other useful tasks like player detection, player tracking, body parts segmentation, pose estimation, and activity recognition can be combined with ball tracking to provide comprehensive insights and analysis for any sport.
In the next sections, we’ll explore ball tracking in golf, soccer, and cricket to understand AI’s benefits.
The National Golf Foundation says 2.4-3.2 million Americans per year play golf for the first time. But only about 27% of them turn into regular players. There is a huge demand for coaching and self-teaching aids that AI can help fulfill.
If you play golf at any level, you already know that it’s a highly technical game. An unending number of factors can affect your shot — your pose and height, the swing arc, the speed and angle of approach, the type of the golf club, the club loft (angle of the club face), the materials of the club and the ball, the grass, changes in ground elevations, even the wind.
Getting good at golf can be frustrating. But being a game over which people socialize and make business deals, many players are highly motivated to get better.
This is where AI can help. Automated golf ball tracking apps let you analyze your technique and improve at your own pace. In addition to automated ball tracking, these apps combine pose estimation, swing tracking, and other analysis to address every aspect of your play.
A smartphone or a laptop is placed on a tripod about 5 feet behind the player. This position allows it to track the ball from the moment it’s launched till it hits the ground.
Most players like to review the trajectory immediately after the shot. So, real-time ball detection and tracking are essential. For high-speed golf ball detection and localization in real-time, we use a mobile-friendly lightweight object detection model like YOLOv3. YOLO reports a bounding box for the ball in the input image and a confidence score for the detection. But instead of using it to detect the ball every frame, we optimize by using it only every few frames. For the gaps, we use a faster image processing algorithm like the Kalman or particle filter.
Being such a technical game, many determined players also like to analyze their play off-course. For this, more accurate detection and object tracking are necessary. They may need a more accurate 3D trajectory by combining inputs from a second camera. For such off-course analysis, we recommend using more sophisticated models like TrackNet and TrackNetv2. They detect the ball more accurately by analyzing sequences of images.
If you’re a golf coach, AI can help you become more effective by enabling you to analyze, measure metrics, and visualize all aspects of your students’ techniques. Combining ball tracking with activity recognition, pose estimation, swing tracking, and data science algorithms like clustering gives you comprehensive insights into techniques and weaknesses.
Each of these tasks uses its own dedicated deep learning model. For activity recognition and pose estimation, we use pre-trained out-of-the-box body segmentation models from frameworks like Detectron2.
Ball and swing tracking are pretty useful by themselves. But even more useful would be the ability to simulate all the factors involved in a golf shot, vary them, and choose the ones that improve the shot.
For example, you can vary the positions and angles of your simulated arms and see how the shot improves. You can then practice this new position out on the course.
For this to work, we create a realistic simulation model that includes all the factors that influence a golf shot. But instead of modeling them explicitly using formulas, we use machine learning to learn all the complex inter-relationships between these factors. The input training data for this learning includes:
By combining these factors, the simulator learns to predict a ball’s trajectory when given all the other factors. We don’t explicitly model its physics using formulas. Instead, all the physics phenomena are embedded in the parameters of the model by simply learning from the training data.
Soccer (or football) is a very popular sport worldwide, especially in Europe, Latin America, and Africa. The sport’s ecosystem includes football clubs, coaching academies, educational institutions, and broadcast media. Let’s see how AI and particularly ball tracking systems are used in soccer.
If you’re a soccer player, automated ball tracking can help you improve your ball control and passing skills. It enables you to visualize how the ball moves in response to your leg and feet movements. You can discover weaknesses in your technique and improve upon them.
Unlike golf or cricket, in soccer, the ball is always moving with several players running around it. It’s a fast-paced game played in a large field which means the cameras have to pan around the field a lot. So, a capable ball tracking system has to overcome challenges like motion blur and frequent occlusion.
We use a sports video analysis pipeline that includes optical flow to compensate for motion blur, a fast detector like YOLOv3 or YOLOv4 for ball detection, and the unscented Kalman filter to continue tracking accurately even when the ball is blocked by players’ bodies and legs.
Since the YOLO models are general-purpose object detectors, we improve their accuracy by fine-tuning them for a specific sport. For example, we fine-tune them on a dataset of soccer ball images in their typical surroundings to help the model learn to detect soccer balls more accurately.
Automated ball tracking also helps soccer coaches record, analyze, and visualize strategies and tactics like positional play, attack, and defense. For this, we combine ball tracking with deep learning models for player detection and tracking. Multiple cameras are fixed around the periphery of the field.
Compared to commercial systems like Hawk-Eye, our custom systems are built for your specific use case allowing us to get a scorching hot in-domain accuracy.
Cricket is a popular sport in the Commonwealth countries. Its ecosystem includes cricket boards, coaching academies, educational institutions, and broadcast media. Let’s explore how AI and ball tracking are used in cricket.
Let’s see how coaches can analyze and enhance a cricketer’s skills using AI.
Good cricket tactics are all about playing mind games against your opponents. Surprise them to keep them unbalanced and on edge.
A bowler seeks to lull the batter by starting out predictably before hitting them with an unexpected swing or googly. Meanwhile, the batter constantly scans the field for weak points to send the ball to and score a quick run or a boundary. Gaps in the field, slow runners, and clumsy fielders are all targets for a clever batter.
As a coach in an academy or an institution, teaching a player to notice such patterns of play and weak points — both their own and those of their opponents — is an important goal of cricket coaching. Every player is taught to unlearn their predictability, get out of their comfort zone occasionally, and surprise their opponents.
Visualizing different aspects of play over time helps your players discover patterns of play and weak points like:
AI helps with such visualizations using automated ball tracking and pitch detection. The data are shown as heat maps, pitch maps, “wagon wheel” graphs (that show trajectories of all the shots played by a batter), and other types of visualizations.
As a coach, you’d like to give immediate feedback on bowling or batting actions while out practicing. But you also require more detailed analyses and visualizations post-practice. Both capabilities are needed in a good ball tracking solution.
In the typical coaching setting, a smartphone, or a laptop with an off-the-shelf camera, is placed near the stumps at the non-striker’s end looking down the pitch. A second device may be placed to the side to capture bowling or batting actions from the side. They record the videos for the AI models to process.
For quick ball detection in real-time, we use an object detector like YOLOv3 or YOLOv4. It’s lightweight, mobile-friendly, and fast with high frames-per-second. These object detector systems make it easy to track multiple balls as well in the same instance.
But detection in every frame is unnecessary because a cricket ball travels quite predictably, not randomly, between two frames. So, we opt for a more lightweight tracking approach using probabilistic tracking algorithms like the Kalman or particle filter. They predict the position of a ball based on its previous position.
But an additional complication in cricket is the ball pitching on the ground. A cricket ball’s pitching makes its trajectory nonlinear. To handle that, we use the unscented variant of the Kalman filter. It can predict the position of the ball, in 2D or 3D, from its previous position. When there’s a sudden flip in the vertical direction of the ball, we know that it has pitched on the ground.
For post-practice analysis, we suggest a more capable detection algorithm like TrackNet or TrackNetv2. They detect balls more accurately by examining sequences of images.
Cricket has some unique rules that require an umpire to imagine a what-if situation before giving a decision. For example, the leg before wicket (LBW) rule says that if a batter defends a ball with their pad, the umpire should mentally trace the trajectory of the ball as if the leg wasn’t present and if that imaginary path looks like it will hit the stumps, then declare the batter out.
Unsurprisingly, such subjective judgments based on imagination have led to a lot of controversial decisions over the years. The situation was improved by automated decision review systems like Hawk-Eye. However, these systems are cost-prohibitive and used only in top-tier matches.
Less expensive AI ball tracking systems can be immensely beneficial for county-level and local matches that don’t have large budgets. Our automated cricket ball tracking uses off-the-shelf devices to supply intelligent ball tracking solutions to any local coaching academy, institution, or cricket board.
For this use case, off-the-shelf cameras are typically attached around the periphery of the field. The ball tracking solution system takes in video feeds from multiple cameras and runs the ball detector on each. We again use an unscented Kalman filter for tracking because there are nonlinear direction changes.
Next, the pipeline uses multi-view geometry to combine multiple camera views into a 3D projection and calculate the 3D position of the ball. Trained on lots of videos of ball movement, the system is now able to predict the 3D trajectory of the ball using a regression model. A second regression-classification model, fine-tuned on a dataset of LBW videos, detects LBW and reports a confidence score.
AI’s human-like vision, language, and audio understanding capabilities enable it to be very useful for multiple tasks in every sport’s ecosystem, including player self-teaching, coaching, officiating, and broadcasting. Moreover, these improvements are now available cheaply to every stratum of society and level of competition, thus directly contributing to socio-economic improvements in the lives of people through sports.
With our deep expertise in AI, deep learning, and computer vision, Width.ai is the ideal implementation partner to bring your sports improvement ideas to life. Let’s talk!