A privacy protection method and device for video anomaly detection service quality guarantee

CN122821448BActive Publication Date: 2026-11-03ZHEJIANG UNIV OF TECH +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611251542.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-08-18
Publication Date
2026-11-03
Estimated Expiration
2046-08-18

AI Technical Summary

Technical Problem

Existing video anomaly detection technologies suffer from privacy leaks and appearance bias, making it difficult to maintain service quality while ensuring privacy protection. This is especially true in complex scenes and high-resolution videos, where existing solutions suffer from high costs, performance degradation, or poor adaptability.

Method used

By employing a motion contour generation network based on neighborhood attention, a self-supervised privacy recognition mechanism, and a multi-granular spatiotemporal anomaly detection framework, and through end-to-end adversarial training, sensitive appearance information is physically eliminated and semantic information loss is compensated, achieving efficient privacy protection and anomaly detection.

Benefits of technology

It achieves comprehensive removal of appearance privacy information while maintaining the accuracy and robustness of anomaly detection. It is suitable for scenarios such as smart cities, industrial safety, and medical monitoring. The coverage has been expanded from faces to all appearance features. It has the ability to automatically audit and suppress residual privacy information, thus improving detection performance and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122821448B_ABST
    Figure CN122821448B_ABST
Patent Text Reader

Abstract

The application discloses a privacy protection method and device for video anomaly detection service quality guarantee, comprising: adopting a generator based on a variable neighborhood attention mechanism, removing all appearance privacy information at the pixel level through parallel processing of multi-head differentiated neighborhood windows, and generating a high-definition contour image that only retains motion information; constructing a self-supervised privacy audit mechanism, automatically identifying and suppressing residual identity distinguishability features through inter-frame comparison learning, and forming secondary protection for anonymization quality; constructing a multi-granularity anomaly detection framework, integrating multi-scale prediction coding and complementary analysis based on frame difference motion object reconstruction, and compensating for semantic information loss caused by privacy protection through distribution divergence constraint. Through the three-layer collaborative architecture of physical anonymity, audit suppression and multi-granularity compensation, the application breaks through the limitations of existing schemes that only protect faces or rely on fixed feature projection, and guarantees the service quality of video anomaly detection while completely eliminating appearance privacy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of intelligent surveillance, computer vision, and machine learning, and specifically to a privacy protection method and apparatus for ensuring the quality of service of video anomaly detection. Background Technology

[0002] Machine learning-driven intelligent video analytics is gaining increasing adoption. Advances in cloud computing have made the deployment of computationally intensive technologies in public spaces possible. One typical application is Video Anomaly Detection (VAD) within autonomous video analytics. VAD is a video understanding task that aims to identify the temporal location of anomalous events in long, continuous videos without human supervision. Anomalies can be defined as any unusual event, such as traffic accidents, elderly people falling, fires, or public disturbances. This technology can lead to faster anomaly response times and reduce reliance on human resources.

[0003] However, the public's adoption of these AI technologies has raised legitimate concerns about security and privacy. Visual privacy breaches and data bias are significant but not yet fully addressed issues in VAD applications. Sending surveillance video to remote computers or cloud services for analysis can lead to unnecessary privacy breaches for ordinary citizens who are not directly involved in the anomaly—including identifiable personal information such as faces, body shapes, clothing, and behavioral habits. Furthermore, anomaly detection systems using standard RGB video may inherit appearance biases (such as skin color and clothing style) from the training data, potentially leading to unfair decisions.

[0004] Existing privacy protection solutions for video analytics can be broadly categorized into three types. The first type is hardware-dependent solutions, such as using thermal imaging cameras, depth sensors, or event cameras instead of traditional RGB cameras, or performing basic desensitization processing like face blurring or Gaussian blurring at the acquisition end. While these solutions can partially protect privacy, the dedicated hardware is expensive, and the blurring process can severely disrupt the spatiotemporal continuity of the video, leading to a significant drop in anomaly detection performance. The second type is feature-level privacy protection solutions, such as skeleton-based keypoint extraction and orthogonal subspace projection-based feature separation methods. While skeleton methods can remove appearance information, they struggle to capture large-scale anomaly patterns in complex scenes (e.g., a riot only manifests as changes in crowd density and movement speed). Subspace projection methods project video features fixedly onto a privacy-independent subspace, but this fixed projection transformation lacks adaptability to specific scenes and tasks, failing to achieve a dynamic optimization balance between privacy protection strength and detection performance. The third category is adversarial training schemes. Existing work (such as "Learning to Anonymize Faces for Privacy Preserving ActionDetection" at ECCV 2018) utilizes generative adversarial networks to anonymize faces to protect privacy while maintaining action recognition performance. However, this type of method has the following key limitations:

[0005] (1) Anonymization is applied only to the face area, ignoring other visual features that can identify an individual, such as body shape, gait, and clothing;

[0006] (2) Its task objective is fully supervised action classification / detection, which is fundamentally different from weakly supervised video anomaly detection in terms of problem setting, annotation requirements and evaluation methods, and cannot be directly transferred;

[0007] (3) The lack of a secondary audit and suppression mechanism for residual privacy information after anonymization poses a risk of privacy leakage. Furthermore, while existing adversarial training frameworks have verified the privacy protection effect of adversarial training on general visual recognition tasks, they are geared towards static image tasks and are not specifically designed for the temporal characteristics and motion features of video data, making them difficult to directly apply to video anomaly detection scenarios. In summary, there is an urgent need for a privacy protection solution specifically designed for video anomaly detection scenarios, with end-to-end capabilities and the ability to audit residual privacy information, which can comprehensively remove apparent privacy information while ensuring the service quality of anomaly detection through a task-specific learning mechanism. Summary of the Invention

