Link to streamlit website : https://telemetry-compression.streamlit.app/
Modern Formula 1 cars generate millions of data points per second. Streaming that telemetry live from the edge (the car) to the pit wall requires extreme compression. Traditional math algorithms like Discrete Wavelet Transforms (DWT) hit a hard ceiling when trying to maintain signal fidelity, and standard deep learning models are too massive and slow to run on edge hardware.
This project is an exploration into solving that exact bottleneck. It is a custom-built, edge-optimized Multi-Scale INT8 Quantized Autoencoder that compresses telemetry by ~7.8x while executing in under 1.5 milliseconds on a standard CPU.
Standard Autoencoders act like low-pass filters. They are great at compressing smooth cruising speeds, but when a driver rapidly downshifts or stomps on the brakes, the network blurs those sharp anomalies out.
The Fix: We implemented a parallel Multi-Scale Inception Architecture. By running two convolutional paths simultaneously—one with a wide kernel_size=15 for global context, and one with a tight kernel_size=5 for high-frequency spikes—the network learned to perfectly preserve sharp transients without blurring them.
When a driver goes from 0% to 100% throttle instantly, it creates a mathematical square wave. Because convolutional filters are smooth curves, trying to reconstruct a 90-degree cliff caused the neural network to "overshoot" (predicting 105% throttle) and "undershoot" (predicting -5% throttle).
The Fix: We built a custom Physics-Bounded Layer directly into the decoder. By applying scaled Sigmoid activations aligned with our Z-score normalisation stats, we mathematically locked the network so it physically cannot output outside of [0, 100] for Throttle and [0, 1] for Brake. This completely cured the ringing artifacts.
During evaluation, we noticed the model would sometimes completely ignore a microscopic "blip" on the brake pedal that lasted less than 0.1 seconds, but it would perfectly reconstruct a short, sharp brake tap a few seconds later. Why? Because of the intense 4-channel spatial bottleneck, the network acts as an intelligent Semantic Filter. It realized that the 0.1s blip happened during heavy braking and didn't actually change the physical speed or RPM of the car (due to inertia), so it threw the data away to save space. But the isolated tap did change the car's physics, so it memorized it. It literally learned which data points matter.
- Compression Ratio: ~7.8x (Achieved via a 4-channel latent bottleneck + Zlib entropy coding).
- Inference Latency: ~1.4 ms per 128-timestep window (Achieved via Quantization-Aware Training, running purely in INT8).
- Throughput: >700 windows compressed per second on CPU.
To prove the model generalizes and doesn't just overfit to a single track, this project includes a live Streamlit dashboard. It evaluates the model on the fly across different tracks (Silverstone, Monaco, Monza, Spa).
Run the dashboard:
streamlit run app.pyInside the dashboard, you can explore:
- Interactive Onion Graphs: Toggle between Original data, the DWT Baseline, and the CNN.
- Transient Preservation: Mathematical proof that the error on heavy-braking zones is virtually identical to steady-state cruising.
- Quantization Tradeoffs: A live benchmark proving that our QAT approach hits the tiny footprint of Naive PTQ, but completely recovers the pristine accuracy of an FP32 model.
If you prefer testing via terminal, you can run the isolated evaluation suites:
python evaluate_compression.py(Core PSNR & Compression Ratio vs DWT)python evaluate_transient_preservation.py(Proving the "Anti-Blur" capabilities)python evaluate_quantization_tradeoff.py(FP32 vs PTQ vs QAT benchmarks)python advanced_evaluation.py(Structural Similarity and Throughput testing)python src/train.py(Retrain the model on FastF1 API data)
