All projects
Education / MLactive

Smart Flashcard App

Spaced repetition system that goes beyond SM-2 learning a personalised forgetting curve per card per user, predicting retention with a trainable model, and scheduling reviews to maximise long-term memory per unit time.

PythonFlaskJavaScriptHTML/CSS

Skills involved

PythonBackend APIsMachine Learning

What This Is

A spaced repetition system that moves beyond the fixed SM-2 schedule toward a personalised forgetting curve per card per user. The goal: maximise long-term retention per unit of study time which is an optimisation problem, not a lookup table.

SM-2 was designed in 1987 for pen-and-paper use. Modern research (Duolingo's HLR model, Anki-on-steroids variants, and work from cognitive science labs) shows that individual forgetting rates vary enormously between people and topics. A system that learns your curve beats one that applies a universal schedule.

The Core Model

We model memory strength as an exponential decay: R(t) = e^(-t/S) where S is the stability (how long it takes to drop to 1/e retention). After each review, we update S based on how well you performed and how much time had elapsed. This is the same family of models used in Anki's FSRS algorithm the current state of the art in SRS.

The scheduler then picks the next review date to hit a target retention threshold (configurable, default 90%) rather than the fixed SM-2 intervals.

What Makes It Hard

  • Cold start problem: new cards have no history. We initialise with item-level priors based on difficulty tags.
  • Irregular review patterns: real users skip days. The model has to degrade gracefully when the schedule isn't followed.
  • Multi-mode consistency: the same card reviewed in "cram" mode vs. "standard" mode should update the same underlying stability estimate.
  • Calibration: predicted recall probability should match actual accuracy. We track calibration curves to validate the model.

Current Stack

  • Python + Flask backend
  • JavaScript frontend with 5 study modes
  • Per-card forgetting curve stored in a lightweight SQLite schema
  • JSON/ASFC import-export for deck portability

What We're Optimising

  • Replacing the hand-tuned stability update formula with a neural network trained on review history
  • Calibration: bringing predicted vs. actual recall closer to perfect agreement
  • Optimal threshold: finding the retention target that maximises knowledge per hour

What's Next

  • Train a small LSTM on review sequences to learn the stability update function from data
  • Add item difficulty estimation that separates "hard to remember" from "not reviewed enough"
  • Cross-device sync with a proper backend

Last updated Oct 14, 2024

← Back to all projects