[0008] To address the shortcomings of existing technologies, this invention provides a privacy protection method and apparatus for ensuring the quality of service (QS) of video anomaly detection. This invention utilizes a neighborhood attention-based motion contour generation network, a self-supervised privacy recognition mechanism, and a multi-granularity spatiotemporal anomaly detection framework to physically eliminate sensitive appearance information (such as facial features, body shape, clothing, and other identity markers) in videos. Simultaneously, a multi-granularity learning mechanism compensates for the semantic information loss caused by privacy removal, ensuring the accuracy and robustness of the anomaly detection service. This invention is applicable to scenarios requiring real-time privacy protection and anomaly analysis of video streams, such as smart cities, industrial safety, and medical monitoring.

[0009] The objective of this invention is achieved through the following technical solution. Firstly, this invention provides a privacy protection method for quality assurance of video anomaly detection services. This method utilizes adversarial training as a parameter optimization mechanism, integrating high-definition motion contour generation based on neighborhood attention, self-supervised privacy auditing, and multi-granularity spatiotemporal anomaly detection to achieve end-to-end privacy protection and anomaly analysis. The method includes the following steps:

[0010] (1) Construct a motion contour generator based on the variable neighborhood attention mechanism. With the original video frame as input, multi-scale motion information is captured in parallel at the pixel level through multi-head differential neighborhood windows. At the same time, with the latent vector injection, the identity attributes and motion features are decoupled in unsupervised manner. The output is a motion contour video representation that retains only motion information and removes all appearance details.

[0011] (2) Construct a self-supervised privacy audit model for motion contour video representation. Select frame pairs from the same video according to different strategies. Map the frame pairs to the normalized representation space by sharing the 2D-CNN skeleton and projection head. Maximize the consistency of the same video frame pairs in the representation space by using the contrast loss function. Learn to identify and suppress the residual identity features that distinguish different individuals in motion contour without the need for manual privacy annotation.

[0012] (3) Construct a multi-granularity anomaly detection framework, taking motion contour video representation as input, extracting spatiotemporal features through a shared backbone network, and performing the following two complementary anomaly analysis tasks in parallel:

[0013] Multi-scale predictive coding branch: The receptive field is expanded step by step through four spatiotemporal feature refinement modules with exponentially increasing dilation rates. The spatial attention units in each module generate multi-scale spatial attention maps through multi-branch dilated convolution to perform dynamic feature weighting. Global multi-scale motion anomalies are captured based on the reconstruction error between the predicted frame and the real frame.

[0014] Object reconstruction branch: Based on the difference image of consecutive frames, the general object existence judgment ability of the pre-trained object detector is used to extract the prior position of moving objects. The spatiotemporal trajectory of the object is modeled through Transformer and attention convolutional network, and local interaction anomalies are located based on trajectory reconstruction error.

[0015] The two branches above are jointly optimized and a distribution divergence constraint is introduced to compensate for the semantic loss caused by privacy protection, so as to achieve high-precision anomaly detection and localization under anonymity conditions.

[0016] Furthermore, step (1) employs an end-to-end optimization framework comprising a generator, a privacy discriminator, and an anomaly discriminator. Through two-stage alternating training, the generator learns the optimal anonymization strategy. The optimization objective during the training phase is to minimize the anomaly detection task loss to ensure no degradation in detection performance, while maximizing the privacy attribute classification loss so that the privacy discriminator cannot identify identity attributes from anonymized videos. The generator and dual discriminators gradually reach Nash equilibrium during the two-stage alternating iterative training. During the inference phase, the generator operates independently without the discriminator's involvement. By using two-stage alternating training instead of joint training, the problem of insufficient anonymization quality in the early stages of training leading to the anomaly detection model learning incorrect features is avoided. The specific method of the two-stage alternating training is as follows:

[0017] In the first stage, the privacy discriminator and the anomaly discriminator are fixed, and only the generator parameters are updated. The training objective is to simultaneously increase the privacy attribute classification loss and decrease the anomaly detection loss.

[0018] In the second stage, the generator is fixed, and the privacy discriminator and the anomaly discriminator are updated. The privacy discriminator is trained with the contrastive loss described in step (2) to enhance its ability to identify residual privacy, and the anomaly discriminator is trained with the multi-granularity joint loss described in step (3) to enhance its anomaly detection capability under anonymization conditions. The two stages are alternately iterated until the classification accuracy of the privacy discriminator no longer decreases significantly and the frame-level AUC of anomaly detection no longer increases significantly.

[0019] Furthermore, in step (2), the core feature of the Hydra-NA (Hydra Neighborhood Attention) mechanism is that different attention heads in the same multi-head attention layer independently set the neighborhood window radius. The shallow layer uses a smaller window to preserve fine motion details, while the deep layer uses a larger window to aggregate the global spatiotemporal context. Compared with traditional self-attention (which calculates the association between all positions), neighborhood attention only calculates the association between each position and the position within its neighborhood window, reducing the computational complexity from O(N²) to a linear level, enabling it to run efficiently on high-resolution video frames. The latent vector injection maps randomly sampled noise vectors to a decoupled intermediate latent space through an 8-layer MLP mapping network, controlling the global identity attributes of the generated image, thus achieving complete preservation of motion features while concealing only identity information.

