Image data desensitization method and device

By automatically identifying facial areas and performing desensitization processing, combining application scenarios and device features, and dynamically adjusting mosaic intensity, the problem of image data privacy leakage is solved, and the privacy protection and data sharing capabilities of computing devices are improved.

CN120671195AActive Publication Date: 2025-09-19YANGTZE DELTA REGION INST OF TSINGHUA UNIV ZHEJIANG
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202511180510.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-22
Publication Date
2025-09-19
Estimated Expiration
2045-08-22

AI Technical Summary

Technical Problem

In existing technologies, there is a risk of privacy leakage during the processing of image data, and there is a lack of efficient privacy protection mechanisms, which hinders the legal and compliant sharing of data.

Method used

By automatically identifying facial areas and performing desensitization processing, using the face detection model in combination with application scenario requirements and device performance feature library, real-time monitoring of computing device hardware parameters, and dynamically adjusting the mosaic intensity for desensitization, privacy protection and data availability are ensured.

Benefits of technology

It achieves privacy protection in different computing devices and scenarios, improves inference speed and stability, adapts to dynamic changes in processors, and balances privacy and usability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120671195A_ABST
    Figure CN120671195A_ABST
Patent Text Reader

Abstract

The invention discloses an image data desensitization method and device, and the method comprises the steps: determining a face detection model for reasoning according to an application scene demand, an equipment performance feature library and computing equipment data of computing equipment; monitoring computing equipment hardware parameters of the computing equipment in real time, and determining a processor of the computing equipment for current reasoning; a reasoning task is executed on the input face image on the processor for current reasoning based on the determined face detection model, at least one face area is obtained, and the reasoning task is migrated according to updating of the processor for current reasoning; and when it is determined that the face areas need to be subjected to desensitization processing, according to the application scene adjustment factor and the desensitization risk index corresponding to each face area, determining corrected mosaic intensity, according to the corrected mosaic intensity, performing desensitization processing on each face area, and writing the face areas subjected to the desensitization processing back to the face image. According to the invention, the face area can be automatically identified and desensitization processing can be carried out.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to an image data desensitization method and device. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. No statement herein is admitted to be prior art by virtue of its inclusion in this section.

[0003] With the rapid development of artificial intelligence and big data technologies, image data (including image data from video data) plays a vital role in multiple fields. This data often contains sensitive information, such as facial features and family scenes. If not properly handled, it can lead to privacy leaks. Furthermore, data silos are prevalent, and the lack of effective privacy protection mechanisms hinders data sharing and utilization. Therefore, an image data processing solution that can automatically identify and desensitize facial regions is needed to promote legal and compliant data sharing while protecting individual privacy. Summary of the Invention

[0004] An embodiment of the present invention provides an image data desensitization method that can automatically identify facial regions and perform desensitization processing, including:

[0005] Determine the face detection model used for inference based on application scenario requirements, the device performance feature library, and the computing device data of the computing device. The device performance feature library is used to record the inference effect data of different computing devices on different types of face detection models under different computing device hardware parameters.

[0006] monitoring the computing device hardware parameters of the computing device in real time to determine the processor of the computing device currently used for inference;

[0007] Performing an inference task on an input face image based on a determined face detection model on a current inference processor to obtain at least one face region, wherein the inference task is migrated according to an update of the current inference processor;

[0008] When it is determined that a facial area needs to be desensitized, the factor and desensitization risk index corresponding to each facial area are adjusted to determine the corrected mosaic strength. Each facial area is desensitized according to the corrected mosaic strength, and the desensitized facial area is written back into the facial image.

[0009] An embodiment of the present invention provides an image data desensitization device that can automatically identify facial regions and perform desensitization processing. The device includes:

[0010] A face detection model selection module is used to determine the face detection model used for inference based on application scenario requirements, a device performance feature library, and computing device data of the computing device. The device performance feature library is used to record the inference effect data of different computing devices on different types of face detection models under different computing device hardware parameters;

[0011] a processor selection module, configured to monitor hardware parameters of the computing device in real time and determine a processor of the computing device currently used for inference;

[0012] a face detection module, configured to perform an inference task on an input face image based on a determined face detection model on a current inference processor to obtain at least one face region, wherein the inference task is migrated based on an update of the current inference processor;

[0013] The desensitization processing module is used to adjust the factor and desensitization risk index according to the application scenario corresponding to each face area when determining that the face area needs to be desensitized, determine the corrected mosaic strength, desensitize each face area according to the corrected mosaic strength, and write the desensitized face area back to the face image.

[0014] An embodiment of the invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned image data desensitization method when executing the computer program.

[0015] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned image data desensitization method is implemented.

[0016] An embodiment of the present invention also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the above-mentioned image data desensitization method.

