Official implementation of the paper Mulugeta W. Asres, et al. "Low-Latency Video Anonymization for Crowd Anomaly Detection: Privacy vs. Performance", published in the IEEE Transactions on Information Forensics and Security (TIFS).
The LA3D (Lightweight Adaptive Privacy Anonymization for Video Anomaly Detection) provides computationally efficient and dynamic anonymization (AN) that enhances privacy protection while maintaining the accuracy of Video Anomaly Detection (VAD).
- AI holds considerable promise for enhancing computer vision (CV) applications using surveillance CCTV cameras.
- Concerns about privacy and model bias have made it challenging to utilize CV in public.
- Deep learning AN models are computationally demanding for real-time edge deployment.
- In this study, we revisit conventional AN solutions for privacy protection and real-time VAD.
- We propose a novel LA3D that employs dynamic AN to enhance privacy-aware VAD.
- The LA3D enables substantial enhancement in the privacy AN without significantly degrading VAD efficacy.
- Performance was evaluated on publicly available privacy and large-scale VAD data sets.
pel_xd_all_imwh320x136_Fast.Five.2011__.00-32-56_00-33-26_label_B2-0-0_ad.mp4
pel_ucf_all_imwh320x240_Burglary033_x264_ad.mp4
We thank and credit the public data sets and source code for the models listed below.
- Data sets
- Models:
General System Pipeline Diagram of Anonymized VAD:
System Pipeline Diagram of the adaptive AN System: The adaptive AN enhances privacy protection by utilizing the dynamic AN method.
Using PEL4VAD and MGFN VAD Models on the UCF-Crime and XD-Violence Datasets.
NB: The above plot presents improved performance of the MGFN VAD model than the reported scores in the aXriv paper due to an enhanced preprocessing of standardization scaling from kinetics.
Table of Contents
- Installation
- Usage-CLI
- Usage-Notebook
- Results
- Computational Cost Analysis
- Privacy-Leakage after AN
- BibTeX Citation
Download models from Google drive
# Clone the repo.
git clone https://github.com/muleina/LA3D.git && cd LA3D
# Download the model checkpoints from the Google drive link.
# Store the models in /src/models/{'MODEL NAME'}/. Keep the path structure for each model as the download repository.
|-LA3D/
|-src/
|-model/
|-OBJECT_DETECTOR/
|-yolo/
|-VIDEO_ENCODER_RESNET_1024/
|-models/
|-i3d/
|-ckpt/
|-VIDEO_ENCODER_RESNET_2048/
|-ckpt/
|-PEL4VAD/
|-ckpt/
|-MGFN
|-ckpt/
# Anaconda install options: using yml
conda env create -f conda_environment.yml
# Anaconda install options: using txt
conda create --name la3d --file conda_requirements.txt
# Pip install to existing environment.
pip install -r pip_requirements.txt
# The setup configurations of the LA3D are given in the config/config.py file.
The LA3D app testing parameters can be supplied through the main.py.
Real-time processing through webcam and offline processing from image or video files are supported.
Use the flag -v for direct visualization of the results and -s to save results.
python main.py -a an -if webcam -is 320 240 -anm mask -odc person -ods 320 240 -odt 0.25 -v
python main.py -a an -if webcam -is 320 240 -anm no-an -odc person -ods 320 240 -odt 0.25 -v
python main.py -a an -if webcam -is 320 240 -anm edge -odc person -ods 320 240 -odt 0.25 -v
python main.py -a an -if webcam -is 320 240 -anm blur -odc person -ods 320 240 -odt 0.25 -v
python main.py -a an -if webcam -is 320 240 -anm adaptive_blur -odc person -ods 320 240 -odt 0.25 -v
python main.py -a an -if webcam -is 320 240 -anm adaptive_full_blur -odc person -ods 320 240 -odt 0.25 -v
python main.py -a an -if webcam -is 320 240 -anm adaptive_max_blur -odc person -ods 320 240 -odt 0.25 -v
python main.py -a an -if webcam -is 320 240 -anm pixelization -odc person -ods 320 240 -odt 0.25 -v
python main.py -a an -if webcam -is 320 240 -anm adaptive_pixelization -odc person -ods 320 240 -odt 0.25 -v
python main.py -a an -if webcam -is 320 240 -anm adaptive_max_pixelization -odc person -ods 320 240 -odt 0.25 -v
python main.py -a an -if image -is 320 240 -id "{add here the main_path}/data/VISPR/2017_17368641.jpg" -anm no-an -odc person -ods 320 240 -odt 0.25 -v
python main.py -a an -if image -is 320 240 -id "{add here the main_path}/data/VISPR/2017_17368641.jpg" -anm mask -odc person -ods 320 240 -odt 0.25 -s
python main.py -a an -if image -is 320 240 -id "{add here the main_path}/data/VISPR/2017_17368641.jpg" -anm blur -odc person -ods 320 240 -odt 0.25 -s
python main.py -a an -if image -is 320 240 -id "{add here the main_path}/data/VISPR/2017_17368641.jpg" -anm adaptive_blur -odc person -ods 320 240 -odt 0.25 -s
python main.py -a an -if image -is 320 240 -id "{add here the main_path}/data/VISPR/2017_17368641.jpg" -anm adaptive_full_blur -odc person -ods 320 240 -odt 0.25 -s
python main.py -a an -if image -is 320 240 -id "{add here the main_path}/data/VISPR/2017_17368641.jpg" -anm pixelization -odc person -ods 320 240 -odt 0.25 -s
python main.py -a an -if image -is 320 240 -id "{add here the main_path}/data/VISPR/2017_17368641.jpg" -anm adaptive_pixelization -odc person -ods 320 240 -odt 0.25 -s
# PEL4VAD on UCF-Crime dataset
python main.py -a an-ad -adm pel -ads ucf -if video -id "{add here the main_path}/data/UCF_Crime/Burglary033_x264.mp4" -anm no-an -odc person -ods 320 240 -odt 0.25 -s
python main.py -a an-ad -adm pel -ads ucf -if video -id "{add here the main_path}/data/UCF_Crime/Burglary033_x264.mp4" -anm mask -odc person -ods 320 240 -odt 0.25 -s
python main.py -a an-ad -adm pel -ads ucf -if video -id "{add here the main_path}/data/UCF_Crime/Burglary033_x264.mp4" -anm blur -odc person -ods 320 240 -odt 0.25 -s
python main.py -a an-ad -adm pel -ads ucf -if video -id "{add here the main_path}/data/UCF_Crime/Burglary033_x264.mp4" -anm adaptive_blur -odc person -ods 320 240 -odt 0.25 -s
python main.py -a an-ad -adm pel -ads ucf -if video -id "{add here the main_path}/data/UCF_Crime/Burglary033_x264.mp4" -anm adaptive_full_blur -odc person -ods 320 240 -odt 0.25 -s
python main.py -a an-ad -adm pel -ads ucf -if video -id "{add here the main_path}/data/UCF_Crime/Burglary033_x264.mp4" -anm pixelization -odc person -ods 320 240 -odt 0.25 -s
python main.py -a an-ad -adm pel -ads ucf -if video -id "{add here the main_path}/data/UCF_Crime/Burglary033_x264.mp4" -anm adaptive_pixelization -odc person -ods 320 240 -odt 0.25 -s
# PEL4VAD on XD-Violence dataset
python main.py -a an-ad -adm pel -ads xd -if video -id "{add here the main_path}/data/XD_Violence/Fast.Five.2011__#00-32-56_00-33-26_label_B2-0-0.mp4" -anm no-an -odc person -ods 320 240 -odt 0.25 -s
python main.py -a an-ad -adm pel -ads xd -if video -id "{add here the main_path}/data/XD_Violence/Fast.Five.2011__#00-32-56_00-33-26_label_B2-0-0.mp4" -anm mask -odc person -ods 320 240 -odt 0.25 -s
python main.py -a an-ad -adm pel -ads xd -if video -id "{add here the main_path}/data/XD_Violence/Fast.Five.2011__#00-32-56_00-33-26_label_B2-0-0.mp4" -anm adaptive_blur -odc person -ods 320 240 -odt 0.25 -s
python main.py -a an-ad -adm pel -ads xd -if video -id "{add here the main_path}/data/XD_Violence/Fast.Five.2011__#00-32-56_00-33-26_label_B2-0-0.mp4" -anm adaptive_full_blur -odc person -ods 320 240 -odt 0.25 -s
python main.py -a an-ad -adm pel -ads xd -if video -id "{add here the main_path}/data/XD_Violence/Fast.Five.2011__#00-32-56_00-33-26_label_B2-0-0.mp4" -anm pixelization -odc person -ods 320 240 -odt 0.25 -s
python main.py -a an-ad -adm pel -ads xd -if video -id "{add here the main_path}/data/XD_Violence/Fast.Five.2011__#00-32-56_00-33-26_label_B2-0-0.mp4" -anm adaptive_pixelization -odc person -ods 320 240 -odt 0.25 -s
# MGFN on UCF-Crime dataset
python main.py -a an-ad -adm mgfn -ads ucf -if video -id "{add here the main_path}/data/UCF_Crime/Burglary033_x264.mp4" -anm mask -odc person -ods 320 240 -odt 0.25 -s
# MGFN on XD-Violence dataset
python main.py -a an-ad -adm mgfn -ads xd -if video -id "{add here the main_path}/data/XD_Violence/Fast.Five.2011__#00-32-56_00-33-26_label_B2-0-0.mp4" -anm mask -odc person -ods 320 240 -odt 0.25 -s
We have also provided notebooks for a step-wise demo of the AN-VAD pipeline using different models and data sources.
The privacy shield comparison with baseline AN: the adaptive AN improves protection considerably---robust against variations in target-object depth and image resolution.
Scalability comparison on different image resolutions
The figure demonstrates the impact of the different AN on the VAD performance. The PEL4VAD has generally better anomaly localization than the MGFN VAD model.
The conventional baseline vs adaptive vs deep learning AN approaches on an Intel(R) Xeon(R) Platinum 8168 CPU @ 2.70GHz with 64GB RAM and Nvidia Tesla V100-SXM3-32GB.
- The adaptive approaches of the LA3D increase the processing time by approximately 5% compared to the non-adpative AN-VAD.
We have also conducted the cost analysis of the AN in GPU and CPU modes:
- The adaptive AN increases the GPU processing time by
$3$ to$6$ ms and$1$ to$9$ ms on CPU. - The incremental memory remains roughly GPU:
$220$ MB and CPU:$160$ MB, with a negligible difference from the baseline ANs. - The DL method has a
$16 \times$ slower speed and a$14 \times$ higher memory consumption. - The cost analysis demonstrates the feasibility of the proposed lightweight AN approaches for real-time edge CV applications.
- The DeepPrivacy2, one of the state-of-the-art DL in realistic image generation for AN, considerably sacrifices computation efficiency.
We have revealed potential privacy leakage after AN, where a person can be identified from personal belongings. We employ OSNet ReID models on the Market1501 multi-camera dataset.
If you employ any part of the study or the code, please kindly cite the following paper:
@article{asres2025low,
title={Low-Latency Video Anonymization for Crowd Anomaly Detection: Privacy Versus Performance},
author={Asres, Mulugeta Weldezgina and Jiao, Lei and Omlin, Christian Walter},
journal={IEEE Transactions on Information Forensics and Security},
year={2025},
publisher={IEEE}
}