[0020] Furthermore, the self-supervised privacy auditing mechanism in step (3) employs the following contrastive learning strategy: the temporal sampler selects two frames from the same anonymized video using different strategies (random sampling or uniform interval sampling), and maps them to a normalized representation space via a shared 2D-CNN skeleton and projection head, respectively. The NT-Xent (Normalized Temperature-scaled Cross Entropy) contrastive loss function is used for training—maximizing the cosine similarity between two frames from the same video in the representation space while minimizing the similarity between frame pairs from different videos. The unique value of this mechanism lies in the fact that if the anonymization quality is insufficient (i.e., identity features that distinguish different individuals still remain in the motion contours), frame pairs from the same video will struggle to maintain feature consistency across time; the model automatically identifies and suppresses residual identity-distinguishing features by maximizing this consistency.

[0021] Furthermore, the architectural features of the multi-granularity anomaly detection framework described in step (4) are as follows:

[0022] Multi-scale predictive coding branch: Four stacked spatiotemporal feature refinement modules (STFRM) are used, with the expansion rate of each module increasing exponentially (STFRM-1: d=1,2,4; STFRM-2: d=2,4,8; STFRM-3: d=4,8,16; STFRM-4 (d=8,16,32) expands the model's receptive field from pixel level to global level. Within each STFRM, multiple dilation rates process the same feature map in parallel and generate multi-scale spatial attention maps before fusing them. The minimum dilation rate preserves spatial details at the original resolution, while the maximum dilation rate covers a wide range of spatial context, ensuring that the model simultaneously focuses on local prediction errors and global motion trends. Each STFRM contains a Spatial Attention Unit (SAU), which generates multi-scale spatial attention maps through multi-branch dilated convolutions (3×3 kernels, output channel compression ratio of 1 / 4). After channel-by-channel concatenation and 1×1 convolution fusion, the SAU is multiplied element-by-element with the original features to achieve dynamic weighting of multi-scale spatial features. This branch captures full-scale motion anomalies, from individual abnormal poses to group riots, by predicting the difference between future frames and the current frame and calculating reconstruction errors.

[0023] Object Reconstruction Branch: Based on the Transformer architecture, this branch models the spatiotemporal trajectory consistency of moving objects across consecutive frames. The key innovation of this branch lies in the fact that the input to the object detection model is not the anonymized motion contour image itself, but rather the difference image between two consecutive frames. Since the static background is eliminated after anonymization, the frame difference operation ensures that only the moving object region retains a valid response, while the pixel values ​​of static objects approach zero. Therefore, it only needs to utilize the general objectness detection capability of the pre-trained object detector Cascade R-CNN, without needing to identify specific categories or perform additional training or fine-tuning on the target dataset. The detected moving object bounding boxes serve as spatial prior input to the Transformer, and the Attention U-Net dynamically learns the attention weights between feature maps of different frames in the sequence, effectively modeling temporal dependencies. By comparing the reconstruction error between the predicted trajectory and the actual trajectory, local anomalous behaviors are located.

[0024] Furthermore, the joint optimization strategy of the multi-granularity anomaly detection framework is as follows: the multi-scale prediction encoding loss and the object reconstruction loss supervise the learning of the shared backbone network from two complementary levels: global motion and local object, respectively. In addition, a KL divergence loss term is introduced to explicitly constrain the distribution difference between normal and abnormal samples in the feature space, compensating for the decrease in the distinguishability of the two types of samples in the high-dimensional feature space caused by the removal of appearance information, thereby improving the detection sensitivity of large-scale anomalies. This multi-loss joint optimization mechanism ensures that the detection framework can maintain high accuracy even under extreme conditions where the input is only a motion contour (without any appearance texture information).

[0025] Secondly, the present invention also provides a privacy protection device for quality assurance of video anomaly detection service, including a memory and one or more processors, wherein the memory stores executable code, and when the processor executes the executable code, it implements the aforementioned privacy protection method for quality assurance of video anomaly detection service.

[0026] Thirdly, the present invention also provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the aforementioned privacy protection method for quality assurance of video anomaly detection services.

[0027] Fourthly, the present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements the aforementioned privacy protection method for video anomaly detection service quality assurance.

[0028] The beneficial effects of this invention are as follows: Unlike existing adversarial training schemes that only focus on face anonymization or use fixed feature projections, this invention makes systematic innovations in terms of privacy auditing mechanisms, anonymization methods, and anomaly detection frameworks, as detailed below:

[0029] 1. Dual-layer privacy protection mechanism: The Hydra-NA motion contour generator physically eliminates appearance privacy information at the pixel level, and then a self-supervised privacy audit mechanism identifies and suppresses residual identity features, forming a dual-layer protection of "generation removal + audit suppression". Compared with face anonymization schemes that rely solely on single-layer adversarial training, the privacy protection coverage of this invention extends from the face to all appearance features (body shape, gait, clothing, etc.). Based on the self-supervised privacy recognition mechanism, it can automatically audit and suppress privacy information that may remain after anonymization without manual privacy annotation, thus forming a dual-layer privacy protection.

[0030] 2. Efficient Video Anonymization Based on Hydra-NA: The motion contour generator based on Hydra-NA independently configures the neighborhood window size for different attention heads, capturing local motion details and global motion patterns simultaneously within a single layer. Through parallel processing of multi-scale neighborhood windows, it completely eliminates appearance privacy information at the physical pixel level while efficiently preserving motion spatiotemporal features. Compared to the quadratic computational complexity of fully self-attention mechanisms, the linear complexity of neighborhood attention enables the network to run efficiently on high-resolution video frames, and can still quickly generate high-definition motion contour samples even under conditions of blurry data, complex scenes, or aging equipment.

[0031] 3. Multi-granularity anomaly detection and semantic compensation: This invention proposes a multi-granularity anomaly detection framework for anonymized videos. It employs joint optimization of multi-scale predictive coding and frame difference-based object reconstruction, and introduces distributional divergence constraints to compensate for semantic losses caused by privacy removal, ensuring the quality of detection services under extreme privacy protection conditions. The multi-scale predictive coding covers full-scale motion modes from pixel-level to global-level through STFRM stacking with exponentially increasing expansion rates and SAU multi-branch spatial attention. Frame difference-based object reconstruction utilizes frame difference images combined with the general object recognition of a pre-trained detector, extracting the spatiotemporal trajectory of moving objects without task-specific training. Joint optimization of the two branches, combined with KL divergence semantic compensation, ensures stable anomaly detection performance even in extreme scenarios where appearance information is completely lost due to privacy protection. Attached Figure Description

[0032] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0033] Figure 1 Flowchart of a privacy protection method for video anomaly detection service quality assurance;