[0017] In an embodiment of the present invention, a face detection model for inference is determined based on application scenario requirements, a device performance feature library, and computing device data of a computing device. The device performance feature library is used to record inference effect data of different computing devices performing inference on different types of face detection models under different computing device hardware parameters. The computing device hardware parameters of the computing device are monitored in real time to determine the processor of the computing device currently used for inference. An inference task is performed on an input face image based on the determined face detection model on the processor currently used for inference to obtain at least one face region, wherein the inference task is migrated based on updates to the processor currently used for inference. When it is determined that a face region requires desensitization processing, a corrected mosaic strength is determined based on the application scenario adjustment factor and desensitization risk index corresponding to each face region. Each face region is desensitized according to the corrected mosaic strength, and the desensitized face region is written back to the face image. A decision tree is used to combine the application scenario, the device performance feature library, and the real-time hardware parameter selection model to accurately match the model with the computing device hardware capabilities, thereby ensuring inference results while reducing resource waste and improving inference speed and stability. Real-time processor monitoring and inference task migration ensure uninterrupted inference during dynamic processor changes (e.g., switching from the CPU to the GPU). This adapts to scenarios such as device load fluctuations and improves system robustness. The application scenario adjustment factor and desensitization risk index are combined to determine the strength of the modified mosaic. This ensures that desensitization processing meets the privacy protection requirements of different scenarios (e.g., enhanced desensitization for high-risk scenarios) while retaining necessary image information, balancing privacy and usability. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0019] Figure 1 Flowchart of the image data desensitization method according to an embodiment of the present invention;

[0020] Figure 2 This is a flow chart of determining a face detection model for reasoning in an embodiment of the present invention;

[0021] Figure 3 A flowchart of a processor of a computing device for determining current reasoning in an embodiment of the present invention;

[0022] Figure 4 This is a flow chart of performing desensitization processing on each face region in an embodiment of the present invention;

[0023] Figure 5 Schematic diagram of an image data desensitization device according to an embodiment of the present invention;

[0024] Figure 6 Schematic diagram of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION

[0025] To make the purpose, technical solutions and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0026] The acquisition, storage, use, and processing of data in this application's technical solution comply with relevant national laws and regulations.

[0027] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned. They should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0028] In an embodiment of the present invention, when automatically desensitizing image data, sensitive areas in the image (such as faces) are automatically detected through advanced computer vision algorithms and processed through mosaic or other masking technologies, thereby protecting privacy while retaining data availability. Face detection and desensitization are achieved in an efficient and flexible manner to meet the needs of diverse application scenarios, and have broad application prospects in smart homes, security monitoring, medical image analysis and other fields.

[0029] Figure 1 Flowchart of a method for desensitizing image data according to an embodiment of the present invention, the method comprising:

[0030] Step 101: Determine a face detection model for inference based on application scenario requirements, a device performance feature library, and computing device data of the computing device. The device performance feature library is used to record inference performance data of different computing devices using different computing device hardware parameters for different types of face detection models.

[0031] Step 102: monitor the hardware parameters of the computing device in real time to determine the processor of the computing device currently used for inference.

[0032] Step 103: Performing an inference task on the input face image based on the determined face detection model on the current inference processor to obtain at least one face region, wherein the inference task is migrated according to the update of the current inference processor;

[0033] Step 104: When it is determined that the facial area needs to be desensitized, the application scenario adjustment factor and the desensitization risk index corresponding to each facial area are adjusted to determine the corrected mosaic strength, each facial area is desensitized according to the corrected mosaic strength, and the desensitized facial area is written back into the facial image.

[0034] In this embodiment of the present invention, the input facial image supports various formats, including JPEG. The facial region is represented by a ground-truth bounding box, with the format [x1, y1, x2, y2] representing the coordinates of the ground-truth bounding box. When outputting a facial region, a confidence level and an IoU threshold can be specified. At least one facial region must be present, meaning that multiple facial regions can be identified from a single facial image. The input facial image can be pre-processed for standardization, including size checking and format conversion. For large images, the resolution can be dynamically adjusted (maximum side length 2000 pixels) to optimize inference speed.

[0035] In an embodiment of the present invention, the device performance feature library is generated in advance after benchmarking on different computing devices (such as different models of CPUs and GPUs). The inference effect data includes time consumption, power consumption and energy efficiency data, providing a decision-making basis for subsequent intelligent scheduling.

[0036] In one embodiment, the application scenario requirements include real-time requirements, accuracy requirements, facial key point error requirements, multi-task support requirements, and extreme robustness requirements;

[0037] The computing device data includes computing device type and computing device hardware parameters.

[0038] The real-time requirements can be divided into the following categories according to the application scenario:

[0039] High (FPS ≥ 30): autonomous driving, video conferencing, live streaming;

[0040] Medium (FPS ≥ 15): security monitoring, access control systems, AR filters;

