-
Notifications
You must be signed in to change notification settings - Fork 0
Home
AI-Powered Formula 1 Race Strategy Analysis and Decision Support System
-
๐ Overview & Architecture
Project overview, system architecture, and installation procedures -
๐ Streamlit Dashboard
Interactive web interface for F1 strategy analysis and visualization -
๐ค Machine Learning
AI models for lap time prediction, tire degradation, and gap calculation -
๐ฃ๏ธ NLP Pipeline
Radio transcription, sentiment analysis, and entity recognition -
๐ง Expert System
Rule-based decision engine for race strategy recommendations -
๐จโ๐ป Developer Guide
Development environment, utilities, and deployment instructions
DeepWiki
VforVitorio/F1_Strat_Manager
Devin
Last indexed: 13 June 2025 (0638ba)
System Architecture
Documentation Workflow
Strategy Recommendations View
Radio Analysis View
Strategy Chat Interface
Lap Time Prediction
Vision-based Gap Calculation
Radio Transcription
Named Entity Recognition
Expert System
Degradation Rules
Radio Message Rules
Developer Guide
Model Artifacts and Deployment
Overview Relevant source files
The F1 Strategy Manager is an integrated AI-powered system for Formula 1 race strategy analysis and decision support. This document provides a technical overview of the system architecture, key components, and data flow, serving as the entry point to understand how the system works.
For detailed setup instructions, see Installation and Setup. For information on the Streamlit interface, see Streamlit Dashboard.
Purpose and Scope
The F1 Strategy Manager combines telemetry data analysis, computer vision, natural language processing, and rule-based expert systems to:
Predict lap times and tire degradation using machine learning models
Calculate optimal race strategies based on complex variables Provide actionable recommendations via an interactive dashboard
It targets technical race strategists who need data-driven decision support for critical race situations.
README.md 5-11
scripts/app/app.py 60-64
System Architecture
The F1 Strategy Manager is structured as a multi-layered system with specialized components for data acquisition, processing, analysis, and visualization:
User Interface
Expert System
Data Processing Pipeline
Data Sources
FastF1 API (Race Telemetry)
OpenF1 API (Team Radio)
Race Video Footage
Gap Calculation System (YOLOv8 Vision Model)
Radio Analysis Pipeline (Sentiment + Intent + NER)
Lap Time Prediction (XGBoost Model)
Tire Degradation Prediction (TCN Model)
utils/processing.py (Data Transformation)
F1StrategyEngine (Experta Rule System)
F1DegradationRules
F1GapRules
F1LapTimeRules
F1RadioRules
F1CompleteStrategyEngine (Conflict Resolution)
app.py (Streamlit Entry Point)
recommendations_view.py
time_predictions_view.py
gap_analysis_view.py
radio_analysis_view.py
degradation_view.py
strategy_chat.py (LLM Interface)
Sources: scripts/app/app.py 8-21
README.md 14-42
Data Sources and Processing
The system ingests and processes data from three primary sources:
Team Radio (OpenF1): Audio transcripts from driver-team communications Video Footage: Raw race footage for gap calculation and position tracking
Data processing is managed through the utils/processing.py module, which contains functions for transforming raw data into analysis-ready formats:
Function Purpose Source File get_processed_race_data() Transforms race telemetry with fuel adjustments and degradation metrics processing.py get_processed_gap_data() Calculates gap consistency between cars processing.py get_processed_recommendations() Loads and filters strategic recommendations processing.py calculate_gap_consistency() Determines consecutive laps with similar gap windows processing.py
Sources: scripts/app/utils/processing.py 115-130
scripts/app/utils/processing.py 173-270
Machine Learning Models
The system employs several machine learning models for predictive analytics:
XGBoost Model: Predicts lap times with MAE of 0.09s
YOLOv8: Computer vision model for team identification and gap calculation NLP Pipeline: Uses Whisper, RoBERTa, and BERT models for radio analysis
These models process telemetry data to generate predictions that feed into the expert system for strategic decision-making.
README.md 31-37
Expert System
At the core of the strategy recommendation engine is a rule-based expert system built on the Experta framework. It consists of several specialized rule sets that analyze different aspects of race data:
KnowledgeEngine
F1StrategyEngine
+get_recommendations()
+record_rule_fired()
F1DegradationRules
F1LapTimeRules
F1RadioRules
F1GapRules
F1CompleteStrategyEngine
+active_systems
+init()
+get_recommendations()
+_resolve_conflicts()
ยซabstractยป
Fact
TelemetryFact
+driver_number
+lap_time
+tire_age
+position
DegradationFact
+degradation_rate
+predicted_rates
GapFact
+gap_ahead
+gap_behind
+consistent_gap_ahead_laps
RadioFact
+sentiment
+intent
+entities
StrategyRecommendation
+action
+confidence
+explanation
+priority
The F1CompleteStrategyEngine integrates multiple rule sets and resolves conflicts to generate coherent strategy recommendations. For more details on the expert system, see Expert System.
README.md 38-41
Streamlit Interface
The user interface is built with Streamlit and provides multiple specialized views:
Gap Analysis View: Visualizes gaps between cars and identifies strategic opportunities
Time Predictions View: Displays lap time predictions Tire Degradation View: Analyzes tire wear patterns and performance impacts
The UI components are organized in the components directory, with each view implemented as a separate module.
Sources: scripts/app/app.py 70-80
scripts/app/components/degradation_view.py 12-87
Data Flow
The following diagram illustrates how data flows through the system from input sources to the user interface:
Visualization
Rule Evaluation
Analysis & Prediction
Data Transformation
Input Data
FastF1 API (Race Telemetry)
OpenF1 API (Team Radio)
Race Video
utils/processing.py (get_processed_race_data)
utils/processing.py (get_processed_gap_data)
utils/processing.py (get_processed_recommendations)
Lap Time Prediction (XGBoost)
Tire Degradation (TCN)
Gap Calculation (YOLOv8)
Radio Analysis (NLP Pipeline)
F1DegradationRules
F1GapRules
F1LapTimeRules
F1RadioRules
F1CompleteStrategyEngine
utils/visualization.py
components/recommendations_view.py
components/gap_analysis_view.py
components/degradation_view.py
components/time_predictions_view.py
components/radio_analysis_view.py
Key steps in the data flow:
Processing: The processing.py module transforms raw data into standardized formats
Rule Evaluation: The expert system applies rules to generate recommendations Visualization: The UI components render the processed data and recommendations
Sources: scripts/app/utils/processing.py 401-427
scripts/app/utils/visualization.py 31-400
Dependencies and Requirements
The system has several key dependencies:
Python 3.10+: Base programming language
Machine Learning: torch, xgboost, transformers, ultralytics
UI Framework: streamlit, plotly Expert System: experta
For a complete list of dependencies, see the requirements.txt file.
Sources: requirements.txt 1-229
README.md 52-73
Getting Started
To run the F1 Strategy Manager:
Install the required dependencies Run the Streamlit application using streamlit run scripts/app/app.py
For detailed setup instructions, see Installation and Setup.
README.md 74-100
๐ This documentation is automatically generated using browser automation.
๐ Last updated: $(date '+%Y-%m-%d %H:%M:%S UTC')
๐ Auto-organized from 1 content files