[0034] Figure 2 This is a schematic diagram of a generator architecture based on a neighborhood attention mechanism.

[0035] Figure 3 A schematic diagram of a self-supervised privacy protection framework;

[0036] Figure 4 A diagram comparing different privacy protection methods;

[0037] Figure 5 This is a structural diagram of a privacy protection device for ensuring the quality of video anomaly detection service, provided by the present invention. Detailed Implementation

[0038] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0039] Reference Figure 1 This invention provides a privacy protection method for quality assurance of video anomaly detection services, comprising the following steps:

[0040] (1) End-to-end training framework: As the parameter optimization mechanism of the overall scheme, an end-to-end training framework including a generator, a privacy discriminator, and an anomaly discriminator is adopted. The generator takes the original video image as input and outputs a privacy-preserving motion contour video representation; the privacy discriminator assists the generator in learning to remove appearance-sensitive information (such as identity features) during the training phase, and its loss function minimizes the privacy attribute classification accuracy; the anomaly discriminator assists the generator in learning to preserve motion spatiotemporal features during the training phase, and ensures content utility by maximizing the anomaly detection accuracy. After training is completed (inference phase), only the generator runs independently, directly converting the original video into anonymized motion contours. During training, the parameters of the generator and dual discriminators are optimized alternately in two stages to avoid the learning bias of the anomaly detection model caused by insufficient generation quality in the early stage of joint training, thus achieving end-to-end collaborative learning.

[0041] (2) High-Resolution Anonymization Generation: A generator architecture based on Hydra-NA (Hydra Neighborhood Attention) is employed to convert the original video sequence X containing privacy information into a high-resolution motion contour image. This architecture generates high-quality anonymized images controllably through latent vector injection and achieves unsupervised decoupling of high-level semantic attributes, ensuring that the generated image is completely privacy-free without affecting behavior capture. The output of this step is a high-resolution contour image that retains only motion information, ensuring that appearance details (such as faces and textures) are completely blurred while motion information (such as speed and direction) is fully preserved. This step solves the data blurring problem caused by device aging or lighting changes in complex scenes, improving generation efficiency and robustness.

[0042] (3) Self-supervised privacy identification: Taking the privacy-protected video representation output by the generator as input, a self-supervised privacy identification model (i.e., further training of the privacy discriminator) is constructed through temporal sampling and contrastive learning mechanisms to identify and suppress potential residual privacy information from the generated motion contours. This step does not rely on manually labeled privacy tags, but achieves privacy assessment through a data-driven approach, reducing costs and improving adaptability.

[0043] (4) Multi-granularity anomaly detection for anonymized images: Using the privacy-preserving motion contour video representation output by the generator as input, a multi-granularity learning model is constructed, which integrates multi-scale prediction coding and object-based reconstruction errors to perform anomaly analysis on the privacy-preserving video representation, thereby achieving high-performance anomaly detection and localization.

[0044] The detailed steps of the dual discriminator adversarial training in step (1) are as follows:

[0045] (1-1) Problem Construction and Framework Definition:

[0046] Using Video Anomaly Detection (VAD) as the utility task and privacy attribute identification as the budget task, the system goal is to learn an anonymization function. This approach aims to maximize the privacy budget task loss (even if privacy attributes cannot be identified) while minimizing the anomaly detection utility task loss (i.e., maintaining detection performance without degradation). Anonymization function. Implemented using an encoder-decoder architecture, it serves as the generator within the optimization framework. The overall system includes anonymization functions. (i.e., generator), utility target model (i.e., anomaly detector) and target budget model (i.e., privacy discriminator), the optimization goal is to find Pareto optimality .

[0047] (1-2) Task objective definition:

[0048] Objective 1: The performance of utility tasks should not degrade from their original performance, i.e., the utility objective model. loss The value should remain almost the same before and after applying the anonymization function.

[0049]

[0050] Objective 2: The application of anonymized functions should include a target budget model. Budget Mission loss .

[0051]

[0052] To achieve these two objectives, this invention mathematically transforms the problem into solving the following optimization problem:

[0053]

[0054] Where X represents the video sequence and Y represents the binary label of the video;

[0055] This framework employs a two-stage alternating iterative training strategy, as detailed below:

[0056] (1-3) Pre-training / initialization strategies for each module:

[0057] Step 1: Pre-train the anonymization function. Use image reconstruction loss (L1 loss) to perform autoencoder-like pre-training on the target dataset, allowing the generator to first learn to reconstruct the input frames, training for approximately 80 epochs; this pre-training ensures... It can extract sufficient structural information from the original video frames, providing a stable initialization basis for subsequent adversarial training.