[0041] Low (offline processing): face database retrieval, data analysis, medical imaging;

[0042] The accuracy requirements can be divided into the following categories:

[0043] Average accuracy: General scenarios such as security scenarios require ≥85%, and high-precision scenarios such as payment verification require ≥95%;

[0044] The required values ​​for facial key point errors can be divided into the following categories: key point detection scenarios (such as expression analysis scenarios) require <5%;

[0045] Multi-tasking support requirements can be divided into the following categories:

[0046] If there are at least two or more tasks (face detection task, expression detection task, posture detection task, and age detection task, etc.), then it is determined that there is a need for multi-task support; otherwise, it is determined that there is no need for multi-task support;

[0047] The values ​​of extreme scenario robustness can be divided into the following categories:

[0048] Wide angle (±60°), occlusion (>30%), and low light (<10lux).

[0049] Computing device types can be divided into high-performance servers (such as GPU clusters, TPUs), edge servers, embedded devices, and mobile terminals (such as mobile phones).

[0050] Computing device hardware parameters may include: CPU parameters (such as CPU utilization, memory occupancy, real-time temperature, etc.), GPU parameters (GPU utilization, video memory occupancy, real-time temperature), and NPU (such as dedicated AI computing power, etc.).

[0051] Figure 2 This is a flowchart for determining a face detection model for inference in an embodiment of the present invention. In one embodiment, determining a face detection model for inference based on application scenario requirements, a device performance feature library, and computing device data of a computing device includes:

[0052] Step 201: Preliminary screening of face detection models is performed based on the computing device type and real-time requirements in combination with a decision tree;

[0053] If the computing device type is a high-performance server:

[0054] High real-time requirements: Preliminary screening of single-stage models.

[0055] Medium / low real-time requirements: Preliminary screening of two-stage models or high-precision single-stage models.

[0056] If the computing device type is an edge server:

[0057] High real-time requirements: Preliminary screening of lightweight single-stage models.

[0058] Medium / low real-time requirements: Preliminary screening of medium-sized single-stage models.

[0059] If the computing device type is an embedded device:

[0060] Considering the computing power in the hardware parameters, the computing power should be ≥5TOPS and the real-time requirements should be high: a lightweight single-stage model should be preliminarily selected.

[0061] Computing power < 5TOPS or low real-time requirements: Preliminary screening of ultra-lightweight models.

[0062] If the computing device type is a mobile terminal:

[0063] Dedicated NPU available and real-time requirements: Preliminary screening of lightweight models optimized for NPU.

[0064] No dedicated NPU or low real-time requirements: Initially screen minimalist models.

[0065] Step 202: performing a secondary screening on the initially screened face detection model set in accordance with accuracy requirements;

[0066] If the accuracy requirement is extremely high (for example, the accuracy requirement is ≥95%):

[0067] High-performance server with high real-time performance: Select a high-precision model (such as RetinaFace + ResNet-50) from the preliminarily screened single-stage models.

[0068] High-performance servers with medium / low real-time performance: Select a high-precision model (such as Faster R-CNN + ResNet-101) from the preliminarily screened two-stage models.

[0069] Other devices such as edge servers: Select the model with better accuracy and that meets device performance from the preliminary screening models.

[0070] If the accuracy requirement is normal (for example, the accuracy requirement is ≥85%):

[0071] High-performance servers with high real-time performance: Choose a large-backbone single-stage model (such as YOLOv8x).

[0072] Edge servers with high real-time performance: Select models such as YOLOv8m + TensorRT optimization.

[0073] For other equipment types and real-time situations, select the model that meets the accuracy requirements from the preliminary screening models.

[0074] Step 203: performing a third screening on the secondarily screened face detection model set according to the facial key point error requirement;

[0075] For keypoint detection scenarios (error must be <5%): From the secondary screened face detection model set, select a model that has a built-in keypoint detection branch or can add a keypoint detection head. Refer to the device performance feature library to ensure that the model meets the error requirements when inferring on the current device.

[0076] If strict keypoint error requirements are not required: keep the secondary filtered face detection model set.

[0077] Step 204: Based on the multi-task support requirements, the face detection model set that has been screened three times is screened a fourth time. If multi-task support is required: a face detection model that supports at least two or more tasks is selected from the existing face detection model set. For high-performance servers, a multi-task version model (such as the YOLOv8x multi-task version) can be selected. The edge server needs to be combined with the hardware parameters of the computing device. If the computing power is ≥20TOPS, a face detection model that supports multi-tasks can be selected. Otherwise, only the face detection model for detection + key point tasks is retained. Embedded devices and mobile terminals select lightweight models that can efficiently run multiple tasks on the current device based on the device performance feature library.

[0078] If there is no need for multi-task support: Select a model that only supports face detection from the existing face detection model collection.

