Dillion Amartey

Notes

How you compress a walk decides what a network can learn

· 4 min read

A gait cycle is dozens of silhouette frames: one person, one stride, seen by one camera. Most gait recognition models don't take all of those frames as input. They take one image that summarises them. Our undergraduate research at the University of Ghana asked a simple question about that step:

If you change how the walk is compressed into an image, and keep everything else the same, how much does recognition change?

Why the summary image matters

Every compression keeps some information and throws the rest away. The best-known representation, the Gait Energy Image (GEI), averages every silhouette in the cycle. The torso and head stay bright because they barely move; arms and legs become soft grey traces. It's cheap, stable and easy to train on, but averaging is lossy. The order of the frames disappears, and so does a lot of the motion.

Turn the stride below to see it. Each layer is one frame; compressing the walk collapses time into a single image.

GEI Gait Energy Image88.41% DenseNet, CASIA-B

mean(frames)

Every frame averaged. The torso stays bright because it barely moves; legs and arms fade to grey.

Fig. 1 One stride, 28 frames stacked along time. Looking straight down the time axis adds the layers together, which is exactly what averaging does: that view is the GEI. The walker is drawn in code for illustration, not taken from CASIA-B; the formulas are the ones from the project notebooks.

Before training anything we mapped the field. A broad search returned 6,952 records across ScienceDirect, IEEE Xplore and Springer Link. Filters for date, language and full-text access cut that to 707, abstract review to 279, and full-text review to a core set of 72 papers. The pattern in that set was consistent: GEI was everywhere, and was repeatedly blamed for losing information. Entropy-based images captured variation; flow-based images captured motion but cost more to compute.

That tension became the hypothesis: a representation that keeps both stable appearance and change over time should beat one that keeps only one of them.

The experiment

We used the normal-walking sequences of CASIA-B: 124 people, each filmed from 11 camera angles. Every gait cycle was encoded five ways:

  • GEI, the Gait Energy Image: the average silhouette.
  • GEnI, the Gait Entropy Image: how uncertain each pixel is across the cycle, which highlights the parts that move.
  • GFI, the Gait Flow Image: motion direction from optical flow.
  • MSI, the Motion Silhouette Image: change between consecutive frames.
  • DEWGI, the representation we proposed: a gait energy image weighted by entropy, so stable shape and dynamic movement live in the same image.

To check that a result came from the representation and not from one lucky architecture, each dataset was trained with two CNN families: DenseNet, which connects each layer to every later one and reuses features, and ResNet, which learns corrections on top of shortcut connections.

What happened

Representation DenseNet ResNet
GEI 88.41% 81.42%
GEnI 86.39% 80.26%
GFI 82.96% 81.91%
MSI 83.87% 80.32%
DEWGI 92.34% 88.17%

Two things stood out. DEWGI ranked first under both architectures, which supports the hypothesis: combining appearance with change carried more identity than either alone. And DenseNet beat ResNet on every representation, with lower loss too, so feature reuse seems to suit these compact, texture-like inputs.

Pushing further: Enhanced GaitSTAR

The second part of the project took GaitSTAR, a published method that fuses spatial appearance with temporal motion using attention, and reworked it rather than using it as a black box. Each frame was cleaned with CLAHE contrast and an edge-preserving filter; a small CNN extracted appearance while Farneback optical flow captured motion; temporal weights pooled both into one feature image. That fed a deeper residual network with channel attention and an auxiliary training head.

The best recorded test accuracy was 98.71% on a 124-way classification, up from 94.91% for an earlier iteration of our classifier. That number needs the caveats below before it means anything.

Reading that number honestly

Some care is needed with that figure, and I'd rather say so here than have someone find it later:

  • It's a saved notebook result, not a peer-reviewed claim.
  • Architecture, optimisation, augmentation and training length all changed between 94.91% and 98.71%, so the gain can't be credited to any single change. It's a development milestone, not an ablation.
  • The split was a random 80/20 split of images, not of people, so every test walker also appeared in training, and the same held-out images guided early stopping. Published CASIA-B results test on people the model has never seen, so 98.71% can't be ranked against them. The comparison between the five representations is still fair: they all shared the same split and classifiers.
  • Everything was measured on CASIA-B normal walking only. Bags, coats and other conditions are harder, and we didn't test them.

What I took from it

The model is not the only lever. Before a network sees anything, someone decides what to keep and what to throw away, and that decision moved accuracy by more than nine points here. I now look for the same thing outside research: in software, the shape of the data going in often matters more than the cleverness of the code processing it.

You can explore all five representations, the eleven camera angles and the literature funnel in the interactive case study, and the code is on GitHub.