[0058] Step 2: Initialize the target budget model. Initialize using ResNet50 weights pre-trained on ImageNet to ensure the 2D-CNN skeleton has basic visual feature extraction capabilities.

[0059] Step 3: Initialize the utility target model. Initialize the shared backbone network F using I3D weights pre-trained on Kinetics-400, and the object reconstruction branch uses pre-trained weights of the STFRM network on the target dataset.

[0060] (1-4) Two-stage alternating training process:

[0061] Phase 1 – Training the Anonymization Function Fixed-target budget model and utility target model The parameters are specifically updated. The parameters. The training objective is to find a parameter that simultaneously increases the classification loss for privacy attributes (making...). Unable to identify the identity) and reduce the total loss of anomaly detection (make Anonymization transformation (capable of accurately detecting anomalies in anonymous videos), this stage of training... The loss value tends to stabilize.

[0062] Phase Two – Training the Privacy Discriminator and Anomaly Detection Model: Fixing the Anonymization Function Trained in Phase One The generated anonymized videos will be used to update... and .renew Using anonymized video as input, the contrast loss described in step (3) maximizes the consistency of the same video frame pair in the feature space, thereby enhancing the ability to identify residual identity-distinguishing features. Update Using anonymized video as input, the ability to detect anomalies from anonymous motion contours is enhanced through multi-branch joint optimization of the multi-granularity learning framework described in step (4).

[0063] The two phases described above constitute a complete round of adversarial iteration. The two phases alternate iterating until the model converges as a whole.

[0064] (1-5) Convergence Criteria: Privacy-Preserving Convergence Criteria: Objective Budget Model The classification accuracy (cMAP) on the validation privacy dataset no longer significantly decreased (the change was less than 0.5% over 5 consecutive epochs), indicating that the anonymization quality has reached the upper limit of the current network's capabilities; Anomaly detection convergence criterion: utility-oriented model. The frame-level AUC on the validation set no longer improves significantly (the change is less than 0.2% over 5 consecutive epochs), indicating that the detection performance has converged. Global convergence criteria: both of the above conditions are met simultaneously, or the total number of training epochs reaches the preset upper limit (200 epochs).

[0065] In step (2), refer to Figure 2 The detailed steps for generating high-definition anonymity are as follows:

[0066] (2-1) Latent Vector Injection and Semantic Decoupling: A latent noise vector z is randomly sampled from a standard normal distribution and mapped to an intermediate latent space W using an 8-layer multilayer perceptron (MLP) mapping network f_map. The purpose of this mapping is to decouple latent factors—the W space has better linearity and decoupling properties than the z space, allowing different dimensions to independently control different image attributes. In this scheme, some dimensions of the W space are constrained to control identity-related attributes (such as body proportions and gait features), while the remaining dimensions control motion-related attributes (such as movement speed and amplitude). The core advantage of this design is that it enables the generator to controllably conceal only identity-related visual attributes without interfering with motion information. Unlike traditional methods that only blur a single face region, this scheme achieves unified anonymization of all appearance features through global attribute control of the latent vector.

[0067] (2-2) Hydra-NA (Variable Neighborhood Multi-Head Attention Mechanism): The original video sequence X is segmented into a frame sequence {x1, x2, ..., x...} T The generator's transformers at each layer employ the Hydra-NA mechanism, whose key innovation lies in the independent configuration of their respective neighborhood window radii r for different attention heads within the same multi-head attention layer. k Specifically, for an attention layer with H heads, h heads k Focus on a point centered at the current pixel with a radius of r k All pixels within the neighborhood window, where r k ∈[3, 11] is set independently based on the role of the head in the layer. In shallow networks, more heads are configured with smaller window radii (r). k =3-5), focusing on the extraction of fine-grained local motion patterns such as limb micro-movements and gesture changes; in deep networks, more heads are configured with large window radii (r k =7-11), capturing global spatiotemporal patterns such as group movement trajectories and crowd flow directions. This differentiated window configuration enables a single-layer network to simultaneously capture a complete motion information spectrum from local to global.

[0068] (2-3) High-efficiency high-definition contour generation: The generator takes the original video frame as input, processes it through multiple layers of Hydra-NA-based transformers, and upsamples it layer by layer, finally outputting a high-definition motion contour image with the same resolution as the input. The computational complexity of each transformer layer is O(N·K), where N is the number of pixels and K is the average number of pixels in each neighboring window. Compared with traditional fully self-attention (computational complexity O(N²)), neighboring attention reduces the computational load to a linear level, enabling the network to directly process full HD (1920×1080) or even higher resolution video frames without downsampling preprocessing. This layer-by-layer processing and progressive upsampling generation mode ensures the spatial accuracy of the motion contour image, while neighboring attention maintains high time efficiency even in high-definition generation tasks because it eliminates redundant correlations between distant pixels. After processing by multiple transformers, the static background in the output image is uniformly set to black (or neutral pixel value), and only the contour area of ​​the moving object retains effective pixels, achieving complete elimination of physical appearance information.

[0069] In step (3), refer to Figure 3 The detailed steps of self-supervised privacy identification are as follows:

[0070] (3-1) Temporal Differentiated Sampling: A temporal sampler (SF) is used to sample two frames from the anonymized motion contour video. This scheme employs a hybrid sampling strategy: uniform interval sampling is performed with a 50% probability (the sampling interval is randomly selected from the range of [5, 30] frames), and fully random sampling is performed with a 50% probability (two frames are independently and randomly selected from the entire video range). Uniform interval sampling enables the model to learn the motion continuity features within a short time span, while fully random sampling enables the model to learn the motion pattern stability over a long time span. The two sampled frames are projected onto a normalized d-dimensional representation space (e.g., d=128) through a shared 2D-CNN skeleton (ResNet50) and a nonlinear projection head (two layers of MLP + ReLU), respectively, to obtain the corresponding projection vector z. i and z j .

[0071] (3-2) Contrastive Learning Optimization: The NT-Xent (Normalized Temperature-scaled CrossEntropy) contrastive loss function is adopted. For a mini-batch containing N videos, a pair of frames is sampled from each video to obtain 2N projection vectors. A positive sample pair is defined as the projection vectors (zi, zi, zi) of two frames from the same video. i , z j Negative sample pairs are defined as the projection vectors of any two frames from different videos. The loss function is:

[0072]

[0073] Where h(u, v) is the exponent for calculating the cosine similarity between vectors u and v.

[0074] The training objective is to maximize the consistency of positive sample pairs while minimizing the similarity of negative sample pairs. The design works as follows: if anonymization is insufficient—that is, if statistical features that distinguish different individuals (such as differences in movement patterns caused by specific gait rhythms and body proportions) remain in the motion profile—then the projection vectors of frame pairs in the same video will be difficult to maintain consistency (because privacy features do not stabilize over time). The model automatically learns to suppress these residual identity features from the representation by optimizing the contrastive loss.

[0075] (3-3) Privacy Residual Auditing and Suppression: After training through contrastive learning, the privacy discriminator possesses the ability to automatically evaluate the quality of anonymization—for any given anonymized video, it samples multiple frame pairs and calculates their representation space consistency score. The lower the consistency, the more residual identity information there is and the worse the anonymization quality. This evaluation result can serve as a feedback signal to guide further optimization of the generator, forming a closed loop of "generation → auditing → feedback → improvement". Most importantly, the entire process requires no manual privacy labeling—it does not require labeling which videos belong to the same person or which features are privacy features. The model automatically discovers and suppresses identity-related statistical patterns during contrastive learning. This self-supervised characteristic is the core advantage compared to traditional anonymization methods that rely on manual identity labeling.

[0076] In step (4), the detailed steps for multi-granularity anomaly detection of anonymized images are as follows:

[0077] (4-1) Feature extraction: All data is converted from RGB channels to feature channels through a shared backbone network to eliminate the influence of environmental noise on anomaly detection and to provide a unified data format for multi-granularity learning frameworks.

[0078] (4-2) Multi-scale predictive coding: generating feature representations ,in Let represent the input features of frame t, and Enc() represent the encoder network. The feature representation is processed at multiple scales through four stacked Spatiotemporal Feature Refinement Modules (STFRMs), with the dilation rate of each STFRM set as follows:

[0079] STFRM-1: Expansion ratio d = 1, 2, 4 (capturing fine-grained local motion);

[0080] STFRM-2: Expansion ratio d = 2, 4, 8;

[0081] STFRM-3: Expansion ratio d = 4, 8, 16;

[0082] STFRM-4: Expansion ratio d = 8, 16, 32 (captures a wide range of global motion patterns).

[0083] The exponentially increasing expansion rate design allows the receptive fields of the four STFRMs to expand progressively from small to large. Within each STFRM, multiple expansion rates process the same feature map in parallel and generate multi-scale spatial attention maps before fusing them. The minimum expansion rate of 1 preserves spatial details at the original resolution, while the maximum expansion rate of 32 covers a wide range of spatial contexts, ensuring that the model simultaneously pays attention to local prediction errors (such as abnormal individual actions) and global motion trends (such as large-area motion changes in a mass riot).

[0084] Each STFRM incorporates Spatial Attention Units (SAUs) with dilated convolutional techniques. Its structure is as follows: Input features → Multi-branch dilated convolution (each branch uses a different dilation rate, the kernel size is 3×3, and the number of output channels is 1 / 4 of the input channels) → Channel-by-channel concatenation → 1×1 convolutional dimensionality reduction → Sigmoid activation → Element-by-element multiplication with the original features → Output. SAUs generate spatial attention maps based on different dilation rates. This design captures multi-scale spatial context. It enables multi-scale spatial encoding in the vertical direction and temporal encoding in the horizontal direction, allowing the model to simultaneously focus on local prediction errors and global motion trends (such as large-scale riots).

[0085] (4-3) Motion Object Reconstruction Based on Frame Difference: The object reconstruction branch uses the Transformer architecture as its main component to calculate the spatiotemporal continuity of moving objects, i.e., capturing the trajectory consistency of moving objects across consecutive video frames. The first key innovation of this branch lies in the input design of the object detector: instead of directly detecting objects on the anonymous motion contour image, it uses the frame difference image |x| between two consecutive frames. t -x t-1| Detection is performed. Since the anonymization process in step (2) has set the pixel values ​​of the static background region to zero (or close to zero), the frame difference operation further makes the pixel values ​​of the static objects (background, non-moving objects) approach zero, and only the contour region of the moving object retains a valid non-zero response value. Therefore, the difference image naturally forms the saliency map of the moving object. In this case, the pre-trained Cascade R-CNN only needs to exert its general "objectness detection" ability - that is, to determine whether a region contains any object (rather than to determine what specific object it is) - to accurately extract the bounding box position of the moving object, without performing category recognition or any additional training or fine-tuning on a specific dataset. This cascaded design of "anonymization to remove background + frame difference to highlight motion + general objectness detection" is the key mechanism by which this scheme can accurately model the trajectory of moving objects while preserving privacy. The detected bounding box of the moving object is passed to the Transformer as a spatial location prior, which helps it focus its attention on the moving object region and more accurately model the temporal motion trajectory of the object between multiple frames. Attention U-Net dynamically learns attention weights between feature maps of different frames in a sequence, and uses reconstruction errors to detect abnormal trajectories (such as objects suddenly disappearing or abnormal movement speeds).

[0086] (4-4) Joint Optimization and Distribution Divergence Compensation: The two tasks, multi-scale predictive coding (global motion anomaly perception) and object reconstruction (local object trajectory anomaly perception), learn spatiotemporal features from videos at different spatial and temporal scales. Both tasks are jointly optimized using multiple loss functions to share a backbone network F. Specifically, considering privacy protection by removing all appearance information (texture, color, face, etc.) from the input, the distributions of normal and abnormal samples in the high-dimensional feature space may overlap due to the lack of appearance information, leading to decreased discriminability. Therefore, this scheme introduces a KL divergence loss term to explicitly maximize the difference between the feature distributions of normal and abnormal samples in the output space of the shared backbone network. This is equivalent to applying a "separating force" to the two types of samples in the feature space, compensating for insufficient discriminative information caused by the lack of appearance and texture information. This significantly improves the detection sensitivity, especially for large-scale anomalies that only manifest as changes in global motion patterns (such as a crowd suddenly scattering).

[0087]

[0088] in, This indicates normal data. This framework effectively compensates for the loss of appearance information caused by privacy protection, and improves the detection sensitivity for large-scale anomalies, representing anomalous data.

[0089] This invention compares the AUC (%) of micro and macro anomalies with the state-of-the-art (SOTA) methods on the Avenue (dataset 1) and ShanghaiTech (dataset 2) datasets. The experimental results are shown in Table 1.

[0090] Table 1

[0091]

[0092] The technical documents for each method in Table 1 are as follows: Method 1: Generating anomalies for video anomaly detection with prompt-based feature mapping. Method 2: A Unified Approach to Video Anomaly Detection via Spatio-Temporal Pseudo-Anomaly Generation. Method 3: BiP-GAN: Pedestrian Video Anomaly Event Automatic Detection Method. Method 4: Weakly supervised video anomaly detection method based on multiview multimodality transformer framework. Method 5: Multi-scale videoanomaly detection by multi-grained spatio-temporal representation learning. Method 6: Transformer-enabled weakly supervised abnormal event detection in intelligent video surveillance systems.

[0093] Furthermore, for different privacy protection methods in various models, a trade-off was made between the anomaly detection benchmark AUC / AP and the VISPR privacy attribute prediction cMAP. Experimental results of different models on the UFC-Crime dataset, XD-Violence dataset, ShanghaiTech dataset, and VISPR dataset are as follows: Figure 4 As shown, Model 1 is Down2X, Model 2 is Down4X, Model 3 is Obf-Blurring, Model 4 is Obf-Blackening, Model 5 is SPAct, and Model 6 is TeD-SPAD.

[0094] Corresponding to the aforementioned embodiment of a privacy protection method for video anomaly detection service quality assurance, the present invention also provides an embodiment of a privacy protection device for video anomaly detection service quality assurance.

[0095] See Figure 5 This invention provides a privacy protection device for video anomaly detection service quality assurance, comprising a memory and one or more processors. The memory stores executable code, and when the processor executes the executable code, it implements a privacy protection method for video anomaly detection service quality assurance as described in the above embodiments.

[0096] The privacy protection device for video anomaly detection service quality assurance provided by this invention can be applied to any device with data processing capabilities, such as a computer. The device embodiment can be implemented in software, hardware, or a combination of both. Taking software implementation as an example, as a logical device, it is formed by the processor of any data processing device loading the corresponding computer program instructions from non-volatile memory into memory for execution. From a hardware perspective, such as... Figure 5 The diagram shown illustrates a hardware structure of any data processing-capable device within which a privacy protection device for video anomaly detection service quality assurance, provided by this invention, is located. (Except for...) Figure 5 In addition to the processor, memory, network interface, and non-volatile memory shown, any data processing device in the embodiment may also include other hardware depending on the actual function of the data processing device, which will not be described in detail here.

[0097] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0098] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the present invention according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0099] This invention also provides a computer-readable storage medium storing a program thereon, which, when executed by a processor, implements a privacy protection method for video anomaly detection service quality assurance as described in the above embodiments.

