back to blog
March 11, 2026·4 min read

Attention Drift Modelling System + AI Soccer Referee

ML/AI
Projects
Computer Vision

I promise I'm not just coming up with ideas-I'll also make them. I just have interviews, and I might watch the Champions League, but that's beside the point.

Currently, I'm interviewing and looking for post-grad opportunities, and I think I've always been able to come up with great CS project ideas that can solve real problems. I think it's because I have so many hobbies and I tend to self-reflect, so I can identify problems and then come up with solutions with my CS background.

So here are two projects I'm currently working on:

Attention Drift Modelling System

In my first episode of The Tradeoff (check the tab), I talk about how hard it is to stay focused because of short-form content, and I'm trying to resolve that through a dopamine detox (a detox where you cut social media, junk food, and anything that artificially makes you happy without earning it).

However, I want to try to build an AI system that can improve my focus.

I've been experimenting with ChatGPT to come up with a high-level plan for this system so I can visualize it before implementing it, and here's something it produced for what some of the key features might be.

Attention drift is operationally defined as one or more of the following observable events:

  • App switch away from the primary task window
  • Navigation to known distraction sites
  • Idle time exceeding a configurable threshold during an active session
  • Rapid tab or window switching above a defined frequency
  • The prediction task is: given the last N seconds of behavioral interaction data, predict whether a drift event will occur within the next 60 seconds. This is a binary supervised classification problem over a labeled temporal event stream.

    The most interesting part of this project will be determining if someone's attention is drifting. Looking at another website like LinkedIn for 5 minutes might not signal attention drift, but continuously hopping from one source to another might.

    Not only that, but if a user is on a productive site like, I don't know, LeetCode or even an IDE and isn't doing anything, they could be lost in rumination-or playing chess on Duolingo on their phone (me).

    So while training an ML model by generating synthetic data and gathering user experience sounds fun, it's important to define the actual problem first: the criteria we are basing it off. And it might be trial and error, because focus is an arbitrary concept. It's hard to define when someone is focused, and people have different opinions.

    Possible Tech Stack (Attention Drift)

  • Event Collection: Python, JSON
  • Streaming: Redpanda
  • Storage: PostgreSQL, Parquet
  • Feature Store: Feast
  • Modeling: PyTorch
  • Training / Experiment Tracking: MLflow, Weights & Biases, Hydra
  • Intervention Policy: Stable-Baselines3
  • Monitoring: Prometheus, Grafana
  • Causal Analysis: DoWhy, EconML
  • AI Soccer Referee

    I grew up watching soccer as a child. I would often watch games in the living room, in the humid Singapore climate, with my dad, eating pizza. It's a peak experience.

    However, these referees have zero brain cells-okay, that's too far. But I often think it's a hard job being a referee. Sometimes you aren't close to the action, you have to rely on video assistance and assistant referees, and when you make the wrong decision, everyone gets mad at you.

    I think it would be interesting to see if AI can detect when a player is fouled, when a player is actually faking an injury, or even when a player deserves a red card. Imagine an AI that can detect these without flaw. A utopia, but maybe worth pursuing.

    The methodology is simple, like with any ML project: gather data and train the model.

    For this process, we need video clips of fouls, slide tackles, shirts being pulled, and handballs-and then we need to tag them: this is a foul, this was ball-to-hand (not a handball).

    The most important part of this project is justification. This reminds me of the process I went through with my soccer scouting bot. Whenever an ML model generates a result-whether that be a similarity score or a verdict-we want to know the reason, the justification for how the model came to a decision.

    When the model says, "this is not a foul," and that's it, that's completely useless. If it said, "this is not a foul because the player got the ball and the opponent fell because of the follow-through; the intention was clean," that is better. That helps the referee and anyone using the system.

    Labelling fouls, finding clips, and getting unbiased opinions will be the crux of this problem, but it could help the soccer community massively.

    Possible Tech Stack (AI Soccer Referee)

  • Event Collection: Python, OpenCV, FFmpeg, JSON
  • Video Processing & Vision: PyTorch, TorchVision, OpenCV, Detectron2, MediaPipe
  • Multimodal Modeling: PyTorch, Transformer Encoder, CLIP, Monte Carlo Dropout
  • Data Storage: PostgreSQL, Parquet, S3, Redis
  • Feature Store: Feast, PostgreSQL
  • Model Training & Experiment Tracking: MLflow, Weights & Biases, Hydra
  • Model Serving: FastAPI, Docker, gRPC, REST
  • Streaming / Event Pipeline: Redpanda (Kafka-compatible), JSON
  • Monitoring & Observability: Prometheus, Grafana
  • Causal / Evaluation Layer: scikit-learn, DoWhy, EconML
  • Final Thoughts

    Overall, these projects are ML projects that attempt to break into production-grade software. Not only will they solve problems that help people, but they will also be challenging endeavors to build from the ground up.

    The Stoic Stack logoA blog post written by Shreyas Shukla

    The Stoic Stack, in your inbox.

    Get notified when I drop a new post. Software, AI, sports, philosophy, and life — unsubscribe anytime.

    More Blogs Like This

    Have something in mind?

    Let’s connect.

    Whether it’s a role, a collaboration, or just a conversation — I’d love to hear from you.