Pocket-Keeper AI: Project Story

Inspiration

The inspiration for Pocket-Keeper AI came from the challenge of creating truly responsive mobile sports games. In traditional football games, goalkeepers often react to animations rather than physics, leading to a "delayed" feel. We wanted to build an ultra-low latency, edge-based goalkeeper AI for the Arm Create: AI Optimization Challenge that could "read" a player's intention and predict the ball's trajectory in real-time, just like a professional keeper.

What it does

Pocket-Keeper AI is a predictive engine optimized for Arm-based architectures. It analyzes a player's "flick" or swipe gesture within the first 15–30 ms, predicts which of the 9 goal zones the ball will reach—accounting for complex physics like gravity and the Magnus-effect curve—and triggers the goalkeeper's dive instantaneously.

  • Latency: ~0.19 ms inference time.
  • Accuracy: 96.89% zone prediction.
  • Size: 4.16 KB (INT8 Quantized TFLite model).

How we built it

The project was developed in three major stages:

  1. Physics Simulation (Web Prototype): We first built a 3D physics engine in JavaScript and Python to simulate 15,000 penalty shots. We modeled the forces acting on the ball:
    • Drag Force: $$F_{drag} = -0.5 \cdot \rho \cdot C_d \cdot A \cdot |v| \cdot v$$
    • Magnus Force (Curve): $$F_{magnus} = C_l \cdot \rho \cdot A \cdot r \cdot (\omega \times v)$$
  2. AI Training & Optimization: We used the synthetic dataset to train a Multi-Layer Perceptron (MLP). To meet the "Edge AI" requirements, we applied INT8 Quantization, shrinking the model to fit entirely within the L1/L2 cache of Arm processors.
  3. Mobile Integration: After perfecting the logic on the web, we migrated the project to a native Android APK using Capacitor, ensuring the AI performed consistently across different mobile chipsets.

Challenges we ran into

  • The "Reaction Budget": The biggest hurdle was the time constraint. Human reaction is slow, so the AI had to be incredibly fast. We had a total budget of <2ms for the entire pipeline.
  • Data Fidelity: Simulating the Magnus effect accurately enough so that the AI could distinguish between a straight power shot and a deceptive "curl" (Ters Köşe) required multiple iterations of our physics constants.
  • Web to Native transition: Synchronizing the high-frequency physics updates between the web view and the mobile hardware required careful optimization of the requestAnimationFrame loops and TFLite WASM delegates.

Accomplishments that we're proud of

  • Model Size: Achieving a 4.16 KB footprint while maintaining nearly 97% accuracy is something we are incredibly proud of. It proves that you don't need massive models for high-performance real-time tasks.
  • Zero-Lag Feel: Testing the APK on an actual Arm-based phone and seeing the goalkeeper dive before the finger even leaves the screen was a major "aha!" moment for the team.

What we learned

  • Edge AI Synergy: We learned that when you combine classical physics knowledge with machine learning, you can build much smaller and more efficient models than by using "black box" deep learning alone.
  • Quantization Matters: We gained deep insights into how INT8 quantization affects model weights and how to mitigate accuracy loss during the conversion process for Arm-based TFLite runtimes.

What's next for Pocket-Keeper AI: Predictive On-Device Goalkeeper Engine

  • Multi-Player Support: Expanding the engine to handle real-time 1v1 penalty shootouts over low-latency networks.
  • Biometric Input: Incorporating camera-based gesture recognition (using Arm NN) to predict shots from actual body movements instead of screen swipes.
  • Dynamic Difficulty: Implementing an on-device reinforcement learning loop where the goalkeeper learns the specific "tells" and habits of the player over time.

Built With

Share this project:

Updates

Submission history