[0100] The computer-readable storage medium can be an internal storage unit of any data processing device described in any of the foregoing embodiments, such as a hard disk or memory. The computer-readable storage medium can also be an external storage device of any data processing device, such as a plug-in hard disk, smart media card (SMC), SD card, flash card, etc., equipped on the device. Furthermore, the computer-readable storage medium can include both internal storage units and external storage devices of any data processing device. The computer-readable storage medium is used to store the computer program and other programs and data required by the data processing device, and can also be used to temporarily store data that has been output or will be output.

[0101] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the aforementioned privacy protection method for quality assurance of video anomaly detection services.

[0102] The above embodiments are used to explain and illustrate the present invention, but not to limit the present invention. Any modifications and changes made to the present invention within the spirit and scope of the claims shall fall within the protection scope of the present invention.

Claims

1. A privacy protection method for quality assurance of video anomaly detection services, characterized in that, The method includes: (1) Construct a motion contour generator based on a variable neighborhood attention mechanism. In the same multi-head attention layer, different attention heads independently configure their own neighborhood window radii: the shallow head uses a smaller window radius to retain fine motion details, and the deep head uses a larger window radius to aggregate the global spatiotemporal context; the latent vector injection maps random noise to the decoupled intermediate latent space by a multi-layer MLP mapping network, controls the global identity attribute of the generated image, and ensures that only identity information is hidden without interfering with motion features; the motion contour generator takes the original video frame as input, captures multi-scale motion information in parallel at the pixel level through multi-head differential neighborhood windows, and at the same time, cooperates with latent vector injection to realize unsupervised decoupling of identity attributes and motion features, and outputs a motion contour video representation that retains only the motion contour; (2) Construct a self-supervised privacy audit model. For motion contour video representation, select frame pairs from the same video according to different strategies and map the frame pairs to a normalized representation space. Use the contrast loss function to maximize the consistency of the same video frame pairs in the representation space. Without manual privacy annotation, learn to identify and suppress identity features in motion contours. The contrast loss function is NT-Xent loss. By maximizing the cosine similarity of the projection vectors of two frames in the same video and minimizing the similarity of different video frame pairs, the model is driven to automatically learn to distinguish subtle differences in motion patterns of different individuals, i.e., potential residual identity distinguishing features. Use random sampling and uniform interval sampling to select frame pairs from the same video to enhance the robustness of the model to identify privacy leakage patterns under different time spans. (3) Construct a multi-granularity anomaly detection framework, taking motion contour video representation as input, extracting spatiotemporal features through a shared backbone network, and performing the following two complementary anomaly analysis tasks in parallel: Multi-scale predictive coding branch: The receptive field is expanded step by step through the spatiotemporal feature refinement module. The spatial attention unit in each module generates a multi-scale spatial attention map through multi-branch dilated convolution to perform dynamic feature weighting. Global multi-scale motion anomalies are captured based on the reconstruction error between the predicted frame and the real frame. Object reconstruction branch: Based on the difference image of consecutive frames, extract the prior position of moving objects to model the spatiotemporal trajectory of objects, and locate local interaction anomalies based on trajectory reconstruction error; The two branches above are jointly optimized and a distributed divergence constraint is introduced to compensate for the semantic loss caused by privacy protection, so as to achieve high-precision anomaly detection and localization under anonymity conditions.

