Back to all work

National Taiwan University, CSIE

TACnet: Weakly Supervised Video Anomaly Detection

Each training video carried one label, normal or anomalous, with no frame timings. TACnet learned which of its segments held the anomaly, and it became my NTU thesis and a first-author CVGIP 2021 oral paper.

M.S. researcher and first author2021CVGIP 2021 oral84.75% frame-level AUC on UCF-Crime

Task

The input is a surveillance video and one label for the whole video, normal or anomalous. The output is an anomaly score for each of 32 segments. No timing information is available during training.

UCF-Crime test videos
  • CAM 011405Robbery0480.99anomaly scorenormal

    Training labelanomalous video

  • CAM 020645RoadAccidents1220.95anomaly scorenormal

    Training labelanomalous video

  • CAM 031745Normal_Videos_1680.00anomaly scorenormal

    Training labelnormal video

  • What training saw: one label per video
  • What TACnet outputs: a score for each of 32 segments
  • Human-labelled interval, used only to score the result

Figure 1. Three UCF-Crime test videos. Segment scores are read from the qualitative figures in the paper. Each monitor plays a clip of its video and skips the quiet stretches before and after. At the end it shows how many of the segments played agree with the human label at a threshold of 0.5. Footage is not shown.

In Robbery048 the score rises one segment after the labelled start. The label begins when the clerk reacts, and the model responds once the robbery is visible. In RoadAccidents122 it rises before the labelled collision, at the illegal left turn that leads to it.

Benchmark

Frame-level AUC on UCF-Crime was 84.75%, the highest among the weakly supervised methods the paper compared. The closest one, Tian et al., used I3D features, and TACnet used the older C3D.

  1. 2021TACnetC3D84.75
  2. 2018Sultani et al.[1]C3D75.41
  3. 2019GCN-Anomaly[3]TSN82.12
  4. 2019IBL[2]C3D78.66
  5. 2020CLAWS[5]C3Da83.03
  6. 2020Wu et al.[4]I3D82.44
  7. 2021Tian et al.[7]I3Db84.03
  8. 2021MIST[6]I3D82.30
  9. 2023UR-DMU[8]I3D86.97
  10. 2024VadCLIP[9]CLIP88.02
  11. 2024LAVAD[10]no training, LLM over captions80.28

Table 1. Frame-level AUC on UCF-Crime in percent. Bars start at 70. TACnet is listed first and the rest are in order of year. Solid bars are the methods compared in the 2021 paper. Dashed bars came later, as each paper reports them. a The 2021 paper listed CLAWS under I3D. Its authors report this score with C3D features. b The score of the January 2021 preprint, which the paper compared against. The ICCV version reports 84.30.

UCF-Crime is still the standard benchmark for this task in 2026. Most of the gain since came from stronger pretrained features. A newer line of work drops training and asks a language model to score captions of the frames.

Model

The video label is the only supervision, so the model is built around a video-level classifier whose decision can be traced back to segments. Two paths predict the label, one through attention and one through clustering. The segment scores come out of the second.

Explosion013

1Video32 segments × 16 frames

2C3D→temporal conv32 × 4096 → 32 × 256

hi , one feature vector per segment, drawn as a column

Path 1 attention

3Gated attention32 × 1

ai , one weight per segment

Hbag = Σ aihi→MLP

Sattn

Path 2 clustering

4K-means, two clusters

on [hi ; ai] , cosine distance

5Segment scores32 × 1

mean of the higher cluster

Scluster

6Bag score and loss

Sbag = (Sattn + Scluster) / 2compared withYbag = 1

  • bag prediction
  • inner bag cluster
  • entropy smoothness
  • sparsity
  • inner bag ranking

Figure 2. The architecture, after Figure 1 of the paper. Attention weights and segment scores are those of Explosion013. Cluster membership is drawn from the scores, and positions inside a cluster are schematic.

Ablation

Removing the cluster module costs the most, 1.97 points. Removing temporal attention costs 1.46. Replacing the entropy loss with the earlier smoothness loss costs 0.07 in AUC, and its effect shows in the shape of the scores more than in the number.

C3DTCNAttentionClusterEntropyAUC
Added one at a time
✓––––79.07
✓✓–––80.61
✓✓✓––82.36
Removed one at a time
✓–✓✓✓83.51
✓✓–✓✓83.29
✓✓✓–✓82.78
✓✓✓✓–84.68
Full model
✓✓✓✓✓84.75

Table 2. Ablation on UCF-Crime. TCN is the temporal convolution. Cluster includes the inner bag cluster loss.

ShanghaiTech

AUC on ShanghaiTech was 93.89%, third among the compared methods. Its anomalous videos average 381 frames, which fills about 24 of the 32 segments. The rest were padded with blank segments, and that costs accuracy.