[0079] Step 205: Considering the extreme robustness requirement, the face detection model set that has been screened four times is screened five times;

[0080] If you need to handle extreme scenarios (wide angles, occlusion, low light): Prioritize models with strong adaptability to extreme scenarios (such as RetinaFace). Refer to the device performance feature library to ensure that the model meets the requirements for time consumption and power consumption in extreme scenarios when inferring on the current device. Optimize the model if necessary (such as adding an attention mechanism). If you do not need to handle extreme scenarios: maintain the existing model range.

[0081] Step 206: Determine a final face detection model from the five screened face detection model sets by combining the computing device hardware parameters and the device performance feature library;

[0082] Check the hardware parameters of the computing device (CPU core number, frequency, GPU memory, CUDA core number, etc.), and combine the time consumption, power consumption, and energy efficiency data of each candidate model on the device in the device performance feature library.

[0083] Eliminate models that cannot run efficiently due to hardware parameter limitations. For example, if the device memory is less than 2GB, exclude models with parameters greater than 10MB. If the power consumption limit is less than 10W, select models that have enabled low-power optimizations such as INT8 quantization. Ultimately, select a face detection model that meets all application scenario requirements with minimal time consumption, low power consumption, and high energy efficiency.

[0084] Figure 3 This is a flowchart of determining a processor of a computing device currently used for inference in an embodiment of the present invention. In one embodiment, real-time monitoring of computing device hardware parameters of the computing device to determine the processor of the computing device currently used for inference includes:

[0085] Step 301, monitoring the computing device hardware parameters of the computing device in real time;

[0086] During system initialization, the built-in monitoring agent is started to monitor the key hardware parameters of the CPU and GPU in the computing device in real time, including:

[0087] CPU parameters: CPU utilization, memory usage, real-time temperature;

[0088] GPU parameters: GPU utilization, video memory occupancy, real-time temperature;

[0089] The monitoring frequency is set to once every 100ms to ensure that hardware status changes are captured in a timely manner.

[0090] Step 302: In the initial state, determine that the processor used for inference is a GPU;

[0091] Make full use of the parallel computing capabilities of GPU to improve reasoning efficiency.

[0092] Step 303: Based on the GPU parameters, determine whether to switch the processor to the CPU;

[0093] When the GPU utilization is continuously (for three consecutive samplings) above the high watermark (e.g., > 80%), or the GPU memory usage is close to the upper limit (e.g., > 90%) (regardless of the GPU utilization), the processor is switched to the CPU.

[0094] Enable INT8 quantization acceleration for tasks, compensating for the performance gap between the CPU and GPU by reducing data precision, and ensuring that the inference speed is basically stable.

[0095] Step 304 , monitoring CPU parameters during CPU execution to determine whether a CPU delayed preemption strategy is triggered;

[0096] After the inference task is switched to the CPU, the monitoring agent synchronously records the time consumption data of each frame of the inference task. The scheduling algorithm calculates the average inference time of multiple consecutive frames (for example, 3 frames) and compares it with the preset threshold (for example, 200ms):

[0097] If the average time is less than or equal to the preset threshold, it indicates that the CPU can stably process the current inference task and maintain the CPU execution mode.

[0098] If the average time consumption exceeds the preset threshold, it indicates that the CPU processing capacity is insufficient to meet the real-time requirements, triggering the CPU delay preemption strategy;

[0099] Step 305: If the CPU delayed preemption policy is triggered, determine whether the processor switches back to the GPU;

[0100] When the CPU delayed preemption policy is triggered, the scheduler performs the following operations:

[0101] Immediately interrupt the current inference task of the CPU through the inference module (saving intermediate states to avoid data loss);

[0102] Trigger GPU priority preemption and switch the inference task back to the GPU for execution;

[0103] If the GPU is still under high load at this time, the scheduler temporarily enables the task queue mechanism, caches new tasks in the queue, and executes them sequentially when the GPU is idle. At the same time, it reduces the GPU resource usage of a single batch of tasks by dynamically adjusting the batch size (for example, reducing the batch size from 8 to 4).

[0104] Step 306: Monitor the real-time temperature of the processor in real time, and adjust the processor according to the real-time temperature.

[0105] During the execution of the inference task, the monitoring agent continuously tracks the real-time temperature of the CPU and GPU:

[0106] If the GPU's real-time temperature remains above a safety threshold (e.g., 85°C), even if load switching conditions are not met, some low-priority inference tasks (e.g., non-real-time log analysis and correlation inference) will be migrated to the CPU to reduce GPU heat dissipation pressure.

[0107] If the real-time CPU temperature continues to be higher than the safety threshold (such as 75°C), reduce the amount of inference tasks assigned to the CPU, and suspend some non-core inference tasks if necessary to avoid performance degradation due to hardware overheating.