2. The privacy protection method for video anomaly detection service quality assurance according to claim 1, characterized in that, In step (1), an end-to-end optimization framework including a generator, a privacy discriminator, and an anomaly discriminator is adopted. The generator learns the optimal anonymization strategy through two-stage alternating training. Specifically: In the first stage, the privacy discriminator and the anomaly discriminator are fixed, and only the generator parameters are updated. The training objective is to simultaneously increase the privacy attribute classification loss and decrease the anomaly detection loss. In the second stage, the generator is fixed, and the privacy discriminator and the anomaly discriminator are updated. The privacy discriminator is trained with the contrastive loss described in step (2) to enhance its ability to identify residual privacy, and the anomaly discriminator is trained with the multi-granularity joint loss described in step (3) to enhance its anomaly detection capability under anonymization conditions. The two stages are alternately iterated until the classification accuracy of the privacy discriminator no longer decreases significantly and the frame-level AUC of anomaly detection no longer increases significantly.

3. The privacy protection method for video anomaly detection service quality assurance according to claim 1, characterized in that, The expansion rate of the four spatiotemporal feature refinement modules STFRM in step (3) is exponential, realizing the exponential expansion of the receptive field from the pixel level to the global level. Within each STFRM, multiple expansion rates process the same feature map in parallel and generate multi-scale spatial attention maps before fusing them. The minimum expansion rate preserves the spatial details of the original resolution, while the maximum expansion rate covers a large range of spatial context, ensuring that the model pays attention to both local prediction errors and global motion trends.

