Method for constructing multi-type image anonymization labeled dataset and target coverage determination

By constructing a multi-type image anonymization annotation dataset and introducing an anonymization feature mapping model into the YOLOv5-L model, the problems of feature dependency failure and insufficient robustness of traditional detection models after anonymization are solved. This achieves accurate identification and coverage evaluation of anonymized regions, meets the GB/T 44464-2024 standard, and is suitable for anonymized detection of vehicle cameras.

CN121415403BActive Publication Date: 2026-05-01CATARC AUTOMOTIVE TEST CENTER (WUHAN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CATARC AUTOMOTIVE TEST CENTER (WUHAN) CO LTD
Filing Date
2025-12-24
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

After anonymization, existing technologies cannot accurately identify theoretically anonymized regions using traditional detection models. Feature dependency fails, there is a lack of anonymized feature correlation, and the model is not robust enough, making it difficult to verify the anonymization effect and meet the requirements of ≥90% detection rate and ≤10% false detection rate of GB/T 44464-2024 standard.

Method used

A dataset of anonymized images of various types is constructed. An anonymized feature mapping model is introduced through the YOLOv5-L model. By combining cross-modal feature fusion, multiple loss functions, and a two-stage progressive training and hard example mining mechanism, the mapping relationship between anonymization processing parameters and theoretical regions is established, so as to achieve stable localization and recognition of anonymized features.

Benefits of technology

It improves the model's generalization ability under different anonymization methods, enhances robustness, achieves accurate identification and coverage evaluation of theoretical anonymization regions, meets the detection requirements of GB/T 44464-2024 standard, reduces computational costs and manual intervention, and is applicable to various anonymization processing methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121415403B_ABST
    Figure CN121415403B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of vehicle information anonymization detection, and particularly relates to a multi-type image anonymization annotation dataset construction and target coverage rate determination method. The method is based on a face and license plate image dataset with double annotation of theoretical anonymization region and anonymization features, introduces an anonymization feature extraction branch in an improved YOLOv5-L model and performs cross-modal feature fusion, combines a plurality of loss functions with theoretical anonymization region positioning loss as the core and a two-stage progressive training and difficult example mining mechanism, and realizes precise learning of the anonymization features. After normalizing the input anonymization image, the model inference obtains the theoretical anonymization region coordinates and maps them back to the original size, and through non-maximum suppression and matching of the IoU threshold, the region coverage rate is calculated to determine the positive detection, missed detection and statistical false detection rate. The application effectively overcomes the feature dependency failure and model robustness problem, and realizes high-precision, low-misjudgment anonymization detection and evaluation under various anonymization conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Construction of Multi-Type Image Anonymization Labeling Dataset and Target Coverage Determination Method Technical Field

[0001] This invention belongs to the field of vehicle information anonymization detection technology, specifically, it relates to a method for constructing multi-type image anonymization annotation datasets and determining target coverage. Background Technology

[0002] With the rapid development of intelligent connected vehicles and autonomous driving technologies, in-vehicle cameras have become an important component of vehicle environmental perception systems. While capturing road scenes, cameras inevitably capture information involving personal privacy, such as pedestrian faces and vehicle license plates. According to GB / T 44464-2024 "General Requirements for Automotive Data," automotive manufacturers and related testing institutions must anonymize image areas involving privacy during data collection, transmission, and storage to prevent the leakage of personal information.

[0003] Common image anonymization methods include mosaic, blurring, and Gaussian filtering. These methods mask sensitive information by destroying the original image's texture and details. However, when testing agencies verify the anonymization effect, they face technical challenges: while anonymization effectively protects privacy, it also destroys the original texture, edge, and other features of faces or license plates, making it difficult for traditional detection models to accurately identify the location of the "theoretical anonymization region." This aligns with the national standard GB / T 44464-2024, "General Requirements for Automotive Data," which specifies the anonymization of the frontal head region of a natural person in image data. The standard requires the theoretical anonymization region to cover the area between the upper edge of the eyebrows and the jawline, and between the left and right ears (excluding the ears). It also specifies the anonymization region for vehicle license plates as the smallest rectangle or rotated rectangle formed by the outer edges of the license plate target.

[0004] The shortcomings of existing technologies are mainly reflected in the following aspects:

[0005] 1. Feature Dependency Failure Problem: Traditional face or license plate detection algorithms (such as YOLO, MTCNN, etc.) mainly rely on texture features and edge details in the original image, such as the facial contours and character boundaries of the license plate. When these areas are pixelated or blurred, the feature information is severely weakened or disappeared, the model's recognition performance deteriorates, and it becomes impossible to accurately locate theoretically anonymized regions, thus failing to determine whether the anonymization process has covered sensitive information.

[0006] 2. Lack of anonymization feature association: Existing datasets typically only label "theoretical regions" or "anonymized regions," without establishing a mapping relationship between anonymization parameters (such as the number of mosaic blocks, blur radius, etc.) and the location of the theoretical regions. During training, the model cannot learn the correspondence between anonymization and the original regions, resulting in an inability to adaptively identify different anonymization parameters.

[0007] 3. Insufficient Model Robustness: When the anonymization level is high (e.g., high blur or large mosaic size), the generalization ability of existing models decreases, and the recognition accuracy drops sharply. In extreme scenarios, the model may even be unable to distinguish between the background and the anonymized area, resulting in a significant increase in false negative and false positive rates. For example, when an image undergoes Gaussian blur or mean blur processing, and the blur radius is set too large (e.g., radius ≥ 20 pixels), the grayscale gradient of the target area tends to be consistent with the surrounding background, and the boundary transition becomes blurred. At this time, traditional gradient-based or edge-detection-based algorithms (such as YOLO, SSD) cannot effectively extract features, causing the model to be unable to determine whether the area belongs to the anonymized face or license plate area. Furthermore, when the mosaic block size is too large (e.g., 16×16 or 32×32 pixel blocks), the original structure is completely lost, and the anonymized area exhibits planar color block features similar to background buildings, car bodies, etc. Especially when the vehicle body color is close to a grayscale background (such as a silver-gray vehicle), the model is prone to misidentifying the license plate mosaic as a normal reflective area of ​​the vehicle body, resulting in missed detection.

[0008] Meanwhile, according to GB / T 44464-2024, the detection rate for anonymization effectiveness verification should be ≥90%, and the false detection rate should be ≤10%. However, existing technologies have not yet proposed an effective and adaptable detection scheme based on "accurate identification of theoretical regions after anonymization." Most methods require complex multi-model combinations or feature restoration methods, resulting in high computational costs, poor versatility, and hindering their application by testing institutions in standardized processes.

[0009] Therefore, there is an urgent need for a technical solution that can still accurately identify theoretically anonymized regions after anonymization. Through a lightweight model structure and feature supplementation mechanism, it is possible to achieve rapid assessment of missed and false detections while ensuring detection accuracy, so as to meet standard requirements and adapt to various anonymization processing methods. Summary of the Invention

[0010] To address the challenges of identifying theoretical regions after anonymization, feature dependency failure, lack of correlation among anonymization parameters, and insufficient robustness of detection results in existing technologies, this invention provides a method for constructing multi-type image anonymization annotation datasets and determining target coverage. This method targets anonymized (including mosaic, solid color block filling, Gaussian blur, etc.) regions of human faces and vehicle license plates in images captured by vehicle cameras. By introducing an anonymization feature mapping model, it establishes the correlation between anonymization parameters (such as the number of mosaic blocks, blur radius, and filling method) and theoretical region features. This enables the model to maintain stable localization capabilities even when texture and edge information are missing. Furthermore, by combining multi-scale structural information and contextual features, the robustness of the model to different anonymization methods (especially high blurriness and large-size mosaics) is enhanced.

[0011] This invention provides a method for constructing multi-type image anonymization annotation datasets and determining target coverage, the method comprising:

[0012] Step 1: Obtain and construct a dataset of original face and license plate images containing double annotations of theoretical anonymized regions and anonymized features;

[0013] Step 2: In the YOLOv5-L model, feature extraction branches with anonymization are set and cross-modal feature fusion is performed. Combined with a multi-loss function configuration based on theoretical anonymized region localization loss and a two-stage progressive training and hard example mining mechanism, features of theoretical anonymized regions are learned and labeled.

[0014] Step 3: Normalize the input anonymized image, perform model inference to obtain the coordinates of the theoretical anonymized region and map them back to the original size, implement non-maximum suppression based on the preset IoU threshold and complete target matching with the maximum IoU, and then calculate the region occlusion rate to determine positive detection, false negative detection and statistically analyze the false detection rate.

[0015] In a preferred implementation, step 1 further includes:

[0016] Step 1.1: Obtain the original image captured by the vehicle-mounted camera in the road scene, which already contains the theoretical anonymity region of the face and license plate as required by the standard, and its coordinate annotations;

[0017] Step 1.2: Configure the anonymization method and processing rules for the theoretical anonymization region of each sample to be processed, and generate a double label consisting of spatial label and processing rule label to establish the mapping relationship between the anonymization parameters and the features of the theoretical anonymization region;

[0018] Step 1.3: Manually define some unprocessed areas within the theoretical anonymity area as missed detection samples, and manually define some incorrectly processed areas outside the theoretical anonymity area as false detection samples, thus forming corresponding abnormal sample labels;

[0019] Step 1.4: Divide the image data containing multiple types of anonymized samples and abnormal samples into training set, validation set and test set according to the proportion, and expand the data through random augmentation strategy to form a complete original image dataset of faces and license plates containing theoretical anonymized region annotations and anonymized feature double annotations.

[0020] In the preferred implementation, further, in step 1.2, the spatial annotation includes the type of theoretical anonymized region and the set of coordinate points of the theoretical anonymized region, and the processing rule annotation includes the anonymization method and the parameters corresponding to each anonymization method.

[0021] In the preferred implementation, step 1.3 further divides the number of missed samples and false positive samples into 5% of the total sample proportion.

[0022] In a preferred implementation, step 2 further includes:

[0023] Step 2.1: In the backbone network of the YOLOv5-L model, set up feature extraction branches for three types of anonymization methods: mosaic, solid color block and Gaussian blur, and configure a cross-modal feature fusion layer. Set up an output layer for extracting the boundary features of the anonymization region and the coordinates and processing parameters of the theoretical anonymization region.

[0024] Step 2.2: The loss function for feature recognition and localization calculation within the theoretical anonymized region is constructed by mainly using the theoretical anonymized region localization loss, combined with the anonymization type classification loss and the anonymization parameter regression loss, and adding lightweight missed detection and false detection penalty terms.

[0025] loss function for:

[0026]

[0027] In the formula: The IoU loss is the bounding box of the theoretical region. Anonymization type classification loss; For anonymized parameter regression loss; To incur losses due to missed detections; The penalty for false positives is calculated; 0.1 and 0.05 are both weights.

[0028] Step 2.3: After completing the loss function configuration, a two-stage progressive training and hard example mining mechanism is used to learn the mapping from anonymized features to theoretical anonymized regions, perform cross-modal fusion optimization, and conduct recognition training in complex anonymized scenarios.

[0029] In the preferred implementation, further, in step 2.2, the loss function... IoU loss of the theoretical region bounding box for:

[0030]

[0031] In the formula: This represents the number of positive samples. This is the i-th predicted bounding box; The ground truth box corresponding to the i-th predicted box; For Complete IoU loss; As a dynamic adjustment factor; Let be the weighting coefficients of the boundary constraint terms; This is for edge consistency loss; For all positive samples;

[0032] Anonymized type classification loss for:

[0033]

[0034] In the formula: This represents the number of positive samples. Let be the predicted probability of the i-th sample for class c; The smoothed true label; Category weighting factor; Focal Loss Index; The true category label for sample i; For cross-entropy; As a focus mechanism; For improved classification loss;

[0035] Anonymized parameter regression loss for:

[0036]

[0037] In the formula: The regression loss is based on the basic parameters; For consistency constraints; For parameter boundary constraints; Odd-numbered kernel constraint; , , These are the weights corresponding to each constraint;

[0038] Penalty for missed detection for:

[0039]

[0040] In the formula: is the number of real targets in the sample image; g is the index of each real target instance traversed; For the lower j predicted anonymous region boxes; The IoU between the real target and the j-th predicted bounding box; The true target is the highest IoU among all predictions; This is the threshold for missed detections; is the sigmoid function; a is the steepness coefficient of the sigmoid function. Weighting the risks and importance of this real objective;

[0041] False detection penalty loss for:

[0042]

[0043] In the formula: The number of predicted anonymous region boxes that enter the statistics; j represents the number of predicted anonymous region boxes that are traversed; The highest IoU between the predicted anonymous region box and all real anonymous region boxes; This is the false detection threshold; is the high confidence threshold; a and b are the steepness coefficients of two sigmoid functions, where a controls the sensitivity to low IoU and b controls the sensitivity to high scores.

[0044] In the preferred implementation, further, in step 2.3, the two-stage progressive training includes a first stage of feature-to-region mapping training, used to establish the correspondence between anonymized features and theoretical regions, and a second stage of cross-modal feature fusion training, used to achieve deep fusion and robust optimization of anonymized features and original image features.

[0045] In the preferred implementation, the first stage of the training process further includes: establishing the correspondence between anonymized features and theoretical anonymized regions through feature-to-region mapping learning, forming a mapping model from feature space to region space, training the mapping model using an optimization algorithm, and achieving collaborative optimization of anonymized feature classification and region boundary localization through a multi-task joint loss function. A warm-up mechanism is introduced during the training process to gradually converge the model, and training is performed by balancing samples and aligning features for different anonymization methods.

[0046] The second stage of the training process includes: cross-modal optimization training under the condition of full network feature fusion, fusing anonymized features with original image features, updating model parameters using a dynamic learning rate adjustment mechanism and a weight smoothing mechanism, introducing an attention mechanism to achieve feature weighting, and using hard example mining and sample resampling mechanisms during the training process to retrain and optimize samples with large recognition errors.

[0047] In a preferred implementation, further, in step 2.3, the difficult example mining mechanism includes: periodically selecting samples from the training samples that meet preset conditions as difficult example samples. The preset conditions include: the cross-union ratio of the samples is lower than a first threshold or the prediction error is higher than a second threshold. The samples that meet the difficult example conditions are resampled, where typical complex samples include multi-target occlusion, strong light interference, low contrast or monochrome block scene samples. In each training cycle, according to the set resampling ratio, the selected difficult example samples are weighted and added to the dataset of the next training stage. K iterations of training are performed on the added dataset. In each iteration, the difficult example selection results are dynamically updated according to the latest training error. When a sample meets the convergence condition for several consecutive training cycles, the difficult example resampling process for that sample is stopped.

[0048] In a preferred implementation, step 3 further includes:

[0049] Step 3.1: Perform color and scale normalization on the acquired anonymized image and record the scaling and padding parameters. Input the normalized image into a model that includes object detection and parameter regression to obtain the location information, mode category and anonymization parameters of the anonymized region. Based on the recorded scaling and padding parameters, map the location information from the model input coordinate system to the original image coordinate system and output the corresponding theoretical anonymized region coordinates and its anonymization parameters.

[0050] Step 3.2: After identifying the theoretical anonymity region, lightweight calculations for positive detection, missed detection, and false detection are achieved through region coverage rate calculation.

[0051] The beneficial effects of this invention are:

[0052] First, the multi-type image anonymization annotation dataset construction and target coverage determination method of this invention constructs a dataset containing both theoretical anonymized regions and anonymized features. During the training phase, the model can simultaneously learn the mapping relationship between anonymization methods and theoretical coverage regions, thus overcoming the shortcomings of existing technologies such as missing anonymization features and the inability to establish parameter-region correspondence. This mechanism effectively improves the model's generalization and adaptability under different anonymization methods (such as mosaic, blurring, and Gaussian filtering), achieving accurate identification of theoretically anonymized regions. By introducing an anonymization feature extraction branch into the YOLOv5-L backbone network and implementing cross-modal feature fusion, the model can comprehensively consider information such as anonymization intensity, texture residue, and color distribution, compensating for the recognition difficulties caused by the loss of texture and edge features after anonymization. This mechanism enhances the model's robustness in high-blur or large-mosaic-size scenes, reducing false negatives and false positives caused by feature degradation. The method employs a multivariate loss function configuration primarily based on theoretical anonymization region localization loss, combined with a two-stage progressive training and hard example mining mechanism. This allows for rapid convergence of basic features in the early stages of model development, followed by reinforcement learning for high-difficulty samples. This training strategy improves the model's localization accuracy and stability, maintaining high detection performance even against complex backgrounds (such as silver-gray car bodies and reflective surfaces), meeting the standard requirements of GB / T 44464-2024 for a detection rate of ≥90% and a false detection rate of ≤10%. During the inference phase, the method uses IoU matching and occlusion rate calculation mechanisms to intelligently determine positive, negative, and false detections after anonymization, outputting target coverage evaluation results. This lightweight and highly automated process is suitable for detection agencies to quickly verify anonymization effects within standardized workflows, reducing manual intervention and improving detection efficiency and consistency. Because the method is based on a general detection framework (YOLOv5-L) and a custom feature fusion module, it possesses good portability and scalability. This technical solution is not only applicable to anonymized detection scenarios for faces and license plates, but can also be extended to privacy protection detection tasks for other sensitive targets (such as human bodies and document information), enabling the construction of a unified privacy compliance detection platform. In summary, this invention, by constructing a dual-labeled dataset and introducing cross-modal feature branches and a multi-stage training mechanism, solves problems such as feature dependency failure, lack of anonymized feature association, and insufficient model robustness in existing anonymization detection technologies. It achieves accurate identification and intelligent coverage evaluation of the theoretical region after anonymization, possessing advantages such as high detection accuracy, low computational cost, and standardized application.

[0053] Secondly, in the preferred implementation, the method of the present invention achieves adaptive learning and differential recognition of anonymized region detection by constructing a multi-level training and verification mechanism that includes normal samples and abnormal samples. By introducing forged and missed samples for comparative training inside and outside the theoretical anonymized region, the model can automatically learn the weak boundary differences between the anonymized region and the background region and form stable discriminative features. Combined with data augmentation and proportional allocation strategies, the model can still maintain high accuracy recognition and low false detection rate when facing different scenarios and anonymization intensities. This scheme not only improves the self-calibration and robustness of the anonymization detection model, but also dynamically optimizes the feature extraction process and reduces the impact of training sample bias on the final evaluation results.

[0054] Third, in the preferred implementation, the method of this invention introduces multiple adaptive weighted loss functions and a multi-stage training mechanism into the YOLOv5-L model, achieving fine-grained feature hierarchical learning and dynamic error balance optimization for anonymized region detection. By jointly modeling the F / PIoU loss of the theoretical region, the anonymization parameter regression loss, and the missed detection and false detection losses, the model can not only maintain high localization accuracy when anonymized features are severely lacking, but also stably identify complex scenes such as blurred edges and weakened structures. Furthermore, the introduction of dynamic IoU adjustment factors and edge consistency constraints effectively enhances the model's adaptability to different anonymization intensities and forms, achieving deep coupling of feature extraction and continuous optimization of the discrimination boundary. Compared with traditional single loss constraint models, this method improves detection accuracy, generalization robustness, and error controllability, and can achieve high-confidence intelligent determination of anonymized regions in complex vehicle images while meeting standardized detection requirements.

[0055] Fourth, in the preferred implementation, the method of this invention achieves a dynamic evolution process of the anonymized region detection model from feature mapping learning to adaptive optimization by introducing a two-stage progressive training and hard example mining mechanism. The first stage establishes a unified understanding of different anonymization forms by learning the multi-layered mapping relationship between anonymized features and theoretical regions. The second stage strengthens the model's boundary discrimination and error correction capabilities in complex scenarios, enabling the model to maintain high robustness under multi-modal feature interference. Simultaneously, the hard example mining mechanism dynamically selects high-error samples during training and strengthens their weights, making the model focus more on learning extremely anonymized samples and regions with blurred boundaries, effectively reducing the false negative and false positive rates.

[0056] Fifth, in the preferred implementation, the method of the present invention introduces color and scale normalization and parameter mapping mechanisms in the anonymized image detection stage, thereby achieving standardized expression and unified judgment of anonymized region features. This mechanism can effectively reduce feature shifts caused by differences in different camera equipment, lighting conditions, and anonymization intensity, enabling the model to obtain a structurally consistent and information-rich anonymized feature distribution at the input end. Simultaneously, by combining the recording and callback of region scaling and filling parameters, high-precision alignment of the detection results when mapping back to the original image is ensured, thus improving the matching degree between the theoretical anonymized region and the actual detection results. Furthermore, through the quantitative calculation of region coverage and the dynamic evaluation of false detection rate and false negative rate, the traceability and consistency of detection accuracy and evaluation results are achieved. Attached Figure Description

[0057] Figure 1 is a flowchart of the method for constructing multi-type image anonymization annotation datasets and determining target coverage provided in an embodiment of the present invention;

[0058] Figure 2 is a schematic diagram of the face bounding box as defined in the GB / T 44464-2024 standard according to an embodiment of the present invention. Detailed Implementation

[0059] To enable those skilled in the art to better understand the technical solutions of this application, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0060] The directional terms such as above, below, left, right, front, and back used in this application are based on the positional relationships shown in the attached drawings. Different attached drawings may result in different positional relationships, therefore they should not be interpreted as limitations on the scope of protection.