[0108] In an embodiment of the present invention, the system has a built-in adaptive learning module that dynamically adjusts various threshold parameters based on historical task execution data and hardware status changes: if the GPU frequently fluctuates between high load and low load in a certain scenario (switching ≥5 times within 1 minute), the high watermark will be automatically raised from 80% to 85% to reduce unnecessary task switching; if the CPU still frequently triggers delay preemption under INT8 quantization acceleration (≥3 times within 10 minutes), the CPU inference time threshold will be automatically raised from 200ms to 250ms to balance delay and processor stability.

[0109] In an embodiment of the present invention, after each processor switch (GPU→CPU or CPU→GPU), the system automatically records the switching time, triggering reason (such as GPU load is too high, CPU time limit exceeded), and inference performance data (FPS, latency) before and after the switch to form a scheduling log.

[0110] The scheduling algorithm regularly analyzes log data (e.g., hourly) and optimizes task allocation strategies. For example, in scenarios where GPU high load is frequently triggered, 20% of GPU resources are reserved in advance for emergency switching. In scenarios where CPU performance is insufficient, high-frequency cores are preferentially bound to the CPU to improve single-threaded processing capabilities.

[0111] In one embodiment, the method further comprises:

[0112] After obtaining at least one face region, non-maximum suppression is applied to merge overlapping face regions based on the IoU threshold of the face regions;

[0113] Filter out low-confidence face regions and face regions beyond the boundary to generate the final face region.

[0114] For example, to filter out low-confidence face regions (e.g., confidence < 0.5), the face region can be represented as [x1, y1, x2, y2, confidence], where x1, y1, x2, y2 are the coordinate values ​​of the face region and confidence is the confidence.

[0115] To improve robustness, during boundary checking, ensure that the coordinate values ​​of the face area do not exceed the range of the face image (x1, y1 ≥ 0, x2 ≤ image width, y2 ≤ image height).

[0116] In one embodiment, determining that a facial region requires desensitization processing includes:

[0117] When the size of the face area is larger than the first preset size, it is determined that desensitization processing is required.

[0118] In one embodiment, the method further comprises:

[0119] The application scenario adjustment factor corresponding to each face region is determined based on the scene weight of the application scenario and the area weight of each face region.

[0120] Application scenario adjustment factor = scenario weight × 0.3 + area weight × 0.7;

[0121] Scenes can be divided into public scenes (such as streets and shopping malls), private scenes (such as bedrooms and offices), and sensitive scenes (such as financial counters and government service windows). The corresponding scene weights are ranked from small to large. The specific scene weights are determined according to the actual situation and are not restricted here. The area weights can be divided according to the actual situation. For example, large-size faces (the size of the face area is larger than the second size, such as an area > 5000 pixels²) and small-size faces (the size of the face area is smaller than the third size, an area < 1500 pixels²) correspond to different area weights, and large-size faces (area > 5000 pixels²) have a larger area weight.

[0122] In one embodiment, the desensitization risk index of each facial region is calculated using the following formula: PRI=a× qxd +b× gz + c× zt, where qxd is the facial clarity, gz is the lighting stability, zt is the posture angle, and a, b, and c are the weights corresponding to the facial clarity, lighting stability, and posture angle, respectively.

[0123] Figure 4 This is a flow chart of desensitizing each face region in an embodiment of the present invention. In one embodiment, desensitizing each face region is performed based on the application scenario adjustment factor and desensitization risk index corresponding to each face region, including:

[0124] Step 401: Correct the basic mosaic strength corresponding to the size range of each face region based on the increase ratio corresponding to the risk threshold range of the desensitization risk index and the application scenario adjustment factor to obtain a corrected mosaic strength for each face region.

[0125] The correction formula includes: Corrected mosaic strength = basic mosaic strength corresponding to the size range of the face area × (1 + first improvement ratio) × (1 + application scenario adjustment factor).

[0126] In the embodiment of the present invention, the size range of the face area can be divided according to actual conditions, for example, into large-size faces (area > 5000 pixels²) and small-size faces (area < 1500 pixels²), with the corresponding basic mosaic strengths being 10×10 pixel grids and 50×50 pixel grids, respectively;

[0127] For example, if the desensitization risk index is within the risk threshold range greater than the first risk threshold of 0.7, the corresponding improvement ratio is 0.2. Then the corrected mosaic strength = the basic mosaic strength corresponding to the size range of the face area × (1 + 0.2) × (1 + application scenario adjustment factor).

[0128] Key areas include highly sensitive areas such as the eyes, nose, and mouth. For example, the highest intensity mosaic (1.3 times the corrected mosaic intensity) is applied to key point areas, 0.7 times the corrected mosaic intensity is applied to non-key areas (cheeks and forehead), and 0 times the corrected mosaic intensity is applied to exempted areas (such as parts covered by masks), that is, no mosaic processing is performed.