4. The privacy protection method for video anomaly detection service quality assurance according to claim 1, characterized in that, The object reconstruction branch in step (3) uses the frame difference image instead of the anonymized contour image itself as the input to the object detector. The anonymization process of the motion contour generator has eliminated the pixels in the static background region. The frame difference operation makes the pixel values ​​of the static object approach zero, and only the motion object region retains the effective response value. Therefore, the pre-trained object detector CascadeR-CNN only needs to perform general object presence detection to accurately extract the position of the moving object. There is no need to identify the object category, nor is there any additional training or fine-tuning on the target dataset.

5. A privacy protection method for video anomaly detection service quality assurance according to claim 1, characterized in that, The distribution divergence constraint mentioned in step (3) is the KL divergence loss, which explicitly constrains the distribution difference between normal samples and abnormal samples in the feature space of the shared backbone network output, and compensates for the decrease in the distinguishability of the two types of samples in the high-dimensional feature space caused by the complete removal of appearance information; this constraint, together with the multi-scale prediction coding loss and the object reconstruction loss, constitutes a multi-granularity joint optimization objective.

6. A privacy protection device for quality assurance of video anomaly detection services, comprising a memory and one or more processors, wherein the memory stores executable code, characterized in that, When the processor executes the executable code, it implements a privacy protection method for quality assurance of video anomaly detection service as described in any one of claims 1-5.

7. A computer-readable storage medium having a program stored thereon, characterized in that, When the program is executed by the processor, it implements a privacy protection method for quality assurance of video anomaly detection service as described in any one of claims 1-5.

8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements a privacy protection method for video anomaly detection service quality assurance as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Video abnormal event self-adaptive detection system and method based on time sequence modeling

    CN119672592A

  • Abnormality detection method and device for privacy protection of multi-modal agricultural product data

    CN120408468A