You Only Watch Once: A Unified CNN Architecture for Real-Time Spatiotemporal Action Localization
- Publication
- Publication venue not yet verified
- First submitted to arXiv
- arXiv:1911.06644
Cite this paper · BibTeX
The citation identifies the linked source version. It cites the original paper and its authors.
@misc{actionrecognitionyowo2019,
title = {{You Only Watch Once: A Unified CNN Architecture for Real-Time Spatiotemporal Action Localization}},
author = {Okan Köpüklü and Xiangyu Wei and Gerhard Rigoll},
year = {2019},
eprint = {1911.06644},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1911.06644}
}
Object detection went through a period when two-stage methods ruled. Faster R-CNN first proposes candidate boxes, then classifies and refines each one. Later, YOLO and SSD showed that a single forward pass could output boxes and classes together, several times faster.
In 2019, spatio-temporal action detection was still in its two-stage era. Most methods first found the people in every frame, or used a 3D CNN to generate candidate tubes across frames, and then classified the action of each candidate. Many also had to compute optical flow, and optical flow alone made real-time operation impossible.
Okan Köpüklü, Xiangyu Wei and Gerhard Rigoll at the Technical University of Munich wanted to bring the YOLO approach to video. The name follows suit, too. YOLO is You Only Look Once; theirs is You Only Watch Once.
Defining the problem

This figure shows that action detection needs two kinds of information. Looking only at the current frame, a detector can find the person but can't tell whether they are about to sit down or are standing up; that takes the previous few frames. Conversely, to box the person accurately, the spatial detail of the current frame matters most.
The authors see three problems with two-stage methods.
First, candidate tubes across frames are much more complex and much slower than candidate boxes on a single image, and classification is entirely limited by the quality of the candidates. Second, the candidates box only the person and ignore context in the background that could be very useful. Third, the proposal network and the classification network are trained separately, so each can only reach its own local optimum, and training costs more too.
Solving the problem

Two branches
YOWO is a single-stage network that outputs boxes and actions directly from the input clip and can be trained end to end.
The upper one is the 3D CNN branch. By default it is a 3D-ResNeXt-101 pretrained on Kinetics; it looks at the whole clip and handles the temporal information of the action. Its output has the time dimension squeezed to 1 and a spatial size of 1/32 of the input image.
The lower one is the 2D CNN branch, YOLOv2's Darknet-19, which looks only at the key frame. The key frame is the last frame of the clip, so YOWO uses only the current and past frames. It is causal and can run behind a live stream.
The two branches' outputs are the same size, so they can be concatenated directly along the channels. The authors also stress that either branch can be swapped for any CNN, depending on the speed required.
CFAM