[0061] In this application, the terms "installation," "connection," "interlocking," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, an integral connection, a mechanical connection, an electrical connection, or a connection that allows communication between components. They can also refer to a direct connection or an indirect connection through an intermediate medium. They can refer to the internal connection of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in this application can be understood according to the specific circumstances.

[0062] This invention provides a method for constructing multi-type image anonymized annotation datasets and determining target coverage. This method is applicable to face and license plate images anonymized using techniques such as mosaic, solid color blocks, or Gaussian blurring. Even when anonymization features severely damage the original texture, it achieves accurate identification of theoretically anonymized regions, fundamentally solving problems such as feature failure and inaccurate region identification caused by anonymization in existing technologies. In its implementation, this invention focuses on "accurate identification of theoretically anonymized regions" as its core objective, constructing a lightweight technical path that can be used for standardized detection and verification. This approach includes: constructing a dual-labeled dataset of theoretical regions and anonymized features, establishing a mapping relationship between theoretical targets and anonymization processing parameters (such as mosaic block size, blur radius, fill color, etc.), enabling the model to simultaneously learn spatial location features and anonymized representation features; training an anonymized feature perception model, introducing a feature residual enhancement module and an anonymized feature domain adaptive mechanism, enabling the model to extract regional structural information even in the absence of original textures; accurate identification of theoretical regions, achieving high-precision detection and localization of anonymized target regions; and lightweight adaptation for missed detections and false detections, performing coverage evaluation and intelligent judgment of correct and false detections based on the identification results, forming quantitative indicators that can be used for verification by testing institutions. Through the above technical approach, this invention not only improves the recognition accuracy and robustness of theoretical regions in anonymized scenarios but also completes compliance verification of detection results with low computational overhead, meeting the standard requirements of GB / T 44464-2024 for anonymization detection rate and false detection rate, providing an efficient and scalable intelligent technical solution for privacy protection detection of automotive video data.