[0129] Step 402: mosaic processing is performed on each face region according to the corrected mosaic strength of the face region;

[0130] In one embodiment, before mosaic processing is performed on each face region according to the corrected mosaic strength of the face region, the method further includes:

[0131] For each face region, when the size of the face region is greater than the second size, dividing the face region into a key area, a non-key area, and an exemption area;

[0132] Adjustments to the revised mosaic intensity for critical, non-critical, and exempted areas;

[0133] If the variation of the corrected mosaic intensities of adjacent frames of the adjusted face area exceeds the variation range, the corrected mosaic intensities of the adjacent frames are smoothly transitioned by an interpolation algorithm;

[0134] Mosaic processing is performed on each face region according to the current modified mosaic strength of the face region.

[0135] In one embodiment, the method further comprises:

[0136] Obtain the true frame of the face area pre-annotated in the face image;

[0137] Based on the real frame and the detection frame of the face area obtained by the inference task, the performance indicators of face image detection are calculated; the performance indicators include:

[0138] True Positive (TP): The IoU between the detection box and the ground-truth box is ≥ 0.45, and there is no repeated matching.

[0139] False Positive (FP): A detection box that does not match a true box.

[0140] False negative (FN): A ground-truth box that is not detected.

[0141] Use the greedy matching algorithm to match the detection frame and the ground truth frame of the face area from high to low confidence level to optimize the TP count.

[0142] Record the confidence distribution and TP / FP labels for subsequent plotting.

[0143] Calculate the overall precision, recall, and F1 score.

[0144] Save the desensitized face image to the prediction directory with the same file name as the original face image.

[0145] Generate comparative visualizations, including:

[0146] The ground-truth box (green, the matched ones are solid lines, the unmatched ones are yellow dotted lines).

[0147] Detection box (red, TP is solid line, FP is blue dotted line), annotated confidence.

[0148] Generate a detailed visualization of the first face image, overlaying mosaic effects, ground truth boxes, and detection boxes.

[0149] Finally, three types of analysis charts can be generated:

[0150] PR curve: Based on the confidence and TP / FP labels of all detection boxes, a PR curve is drawn, marking the average precision (AP) and the operating point (confidence level 0.5).

[0151] Confidence Histogram: Draw the confidence histogram of TP and FP and mark the confidence threshold.

[0152] Normalized center coordinates of the ground truth box: Analyze the normalized center coordinates, width, and height of the ground truth box, and display the distribution in the form of scatter plots and histograms.

[0153] All charts are generated using existing tools and can be saved in pre-defined formats (e.g. PNG) for easy analysis and reporting.

[0154] An embodiment of the present invention further proposes an image data desensitization device, the principle of which is similar to that of the image data desensitization method, and will not be described in detail here.

[0155] Figure 5 Schematic diagram of an image data desensitization device according to an embodiment of the present invention, comprising:

[0156] A face detection model selection module 501 is configured to determine a face detection model for inference based on application scenario requirements, a device performance feature library, and computing device data of the computing device. The device performance feature library is configured to record inference performance data of different computing devices using different hardware parameters for different types of face detection models.

[0157] A processor selection module 502 is configured to monitor hardware parameters of the computing device in real time and determine a processor of the computing device currently used for inference;

[0158] A face detection module 503 is configured to perform an inference task on an input face image based on a determined face detection model on a current inference processor to obtain at least one face region, wherein the inference task is migrated based on an update of the current inference processor;

[0159] The desensitization processing module 504 is used to determine the corrected mosaic strength when it is determined that the facial area needs to be desensitized, adjust the factor and desensitization risk index corresponding to the application scenario of each facial area, desensitize each facial area according to the corrected mosaic strength, and write the desensitized facial area back to the facial image.

[0160] In one embodiment, the face detection model selection module is used to:

[0161] Based on the computing device type and real-time requirements, a decision tree is used to perform preliminary screening of face detection models;

[0162] Combined with the accuracy requirements, the face detection model set that was initially screened is screened again;

[0163] Based on the facial key point error requirements, the twice-screened face detection model set is screened three times;

[0164] Based on the multi-task support requirements, the face detection model set that was screened three times was screened four times;

[0165] Considering the extreme robustness requirement, the face detection model set that was screened four times was screened five times;

[0166] Combining the computing device hardware parameters and the device performance feature library, the final face detection model is determined from the five screened face detection model sets.

[0167] In one embodiment, the processor selection module is configured to:

[0168] monitoring computing device hardware parameters of the computing device in real time;

[0169] In the initial state, the processor used for inference is determined to be GPU;

[0170] Based on GPU parameters, determine whether to switch the processor to the CPU;

[0171] Monitor CPU parameters during CPU execution to determine whether to trigger the CPU delay preemption strategy;

[0172] If the CPU delayed preemption policy is triggered, the processor is determined to switch back to the GPU;