Concatenating the features directly just jams the two kinds of information together. The authors designed a channel fusion and attention module, called CFAM.
After concatenation, two convolution layers produce . Each channel of is flattened into a vector, and the vectors are arranged into a matrix . Multiplying it by its own transpose gives the Gram matrix, which records how correlated every pair of channels is. A softmax turns it into the attention matrix , which is then used to recombine the channels:
is a learnable weight that starts at 0. Each channel's output becomes a combination of all channels weighted by how correlated they are, plus the original channel itself. Two more convolution layers follow.
The authors make a point of saying that these four convolution layers, two before and two after, matter. The 2D and 3D features come from different networks and their distributions differ a lot; without these convolutions to mix them first, attention brings only a small improvement.
Detection head and training
The last convolution layer outputs results the way YOLOv2 does. Each grid cell has 5 anchor boxes computed from the dataset with k-means, and each anchor box predicts 4 coordinates, 1 confidence score and a score for every action class.
The input is 224×224. Localization uses smooth L1, confidence uses mean squared error and classification uses focal loss. AVA is a special case. Each person has one pose action (stand, sit, walk) and several interaction actions at the same time, so pose actions use softmax and interaction actions use sigmoid. And because the classes are extremely imbalanced, focal loss is further multiplied by weights set from the sample counts.
Training uses a single Titan Xp. J-HMDB is very small, so the authors freeze the whole 3D branch to avoid overfitting.
Linking into action tubes
Video-level evaluation requires linking the detections of every frame into a tube. The authors reuse an earlier linking algorithm. For two boxes in adjacent frames, as long as they overlap, a linking score is computed from their action scores and their overlap, and the Viterbi algorithm then finds the highest-scoring path. The authors add one more term, the product of the two frames' scores, so that links where the score suddenly drops are less likely to be chosen.
Long-term features
A 16-frame clip is too short for many actions. The authors also borrow the approach of the long-term feature bank (LFB). At inference, the trained 3D CNN extracts features every 8 frames over the whole video, and the features of 8 segments, 64 frames in total, around the key frame are averaged and used in place of the original 3D features that see only 16 frames.
This comes at a cost. The features "around" the key frame include future frames, so YOWO with LFB is no longer causal and can't run on a live stream.
Discussion
Both branches are needed
| Architecture (8-frame input) | UCF101-24 | J-HMDB-21 | AVA |
|---|---|---|---|
| 2D only | 61.6 | 36.0 | 13.2 |
| 3D only | 70.5 | 41.5 | 13.7 |
| 2D + 3D concat | 73.8 | 47.1 | 16.0 |
| 2D + 3D + CFAM | 79.2 | 64.9 | 16.4 |
The authors look at localization and classification separately. On J-HMDB, localization recall is 94.3% with the 2D branch alone and 76.3% with the 3D branch alone; classification accuracy goes the other way, 50.6% for 2D and 69.3% for 3D. 2D finds the person and 3D recognizes the action, a clear division of labor. On UCF101-24 the gaps are smaller, localization recall 91.7% vs 90.8% and classification accuracy 85.9% vs 92.9%, but in the same direction. CFAM has its biggest effect on J-HMDB, adding nearly 18 points.
Lengthening the clip to 16 frames improves results on all three datasets; but sampling every other frame, so that 8 frames cover a longer span, actually makes things worse. Fast actions fall apart once the gap widens.
The 3D branch can also be swapped for a lightweight network:
| 3D backbone | GFLOPs | UCF101-24 | J-HMDB-21 |
|---|---|---|---|
| 3D-ResNeXt-101 | 38.6 | 80.4 | 74.4 |
| 3D-ResNet-18 | 33.3 | 72.6 | 57.5 |
| 3D-ShuffleNetV2 2.0x | 1.8 | 71.4 | 55.3 |
| 3D-MobileNetV2 1.0x | 2.2 | 66.6 | 52.5 |
The lightest, 3D-ShuffleNetV2, needs only 1.8 GFLOPs. Its accuracy drops quite a bit, but it is still better than the 61.6 of the 2D branch alone. The stronger the 3D backbone, the better the results, and that is also where the next two generations kept tuning.
Against other methods
| Dataset | Metric | Prior best | YOWO (16 frames) | YOWO + LFB |
|---|---|---|---|---|
| J-HMDB-21 | frame-mAP | 71.1 | 74.4 | 75.7 |
| UCF101-24 | frame-mAP | 75.0 | 80.4 | 87.3 |
| UCF101-24 | [email protected] | 51.4 | 48.8 | 53.1 |
The abstract says YOWO raises frame-mAP on UCF101-24 by about 12%, and that number compares the 87.3 with LFB against the previous best of 75.0. The 16-frame version, the one that really is real-time and looks only at the past, improves by 5.4 points. That's already a lot; it just didn't make it into the abstract. On video-level mAP at the 0.5 threshold, the 16-frame version still loses to ACT.
On AVA, the 16-frame version scores 17.9, the 32-frame version 19.1 and the version with LFB 20.2, still a long way behind the 29.0 of methods such as SlowFast. The authors' argument is that every method better than YOWO is multi-stage and looks at future frames; YOWO is the first single-stage architecture to post a respectable result on AVA.
Speed
On a Titan Xp, the 8-frame version runs at 62 frames per second and the 16-frame version at 34. These numbers were measured with a batch size of 8, that is, the throughput of processing 8 clips at once; when processing a stream frame by frame the batch size is 1, and the two are not quite the same thing.
The authors also list two common failures. One is reporting an action before it happens, for example a player standing under the hoop holding the ball is judged to be shooting before releasing it; the other is the first few frames of an action, when there isn't enough temporal information yet and running is misjudged as climbing stairs.
Reproduction
The official code and weights are both public. Someone re-evaluated the official weights and reproduced frame-mAP almost exactly, 80.37 on UCF101-24 and 74.51 on J-HMDB; video-mAP, however, came out three to four points lower, with only 82.57 on J-HMDB at the 0.5 threshold against 85.7 in the paper. That issue never got a reply.
The LFB code, meanwhile, has never been released, and two issues were already asking about it in 2020. The 12% improvement in the abstract rests on exactly this unreleased, non-real-time version.
Conclusion
YOWO's architecture is simple. A 2D CNN looks at the present, a 3D CNN looks at the past, an attention module fuses them, and the boxes and actions come out in one go, the YOLO way. It showed that spatio-temporal action detection doesn't have to be two-stage, and doesn't have to use optical flow either.
This skeleton of "2D looks at the key frame, 3D looks at the clip" was carried all the way forward by [23.02] YOWOv2: Striking at Every Scale and [24.08] YOWOv3: Taking the Baton, and the CFAM module stayed on in both of them as well.