[0063] Example

[0064] As shown in Figure 1 of the specification, the method for constructing multi-type image anonymized annotation datasets and determining target coverage is based on the "face / license plate theoretical anonymized region recognition method." It accurately identifies the theoretical anonymized regions of faces and license plates in vehicle images, solving the recognition failure problem caused by feature destruction due to anonymization. It also supports detection indicators compliant with GB / T 44464-2024 standards and can be used for automotive data privacy protection compliance testing. This method includes:

[0065] Step 1: Obtain and construct a dataset of original face and license plate images containing double annotations of theoretical anonymized regions and anonymized features.

[0066] The purpose of step 1 is to establish the correlation between anonymization processing feature parameters and theoretical region locations by constructing a dataset of original face and license plate images containing both theoretical anonymized regions and anonymized features. This provides a training basis and judgment benchmark for the model to accurately identify theoretical anonymized regions even when anonymized features are missing.

[0067] Specifically, step 1 includes:

[0068] Step 1.1: Obtain the original image captured by the vehicle-mounted camera in the road scene, which already contains the theoretical anonymity region of the face and license plate as required by the standard, and its coordinate annotation.

[0069] It should be noted that in this invention, the theoretical anonymization regions in the original image are marked with rectangular boxes according to the GB / T 44464-2024 standard. Pixels within the rectangular boxes are all raw data without any anonymization operations, i.e., without any processing such as mosaic or Gaussian blur. These rectangular box markings serve as the baseline ground truth for subsequent anonymization effect evaluation, used to calculate the coverage of the theoretical region and determine false positives (processed outside the theory) and false negatives (unprocessed within the theory) in the anonymization result. To ensure the reliability of the evaluation, the included data must meet quality requirements such as image clarity, sufficient contrast, and well-defined theoretical region boundaries, thus providing a reliable benchmark for reverse localization and accurate evaluation after anonymization processing.

[0070] Face samples were obtained from 13,000 road scene images showing natural-looking faces. The images cover different poses, including frontal, side, head-down, and head-back poses. The shooting distance and scale include multiple scales, including close-up and distant views. The lighting includes daytime, evening, nighttime, front lighting, backlighting, and shadow occlusion. The scene conditions include sunny, cloudy, rainy, and slightly motion-blurred images with controllable settings.

[0071] As shown in Figure 2 of the instruction manual, the theoretical face region in the face sample is a rectangular area between the upper edge of the eyebrow and the jawline, and between the left and right ears (excluding the ears). This theoretical anonymous face region is denoted as coordinate G.

[0072] The license plate sample was obtained from 5,000 road scene images, covering vehicle license plates, including blue plates, yellow plates, and new energy vehicles. The license plate angles ranged from horizontal to tilted 0°-30°, and the degree of soiling included: no soiling and slight soiling (including light mud spots and slight reflections). The theoretical anonymization region of the license plate sample is defined as the smallest rectangular or rotated rectangular region formed by the outer edges of the vehicle license plate target, denoted by coordinate L.

[0073] Step 1.2: Configure the anonymization method and processing rules for the theoretical anonymization region of each sample to be processed, and generate a dual label consisting of spatial label and processing rule label to establish a mapping relationship between the anonymization parameters and the features of the theoretical anonymization region.

