{"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/a-hybrid-video-anomaly-detection-framework","title":"A Hybrid Video Anomaly Detection Framework via Memory-Augmented Flow Reconstruction and Flow-Guided Frame Prediction","arxiv_id":"2108.06852","date":"2021-08-16","proceeding":"ICCV 2021 10","authors":["Zhian Liu","Yongwei Nie","Chengjiang Long","Qing Zhang","Guiqing Li"],"abstract":"In this paper, we propose $\\text{HF}^2$-VAD, a Hybrid framework that integrates Flow reconstruction and Frame prediction seamlessly to handle Video Anomaly Detection. Firstly, we design the network of ML-MemAE-SC (Multi-Level Memory modules in an Autoencoder with Skip Connections) to memorize normal patterns for optical flow reconstruction so that abnormal events can be sensitively identified with larger flow reconstruction errors. More importantly, conditioned on the reconstructed flows, we then employ a Conditional Variational Autoencoder (CVAE), which captures the high correlation between video frame and optical flow, to predict the next frame given several previous frames. By CVAE, the quality of flow reconstruction essentially influences that of frame prediction. Therefore, poorly reconstructed optical flows of abnormal events further deteriorate the quality of the final predicted future frame, making the anomalies more detectable. Experimental results demonstrate the effectiveness of the proposed method. Code is available at \\href{https://github.com/LiUzHiAn/hf2vad}{https://github.com/LiUzHiAn/hf2vad}.","url_abs":"https://arxiv.org/abs/2108.06852v1","url_pdf":"https://arxiv.org/pdf/2108.06852v1.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":"a-hybrid-video-anomaly-detection-framework","repo_url":"https://github.com/LiUzHiAn/hf2vad","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"anomaly-detection","task_name":"Anomaly Detection"},{"task_slug":"optical-flow-estimation","task_name":"Optical Flow Estimation"},{"task_slug":"video-anomaly-detection","task_name":"Video Anomaly Detection"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/video-anomaly-detection-on-cuhk-avenue","task":"Video Anomaly Detection","dataset":"CUHK Avenue","model":"HF2-VAD","rank_in_archive_order":5,"of":7,"metrics":{"AUC":"91.1%"},"uses_additional_data":false},{"leaderboard":"/sota/video-anomaly-detection-on-ped2","task":"Video Anomaly Detection","dataset":"Ped2","model":"HF2-VAD","rank_in_archive_order":1,"of":1,"metrics":{"AUC":"0.993"},"uses_additional_data":false},{"leaderboard":"/sota/video-anomaly-detection-on-shanghaitech","task":"Video Anomaly Detection","dataset":"ShanghaiTech Campus","model":"HF2-VAD","rank_in_archive_order":4,"of":4,"metrics":{"AUC":"76.2"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2108.06852","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2108.06852"}},"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":"deterministic:regex_extraction","url":"https://github.com/LiUzHiAn/hf2vad","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":11},"by_repo_kind":{"official":{"samples":11,"ran":0,"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":0,"samples":[{"code_sha256_prefix":"38d8b97b928f93a2","entry":"aggregate_kl_loss","repo":"LiUzHiAn/hf2vad","repo_kind":"official","path":"losses/loss.py","file_url":"https://github.com/LiUzHiAn/hf2vad/blob/HEAD/losses/loss.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"38d8b97b928f93a2"}},{"code_sha256_prefix":"a653b45bfcbe2b95","entry":"delCoverBboxes","repo":"LiUzHiAn/hf2vad","repo_kind":"official","path":"pre_process/extract_bboxes.py","file_url":"https://github.com/LiUzHiAn/hf2vad/blob/HEAD/pre_process/extract_bboxes.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a653b45bfcbe2b95"}},{"code_sha256_prefix":"b3698ab6fca12450","entry":"getFgBboxes","repo":"LiUzHiAn/hf2vad","repo_kind":"official","path":"pre_process/extract_bboxes.py","file_url":"https://github.com/LiUzHiAn/hf2vad/blob/HEAD/pre_process/extract_bboxes.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b3698ab6fca12450"}},{"code_sha256_prefix":"8d81b09e9f81cc4b","entry":"get_inputs","repo":"LiUzHiAn/hf2vad","repo_kind":"official","path":"datasets/dataset.py","file_url":"https://github.com/LiUzHiAn/hf2vad/blob/HEAD/datasets/dataset.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8d81b09e9f81cc4b"}},{"code_sha256_prefix":"22ed0e6535db75a1","entry":"hard_shrink_relu","repo":"LiUzHiAn/hf2vad","repo_kind":"official","path":"models/ml_memAE_sc.py","file_url":"https://github.com/LiUzHiAn/hf2vad/blob/HEAD/models/ml_memAE_sc.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"22ed0e6535db75a1"}},{"code_sha256_prefix":"c33c92a32cd64fd4","entry":"img_batch_tensor2numpy","repo":"LiUzHiAn/hf2vad","repo_kind":"official","path":"datasets/dataset.py","file_url":"https://github.com/LiUzHiAn/hf2vad/blob/HEAD/datasets/dataset.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c33c92a32cd64fd4"}},{"code_sha256_prefix":"b6912e844379ed70","entry":"img_tensor2numpy","repo":"LiUzHiAn/hf2vad","repo_kind":"official","path":"datasets/dataset.py","file_url":"https://github.com/LiUzHiAn/hf2vad/blob/HEAD/datasets/dataset.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b6912e844379ed70"}},{"code_sha256_prefix":"46f0670b0df56146","entry":"latent_kl","repo":"LiUzHiAn/hf2vad","repo_kind":"official","path":"losses/loss.py","file_url":"https://github.com/LiUzHiAn/hf2vad/blob/HEAD/losses/loss.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"46f0670b0df56146"}},{"code_sha256_prefix":"bc27df2e0a58fe31","entry":"loader","repo":"LiUzHiAn/hf2vad","repo_kind":"official","path":"utils/model_utils.py","file_url":"https://github.com/LiUzHiAn/hf2vad/blob/HEAD/utils/model_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"bc27df2e0a58fe31"}},{"code_sha256_prefix":"79bed0a0515af148","entry":"mem_loader","repo":"LiUzHiAn/hf2vad","repo_kind":"official","path":"utils/model_utils.py","file_url":"https://github.com/LiUzHiAn/hf2vad/blob/HEAD/utils/model_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"79bed0a0515af148"}},{"code_sha256_prefix":"75bb71577a8469ba","entry":"only_model_loader","repo":"LiUzHiAn/hf2vad","repo_kind":"official","path":"utils/model_utils.py","file_url":"https://github.com/LiUzHiAn/hf2vad/blob/HEAD/utils/model_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"75bb71577a8469ba"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}