{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/weakly-supervised-video-anomaly-detection","title":"Weakly-supervised Video Anomaly Detection with Robust Temporal Feature Magnitude Learning","arxiv_id":"2101.10030","date":"2021-01-25","proceeding":"ICCV 2021 10","authors":["Yu Tian","Guansong Pang","Yuanhong Chen","Rajvinder Singh","Johan W. Verjans","Gustavo Carneiro"],"abstract":"Anomaly detection with weakly supervised video-level labels is typically formulated as a multiple instance learning (MIL) problem, in which we aim to identify snippets containing abnormal events, with each video represented as a bag of video snippets. Although current methods show effective detection performance, their recognition of the positive instances, i.e., rare abnormal snippets in the abnormal videos, is largely biased by the dominant negative instances, especially when the abnormal events are subtle anomalies that exhibit only small differences compared with normal events. This issue is exacerbated in many methods that ignore important video temporal dependencies. To address this issue, we introduce a novel and theoretically sound method, named Robust Temporal Feature Magnitude learning (RTFM), which trains a feature magnitude learning function to effectively recognise the positive instances, substantially improving the robustness of the MIL approach to the negative instances from abnormal videos. RTFM also adapts dilated convolutions and self-attention mechanisms to capture long- and short-range temporal dependencies to learn the feature magnitude more faithfully. Extensive experiments show that the RTFM-enabled MIL model (i) outperforms several state-of-the-art methods by a large margin on four benchmark data sets (ShanghaiTech, UCF-Crime, XD-Violence and UCSD-Peds) and (ii) achieves significantly improved subtle anomaly discriminability and sample efficiency. Code is available at https://github.com/tianyu0207/RTFM.","url_abs":"https://arxiv.org/abs/2101.10030v3","url_pdf":"https://arxiv.org/pdf/2101.10030v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"weakly-supervised-video-anomaly-detection","repo_url":"https://github.com/tianyu0207/RTFM","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"weakly-supervised-video-anomaly-detection","repo_url":"https://github.com/seominseok0429/Real-world-Anomaly-Detection-in-Surveillance-Videos-pytorch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"weakly-supervised-video-anomaly-detection","repo_url":"https://github.com/tianyu0207/CCD","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"anomaly-detection","task_name":"Anomaly Detection"},{"task_slug":"anomaly-detection-in-surveillance-videos","task_name":"Anomaly Detection In Surveillance Videos"},{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"},{"task_slug":"multiple-instance-learning","task_name":"Multiple Instance Learning"},{"task_slug":"video-anomaly-detection","task_name":"Video Anomaly Detection"},{"task_slug":"weakly-supervised-video-anomaly-detection","task_name":"Weakly-supervised Video Anomaly Detection"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/anomaly-detection-in-surveillance-videos-on-1","task":"Anomaly Detection In Surveillance Videos","dataset":"ShanghaiTech Weakly Supervised","model":"Learning Causal Temporal Relation and Feature Discrimination for Anomaly Detection","rank_in_archive_order":5,"of":12,"metrics":{"AUC-ROC":"97.48"},"uses_additional_data":false},{"leaderboard":"/sota/anomaly-detection-in-surveillance-videos-on-1","task":"Anomaly Detection In Surveillance Videos","dataset":"ShanghaiTech Weakly Supervised","model":"RTFM","rank_in_archive_order":6,"of":12,"metrics":{"AUC-ROC":"97.21"},"uses_additional_data":false},{"leaderboard":"/sota/anomaly-detection-in-surveillance-videos-on","task":"Anomaly Detection In Surveillance Videos","dataset":"UCF-Crime","model":"RTFM","rank_in_archive_order":13,"of":21,"metrics":{"ROC AUC":"84.03"},"uses_additional_data":false},{"leaderboard":"/sota/anomaly-detection-in-surveillance-videos-on-3","task":"Anomaly Detection In Surveillance Videos","dataset":"UCSD Peds2","model":"RTFM","rank_in_archive_order":2,"of":6,"metrics":{"AUC":"98.6"},"uses_additional_data":false},{"leaderboard":"/sota/anomaly-detection-in-surveillance-videos-on-2","task":"Anomaly Detection In Surveillance Videos","dataset":"XD-Violence","model":"RTFM","rank_in_archive_order":15,"of":17,"metrics":{"AP":"77.81"},"uses_additional_data":false},{"leaderboard":"/sota/weakly-supervised-video-anomaly-detection-on","task":"Weakly-supervised Video Anomaly Detection","dataset":"ShanghaiTech Weakly Supervised","model":"RTFM","rank_in_archive_order":9,"of":16,"metrics":{"AUC-ROC":"97.21","FAR-Normal":"1.06"},"uses_additional_data":false},{"leaderboard":"/sota/weakly-supervised-video-anomaly-detection-on-1","task":"Weakly-supervised Video Anomaly Detection","dataset":"UBnormal","model":"RTFM","rank_in_archive_order":4,"of":11,"metrics":{"AUC-ROC":"66.83"},"uses_additional_data":false}],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2101.10030","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2101.10030"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/tianyu0207/CCD","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/tianyu0207/RTFM","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/seominseok0429/Real-world-Anomaly-Detection-in-Surveillance-Videos-pytorch","reach":null}],"summary":{"ran":3,"ran_fixture":1,"unverified":1},"by_repo_kind":{"official":{"samples":4,"ran":3,"repositories":1},"listed":{"samples":1,"ran":1,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":5,"samples":[{"code_sha256_prefix":"4a7b7466479e9f00","entry":"Aggregate","repo":"tianyu0207/RTFM","repo_kind":"official","path":"model.py","file_url":"https://github.com/tianyu0207/RTFM/blob/HEAD/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4a7b7466479e9f00"}},{"code_sha256_prefix":"71a14bfb51a8c536","entry":"MIL","repo":"seominseok0429/Real-world-Anomaly-Detection-in-Surveillance-Videos-pytorch","repo_kind":"listed","path":"loss.py","file_url":"https://github.com/seominseok0429/Real-world-Anomaly-Detection-in-Surveillance-Videos-pytorch/blob/HEAD/loss.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"71a14bfb51a8c536"}},{"code_sha256_prefix":"afe36e4c1ec064d8","entry":"NONLocalBlock1D","repo":"tianyu0207/RTFM","repo_kind":"official","path":"model.py","file_url":"https://github.com/tianyu0207/RTFM/blob/HEAD/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"afe36e4c1ec064d8"}},{"code_sha256_prefix":"4373964d14de29e5","entry":"_NonLocalBlockND","repo":"tianyu0207/RTFM","repo_kind":"official","path":"model.py","file_url":"https://github.com/tianyu0207/RTFM/blob/HEAD/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4373964d14de29e5"}},{"code_sha256_prefix":"ffca62d39dfe7587","entry":"Model","repo":"tianyu0207/RTFM","repo_kind":"official","path":"model.py","file_url":"https://github.com/tianyu0207/RTFM/blob/HEAD/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ffca62d39dfe7587"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}