[0074] Anonymization is performed only within the theoretical anonymization region, which is already defined by the theoretical anonymization region annotation in the original image obtained in step 1.1. Since the original image obtained in step 1.1 only contains the coordinates of the theoretical anonymization region, the anonymization method cannot be reproduced; only the processing parameters are set, and the scope of application is unknown. Therefore, this invention requires that each sample to be processed must generate a double annotation. Double annotation refers to generating two types of synchronous records for each image to be processed during the anonymization process to fully describe the spatial scope and processing method of the anonymization operation. The spatial annotation refers to the spatial location where the anonymization operation takes place, i.e., the theoretical anonymization region, including the region type and the set of coordinate points (x, y). The processing rule annotation specifies the anonymization method and its parameters used within this theoretical anonymization region, i.e., the processing rule, including the anonymization method and core parameters (such as M, N, σ, RGB values). Double annotation allows for simultaneous recording of location and method, ensuring that the results are reproducible and verifiable. By establishing a mapping between anonymization parameters and theoretical anonymization region features through double labeling, the system can automatically optimize parameter selection for subsequent samples by analyzing the relationship between the features of different regions (such as faces and license plates) and the selected parameters. This is the key to model learning. In addition, subsequent models can use the double labeling of existing samples for parameter recommendation or automatic anonymization decision training.

[0075] Specifically, each core sample is anonymized using three mainstream methods: mosaic, solid color block filling, and Gaussian blur. The anonymization feature parameters are carefully recorded to ensure the model learns the mapping between theoretically anonymized region features and anonymization parameters, as shown in Table 1.

[0076] Table 1

[0077]

[0078] In Table 1, the processing rules define M / N in the mosaic anonymization method as representing the number of rows and columns (or block density) of the mosaic blocks. Larger M and N values ​​result in smaller blocks and more image detail retention, while smaller values ​​lead to higher blurriness. The value range is [5, 30], determined through iterative optimization. s represents the pixel interval between mosaic blocks, used to control the smoothness and recognizability between adjacent blocks. The value range is [0, 2] pixels, with s=0 indicating seamless stitching. The mosaic method primarily balances concealment and recognizability by adjusting the number of blocks M / N and the inter-block interval s. In the solid color block fill anonymization method, R, G, and B represent the red, green, and blue components of the fill color, respectively, ranging from [50, 200], used to determine the fill block color. Adjusting the RGB values ​​controls the brightness of the filled area and the background contrast (should be ≥3:1). The solid color block fill method ensures concealment while maintaining contrast with the background color by selecting appropriate RGB values. In Gaussian blur anonymization, k represents the Gaussian convolution kernel size (must be an odd number). A larger k value results in a wider blur range; typical values ​​are [3, 15]. σ represents the standard deviation of the Gaussian distribution, controlling the blur intensity. A larger σ value results in more pronounced blur; typical values ​​are [1, 5]. Gaussian blur controls the blur intensity by adjusting the kernel size k and standard deviation σ, making it suitable for gentle anonymization needs. In the double-annotation content, the F / P coordinates are double-annotation items. F represents the "feature point" in the image, and P represents the "pixel point," used to accurately pinpoint the spatial location of the theoretical anonymization region. This item is included in both double annotations to establish the mapping relationship between spatial location and processing parameters.

[0079] For each sample to be processed, the system sequentially performs the following processes for its theoretical anonymization region: Extracting the theoretical anonymization region from the image sample to be processed, obtaining its spatial coordinate information (F / P coordinates), and forming spatial annotations. Based on the region type and privacy protection level, three mainstream anonymization methods (mosaic, solid color block filling, and Gaussian blur) are selected. Initial parameters are determined based on industry experience (such as anonymization standards for car manufacturers) as the starting point for parameter optimization. Core parameters are optimized through a substitution method, using the parameter range defined in Table 1 as a basis, and different parameter combinations (such as M = 5 / 10 / 15 / 20 / 30) are tested. The recognition index within the theoretical anonymization region is calculated, and the parameter group is selected under the condition of "sufficient privacy protection and optimal image information preservation." The final parameter range is determined as follows: number of mosaic blocks M / N ∈ [5,30]; standard deviation of Gaussian blur σ ∈ [1,5]. After determining the optimal anonymization method and parameters, the system stores the coordinates of the theoretical anonymized region (spatial annotation), the corresponding anonymization method, and processing parameters (processing rule annotation) in a key-value mapping format, forming a double-annotation. This establishes a correspondence between "anonymization parameters and theoretical anonymized region features," which is used for model learning and subsequent batch anonymization adaptation. The double-annotated data is written to the anonymization metadata table and used for subsequent model training, forming a closed loop of parameter self-learning and dynamic optimization.

[0080] Step 1.3: Manually define some unprocessed areas within the theoretical anonymity area as missed detection samples, and manually define some incorrectly processed areas outside the theoretical anonymity area as false detection samples, thus forming corresponding abnormal sample labels.

[0081] After completing the automatic identification and parameter optimization of the theoretical anonymization region (after step 1.2), in order to enhance the robustness and generalization ability of the model training data, this step manually constructs false negative and false positive scenario samples to supplement the dataset and simulate the possible biases that may occur in actual anonymization detection.

[0082] Missed detection samples are used to train or validate the model's "missed detection capability," that is, to identify portions of theoretically anonymized regions that have not been fully anonymized. The process of generating missed detection samples includes: randomly selecting a certain proportion (approximately 5% of the total samples) from the already generated theoretically anonymized regions, ensuring that different types of targets (such as faces, license plates, and brand logos) are covered; randomly delineating 10%-50% of the area within the theoretically anonymized regions without anonymization, forming regions with partially residual identifiable information; and labeling the regions as theoretical regions and missed detection regions. In the dual-label structure, to distinguish the special attributes of this type of sample, a region type identifier field is added, where the "region_type" field is assigned the value "leak" to indicate that the region belongs to the missed detection region.

[0083] False positive samples are used to simulate situations where the system mistakenly identifies ordinary regions as sensitive regions, helping the model learn its "false positive sample filtering" ability. The false positive sample generation process includes: extracting another portion from the original image samples, approximately 5% of the total samples; randomly selecting several small regions outside the theoretical anonymization region (the area outside the theoretical anonymization region generally does not exceed 5% of the total area of ​​the original image, and 0% of the area within the theoretical anonymization region is not processed), and incorrectly applying anonymization processing (such as blurring, mosaicking, filling, etc.) to them; and labeling the regions as theoretical regions and false positive regions. In the double-label structure, to distinguish the attributes of false positive samples, a region type identifier field is added, where the field "region_type" is assigned the value "false_positive" to indicate that the region belongs to the false positive region.

[0084] In step 1.3, the sample proportions are divided as follows: 90% core samples (processed according to the standard procedure in step 1.2, i.e., double labeling: theoretical region and parameter labeling), 5% missed samples (unprocessed portions within the theoretical region, labeled with both theoretical and missed regions), and 5% false positive samples (misprocessed portions outside the theoretical region, labeled with both theoretical and false positive regions). The total number of missed and false positive samples is maintained at approximately 10% of the training set, serving as a feature sample set to enhance the model's anomaly detection capabilities. Through manually controlled missed and false positive samples, the model can learn more about the distribution of anomalies in real-world applications. This is compatible with the double labeling mechanism in step 1.2, forming a labeling system encompassing spatial labeling, parameter labeling, and error type labeling.

[0085] Step 1.4: Divide the image data containing multiple types of anonymized samples and abnormal samples into training set, validation set and test set according to the proportion, and expand the data through random augmentation strategy to form a complete original image dataset of faces and license plates containing theoretical anonymized region annotations and anonymized feature double annotations.

[0086] After generating anonymized samples (including normal samples, missed detection samples, and false detection samples), the data needs to be scientifically partitioned and augmented to construct a balanced, feature-rich, and robust training, validation, and test set. This step aims to ensure a balanced distribution of different anonymization methods and anomalous samples, improve the model's generalization ability through random augmentation, and prevent data leakage or overfitting.

[0087] The dataset contains core samples processed by three anonymization methods (mosaic, solid color block filling, and Gaussian blur), as well as manually constructed missed and false detection samples. Each sample is accompanied by double annotation information (spatial annotation + processing rule annotation).

[0088] Based on the total number of samples and the complexity of the task, the dataset is divided into:

[0089] Training set:Validation set:Test set = 7:2:1 (1)

[0090] The training set is used for learning model parameters, the validation set is used for intermediate parameter tuning, and the test set is used for final performance evaluation.

[0091] When dividing the samples, ensure that the proportion of samples with different anonymization methods is consistent in each subset, and that the proportion of each type of abnormal sample (missed detection, false detection) is evenly distributed at approximately 10% of the total.

[0092] Mild random augmentation is applied to the core samples (i.e., normally anonymized samples) to improve the model's adaptability to environmental changes. Augmentation operations include random horizontal or vertical flipping, random brightness perturbation (amplitude ±20%), and mild rotation (within ±10°). This augmentation is performed only without destroying the structure and boundary information of the anonymized regions, ensuring that core features are not distorted. The final partitioning and augmented dataset structure are written to an index file, recording the type, augmentation state, and cluster to which each sample belongs.

[0093] Step 2: In the YOLOv5-L model, feature extraction branches with anonymization are set up and cross-modal feature fusion is performed. Combined with a multi-loss function configuration based on theoretical anonymized region localization loss and a two-stage progressive training and hard example mining mechanism, features of theoretical anonymized regions are learned and labeled.

