overview - VforVitorio/F1_Strat_Manager GitHub Wiki

Overview

VforVitorio/F1_Strat_Manager

powered by

Devin

Overview

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:

  1. Analyze real-time race data from multiple sources
  2. Predict lap times and tire degradation using machine learning models
  3. Interpret team radio communications
  4. Calculate optimal race strategies based on complex variables
  5. Provide actionable recommendations via an interactive dashboard

It targets technical race strategists who need data-driven decision support for critical race situations.

System Architecture

The F1 Strategy Manager is structured as a multi-layered system with specialized components for data acquisition, processing, analysis, and visualization:

Key Components

Data Sources and Processing

The system ingests and processes data from three primary sources:

  1. Race Telemetry (FastF1): Lap times, sector data, tire information
  2. Team Radio (OpenF1): Audio transcripts from driver-team communications
  3. 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

Machine Learning Models

The system employs several machine learning models for predictive analytics:

  1. XGBoost Model: Predicts lap times with MAE of 0.09s
  2. TCN (Temporal Convolutional Network): Models tire degradation over time
  3. YOLOv8: Computer vision model for team identification and gap calculation
  4. 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.

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:

The F1CompleteStrategyEngine integrates multiple rule sets and resolves conflicts to generate coherent strategy recommendations. For more details on the expert system, see Expert System.

Streamlit Interface

The user interface is built with Streamlit and provides multiple specialized views:

  1. Strategy Recommendations View: Displays AI-powered recommendations
  2. Gap Analysis View: Visualizes gaps between cars and identifies strategic opportunities
  3. Radio Analysis View: Shows insights from team radio communications
  4. Time Predictions View: Displays lap time predictions
  5. 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.

Data Flow

The following diagram illustrates how data flows through the system from input sources to the user interface:

Key steps in the data flow:

  1. Data Acquisition: Raw data is collected from multiple sources
  2. Processing: The processing.py module transforms raw data into standardized formats
  3. Analysis: Machine learning models generate predictions and insights
  4. Rule Evaluation: The expert system applies rules to generate recommendations
  5. Visualization: The UI components render the processed data and recommendations

Dependencies and Requirements

The system has several key dependencies:

  • Python 3.10+: Base programming language
  • Data Analysis: pandas, numpy, matplotlib
  • Machine Learning: torch, xgboost, transformers, ultralytics
  • API Clients: fastf1, openf1
  • UI Framework: streamlit, plotly
  • Expert System: experta

For a complete list of dependencies, see the requirements.txt file.

Getting Started

To run the F1 Strategy Manager:

  1. Clone the repository
  2. Install the required dependencies
  3. Run the Streamlit application using streamlit run scripts/app/app.py

For detailed setup instructions, see Installation and Setup.

On this page