References

  1. W. Sultani, C. Chen, and M. Shah. Real-world Anomaly Detection in Surveillance Videos. CVPR 2018.
  2. J. Zhang, L. Qing, and J. Miao. Temporal Convolutional Network with Complementary Inner Bag Loss for Weakly Supervised Anomaly Detection. ICIP 2019.
  3. J.-X. Zhong, N. Li, W. Kong, S. Liu, T. H. Li, and G. Li. Graph Convolutional Label Noise Cleaner: Train a Plug-and-play Action Classifier for Anomaly Detection. CVPR 2019.
  4. P. Wu, J. Liu, Y. Shi, Y. Sun, F. Shao, Z. Wu, and Z. Yang. Not only Look, but also Listen: Learning Multimodal Violence Detection under Weak Supervision. ECCV 2020.
  5. M. Z. Zaheer, A. Mahmood, M. Astrid, and S.-I. Lee. CLAWS: Clustering Assisted Weakly Supervised Learning with Normalcy Suppression for Anomalous Event Detection. ECCV 2020.
  6. J.-C. Feng, F.-T. Hong, and W.-S. Zheng. MIST: Multiple Instance Self-Training Framework for Video Anomaly Detection. CVPR 2021.
  7. Y. Tian, G. Pang, Y. Chen, R. Singh, J. W. Verjans, and G. Carneiro. Weakly-supervised Video Anomaly Detection with Robust Temporal Feature Magnitude Learning. ICCV 2021. First posted in January 2021 as arXiv:2101.10030.
  8. H. Zhou, J. Yu, and W. Yang. Dual Memory Units with Uncertainty Regulation for Weakly Supervised Video Anomaly Detection. AAAI 2023.
  9. P. Wu, X. Zhou, G. Pang, L. Zhou, Q. Yan, P. Wang, and Y. Zhang. VadCLIP: Adapting Vision-Language Models for Weakly Supervised Video Anomaly Detection. AAAI 2024.
  10. L. Zanella, W. Menapace, M. Mancini, Y. Wang, and E. Ricci. Harnessing Large Language Models for Training-free Video Anomaly Detection. CVPR 2024.
  11. S. Abdulaziz and E. Bondarev. Auditing Frame-Level AUC in Weakly Supervised Video Anomaly Detection: Granularity, Resolution, and Scene Bias. arXiv:2608.11985, 2026.
Limitations
  • In Explosion013 the model also gives high scores to an earlier stretch that the labels mark as normal. Figure 2 shows it.
  • A fixed 32 segments penalizes short videos, as on ShanghaiTech.
  • A 2026 audit [11] argues that pooled frame-level AUC, the metric used here and in every table above, does not reliably show how well a model localizes inside one video.
  • This page reports the 2021 research artifact and its original evaluation. The laboratory environment and trained artifacts are no longer available, so the public repository is preserved as frozen thesis code rather than presented as a currently reproducible production ML system.
Contribution notes

End-to-end weakly supervised video pipeline

Designed and implemented a pipeline that trained on one normal or anomalous label per video while producing anomaly scores for individual temporal segments.

Problem
Videos had different lengths, anomalous events occupied only a small fraction of their frames, and frame-level training labels were too expensive to assume.
Implementation
Sampled every video into 32 segments of 16 frames, used a Sports-1M-pretrained C3D backbone, and added a 1D temporal convolution to capture longer-range context while reducing the feature dimension.
Reasoning
A uniform segment sequence made variable-length videos batchable, while retaining the video backbone inside the training path avoided treating precomputed clip averages as the final temporal representation.
Outcome
Created one end-to-end representation for video-level classification and segment-level localization across UCF-Crime and ShanghaiTech.

Attention-guided clustering for segment localization

Combined gated temporal attention with two-cluster K-means to infer which segments inside an anomalous video represented the event.

Problem
A video-level label identifies an anomalous bag but does not reveal which of its segments contain the anomaly.
Implementation
Learned attention weights for the bag prediction, concatenated each segment feature with its attention weight, clustered the segments with cosine distance, and treated the cluster with the higher mean segment score as the anomaly candidate.
Reasoning
Attention exposed each segment's contribution to the bag decision, while clustering converted that weak signal into a within-video separation without requiring frame labels. Cosine distance was more stable than Euclidean distance in the experiments.
Outcome
Removing the clustering path produced the largest top-down ablation drop, 1.97 percentage points on UCF-Crime.

Entropy loss and empirical evaluation

Proposed an entropy smoothness loss and evaluated the complete model through quantitative comparisons, qualitative traces, ablations, and clustering-distance experiments.

Problem
Penalizing differences between adjacent segment scores can blur the boundary between normal and anomalous behavior.
Implementation
Quantized segment scores into 20 intervals and minimized their distribution entropy, then analyzed component removals, attention weights, prediction curves, and feature clusters.
Reasoning
Concentrating predictions into fewer score ranges encouraged stable, separable outputs without assuming neighboring segments must always receive similar scores.
Outcome
The model achieved 84.75% frame-level AUC on UCF-Crime and 93.89% on ShanghaiTech in the paper's evaluation.

PyTorch, C3D, Weakly supervised learning, Multiple-instance learning, Temporal attention, K-means clustering. UCF-Crime and ShanghaiTech, Video-level labels to segment-level scores, 84.75% frame-level AUC on UCF-Crime.