[0094] The purpose of step 2 is to enable the model not only to identify the target object itself, but also to automatically understand and accurately label the correlation between anonymized features and theoretical anonymized regions. By introducing anonymization feature branches, cross-modal feature fusion, and progressive training into the YOLOv5-L detection framework, the model can learn to recognize the feature representations of different anonymization methods (such as mosaic, solid color fill, and Gaussian blur), establish a mapping between theoretical anonymized regions (manually or rule-based annotations) and model-perceived features, and improve the model's ability to locate, identify, and discriminate in anonymized scenarios, laying the foundation for automatic detection and adaptive processing of anonymized samples.

[0095] Specifically, step 2 includes:

[0096] Step 2.1: In the backbone network of the YOLOv5-L model, set up feature extraction branches for three types of anonymization methods: mosaic, solid color block, and Gaussian blur, and configure a cross-modal feature fusion layer. Set up an output layer for extracting the boundary features of the anonymization region and the coordinates and processing parameters of the theoretical anonymization region.

[0097] Based on the YOLOv5-L model, this paper modifies it. YOLOv5-L is the "Large" version of the YOLOv5 series, consisting of four core modules: Input layer: image preprocessing and size normalization; Backbone network: responsible for extracting multi-level features from the original image; Neck: such as PAN-FPN, used for multi-scale feature fusion; Head: outputs the bounding box, category, and confidence score of the target. The backbone network is the core of feature extraction in the entire YOLOv5-L model, directly affecting the model's ability to perceive different patterns (texture, edge, color, blur). In YOLOv5-L, the backbone network uses CSPDarknet53 (Cross Stage Partial Darknet) by default.

[0098] In this step, the YOLOv5-L backbone network undergoes structural optimization and functional enhancement, forming the following relationship: The backbone network is the basic feature extraction layer, retaining the original CSPDarknet structure of YOLOv5-L, strengthening low-level edge feature extraction, and facilitating the adaptation of residual region boundaries after anonymization; the anonymization feature branch is attached to the middle layer of the backbone (C3_8 / C3_16), that is, three dedicated anonymization perceptual sub-branches (mosaic, solid color block, Gaussian blur) are added after the backbone output; the backbone output simultaneously enters PAN-FPN and the cross-modal fusion layer, which fuses the original features and anonymized features to generate an enhanced theoretical anonymized region representation.

[0099] Three anonymization methods are constructed for feature extraction branches: a mosaic feature sub-branch (3×3 convolutions) to enhance the response to grids formed by periodic block textures and inter-block intervals s; a solid color block feature sub-branch (2×1 convolutions) to strengthen the boundaries of regions with color abrupt changes (such as the edge between fill color and skin color); and a Gaussian blur feature sub-branch (1×5 convolution) to extract the gradient smoothing boundaries of blurred regions (such as grayscale changes at blurred edges). The three branches are constructed in parallel at stride=8 and stride=16, with the output channel unified as C_branch, and then fed into cross-modal fusion.

[0100] Configure a cross-modal feature fusion layer: weighted fusion of anonymized features and contour features of the original image (such as face head contour and license plate border) (anonymized feature weight 0.4, contour feature weight 0.6, obtained through iterative training after initial values) to improve the accuracy of theoretical region boundary localization.

[0101] The output layer is the result aggregation and inference module of the entire anonymization feature learning model, mainly responsible for the comprehensive output of "theoretical anonymization region identification results and anonymization processing parameters". Its design goal is to enable the model to accurately provide the spatial coordinates (F / P coordinates) of the theoretical anonymization region during the inference stage, simultaneously predict the corresponding anonymization processing method and key parameters, and statistically output the detection accuracy (positive detection), false negative rate, and false positive rate, providing a basis for model performance evaluation.

[0102] The output layer of this step consists of three sub-branches, corresponding to three types of output information: region localization, parametric regression, and result evaluation. The region localization branch outputs the coordinates F / P (Frame / Point) of the theoretical anonymization region in the form of bounding box parameters (x, y, w, h), representing the specific spatial location of the anonymized region determined by the model in the image. The parametric regression branch outputs the anonymization processing method and core parameters in the form of [method type, parameter value] (e.g., [Mosaic, M=15, N=20]), representing the anonymization processing type predicted by the model and its corresponding parameters. The detection evaluation branch outputs the positive detection rate, false negative rate, and false positive rate in the form of probability or proportion values, used for model performance statistics, supporting automatic evaluation and dynamic tuning during training.

[0103] Step 2.2: The loss function for feature recognition and localization calculation within the theoretical anonymized region is constructed by mainly using the theoretical anonymized region localization loss, combined with the anonymization type classification loss and the anonymization parameter regression loss, and by adding lightweight missed detection and false detection penalty terms.

[0104] The loss function for feature recognition and localization calculation within the theoretically anonymous region is:

[0105] (2)

[0106] In the formula: The IoU loss is the theoretical region bounding box loss, which measures the deviation between the anonymized region boundary predicted by the model and the true theoretical anonymized region. It is the dominant term in the overall loss. Anonymization type classification loss is used to determine the anonymization method of the predicted region (mosaic, solid color block, Gaussian blur). The regression loss for anonymization parameters is used to constrain the regression error of the core parameters for each anonymization method (such as M, N, s for mosaic, k, σ for Gaussian blur, and R, G, B for solid color blocks). This is the missed detection penalty loss, used to penalize theoretically anonymous regions that the model fails to detect. The false detection penalty loss is used to penalize pseudo-anonymous regions that the model incorrectly detects; 0.1 and 0.05 are both weights, where 0.1 is used to balance the influence of primary and secondary tasks, and 0.05 is used for auxiliary regularization.

[0107] Among them, the theoretical region boundary box localization loss for:

[0108] (3)

[0109] In the formula: The number of positive samples, i.e. the number of candidate boxes that match the target, is used as a normalization factor to prevent gradient imbalance caused by differences in the number of samples. This is the i-th predicted bounding box; The ground truth box corresponding to the i-th predicted box; This is used to calculate the CIoU (Complete IoU) metric between the two, thereby measuring the positioning error; The Complete IoU loss comprehensively considers the differences in overlap rate, center point distance, and aspect ratio, reflecting the geometric differences between the predicted box and the ground truth box more comprehensively than simple IoU. As a dynamic adjustment factor, the weight of the exponent is adaptively changed according to the IoU value. When IoU is low (difficult example), 1−CIoU is large, making Larger values ​​increase the loss weight for difficult examples; when IoU is high (easy examples), Smaller, thus reducing the influence of already fitted samples, parameters Adjusting the hyperparameters of the adaptive factor's variation range controls the degree of focusing; These are the weighting coefficients for the boundary constraint terms, used to control the edge alignment loss. The proportion of overall positioning loss; This is the edge consistency loss, used to constrain the consistency between the predicted bounding box and the ground truth bounding box at their boundary locations; The core idea is to introduce an adaptive weighted exponent on the localization loss for all positive samples, i.e., the predicted bounding boxes that detect the target. This is based on CloU (Complete IoU). We will use weighted focusing on difficult examples.

[0110] In formula (3), edge alignment loss for:

[0111] (4)

[0112] In the formula: The set of pixels for the entire image region is used to normalize the loss. To prevent scale effects; It is a Gaussian smoothing operator; , These are the ground truth bounding boxes and the predicted anonymous region boxes, respectively. Gradient operators are used to extract image edges; The absolute values ​​of the gradient differences between the two edges are summed. , Gaussian convolutions for predicting anonymous regions and truly anonymous regions; - The difference between the predicted edge and the true edge is calculated. If the predicted edge coincides with the true edge, the difference is close to zero.

[0113] Anonymized type classification loss for:

[0114] (5)

[0115] In the formula: The number of positive samples, i.e. the number of candidate boxes that match the target, is used as a normalization factor to prevent gradient imbalance caused by differences in the number of samples. Given a set of positive samples, only calculate the classification loss for positive samples where the target box is successfully matched; Let be the predicted probability of the i-th sample for class c; The smoothed true label; This is a category weighting factor, set according to the frequency of samples in each category, used to alleviate category imbalance; Focal Loss index is used to control the weighting of easy and difficult samples, emphasizing samples that are difficult to classify. Let be the true class label of sample i, used to select the target class probability; The Cross Entropy Loss term is used to calculate the distance between the predicted anonymous region box and the ground truth anonymous region box. This is a focus mechanism used to reduce the weight of easily classified samples and increase the influence of difficult-to-classify samples. When the prediction probability is high (for easily classified samples), This term is close to 0. When the predicted probability is low (difficult-to-classify samples), this term increases, amplifying the loss. The improved classification loss, i.e., the weighted classification loss of positive samples, is used to measure the prediction bias of the model in multi-class classification tasks.

[0116] Anonymized parameter regression loss for:

[0117] (6)

[0118] In the formula: The regression loss (numerical accuracy) is based on the basic parameters. For consistency constraints (image consistency); For parameter boundary constraints (to prevent out-of-bounds access); Odd kernel constraint (Gaussian kernel regularization); , , These are the weights corresponding to each constraint.

[0119] In formula (6), the regression loss of the basic parameters for:

[0120] (7)

