Inspiration
In the world of racing, the "Perfect Lap" is a myth. It’s a limit that drivers chase but never truly touch.
Engineers try to help drivers get faster using telemetry, but looking at telemetry data is painful. It is just hundreds of jagged lines on a screen. You have to be a data scientist to understand why you are slow.
We asked ourselves a simple question: "Why do I have to stare at squiggly lines? Why can't I just race against the math?"
In video games, you race against a "Ghost"—a transparent replay of your best self. We wanted to bring that magic to real life. But instead of replaying a human lap with human mistakes, we wanted to build an AI that hallucinates the physically perfect lap, creating a rival that shows you exactly what is possible.
What it does
Ghost Engineer is an AI-powered coach that creates the ultimate driving line.
- It Dreams: It takes the layout of a race track (like Road America) and uses Generative AI to "imagine" the fastest possible way to drive it.
- It Simulates: It creates a "Ghost Car" that drives this perfect lap.
- It Compares: It takes real human data and plays it side-by-side with the Ghost in a 60 FPS simulation.
- It Teaches: Instead of confusing graphs, it gives you simple advice like "Braking too early" or "Throttle hesitant," showing you exactly where you lost time.
How we built it
We realized that teaching an AI to drive a whole track at once is too hard. Every lap is different. So, we broke the problem down into tiny pieces.
1. Breaking the Track (Micro-Sectors)
We treated the race track like a set of LEGO blocks. We sliced the data into hundreds of small "MicroSectors." We categorized them into Turns, Straights, and Braking Zones. $$ S = { s_1, s_2, ..., s_n } $$
2. The Brain (LSTM-GAN)
We built a Generative Adversarial Network (GAN). This is two AIs fighting each other:
- The Generator ($G$): Tries to create a fake piece of driving data (Speed, Steering, Brake).
- The Discriminator ($D$): Acts as the "Physics Police." It tries to tell the difference between real pro-driver data and the fake data.
By fighting each other, the Generator learns to drive perfectly to fool the police. $$ \min_G \max_D V(D, G) $$
3. The "Liquid" Interface
We didn't want a boring chart. We built a physics engine in the web browser using React. It doesn't just play a video; it calculates the actual distance traveled by the cars ($d = v \times t$) in real-time. This makes the movement look smooth and "liquid," not robotic.
Challenges we ran into
This project was a battle between Math and Reality.
The "Bored AI" Problem
Our AI was great at corners, but it panicked on straight lines. Mathematically, driving straight is "too simple." The AI got bored and started hallucinating shakes and wobbles just to make things interesting.
- The Fix: We built a hybrid system. We let the AI use its "intuition" for corners, but we used pure physics equations for the straights. This kept the car stable.
Teleporting Cars
Because we cut the track into small pieces, the AI forgot about the past. The car would exit a turn at 90 km/h and magically appear at 200 km/h in the next section.
- The Fix: We implemented Physics Chaining. We forced the AI to look at the exit speed of the previous section before starting the next one. $$ v_{entry}^{(next)} = v_{exit}^{(previous)} $$
The "220" Glitch
At one point, our AI car got stuck at 220 km/h and wouldn't slow down.
- The Reason: Neural Networks work with small numbers (between -1 and 1). We were feeding it raw speeds like "220." The AI's brain got overwhelmed (saturated) and just outputted the maximum value possible.
- The Fix: We had to normalize all our data, shrinking the real world down to fit inside the AI's brain, and then scaling it back up for the user.
Accomplishments that we're proud of
- We tamed the GAN: Getting a Generative Adversarial Network to output smooth, drivable physics data is notoriously difficult. We made it look organic.
- Real-Time Sync: We successfully synchronized complex backend Python processing with a smooth 60 FPS frontend animation.
- The "Human" Feel: By applying special filters (Savitzky-Golay), we made the Ghost car feel like it has actual weight and mass, rather than moving like a laser beam.
What we learned
- Data is messy: We spent hours fixing a bug where our laps were 260 seconds long (instead of 140s) because the raw data format was confusing. Cleaning data is 80% of the work.
- Physics cannot be cheated: You can't just tell an AI to "go fast." You have to respect momentum, friction, and inertia.
- Simplicity wins: The best way to visualize speed isn't a graph; it's two dots racing on a map.
What's next for Ghost
- Audio Coaching: We want the Ghost to talk to you in real-time, shouting "Brake!" or "Push!" through your headset while you drive.
- Virtual Reality: Projecting the Ghost line onto a VR headset for Sim Racers.
- More Tracks: Scaling our MicroSector database to cover every major race track in the world.
Log in or sign up for Devpost to join the conversation.