Project Title: Formulator: AI-Driven Race Strategy Assistant for Formula E Simulation
Problem Statement (in simple words)
Modern motorsports, particularly Formula E, rely heavily on strategic decision-making in time-critical situations. Formula E races are complex, focused primarily on energy management over a fixed period (45 minutes plus one lap), demanding that teams maximize the usable energy allowance to the last jolt. Engineers and drivers must quickly crunch reams of streaming data (telemetry, weather, competitor behavior) to decide optimal pit stops, energy use, and overtaking maneuvers in seconds. Traditional pre-race simulations often cannot account for dynamic, real-time events or produce tailored strategies quickly enough to adapt to unexpected scenarios like safety cars or sudden tire degradation. The core problem is creating an automated system that can quickly model specific track/car/driver characteristics and deliver dynamic, optimal strategy recommendations instantly during simulated (and potentially real-world) race conditions.
Solution
The solution is the AI-Based Race Strategy Assistant and Car Data Monitor, a modular mobility simulator designed to model vehicle races and mobility systems with real-time events. This system utilizes a three-tiered approach:
- High-Fidelity Modeling: Extracting specific car and tire degradation characteristics from simulated practice data using a regression model.
- Optimization: Using these characteristics within a Mixed-Integer Quadratic Programming (MIQP) optimization framework to generate maximized, mathematically optimal base strategies (stint lengths and compound choices).
- Real-Time AI: Training Artificial Neural Networks (ANNs) on these optimal strategies to learn the non-linear relationship between car telemetry data and strategic decisions, enabling the system to provide dynamic pit stop and tire change recommendations instantaneously during a simulated race.
What it does
The AI-Based Race Strategy Assistant functions as a predictive tool that integrates vehicle dynamics with an advanced strategy layer:
- Models Vehicle Dynamics: Uses raw simulation telemetry data, including wheel speed, tire slip, temperatures, and wear, to model the performance and degradation of different tire compounds specifically for a given track/session.
- Calculates Optimal Stints: Solves an MIQP optimization problem to determine the mathematically optimal stint lengths and tyre compound combinations (e.g., Soft-Medium, Soft-Hard) necessary to achieve the minimum race time.
- Predicts Pit Stops: The Pit Stop Decision NN analyzes 31 input features (including tire age, wear, damage, safety car status, and fuel in tank) to generate a prediction (Yes/No probability) on whether a pit stop is optimal in the current lap.
- Recommends Tires: The Tyre Change Decision NN analyzes 21 input features (mostly relating to tire status, track conditions, and race progress) to suggest the next optimal tire compound (Soft, Medium, or Hard).
- Real-Time Monitoring: Collects data via a UDP stream from the simulator, processes it, and displays the strategic AI predictions and real-time telemetry data through a user interface (UI).
USP
Our approach offers a unique blend of mathematical optimization and real-time machine learning tailored for high-stakes mobility scenarios:
- Dynamic, Adaptable Strategy: Unlike pre-defined, hard-coded strategies, our AI can adapt dynamically during the race based on real-time factors like higher-than-expected degradation, providing situation-specific decisions.
- AI-Driven Speed: The use of ANNs replaces traditional, slow lap time simulations, serving as a much faster performance prediction tool. This provides the capability to generate fast, quality decision-making solutions for both pre-race planning and in-race reaction.
- Holistic Optimization: The project combines a regression model to derive physics constants, an MIQP optimization core to define the base strategy, and Neural Networks for execution, linking vehicle dynamics directly to complex strategy decisions.
- Mobility Relevance: While focusing on Formula E, the modular structure (Simulation Core + Agent Logic + Analytics) is designed to be applicable to other mobility domains, such as autonomous vehicles or drone swarms.
Inspiration
The inspiration for this project is rooted in the high-stakes, data-driven nature of electric motorsports and the broader AI-Sustainability-Mobility ecosystem.
- Formula E as a Laboratory: Formula E is specifically designed to be a "laboratory of cutting-edge technologies" and an innovation driver for electric road car systems, focusing heavily on power electronics and energy management.
- The Strategy Gap: Successful racing requires extensive simulation for driver training, car setup optimization, and evaluating potential strategies like managing tire wear and pit stops. The need to quickly predict race outcomes and strategize against unexpected events (like yellow flags) confirmed the value of an AI-based system.
- Challenge Alignment: The project aligns perfectly with the competition's explicit "Mobility Simulator" challenge track, specifying Formula E, race strategy testing as core applications.
How we built it (tech stack)
The project utilized a modular architecture leveraging Python for the core logic and standard simulation/data frameworks:
| Component | Technology / Platform | Purpose |
|---|---|---|
| Simulation Source | F1 2021 Game + UDP Stream | Provided telemetry data packets for the "driver-in-loop" approach. |
| Physics/Optimization | Python, cvxpy, Scikit-learn (for Regression) | Used Ordinary Least Squares (OLS) regression to calculate tire constants. Used the cvxpy package to solve the Mixed-Integer Quadratic Programming (MIQP) problem for optimal stint lengths. |
| AI/ML Core | Python, Keras API in TensorFlow | Designed and trained the two Artificial Neural Networks (NNs) for pit stop and tire decisions. |
| Backend & Storage | Django (Python) RESTful API, PostgreSQL database | Controlled the data flow, stored necessary data, and managed endpoints for communication. |
| Frontend/UI | Android Studios/React Native | Built a mobile application to monitor car data (speed, RPM, etc.) and visualize the AI's real-time predictions, providing users with mobility while monitoring. |
*Methodology*
The creation of the race strategy assistant followed a rigorous pipeline involving data collection, mathematical modeling, and machine learning integration:
- Data Collection & Pre-processing: Collected simulated telemetry data (193 data entries per row, including speed, tire wear, and temperature) via a UDP stream from the simulation client. The data included both finished and unfinished races to maximize representation. Categorical and numerical features were selected and cleaned (e.g., removing invalid data).
- Tire Modeling (Regression): Used raw practice session data (around 10 laps) to generate tyre pace constants (using OLS 7th degree polynomial linear model) and tyre wear constants (calculated from the gradient of degradation), specific to the track conditions.
- Strategy Optimization (MIQP): Used the calculated constants as inputs to the MIQP linear programming formula to mathematically derive the optimal stint lengths for various viable tire combinations (e.g., 1-stop Soft-Medium).
- NN Training Data Generation: Ran full race simulations using the optimal strategies identified by the MIQP model to generate the necessary labeled training data for the neural networks.
- AI Training and Validation: Designed the Pit Stop NN and Tyre Change NN using Keras/TensorFlow. Implemented a pre-processing model to normalize numerical inputs. Used techniques like class weighting to compensate for the significant data imbalance (very few pit stops vs. no pits), and used early stopping and learning rate reduction to optimize training and prevent overfitting.
Challenges we ran into
Successfully executing a complex, real-time simulation system in a hackathon timeframe involved navigating several technical hurdles:
- Data Scarcity and Secrecy: Obtaining realistic and trustworthy data from professional F1 teams is highly restricted due to confidentiality. This necessitated relying on simulated data generated by the F1 2021 game client.
- Data Generation Efficiency: The chosen simulation environment did not allow for an automated Monte Carlo approach to generate random events or large data sets. This meant relying on time-consuming manual "driver-in-loop" practice sessions to generate diverse race situations.
- Data Imbalance: The Pit Stop Decision NN faced severe data imbalance, as positive labels (pit) made up less than 0.5% of the total labeled data points (17,925 pits vs. 3,688,947 total labels). This required careful modification and setting of high class weights for the positive class to ensure accurate training.
- Integration Complexity: Integrating the Python-based AI core, the data streams from the simulation client, and the API/database required significant time to ensure synchronization and real-time performance.
Accomplishments that we're proud of
We demonstrated strong results across the strategic, mathematical, and technical implementation layers:
- Strategy Superiority: The MIQP optimization successfully identified a more efficient strategy than the simulation’s own recommendation: a calculated 1-stop strategy (Soft for 10 laps, Medium for 17 laps) resulted in a faster race time (43:48,031) compared to the simulation’s recommended 2-stop strategy (43:49,451) on the Paul Ricard track.
- High AI Accuracy: The Tyre Change Decision NN achieved a high categorical accuracy (close to 1.00) on both training and validation data sets, indicating the model successfully learned to map features to the correct tire compound decision. The pit stop NN adapted to different base strategies and showed predicted pit stop probabilities above 50% within the designated pit interval.
- System Integration: We successfully implemented the full end-to-end architecture, connecting the simulator data stream, the AI prediction module, and a Django/PostgreSQL backend, demonstrating live strategy recommendations via a functional React Native mobile application.
- Robust Modeling: The ability to generate accurate tire pace and degradation constants using OLS regression provided a strong, verifiable foundation for the subsequent complex optimization and AI training.
What we learned
Through developing this project, we gained critical insights into high-performance simulation and AI development:
- Balancing Fidelity and Performance: We learned that for strategic testing, the simulation must prioritize running faster than real time to evaluate strategies efficiently, even if it means simplifying visual fidelity.
- The Power of Optimization: Relying on simple, computationally cheap linear programming (MIQP) based on strong physics modeling is highly effective for determining initial optimal strategic baselines before training complex AI models.
- AI Training Challenges: We learned the crucial necessity of addressing data imbalance in classification problems like pit stops (using class weights) and employing mechanisms like early stopping and learning rate reduction to ensure the model generalizes well and avoids overfitting.
- Modular Design: The successful deployment reinforced the importance of a modular architecture (decoupling physics, strategy, and UI) to allow independent development and future extensibility.
What's next for “Formulator”
To evolve the AI-Based Race Strategy Assistant into a more comprehensive and realistic tool, future work should focus on:
- Data Enhancement: Integrating real-world sensor data and more precise measurements to improve the prediction quality and realism of the AI.
- Advanced Training Techniques: Applying reinforcement learning (RL) alongside the simulation environment to automatically generate more data and allow the AI to adapt to a wider spread of random events and generate situation-specific decisions autonomously.
- Expanding Strategic Scope: Reconstructing the AI to consider advanced racing tactics and maneuvers, such as managing the under/over cuts and integrating opponent behavior prediction in real time.
- Unifying Domains: Leveraging the existing modular structure to expand modeling capabilities to include other mobility applications, such as integrating drone flight dynamics or multi-agent traffic flow alongside the racing environment.
Project Name: Formulator
Team Details
Name: Desyn Studio Members:
- Tamal Krishna Chhabra
- Devansh
Built With
- cvxpy-package
- django
- f1
- keras-api
- obd-2
- postgresql
- python
- react
- react-native
- rmsprop
- tensorflow