[0121] In the formula: is the number of positive samples; i is the sample index; p is the parameter dimension index (such as fuzzy radius, block size, etc.); The parameter value is for the real anonymous region; Predict parameters for the anonymized region for the model; A smooth L1 loss function is used (using a squared penalty for small errors and a linear penalty for large errors) to improve robustness.

[0122] In formula (6), the parameter boundary constraints for:

[0123] (8)

[0124] In the formula: is the number of positive samples; i is the sample index; p is the parameter dimension index of the i-th sample (such as mosaic size, solid color brightness, Gaussian σ, etc.). Output the predicted parameter value for the i-th anonymized region to the model; In the middle, if If the value is greater than 1, a positive penalty is applied (exceeding the upper bound); otherwise, the value is 0. In the middle, if A value less than 0 results in a positive penalty (beyond the lower bound); otherwise, the value is 0. Only when... It will only be penalized when it falls within the range; if it falls within the range, the cost is 0.

[0125] In formula (6), the odd-numbered kernel constraint term for:

[0126]

[0127] In the formula: is the number of positive samples; i is the sample index; This is an indicator function, which takes the value 1 only when the anonymization method of the i-th sample is Gaussian blur, and 0 otherwise; Let be the Gaussian kernel size predicted by the model for the i-th sample; For the set of allowed odd-numbered kernels; For calculation The distance to the nearest odd kernel is smaller the closer it is to an odd kernel, and is 0 when it is exactly equal to an odd kernel.

[0128] In formula (6), the consistency constraint term for:

[0129]

[0130] In the formula: This represents the number of positive samples. The set of positive samples; The indicator function takes the value 1 when the anonymization method of sample i is of the specified type, and takes the value 0 otherwise. In this way, each sample only activates the consistency loss that matches its method. The anonymized class label (mosaic, solid, gauss) for sample i; For mosaic consistency, the predicted block size and step size should be consistent with the dominant frequencies of the image in the x and y directions; For solid color consistency, the predicted solid color coverage intensity and brightness should provide sufficient contrast with the surrounding background; For Gaussian consistency, the predicted Gaussian blur intensity should match the degree of edge attenuation of the image.

[0131] Formula (10) uses different consistency loss functions according to different anonymization types (mosaic, solid color, Gaussian blur), with the goal of keeping the prediction parameters consistent with the statistical characteristics of the image. The formula aligns the predicted parameters and generated statistical features with the statistical features of the real image: mosaic aligns with the dominant frequency in the frequency domain, solid aligns with brightness contrast, and gauss aligns with edge energy and sharpness. This ensures that the parameters are not only numerically reasonable but also consistent with visual performance, thus improving robustness and interpretability.

[0132] Furthermore, in formula (10), mosaic consistency for:

[0133]

[0134] In the formula: The fundamental frequency is extracted in the x and y directions by FFT or autocorrelation, reflecting the periodicity of the mosaic blocks in a certain direction. The smaller the block size, the higher the fundamental frequency. , The dominant frequencies in the x and y directions are calculated from the observed images; , The expected frequency is derived from the mosaic parameters (such as block size / sampling step size) predicted by the model.

[0135] Solid color consistency for:

[0136]

[0137] In the formula: This is the lower limit threshold for contrast ratio, with common values ​​being ≥3:1; To predict the contrast between a solid color occlusion and its neighboring background; The color and brightness of the solid color blocks predicted by the model; The background brightness and color of the target neighborhood; If the true contrast is greater than or equal to the threshold, no penalty is imposed; otherwise, a linear penalty is imposed for insufficient contrast.

[0138] Gaussian consistency for:

[0139]

[0140] In the formula: The standard deviation of the Gaussian blur (blur intensity) predicted by the model. The edge energy and sharpness metrics, such as Laplacian variance, are estimated from observed images; the sharper the edge, the larger the value.

[0141] Substituting formulas (11)-(13) into formula (10) yields:

[0142]

[0143] Furthermore, the penalty loss for missed detection in formula (2) for:

[0144]

[0145] In the formula: The number of real targets in the sample image is normalized; g is the index for traversing each real target instance; For the lower j predicted anonymous region boxes; The IoU between the real target and the j-th predicted bounding box; The true target is the highest IoU among all predictions; This is the threshold for missed detections. If the maximum IoU between a real target and all predictions is below this threshold, it is considered a possible missed detection. For sigmoid, the hard indicator of "whether a detection is missed" is transformed into a soft indicator for backpropagation; 'a' is the steepness coefficient of sigmoid, the larger the value, the closer it is to a 0 / 1 step, and a common value is 10. Assign risk and importance weights to the real target (which can be set by category, size, difficulty, etc.; for example, critical categories have greater weights).

[0146] like If the brackets are positive and the sigmoid function is close to 1, it means a prediction was missed. If there is already a prediction that highly matches the prediction, the brackets are negative and the sigmoid function is close to 0.

[0147] False detection penalty loss in formula (2) for:

[0148]

[0149] In the formula: The number of predicted anonymous region boxes that enter the statistics; j represents the number of predicted anonymous region boxes that are traversed; The highest IoU between the predicted anonymous region box and all real anonymous region boxes; This is the false positive threshold. If the highest IoU between the predicted region and any real anonymous region is lower than this value, it should be considered a false positive. To predict the confidence level of anonymous region boxes; For high confidence thresholds, only those higher than [the specified threshold] are considered. The predictions are more likely to incorporate false positive penalties; a and b are the steepness coefficients of two sigmoid functions, where a controls the sensitivity to low IoU and b controls the sensitivity to high scores.

[0150] Substituting formulas (3), (5), (15), and (16) into formula (6), we obtain the final loss function for feature recognition and localization calculation within the theoretical anonymous region:

[0151]

[0152]

[0153]

[0154]

[0155] (17)

[0156] Step 2.3: After completing the loss function configuration, a two-stage progressive training and hard example mining mechanism is used to learn the mapping from anonymized features to theoretical anonymized regions, perform cross-modal fusion optimization, and conduct recognition training in complex anonymized scenarios.

[0157] To ensure the model can progressively establish a mapping relationship from anonymized features to theoretical anonymized regions and maintain high recognition accuracy in complex anonymization scenarios, a two-stage progressive training mechanism is adopted: a "core training stage" and a "fine-tuning optimization stage." This achieves gradual optimization from feature learning to cross-modal fusion and scene generalization. The first stage is feature-to-region mapping training, used to establish the correspondence between anonymized features and theoretical regions. The second stage is cross-modal feature fusion training, used to achieve deep fusion and robust optimization of anonymized features and original image features.

[0158] The first stage of the training process includes: establishing the correspondence between anonymized features and theoretical anonymized regions through feature-to-region mapping learning, forming a mapping model from feature space to region space, training the mapping model using optimization algorithms, and achieving collaborative optimization of anonymized feature classification and region boundary localization through a multi-task joint loss function. A warm-up mechanism is introduced during the training process to gradually converge the model, and training is conducted through sample balancing and feature alignment for different anonymization methods.

[0159] Specifically, in the first stage, the core training stage (Feature-to-Region mapping learning), the main goal is to learn the correspondence between anonymized features and theoretical anonymized regions, establishing preliminary region localization capabilities and anonymization method recognition capabilities. The parameters of the first 50 layers of the backbone network are frozen, and only the anonymized feature extraction branch, the output of the cross-modal fusion layer, and the final detection head are trained; this prevents low-level features from being prematurely perturbed, ensuring the stability of the anonymized feature mapping. A warm-up mechanism is introduced: using the Adam optimizer, the initial learning rate is set to 0.001, and the batch size is 32. In the early stages of training, 3-5 rounds of linear warm-up are used to allow the model to smoothly enter the convergence phase.

[0160] A collaborative optimization of feature classification and region boundary localization is achieved through a multi-task joint loss function: the focus is on optimizing the boundary localization loss for theoretically anonymous regions. Anonymized type classification loss To mitigate the impact of parametric regression and penalty terms, the weight ratio is set to 1. 1 , , , The core objective is to achieve "theoretical region localization accuracy." Only lightweight data augmentation (scale scaling 0.8–1.2, horizontal flipping) is used to avoid damaging the texture features of anonymized regions. The model is trained by aligning samples with different anonymization methods, enabling it to accurately distinguish between different anonymization methods (mosaic, solid color, Gaussian blur) and demonstrating good theoretical anonymized region identification and boundary localization capabilities.

[0161] In this application, Phase 1 training is performed for 30 epochs or until there is no significant improvement (<0.2%) in val-mAP@0.5 (i.e., mean average precision calculated on the validation set, where the matching threshold uses IoU=0.5, and the higher val-mAP@0.5, the better the overall detection performance of the model on the validation set under the standard of IoU≥0.5). Then, the system switches to Phase 2.

[0162] The second stage of the training process includes: cross-modal optimization training under the condition of full network feature fusion, fusing anonymized features with original image features, updating model parameters using a dynamic learning rate adjustment mechanism and a weight smoothing mechanism, introducing an attention mechanism to achieve feature weighting, and using hard example mining and sample resampling mechanisms during the training process to retrain and optimize samples with large recognition errors.

