arthur.shhome

Predicting roulette
from video.

How much of a roulette spin can you predict from a few seconds of video?

I built a computer vision system to follow the ball and wheel, assembled a dataset of 2,765 spins, and trained three neural networks to forecast their motion. The models learned enough to substantially outperform the simple baselines.

Read the dissertation
How I built it

What the camera sees

Choose a frame to inspect its labels.
Here the ball and green zero are both visible. Their labelled centres let us follow the ball’s position and the wheel’s rotation independently.
Here the ball and green zero are both visible. Their labelled centres let us follow the ball’s position and the wheel’s rotation independently.

Making the
motion measurable.

An angled camera turns a circular track into an ellipse. A hand can hide the ball, and a missed detection can look like a sudden jump. I built a processing pipeline to correct the view, repair short gaps, and extract motion the models could learn from.

  1. 01 Video
  2. 02 Detect
  3. 03 Correct
  4. 04 Measure

A frame from the source footage.

01 Video

Starting with the camera’s view

I started with 42 videos: over 5.46 million frames across different wheels, lighting conditions, and camera angles.

02 Detect

Locating the ball and wheel

I trained a YOLOv11 segmentation model to find the ball, green zero, and dealer’s hand. It located the ball’s centre with a mean error of 1.36 pixels.

03 Correct

Removing the camera angle

I fitted an ellipse to the track, then transformed the angled camera view into a top-down circle. That gave every spin a shared coordinate system.

04 Measure

Turning positions into motion

From those tracks, I calculated position and speed, then identified when the ball left the rim. Those measurements became the models’ training data.

PULL DISTANCE0.0px
LAUNCH SPEED260px/s
SPIN STATUSREADY · READY
0321519421225173462713361130823105241633120143192218297281235326SLOPED INWARD ↘OCCLUSION ZONEPULL & RELEASE
CHANGE IN DISTANCE FROM THE CENTREWAITING FOR THE DROP
+.0060−.0060s8s16s
0.0 s

Teaching a model
to follow the spin.

With the tracks in place, I could test the original question. I gave the models only the first 2–10 seconds of each spin and asked them to predict the motion that followed, up to the moment the ball left the rim.

  1. 01 Split
  2. 02 Design
  3. 03 Train
  4. 04 Test

2,765 SPINS, DIVIDED BY PURPOSE

TRAIN
75%
VALIDATE
12.5%
TEST
12.5%

11 motion features per frame

WHEN THE BALL DROPSLSTM 128 → 96 units

Motion in → time out

t*
WHERE THE BALL MOVESLSTM 128 / 128 units

Motion in → future positions out

sin θ̂, cos θ̂
HOW THE WHEEL TURNSLSTM 128 / 128 units

Motion in → future positions out

sin θ̂, cos θ̂
RESTORE BESTepoch 0early stop
training lossvalidation loss

An illustration of early stopping: keep the model that performs best on validation data, rather than simply training for longer.

OPTIMISER
Adam
BATCH
64
TRAJECTORY LR
5e−4
WEIGHT DECAY
1e−5
EARLY STOPPING
10 epochs

01 Split

Keeping the final test separate

I used 75% of the spins for training, 12.5% to tune the models, and reserved the final 12.5% for testing.

02 Design

A separate model for each question

One LSTM predicts a single drop time. Two encoder–decoder networks predict sequences of future angles, one for the ball and one for the wheel.

03 Train

Training without overfitting the examples

I trained with Adam and a loss suited to circular motion, reducing the learning rate as progress slowed and stopping after ten epochs without improvement.

04 Test

Checking what the models depended on

I removed features, added noise, and reduced the training set to test how robust the models were. I also varied the observation window from two to ten seconds to measure how much early footage helped.

The models learned
from the motion.

After six seconds of video, the ball model’s mean trajectory error was 0.185 radians—about 10.6°. That is 88% lower than simply keeping the last observed angle. Giving the models more of the spin improved all three predictions.

INPUTTIME MAEBALL radWHEEL rad
TIME ERROR (s)ANGLE ERROR (rad)1.180.8450.1082s0.900.3490.0394s0.740.1850.0346s0.600.1240.0338s0.520.1170.02510s■ DROP-OFF TIME□ BALL TRAJECTORY▫ WHEEL TRAJECTORY10s INPUT10.0sobserved0.52stiming MAE0.117ball error (rad)0.025wheel error (rad)

How much did the model improve?

RANDOM1.572
LAST-ANGLE1.565
LSTM0.185

The comparison is made after six seconds of observed motion. “Last-angle” keeps the last position; “Random” guesses an angle. The bars show mean error in radians, so shorter is better.

Where the forecasts break down

The difficult cases involve abrupt slowing or a ball hidden from view. A forecast can follow the earlier motion well and still miss what happens after that interruption.
OCCLUSIONstable motionabrupt decelerationerror tail

The full experiment.

The project showed that video contains enough information to learn useful forecasts of roulette motion. Predicting the final pocket is a further problem: these experiments stop at drop-off. The dissertation covers the dataset, model choices, comparisons, and the cases that were hardest to predict.

Read the methods and results