[0173] The real-time temperature of the processor is monitored in real time, and the processor is adjusted according to the real-time temperature.

[0174] In one embodiment, the face detection module is further configured to:

[0175] After obtaining at least one face region, non-maximum suppression is applied to merge overlapping face regions based on the IoU threshold of the face regions;

[0176] Filter out low-confidence face regions and face regions beyond the boundary to generate the final face region.

[0177] In one embodiment, the desensitization processing module is used to:

[0178] When the size of the face area is larger than the first preset size, it is determined that desensitization processing is required.

[0179] In one embodiment, the desensitization processing module is used to:

[0180] The application scenario adjustment factor corresponding to each face region is determined based on the scene weight of the application scenario and the area weight of each face region.

[0181] In one embodiment, the desensitization processing module is used to:

[0182] The desensitization risk index of each facial area is calculated using the following formula:

[0183] PRI=a× qxd + b× gz + c× zt, where qxd is the face definition, gz is the lighting stability, zt is the posture angle, and a, b, and c are the weights corresponding to face definition, lighting stability, and posture angle, respectively.

[0184] In one embodiment, the desensitization processing module is used to:

[0185] According to the increase ratio corresponding to the risk threshold range of the desensitization risk index and the application scenario adjustment factor, the basic mosaic strength corresponding to the size range of each face area is corrected to obtain the corrected mosaic strength of each face area;

[0186] Mosaic processing is performed on each face region according to the corrected mosaic strength of the face region.

[0187] In one embodiment, the desensitization processing module is used to:

[0188] Before mosaic processing is performed on each facial region according to the corrected mosaic strength of the facial region, for each facial region, when the size of the facial region is larger than the second size, dividing the facial region into a key area, a non-key area, and an exemption area;

[0189] Adjustments to the revised mosaic intensity for critical, non-critical, and exempted areas;

[0190] If the variation of the corrected mosaic intensities of adjacent frames of the adjusted face area exceeds the variation range, the corrected mosaic intensities of the adjacent frames are smoothly transitioned by an interpolation algorithm;

[0191] Mosaic processing is performed on each face region according to the current modified mosaic strength of the face region.

[0192] In summary, in the method and apparatus proposed in the embodiments of the present invention, a face detection model for inference is determined based on application scenario requirements, a device performance feature library, and computing device data of a computing device. The device performance feature library is used to record inference effect data of different computing devices performing inference on different types of face detection models under different computing device hardware parameters. The computing device hardware parameters of the computing device are monitored in real time to determine the processor of the computing device currently used for inference. An inference task is performed on the input face image based on the determined face detection model on the processor currently used for inference to obtain at least one face region, wherein the inference task is migrated based on the update of the processor currently used for inference. When it is determined that a face region needs to be desensitized, a correction mosaic strength is determined based on the application scenario adjustment factor and desensitization risk index corresponding to each face region. Each face region is desensitized according to the correction mosaic strength, and the desensitized face region is written back to the face image. By combining a decision tree with the application scenario, the device performance feature library, and the real-time hardware parameter selection model, the model is accurately matched with the computing device hardware capabilities, while ensuring the inference effect, reducing resource waste, and improving inference speed and stability. Real-time processor monitoring and inference task migration ensure uninterrupted inference during dynamic processor changes (e.g., switching from the CPU to the GPU). This adapts to scenarios such as device load fluctuations and improves system robustness. The application scenario adjustment factor and desensitization risk index are combined to determine the strength of the modified mosaic. This ensures that desensitization processing meets the privacy protection requirements of different scenarios (e.g., enhanced desensitization for high-risk scenarios) while retaining necessary image information, balancing privacy and usability.

[0193] An embodiment of the present invention further provides a computer device, Figure 6 This is a schematic diagram of a computer device in an embodiment of the present invention. The computer device 600 includes a memory 610, a processor 620, and a computer program 630 stored in the memory 610 and executable on the processor 620. When the processor 620 executes the computer program 630, the above-mentioned image data desensitization method is implemented.

[0194] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned image data desensitization method is implemented.

[0195] An embodiment of the present invention also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the above-mentioned image data desensitization method.

[0196] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0197] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0198] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0199] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0200] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for desensitizing image data, characterized in that: include: Determine the face detection model used for inference based on application scenario requirements, the device performance feature library, and the computing device data of the computing device. The device performance feature library is used to record the inference effect data of different computing devices on different types of face detection models under different computing device hardware parameters. monitoring the computing device hardware parameters of the computing device in real time to determine the processor of the computing device currently used for inference; Performing an inference task on an input face image based on a determined face detection model on a current inference processor to obtain at least one face region, wherein the inference task is migrated according to an update of the current inference processor; When it is determined that a facial area needs to be desensitized, the factor and desensitization risk index corresponding to each facial area are adjusted to determine the corrected mosaic strength. Each facial area is desensitized according to the corrected mosaic strength, and the desensitized facial area is written back into the facial image.