[0163] Specifically, the training strategy for Phase Two is as follows: Phase Two involves unfreezing the entire network for joint optimization. In the second phase, namely the fine-tuning optimization phase (cross-modal fusion and complex scene enhancement), the aim is to unfreeze the entire network for fine-grained tuning, focusing on strengthening the learning of weights in the cross-modal fusion layer to improve the model's generalization performance in complex anonymization scenarios. All parameters of the backbone network and neck structure are unfrozen and fully participate in backpropagation, enabling joint optimization of basic features and anonymized features. The cross-modal fusion in Phase Two is implemented by outputting the anonymized feature branch. Compared with the feature branch output of the original image By splicing along the channel dimension, we obtain After channel alignment and linear mixing via 1×1 convolution, the data is fed into an SE-Gate (Squeeze-and-Excitation gate, which introduces an attention mechanism) for adaptive channel weighting to obtain the fused features. , and then Driven by detection, classification, and parameter regression heads, participating in , , The joint backtransmission achieves end-to-end optimization.

[0164] The model parameters are updated using a dynamic learning rate adjustment mechanism and a weight smoothing mechanism: a cosine annealing learning rate strategy is used, with the initial learning rate inheriting the convergence value from the previous stage (approximately...). The learning rate eventually decays to This ensures stable convergence in the later stages of training. During training, the weighted fusion of anonymized feature branches and original image contour features is enhanced, enabling the model to maintain high-precision localization even in blurred, low-contrast, or large-scale anonymized regions.

[0165] Incorporate moderate-intensity data augmentation: random brightness, color perturbation, mild noise, or blurred simulation to improve the model's robustness to complex anonymized features (such as large mosaic blocks, high-σ blur, and low-contrast solid colors). Adjust the loss weights to enhance feature and parameter regression, setting the weight ratio to 1. 1 , , , The model employs EMA (Exponential Moving Average) weight smoothing to reduce oscillations, and uses mixed precision training (AMP) and gradient clipping (threshold 1.0) to prevent gradient explosion. The model's anonymization region localization accuracy, mode recognition accuracy, and parameter regression stability are significantly improved, effectively adapting to diverse anonymization methods and complex background environments.

[0166] Dynamic optimization is achieved between the two training phases through a difficult example mining mechanism. In the second training phase, samples with IoU < 0.6 or parameter error > 20% are periodically screened. Typical complex samples (such as M = 30 × 30 large mosaic, σ = 5 Gaussian blur, low contrast solid color block) are resampled with three times the weight and re-entered into training with high weight to enhance the model's ability to identify difficult-to-detect anonymous regions and its boundary accuracy.

[0167] The difficult example mining mechanism includes: periodically selecting samples from the training samples that meet preset conditions as difficult examples. The preset conditions include: the cross-union ratio of the samples is lower than a first threshold or the prediction error is higher than a second threshold. Samples that meet the difficult example conditions are resampled. Typical complex samples include multi-target occlusion, strong light interference, low contrast or monochrome block scene samples. In each training cycle, according to the set resampling ratio, the selected difficult examples are weighted and added to the dataset of the next training stage. K iterations of training are performed on the added dataset. In each iteration, the difficult example selection results are dynamically updated according to the latest training error. When a sample meets the convergence condition for several consecutive training cycles, the difficult example resampling process for that sample is stopped.

[0168] Specifically, the hard example mining mechanism performs hard example screening and resampling every K=5 epochs after entering Phase 2, periodically selecting samples from the training samples that meet preset conditions as hard example samples. The hard example determination criteria are based on the most recent inference results in the training set, selecting samples that meet the following conditions: theoretical anonymity region IoU < 0.6 (intersection over union ratio below the first threshold), or parametric regression relative error > 20% (prediction error above the second threshold) (e.g., |M̂−M| / M > 0.2), or mode classification confidence < 0.6.

[0169] Samples meeting the criteria for difficult examples are resampled. Typical complex samples include multi-target occlusion, strong light interference, low-contrast or monochrome block scene samples. Key sample templates include: extra-large mosaic: M=30, N=30; strong blur: Gaussian blurred image with σ=5; low-contrast solid color: RGB close to the background, critical contrast (≈3:1). Difficult examples are duplicated with three times the weight and added to the next training cycle. This ensures that within each training cycle, the selected difficult examples are weighted according to the set resampling ratio and added to the dataset for the next training stage, guaranteeing the accuracy of core scenes. The above templates are used for data augmentation at regular intervals to achieve periodic iteration, ensuring that the training set continuously covers the weak areas of the model and dynamically updates the sample set.

[0170] Step 3: Normalize the input anonymized image, perform model inference to obtain the coordinates of the theoretical anonymized region and map them back to the original size, implement non-maximum suppression based on the preset IoU threshold and complete target matching with the maximum IoU, and then calculate the region occlusion rate to determine positive detection, false negative detection and statistically analyze the false detection rate.

[0171] The purpose of step 3 is to obtain a unique and accurate theoretical anonymization region that corresponds one-to-one with the input anonymized image and reflects the original size, as well as its matching results. The masking rate is used to objectively determine the positive detection, missed detection, and false detection, thereby verifying the accuracy and stability of the recognition results and providing reliable input for subsequent parameter regression and processing.

[0172] Specifically, step 3 includes:

[0173] Step 3.1: Perform color and scale normalization on the acquired anonymized image and record the scaling and padding parameters. Input the normalized image into a model that includes object detection and parameter regression to obtain the location information, mode category, and anonymization parameters of the anonymized region. Based on the recorded scaling and padding parameters, map the location information from the model input coordinate system to the original image coordinate system and output the corresponding theoretical anonymized region coordinates and its anonymization parameters.

[0174] Step 3.1 is used to achieve high-precision identification and localization of anonymous feature regions, providing accurate regional basis for subsequent anonymization processing.

[0175] The original anonymized image is read into a unified color space, and then proportionally scaled and padded to 640×640 to fit the model's input size. The scaling ratio and padding offset are recorded. Channel rearrangement and pixel normalization are then performed to obtain a tensor that the model can accept. This 640×640 tensor is fed into the network to obtain candidate bounding boxes. , , , The regression parameters (target score, anonymization method (mosaic, solid, Gaussian) and anonymization parameters (block size, solid color brightness and color, Gaussian σ, etc., all normalized outputs) are decoded to obtain the candidate set at the input scale (640×640). , , , ).in,( , , , The bounding box () represents the position and size of the theoretical anonymity region in the original image coordinate system, derived from the theoretical anonymity region bounding box (original image coordinate system) provided with the original image in step 1.1. , , , ) represents the position and size of the predicted anonymous region box obtained by decoding the model on the input scale map (e.g., 640×640, after scaling and padding).

[0176] Furthermore, low-confidence candidates are first filtered based on a score threshold. Redundant overlapping boxes are then removed using Non-Multiple Streams (NMS) with an IoU threshold of 0.7 (which can be performed by class or class-independent criteria), resulting in a deduplicated candidate set while simultaneously retaining their scores, categories, and parameters. Each box after NMS is then mapped back to its original size from the input scale.

[0177] , , , (18)

[0178] In the formula: , , , The coordinates and dimensions of the predicted anonymized region bounding box on the model input map (640×640 after proportional scaling and letterbox filling); , This is the fill pixel offset of the letterbox in the left / top direction of the input image; The scaling factor used when scaling the original image to the input image; , , , This refers to the predicted anonymous region box position and size after mapping back to the original image coordinate system.

[0179] In the formula, x and y represent the center coordinates of the anonymous region box, w represents the width of the anonymous region box, and h represents the height of the anonymous region box.

[0180] The above , , , This set of formulas (18) is used to map the anonymous region boxes on the model input scale (640×640 after proportional scaling and padding) back to the original image size. When evaluating the match, it is compared with the true anonymous region boxes ( , , , ) Calculate IoU and occlusion rate in the same (original image) coordinate system to determine positive detection, missed detection and statistical false detection rate.

[0181] Step 3.2: After identifying the theoretical anonymity region, lightweight calculations for positive detection, missed detection, and false detection are achieved through region coverage rate calculation.

[0182] Step 3.2 is used to evaluate the accuracy and stability of the recognition results without increasing the complexity of the model, so as to ensure the reliability of the theoretical region recognition.

[0183] First, input the prediction set and the label set. The prediction set is... (i.e., the theoretical anonymous region bounding box that has completed backmapping / NMS), the annotation set is as follows (i.e., the theoretical anonymity region in step 1.1), the pixel area of ​​the theoretical anonymity region is i and j are indices, i=1,..., traverse the prediction set P = The i-th predicted theoretical anonymous region box; j=i=1,……, Traverse the labeled set The j-th true theoretical anonymous region.

[0184] Coverage matrix for:

[0185] (19)

[0186] Preset thresholds: Coverage threshold is 50% by default, false detection rate threshold is 10% by default.

[0187] First, according to the coverage matrix Alternatively, sort the IoU from largest to smallest and perform a greedy matching, with a matching pair set: M={(i,j)}.

[0188] Based on occlusion rate for each Positive and negative detections:

[0189] (20)

[0190] Positive inspection Coverage threshold, missed detection Occlusion threshold.

