LeanScene Refuses to Learn What Shot Detection Already Knows
A half-million-parameter video model feeds its network the field's oldest signal, then holds its own against an incumbent fifteen times larger.

A 0.5M-parameter network that finds shot transitions (cuts, dissolves, fades) in video.
- LeanScene hands its temporal head a hand-computed color-histogram delta instead of asking the network to learn frame differencing from scratch.
- The model carries about 0.49M parameters and 20.9M MACs per frame against TransNet V2's 7.62M and 832M, and ships as a 1.6 MB checkpoint inside the pip package.
- The README undercuts its own headline, disclosing that test sets were examined during development and that the lead holds clearly only on BBC under the stated protocol.
- Streaming inference labels arbitrarily long videos in constant memory by keeping exactly 64 feature rows as left context for the next window.
A Half-Million Parameters Against Seven Million
LeanScene labels every frame of a video as same shot, cut, or fade, then stitches those labels into a shot list. It does this with about 0.49 million parameters and 20.9 million multiply-accumulate operations per frame.
TransNet V2, the reference model in the field, carries 7.62 million parameters and 832 million MACs per frame. That is roughly fifteen times the parameters and forty times the compute. The LeanScene checkpoint that ships inside the pip package weighs 1.6 MB, and frames are resized to 100 by 100 pixels before anything else happens.
- Parameters: 0.49M (TransNet V2: 7.62M)
- MACs per frame: 20.9M (TransNet V2: 832M)
- Bundled checkpoint: 1.6 MB
- Temporal receptive field: 63 frames
The whole pipeline is small by construction. The interesting question is not whether a tiny model can run cheaply. It is how one this small stays competitive at all.
Don't Make the Network Learn Differencing
The frame encoder turns each 100 by 100 image into a feature vector stitched from four sources: a global CNN feature, a 64-bin joint color histogram, an 8 by 8 color thumbnail, and a 2 by 2 grid of CNN features. Each descriptor is cheap to compute and each one gives the downstream network a different way to see a frame.
Then the temporal head does something unusual. It computes the absolute difference between consecutive frames' color histograms by hand, sums the 64 bins into a single scalar, and feeds that scalar to the network as an explicit input. It also computes differences of the spatial descriptors and projects them through a 1 by 1 convolution before concatenating everything together.
This is the classic histogram-difference signal that shot detection used decades before anyone trained a network on it. LeanScene does not ask the model to rediscover it. It hands the change signal over and lets the network spend its tiny budget on the parts that actually need learning.
From there the head runs five residual dilated 1D convolutions, with dilations 1, 2, 4, 8, and 16. The receptive field works out to 63 frames, and that number matters later when the model has to stream.
One Author, One Paper Still in Preparation
LeanScene is a solo project by Lucas Jackson, who publishes as lucasjacks0n. The repository ships MIT-licensed code, a PyPI package, an npm package with an ONNX port, a browser demo, a training pipeline, and an evaluation script. That is a research-engineering release with real surface area, built by one person.
The paper is not out yet, and the clips used to generate the synthetic training transitions are withheld. Both facts shape how the benchmark claims should be read: there is no external write-up to check the method against, only the code and the numbers the project reports.
The Fine Print That Undercuts the Headline
The decision rule was frozen before scoring. The module header states that the rule used for every number in the paper was fixed before the test sets were scored, with CUT_THRESHOLD = 0.7, FADE_THRESHOLD = 0.8, and FADE_CLOSE = 8. Pre-registering a threshold is a real discipline, and most releases at this stage do not bother.
Then the README does something rarer. It discloses the limits of its own result.
The test sets were looked at during development. No benchmark here was unseen.
The disclosure goes further. The project reports that the statistical comparison supports a clear difference only on BBC under the stated protocol, that the BBC lead shrinks when TransNet V2's threshold is tuned on the test set, and that the model scores differently without its hand-labeled training data. A project that walks back its own headline is worth more attention, not less.
How It Stacks Up
| LeanScene | TransNet V2 | PySceneDetect | AutoShot | |
|---|---|---|---|---|
| Parameters | 0.49M | 7.62M | No learned weights | Architecture-searched |
| MACs per frame | 20.9M | 832M | Not applicable | Not comparable |
| Approach | Hand-engineered descriptors plus small temporal CNN | Learned 3D CNN | Classical content and adaptive detection | 3D ConvNet and Transformer search |
| Transitions detected | Cuts, dissolves, fades | Cuts and gradual transitions | Cuts and fades | Cuts and gradual transitions |
| License | MIT | MIT | BSD 3-Clause | MIT |
| Community signal | Early, single contributor | Established and widely cited | Mature and long-running | Research release |
Benchmark numbers are project-reported and not independently replicated. LeanScene's own README notes test-set exposure during development, and its comparison reports parity intervals on ClipShots and RAI rather than a decisive lead. Against PySceneDetect the trade is different: PySceneDetect offers a long-established detector library with several strategies, while LeanScene offers a packaged learned model with frame-level transition probabilities.
Watching an Infinite Video in Constant Memory
A feature-length video will not fit in memory, but the temporal head wants 63 frames of context on both sides of every frame it labels. LeanScene resolves this by encoding frames into a feature buffer, running the head over windows, and labeling only the frames that have full context on both sides. After each window, the buffer is trimmed so the last 64 rows survive as left context for the next one.
The docstring claims the result equals a single pass up to float rounding. That holds because the convolutions use zero padding and the context window exceeds the receptive field, so interior frames see the same neighbors either way. The first window has no left context, which matches the zero padding at the true start of the video.
What It Feels Like to Run
The CLI writes a table, JSON, or CSV, and draws a single progress line to stderr only when stderr is a terminal, so piped output stays clean. The progress line reports frame counts, frames per second, and time remaining, and it copes with containers whose frame count is sometimes absent. Multiple videos can be processed in a batch, and a failure on one does not stop the rest.
The browser demo runs entirely locally through ONNX Runtime Web and uploads nothing. Device selection deliberately skips Apple's MPS backend, because a process feeding it many different input lengths kept growing in memory. The streaming design's fixed window sizes are probably part of why that lesson mattered.
The label rule is short, but its ordering carries real precedence. Fades are written first, cuts overwrite them where both thresholds fire, and then gaps of up to eight frames between fades are bridged:
labels[probs[:, 2] >= fade] = 2 # fade first
labels[probs[:, 1] >= cut] = 1 # cut overwrites fade where both fire
fades = np.flatnonzero(labels == 2)
for a, b in zip(fades[:-1], fades[1:]):
if 1 < b - a <= close + 1:
labels[a:b] = 2 # bridge gaps of up to 8 frames
One subtlety worth reading twice: the gap-bridging fill overwrites the entire span, including any frames inside it that were labelled cut. A cut that lands inside a fade-bridging window gets absorbed. That is a plausible source of edge-case disagreement with another model's protocol, and it is exactly the kind of detail the frozen decision rule makes visible.