2. The method according to claim 1, wherein The application scenario requirements include one or any combination of real-time requirements, accuracy requirements, facial key point error requirements, multi-task support requirements, and extreme robustness requirements; The computing device data includes computing device type and / or computing device hardware parameters.

3. The method according to claim 2, wherein Determine the face detection model used for inference based on the application scenario requirements, device performance feature library, and computing device data, including: Based on the computing device type and real-time requirements, a decision tree is used to perform preliminary screening of face detection models; Combined with the accuracy requirements, the face detection model set that was initially screened is screened again; Based on the facial key point error requirements, the twice-screened face detection model set is screened three times; Based on the multi-task support requirements, the face detection model set that was screened three times was screened four times; Considering the extreme robustness requirement, the face detection model set that was screened four times was screened five times; Combining the computing device hardware parameters and the device performance feature library, the final face detection model is determined from the five screened face detection model sets.

4. The method according to claim 2, wherein Monitoring the computing device hardware parameters of the computing device in real time to determine the processor of the computing device currently used for inference includes: monitoring computing device hardware parameters of the computing device in real time; In the initial state, the processor used for inference is determined to be GPU; Based on GPU parameters, determine whether to switch the processor to the CPU; Monitor CPU parameters during CPU execution to determine whether to trigger the CPU delay preemption strategy; If the CPU delayed preemption policy is triggered, the processor is determined to switch back to the GPU; The real-time temperature of the processor is monitored in real time, and the processor is adjusted according to the real-time temperature.

5. The method according to claim 1, wherein Also includes: After obtaining at least one face region, non-maximum suppression is applied to merge overlapping face regions based on the IoU threshold of the face regions; Filter out low-confidence face regions and face regions beyond the boundary to generate the final face region.

6. The method according to claim 1, wherein Determine the facial area that needs desensitization, including: When the size of the face area is larger than the first preset size, it is determined that desensitization processing is required.

7. The method according to claim 1, wherein Also includes: The application scenario adjustment factor corresponding to each face region is determined based on the scene weight of the application scenario and the area weight of each face region.

8. The method according to claim 1, wherein Also includes: The desensitization risk index of each facial area is calculated using the following formula: PRI=a× qxd + b× gz + c× zt, where qxd is the face definition, gz is the lighting stability, zt is the posture angle, and a, b, and c are the weights corresponding to face definition, lighting stability, and posture angle, respectively.

9. The method according to claim 1, wherein Desensitization is performed on each facial region based on the application scenario adjustment factor and desensitization risk index corresponding to each facial region, including: According to the increase ratio corresponding to the risk threshold range of the desensitization risk index and the application scenario adjustment factor, the basic mosaic strength corresponding to the size range of each face area is corrected to obtain the corrected mosaic strength of each face area; Mosaic processing is performed on each face region according to the corrected mosaic strength of the face region.

10. The method according to claim 9, wherein Before mosaic processing is performed on each face region according to the corrected mosaic strength of the face region, the method further includes: For each face region, when the size of the face region is greater than the second size, dividing the face region into a key area, a non-key area, and an exemption area; Adjustments to the revised mosaic intensity for critical, non-critical, and exempted areas; If the variation of the corrected mosaic intensities of adjacent frames of the adjusted face area exceeds the variation range, the corrected mosaic intensities of the adjacent frames are smoothly transitioned by an interpolation algorithm; Mosaic processing is performed on each face region according to the current modified mosaic strength of the face region.

11. An image data desensitization device, characterized in that: include: A face detection model selection module is used to determine the face detection model used for inference based on application scenario requirements, a device performance feature library, and computing device data of the computing device. The device performance feature library is used to record the inference effect data of different computing devices on different types of face detection models under different computing device hardware parameters; a processor selection module, configured to monitor hardware parameters of the computing device in real time and determine a processor of the computing device currently used for inference; a face detection module, configured to perform an inference task on an input face image based on a determined face detection model on a current inference processor to obtain at least one face region, wherein the inference task is migrated based on an update of the current inference processor; The desensitization processing module is used to adjust the factor and desensitization risk index according to the application scenario corresponding to each face area when determining that the face area needs to be desensitized, determine the corrected mosaic strength, desensitize each face area according to the corrected mosaic strength, and write the desensitized face area back to the face image.

12. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 10 is implemented.

13. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

14. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

Citation Information

Patent Citations

  • Display device and camera tracking method in multi-person scene

    CN112866773A

  • Equipment configuration method, system and device, equipment, storage medium and access control equipment

    CN115311700A

  • Automobile video and image desensitization test method and system

    CN116484386A

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

    CN116596751A

  • Image data desensitization processing method and device, equipment and medium

    CN117171767A