[0191] Predicting anonymous region boxes based on false positives caused by mismatches or low coverage. If not matched, or if matched with satisfy The occlusion threshold is denoted as the false positive rate. The false positive rate is:

[0192] (twenty one)

[0193] In the formula: FP is the number of false positives; TP is the number of positive positives.

[0194] In step 3, the input anonymized image is preprocessed to 640×640 normalization. While preserving the anonymization features, model inference is performed to output the coordinates of the theoretical region and map them back to the original size (accuracy ±1 pixel). Redundant boxes are removed by non-maximum suppression with an IoU threshold of 0.7, and the corresponding theoretical region is output based on the maximum IoU matching. After recognition, the positive detection (coverage rate ≥50%), negative detection (coverage rate <50%), and false detection rate (≤10%) are calculated based on the region occlusion rate, achieving lightweight evaluation of negative detection and false detection without increasing model complexity.

[0195] The above descriptions are merely embodiments of the present invention, and common knowledge regarding specific structures and characteristics of the solutions is not described in detail here. It will be apparent to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the present invention is defined by the appended claims rather than the foregoing description. Therefore, it is intended that all variations falling within the meaning and scope of equivalents of the claims be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

Claims

1. A method for constructing multi-type image anonymization annotation datasets and determining target coverage, characterized in that, The method includes: Step 1: Obtaining and constructing a dataset of original face and license plate images containing both theoretical anonymized regions and anonymized features; Step 2: In the YOLOv5-L model, feature extraction branches for anonymization methods are set and cross-modal feature fusion is performed. This is combined with a multi-loss function configuration primarily based on theoretical anonymized region localization loss, along with a two-stage progressive training and hard example mining mechanism, to learn and annotate the features of the theoretical anonymized regions; Step 2.1: In the backbone network of the YOLOv5-L model, feature extraction branches are set for three anonymization methods: mosaic, solid color block, and Gaussian blur. The backbone output simultaneously enters the PAN-FPN and cross-modal fusion layer. The cross-modal fusion layer fuses the original features and anonymized features, and sets the output layer for extracting anonymized region boundary features and outputting theoretical anonymized region coordinates and processing parameters; Step 2.2: Using theoretical anonymized region localization loss as the main component, combined with anonymization type classification loss and anonymization parameter regression loss, and adding lightweight false negative and false positive penalty terms, a loss function for feature recognition and localization calculation within the theoretical anonymized region is constructed. for: In the formula: The IoU loss is the bounding box of the theoretical region. Anonymization type classification loss; For anonymized parameter regression loss; To incur losses due to missed detections; The loss is a false positive penalty; 0.1 and 0.05 are weights; Step 2.3: After configuring the loss function, a two-stage progressive training and hard example mining mechanism are used to learn the mapping from anonymized features to theoretical anonymized regions, perform cross-modal fusion optimization, and train for recognition in complex anonymized scenarios, respectively; The two-stage progressive training includes: the first stage of feature-to-region mapping training, used to establish the correspondence between anonymized features and theoretical regions, and the second stage of cross-modal feature fusion training, used to achieve deep fusion and robust optimization of anonymized features and original image features; The hard example mining mechanism includes: periodically selecting samples that meet preset conditions from the training samples as hard example samples, the preset conditions including: the intersection-union ratio of the samples is lower than a first threshold or the prediction error is higher than a second threshold, and samples that meet the hard example conditions are selected as hard example samples. The samples are resampled, and typical complex samples include multi-target occlusion, strong light interference, low contrast or monochrome block scene samples. In each training cycle, according to the set resampling ratio, the selected difficult sample samples are weighted and added to the dataset of the next training stage. K iterations of training are performed on the added dataset. In each iteration, the difficult sample selection results are dynamically updated according to the latest training error. When the sample meets the convergence condition in several consecutive training cycles, the difficult sample resampling process is stopped. Step 3: Normalize the input anonymized image, perform model inference to obtain the coordinates of the theoretical anonymized region and map them back to the original size. Non-maximum suppression is implemented based on the preset IoU threshold and target matching is completed with the maximum IoU. Then, the region occlusion rate is calculated to determine the positive detection, the missed detection and the false detection rate is calculated.

2. The method for constructing multi-type image anonymization annotation datasets and determining target coverage according to claim 1, characterized in that, Step 1 includes: Step 1.1: Acquire the original image captured by the vehicle-mounted camera in a road scene, which contains the theoretical anonymization regions of faces and license plates that meet the standard requirements, along with their coordinate annotations; Step 1.2: Configure the anonymization method and processing rules for the theoretical anonymization region of each sample to be processed, generating a dual annotation consisting of spatial annotations and processing rule annotations to establish a mapping relationship between anonymization parameters and features of the theoretical anonymization region; Step 1.3: Manually set some unprocessed regions within the theoretical anonymization region as missed detection samples, and manually set some incorrectly processed regions outside the theoretical anonymization region as false detection samples, forming corresponding abnormal sample annotations; Step 1.4: Divide the image data containing multiple types of anonymized samples and abnormal samples into training set, validation set, and test set according to the proportion, and expand the data through a random augmentation strategy to form a complete original image dataset of faces and license plates containing both theoretical anonymization region annotations and anonymization feature dual annotations.

3. The method for constructing multi-type image anonymization annotation datasets and determining target coverage according to claim 2, characterized in that, In step 1.2, spatial annotation includes the type of theoretical anonymized region and the set of coordinate points of the theoretical anonymized region, and processing rule annotation includes the anonymization method and the parameters corresponding to each anonymization method.

4. The method for constructing multi-type image anonymization annotation datasets and determining target coverage according to claim 2, characterized in that, Step 1.3 Divide the number of missed samples and false positive samples into 5% of the total sample proportion.

5. The method for constructing multi-type image anonymization annotation datasets and determining target coverage according to claim 1, characterized in that, In step 2.2, the loss function IoU loss of the theoretical region bounding box for: In the formula: This represents the number of positive samples. This is the i-th predicted bounding box; The ground truth box corresponding to the i-th predicted box; For Complete IoU loss; As a dynamic adjustment factor; These are the weighting coefficients for the boundary constraint terms; This is for edge consistency loss; For all positive samples; anonymized classification loss for: In the formula: This represents the number of positive samples. Let be the predicted probability of the i-th sample for class c; The smoothed true label; Category weighting factor; Focal Loss Index; The true category label for sample i; For cross-entropy; As a focus mechanism; Improved classification loss; anonymized parameter regression loss for: In the formula: The regression loss is based on the basic parameters; For consistency constraints; For parameter boundary constraints; Odd-numbered kernel constraint; 、 、 These represent the weights corresponding to each constraint; and the penalty loss for missed detections. for: In the formula: is the number of real targets in the sample image; g is the index of each real target instance traversed; For the j-th predicted anonymous region bounding box; The IoU between the real target and the j-th predicted bounding box; The true target is the highest IoU among all predictions; This is the threshold for missed detections; is the sigmoid function; a is the steepness coefficient of the sigmoid function. Weighting the risks and importance of this real objective; False detection penalty loss for: In the formula: The number of predicted anonymous region boxes that enter the statistics; j represents the number of predicted anonymous region boxes that are traversed; The highest IoU between the predicted anonymous region box and all real anonymous region boxes; This is the false detection threshold; is the high confidence threshold; a and b are the steepness coefficients of two sigmoid functions, where a controls the sensitivity to low IoU and b controls the sensitivity to high scores.

6. The method for constructing multi-type image anonymization annotation datasets and determining target coverage according to claim 1, characterized in that, The first stage of the training process includes: establishing a correspondence between anonymized features and theoretical anonymized regions through feature-to-region mapping learning, forming a mapping model from feature space to region space, training the mapping model using optimization algorithms, and achieving collaborative optimization of anonymized feature classification and region boundary localization through a multi-task joint loss function. A warm-up mechanism is introduced during the training process to gradually converge the model, and training is conducted through sample balancing and feature alignment for different anonymization methods. The second stage of the training process includes: performing cross-modal optimization training under full-network feature fusion conditions, fusing anonymized features with original image features, updating model parameters using a dynamic learning rate adjustment mechanism and a weight smoothing mechanism, introducing an attention mechanism to achieve feature weighting, and employing hard example mining and sample resampling mechanisms during the training process to retrain and optimize samples with large recognition errors.

7. The method for constructing multi-type image anonymization annotation datasets and determining target coverage according to claim 1, characterized in that, Step 3 includes: Step 3.1: Perform color and scale normalization processing on the acquired anonymized image and record the scaling and filling parameters. Input the normalized image into a model that includes object detection and parameter regression to obtain the location information, mode category, and anonymization parameters of the anonymized region. Based on the recorded scaling and filling parameters, map the location information from the model input coordinate system to the original image coordinate system and output the corresponding theoretical anonymized region coordinates and its anonymization parameters; Step 3.2: After identifying the theoretical anonymized region, perform lightweight calculations of positive detection, missed detection, and false detection through region occlusion rate calculation.

Citation Information

Patent Citations

  • Image anonymization processing method and device, equipment and storage medium

    CN119358015A

  • Evaluation method for anonymization performance of sensitive target in image

    CN119963951A