Image anonymization processing method and device, equipment and storage medium
By training the preset CNN regression model, generating anonymous processing model, predicting Gauss's fuzzy nuclear parameters for image anonymous processing, solving the problem of poor image anonymity in the existing technology, and achieving a more efficient anonymous effect effect And the degree of automation.
Patent Information
- Application Number
- CN202411360916.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-24
AI Technical Summary
In the prior art, image anonymization effect is poor and personal privacy cannot be effectively protected.
By training the preset CNN regression model, generate anonymous processing model, use this model to treat anonymous images for processing, predict Gaussian fuzzy nuclear parameters, and use these parameters to perform anonymous processing.
It achieves more efficient image anonymization, improves anonymization effect and automation, and reduces the need for manual intervention.
Smart Images

Figure CN119358015A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image anonymization processing method, device, equipment and computer-readable storage medium. Background Art
[0002] With the continuous advancement of science and technology, driverless cars are gradually becoming a reality. Although driverless car technology has brought us many conveniences, the images containing faces or license plates collected by driverless car technology during driving have also caused people to worry about personal privacy security. At present, image anonymization technologies include mosaic, pixelation, color transformation, and Gaussian blur, but the anonymization effect is poor. Summary of the invention
[0003] The present application provides an image anonymization processing method, device, equipment and computer-readable storage medium, which can solve the technical problem that the image anonymization technology in the prior art has poor effect.
[0004] In a first aspect, an embodiment of the present application provides an image anonymization processing method, the image anonymization processing method comprising:
[0005] The preset CNN regression model is trained according to the acquired training data set to generate a corresponding anonymization processing model, wherein the training data set includes a face image or a license plate image, and the face image or the license plate image is annotated with sensitive area information and an optimal blur kernel standard deviation;
[0006] Verifying the anonymization processing model according to the obtained verification data set to determine whether the anonymization processing model is an optimal anonymization processing model;
[0007] If it is determined that the anonymization processing model is the optimal anonymization processing model, the image to be anonymized is processed based on the anonymization processing model to predict the Gaussian blur kernel parameters of the image to be anonymized;
[0008] The image to be anonymized is anonymized by using the Gaussian blur kernel parameters to generate an anonymized image.
[0009] In combination with the first aspect, in one implementation, the training of a preset CNN regression model according to the acquired data set to be trained to generate a corresponding anonymization processing model includes:
[0010] Inputting the face image or license plate image into a preset CNN regression model, wherein the preset CNN regression model includes an input layer, a convolution layer, a pooling layer, a fully connected layer and an output layer;
[0011] Normalizing the sensitive area information of the input face image or the license plate image through the input layer to obtain the normalized sensitive area size;
[0012] Extracting the sensitive area size and the optimal blur kernel standard deviation through the convolution layer to obtain input pair features;
[0013] Reducing the dimension of the input pair features by the pooling layer;
[0014] Outputting the predicted Gaussian blur kernel standard deviation through the fully connected layer;
[0015] Determining a loss value according to the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation;
[0016] According to the loss function, a gradient value is determined;
[0017] The weight value of the preset CNN regression model is updated according to the gradient value to generate a corresponding anonymization processing model.
[0018] In combination with the first aspect, in one implementation, determining the loss value according to the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation includes:
[0019] Comparing the Gaussian blur kernel standard deviation with the optimal blur kernel standard deviation;
[0020] If the absolute difference between the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation is less than or equal to a preset hyperparameter, a loss function is calculated according to a first preset loss function, the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation;
[0021] If the absolute difference between the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation is greater than the preset hyperparameter, a loss function is calculated according to a second preset loss function, the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation.
[0022] In combination with the first aspect, in one implementation, updating the weight value of the preset CNN regression model according to the gradient value to generate a corresponding anonymization processing model includes:
[0023] Calculating a first parameter based on the gradient value, the first preset momentum coefficient, the second preset momentum coefficient and the first preset formula;
[0024] Calculating a second parameter based on the gradient value, the first preset momentum coefficient, the second preset momentum coefficient, and the second preset formula;
[0025] Calculating a third parameter based on the first parameter, the preset second momentum coefficient and a third preset formula;
[0026] Calculating a fourth parameter based on the second parameter, the preset first momentum parameter and a fourth preset formula;
[0027] Calculating a target weight value based on the third parameter, the fourth parameter, a preset global learning rate, a preset constant and a fifth preset formula;
[0028] The weight value of the preset CNN regression model is updated by the target weight value to generate a corresponding anonymization processing model.
[0029] In combination with the first aspect, in one implementation, verifying the anonymization processing model according to the acquired verification data set to determine whether the anonymization processing model is an optimal anonymization processing model includes:
[0030] The anonymization processing model is verified by using the obtained verification data set to obtain the corresponding accuracy, recall rate and MAP value;
[0031] If the accuracy is greater than or equal to the preset accuracy, the recall is less than or equal to the preset recall, and the MAP value is greater than or equal to the preset MAP value, it is determined that the anonymization processing model is the optimal anonymization processing model.
[0032] In combination with the first aspect, in one implementation, after verifying the anonymization processing model by using the acquired verification data set to obtain the corresponding accuracy, recall rate and MAP value, the method further includes:
[0033] If the accuracy is less than the preset accuracy, the recall is greater than the preset recall, and the MAP value is less than the preset MAP value, then determining that the anonymization processing model is the optimal anonymization processing model;
[0034] The hyperparameters of the anonymization processing model are adjusted according to the accuracy, the recall rate and the MAP value, so that the anonymization processing model after adjusting the hyperparameters is an optimal anonymization processing model.
[0035] In combination with the first aspect, in one implementation, before training the preset CNN regression model according to the acquired training data set to generate the corresponding anonymization processing model, the method further includes:
[0036] Collect images containing human faces or license plate images;
[0037] Marking the coordinates of the sensitive area and the best blur kernel standard deviation of the face image or license plate image to generate a data set, wherein the data set includes multiple face images or license plate images with the coordinates of the sensitive area and the best blur kernel standard deviation marked;
[0038] According to a preset ratio, the data set is divided into a training data set and a verification data set.
[0039] In a second aspect, an embodiment of the present application provides an image anonymization processing device, the image anonymization processing device comprising:
[0040] A first generating module is used to train a preset CNN regression model according to the acquired training data set to generate a corresponding anonymization processing model, wherein the training data set includes a face image or a license plate image, and the face image or the license plate image is annotated with sensitive area information and an optimal blur kernel standard deviation;
[0041] A determination module, used to verify the anonymization processing model according to the obtained verification data set, and determine whether the anonymization processing model is an optimal anonymization processing model;
[0042] A prediction module, configured to process the image to be anonymized based on the anonymization processing model and predict Gaussian blur kernel parameters of the image to be anonymized if the anonymization processing model is determined to be the optimal anonymization processing model;
[0043] The second generating module is used to perform anonymization processing on the image to be anonymized by using the Gaussian blur kernel parameters to generate an anonymized image.
[0044] In a third aspect, an embodiment of the present application provides an image anonymization processing device, which includes a processor, a memory, and an image anonymization processing program stored in the memory and executable by the processor, wherein when the image anonymization processing program is executed by the processor, the steps of the image anonymization processing method as described above are implemented.
[0045] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which an image anonymization processing program is stored, wherein when the image anonymization processing program is executed by a processor, the steps of the image anonymization processing method as described above are implemented.
[0046] The beneficial effects brought by the technical solution provided in the embodiments of the present application include:
[0047] The preset CNN regression model is trained according to the acquired training data set to generate a corresponding anonymization processing model, wherein the training data set includes a face image or a license plate image, and the face image or the license plate image is annotated with sensitive area information and an optimal blur kernel standard deviation; the anonymization processing model is verified according to the acquired verification data set to determine whether the anonymization processing model is the optimal anonymization processing model; if it is determined that the anonymization processing model is the optimal anonymization processing model, the anonymization image is processed based on the anonymization processing model to predict the Gaussian blur kernel parameters of the anonymization image; the image to be anonymized is anonymized by the Gaussian blur kernel parameters to generate an anonymized image, thereby solving the technical problem of poor anonymization effect in the related technology, realizing fully automatic intelligent anonymization, improving the anonymization effect and automation level, and reducing the need for manual intervention. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 This is a flow chart of the first embodiment of the image anonymization processing method of the present application;
[0049] Figure 2 For this application Figure 1 A detailed flow chart of step S10;
[0050] Figure 3 This is a functional module diagram of an embodiment of an image anonymization processing device of the present application;
[0051] Figure 4 Schematic diagram of the hardware structure of the image anonymization processing device involved in the embodiment of the present application. DETAILED DESCRIPTION
[0052] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0053] First, some technical terms in the present application are explained to facilitate those skilled in the art to understand the present application.
[0054] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0055] In a first aspect, an embodiment of the present application provides an image anonymization processing method.
[0056] In one embodiment, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the image anonymization processing method of this application. Figure 1 As shown, the image anonymization processing method includes:
[0057] Step S10: training a preset CNN regression model according to the acquired training data set to generate a corresponding anonymization processing model, wherein the training data set includes a face image or a license plate image, and the face image or the license plate image is annotated with sensitive area information and an optimal blur kernel standard deviation;
[0058] Exemplarily, a data set to be trained is obtained, which includes face images or license plate images, and each face image or license plate image is annotated with sensitive area information and the best blur kernel standard deviation. Each face image or license plate image in the data set to be trained is input into a preset CNN regression model to train the preset CNN regression model. After training, it is determined whether the preset CNN regression model is in a convergence state. If it is determined that the trained preset CNN regression model is in a convergence state, a corresponding anonymization processing model is generated. For example, the number of training times for training the preset CNN regression model is obtained. If the number of training times is greater than or equal to the preset number of training times, it is determined that the current preset CNN regression model is in a convergence state; if the number of training times is less than the preset number of training times, it is determined that the current preset CNN regression model is not in a convergence state, and the preset CNN regression model is trained again through the face images or license plate images in the training set until the preset CNN regression model is in a convergence state, and a corresponding anonymization processing model is generated.
[0059] Specifically, the method further includes: collecting facial images or license plate images; marking the coordinates of sensitive areas and the best blur kernel standard deviation of the facial images or license plate images to generate a dataset, wherein the dataset includes multiple facial images or license plate images with the coordinates of sensitive areas and the best blur kernel standard deviation marked; and dividing the dataset into a dataset to be trained and a validation dataset according to a preset ratio.
[0060] Exemplarily, face images or license plate images are collected, and the coordinates of sensitive areas and the best blur kernel standard deviation are annotated on the face images or license plate images to generate a data set, wherein the data set contains multiple face images or license plate images with the coordinates of sensitive areas and the best blur kernel standard deviation annotated. For example, there are 20,000 face images or license plate images with the coordinates of sensitive areas and the best blur kernel standard deviation annotated in the data set. According to the ratio, the face images or license plate images with the coordinates of sensitive areas and the best blur kernel standard deviation annotated in the data set are divided into a training data set and a verification data set. For example, according to the preset ratio of 3:1, the face images or license plate images with the coordinates of sensitive areas and the best blur kernel standard deviation annotated in the data set are divided into 15,000 and 5,000 images, wherein 15,000 images are used as the training data set and 5,000 images are used as the verification data set.
[0061] Step S20: verifying the anonymization processing model according to the obtained verification data set to determine whether the anonymization processing model is an optimal anonymization processing model;
[0062] Exemplarily, the acquired verification data set is used to verify the anonymization processing model to determine whether the anonymization processing model is the optimal anonymization processing model. For example, the verification data set contains 5,000 facial images or license plate images with the coordinates of the sensitive areas and the best blur kernel standard deviation. The 5,000 facial images or license plate images with the coordinates of the sensitive areas and the best blur kernel standard deviation are sequentially input into the anonymization processing model to obtain the corresponding Gaussian blur kernel parameters, and the accuracy is determined by comparing the corresponding best blur kernel standard deviation. When the accuracy of the 5,000 facial images or license plate images with the coordinates of the sensitive areas and the best blur kernel standard deviation is obtained in sequence, the obtained accuracy is compared with the preset accuracy; if the accuracy is greater than or equal to the preset accuracy, the anonymization processing model is determined to be the optimal anonymization processing model; if the accuracy is less than the preset accuracy, the anonymization processing model is determined to be not the optimal anonymization processing model, and the anonymization processing model needs to be continuously trained until the anonymization processing model is the optimal anonymization processing model.
[0063] Specifically, the anonymization processing model is verified according to the obtained verification data set to determine whether the anonymization processing model is the optimal anonymization processing model, including: verifying the anonymization processing model through the obtained verification data set to obtain the corresponding accuracy, recall rate and MAP value; if the accuracy is greater than or equal to the preset accuracy, the recall rate is less than or equal to the preset recall rate, and the MAP value is greater than or equal to the preset MAP value, then the anonymization processing model is determined to be the optimal anonymization processing model.
[0064] Exemplarily, the acquired verification data set is used to verify the anonymization processing model to determine whether the anonymization processing model is the optimal anonymization processing model. For example, the verification data set contains 5,000 facial images or license plate images with the coordinates of the sensitive areas and the best blur kernel standard deviation. The 5,000 facial images or license plate images with the coordinates of the sensitive areas and the best blur kernel standard deviation are sequentially input into the anonymization processing model to obtain the corresponding Gaussian blur kernel parameters. The corresponding best blur kernel standard deviation is compared to determine whether it is accurate, thereby obtaining the accuracy of the 5,000 facial images or license plate images with the coordinates of the sensitive areas and the best blur kernel standard deviation. The anonymization processing model is verified by 5,000 facial images or license plate images with the coordinates of the sensitive areas and the best blur kernel standard deviation, and the corresponding accuracy, recall rate and MAP value are obtained. The acquired accuracy is compared with the preset accuracy, the recall rate is compared with the preset recall rate, and the MAPP value is compared with the preset MAP value. If the accuracy is greater than or equal to the preset accuracy, the recall is less than or equal to the preset recall, and the MAP value is greater than or equal to the preset MAP value, it is determined that the anonymization processing model is the optimal anonymization processing model.
[0065] Specifically, after verifying the anonymization processing model by using the acquired verification data set to obtain the corresponding accuracy, recall rate and MAP value, the method further includes: if the accuracy is less than the preset accuracy, the recall rate is greater than the preset recall rate, and the MAP value is less than the preset MAP value, determining that the anonymization processing model is the optimal anonymization processing model; and adjusting the hyperparameters of the anonymization processing model by using the accuracy, the recall rate and the MAP value, so that the anonymization processing model after adjusting the hyperparameters is the optimal anonymization processing model.
[0066] Exemplarily, if the accuracy is less than the preset accuracy, the recall is greater than the preset recall, and the MAP value is less than the preset MAP value, the anonymization processing model is determined to be the optimal anonymization processing model; the hyperparameters of the anonymization processing model are adjusted by the accuracy, recall and MAP value, so that the anonymization processing model after adjusting the hyperparameters is the optimal anonymization processing model.
[0067] Step S30: If it is determined that the anonymization processing model is the optimal anonymization processing model, the image to be anonymized is processed based on the anonymization processing model to predict the Gaussian blur kernel parameters of the image to be anonymized;
[0068] Exemplarily, if the anonymization processing model is determined to be the optimal anonymization processing model, the image to be anonymized is obtained, and the obtained image to be anonymized is input into the anonymization processing model for processing, and the Gaussian blur kernel parameters of the image to be anonymized output by the anonymization processing model are obtained. For example, the obtained image to be anonymized is input into the anonymization processing model, and the anonymization processing model determines the area to be anonymized in the image to be anonymized, predicts the anonymized area, and obtains the corresponding Gaussian blur kernel parameters.
[0069] Step S40: performing anonymization processing on the image to be anonymized by using the Gaussian blur kernel parameters to generate an anonymized image.
[0070] Exemplarily, when the Gaussian blur kernel parameters are obtained, anonymization processing is performed on the region to be anonymized in the image to be anonymized by using the Gaussian blur kernel parameters to generate an anonymized image.
[0071] In this embodiment, a corresponding anonymization processing model is generated by training a preset CNN regression model according to an acquired data set to be trained, wherein the data set to be trained includes a face image or a license plate image, and the face image or the license plate image is annotated with sensitive area information and an optimal blur kernel standard deviation; the anonymization processing model is verified according to the acquired verification data set to determine whether the anonymization processing model is the optimal anonymization processing model; if it is determined that the anonymization processing model is the optimal anonymization processing model, the image to be anonymized is processed based on the anonymization processing model to predict the Gaussian blur kernel parameters of the image to be anonymized; the image to be anonymized is anonymized by the Gaussian blur kernel parameters to generate an anonymized image, thereby solving the technical problem of poor anonymization effect in the related art, realizing fully automatic intelligent anonymization, improving the anonymization effect and automation level, and reducing the need for manual intervention.
[0072] In one embodiment, referring to Figure 2 , Figure 2 For this application Figure 1 Detailed flow chart of step S10 in FIG. Figure 1 As shown, the preset CNN regression model is trained according to the acquired training data set to generate a corresponding anonymization processing model, including:
[0073] Step S11: inputting the face image or license plate image into a preset CNN regression model, wherein the preset CNN regression model includes an input layer, a convolution layer, a pooling layer, a fully connected layer and an output layer;
[0074] Exemplarily, a face image or a license plate image is input into a preset CNN regression model, each face image or license plate image is annotated with sensitive area information and an optimal blur kernel standard deviation, and there is more than one face image or license plate image.
[0075] Step S12: normalizing the sensitive area information of the input face image or the license plate image through the input layer to obtain the normalized sensitive area size;
[0076] Exemplarily, the input layer normalizes the sensitive area information of the input face image or license plate image. For example, the sensitive area information includes width and height, and the width and height constitute a two-dimensional feature S = (width, height). The maximum and minimum normalization method is used to map the width and height to the [0,1] interval. Traverse the training set to calculate the maximum and minimum values of the height: max_h, min_h. The maximum and minimum values of the width: max_w, min_w. Among them, the width in the two-dimensional feature is S_width = (width-min_w) / (max_w-min_w), and the height in the two-dimensional feature is S_height = (height-min_h) / (max_h-min_h). The size of the sensitive area after normalization is S = (S_width, S_height).
[0077] Step S13: extracting the sensitive area size and the optimal blur kernel standard deviation through the convolution layer to obtain input pair features;
[0078] Exemplarily, the sensitive region size S = (S_width, S_height) and the optimal blur kernel standard deviation σ are extracted through the convolution layer to obtain the input pair feature (S_width, S_height)->σ.
[0079] Step S14: reducing the dimension of the input pair features through the pooling layer;
[0080] Step S15: The Gaussian blur kernel standard deviation predicted after reducing the dimension of the input pair features through the fully connected layer output;
[0081] Demonstratively, the best Gaussian blur kernel standard deviation σ_pred predicted after reducing the dimensionality of the input pair features through the fully connected layer output.
[0082] Step S16: determining a loss value according to the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation;
[0083] Exemplarily, the Gaussian blur kernel standard deviation σ is compared with the Gaussian blur kernel standard deviation σ_pred, and the minimum value is selected as the loss function. For example, if the Gaussian blur kernel standard deviation σ is less than the Gaussian blur kernel standard deviation σ_pred, the Gaussian blur kernel standard deviation σ is determined to be used as the loss function. Alternatively, if the Gaussian blur kernel standard deviation σ is greater than the Gaussian blur kernel standard deviation σ_pred, the Gaussian blur kernel standard deviation σ_pred is determined to be used as the loss function. Alternatively, if the Gaussian blur kernel standard deviation σ is equal to the Gaussian blur kernel standard deviation σ_pred, the Gaussian blur kernel standard deviation σ_pred or the Gaussian blur kernel standard deviation σ is determined to be used as the loss function.
[0084] Specifically, determining the loss value according to the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation includes: comparing the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation; if the absolute difference between the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation is less than or equal to a preset hyperparameter, calculating the loss function according to a first preset loss function, the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation; if the absolute difference between the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation is greater than the preset hyperparameter, calculating the loss function according to a second preset loss function, the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation.
[0085] Exemplarily, the Gaussian blur kernel standard deviation σ is compared with the optimal blur kernel standard deviation σ_pred. If the absolute difference between the Gaussian blur kernel standard deviation σ and the optimal blur kernel standard deviation σ_pred is less than or equal to the preset hyperparameter δ, the loss function is calculated according to the first preset loss function, the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation. For example, when |σ-σ_pred|≤δ, the loss function is calculated according to the first preset loss function HuberLoss=0.5*(σ-σ_pred) 2 , calculate the loss function.
[0086] If the absolute difference between the Gaussian blur kernel standard deviation σ and the optimal blur kernel standard deviation σ_pred is greater than the preset hyperparameter δ, the loss function is calculated according to the second preset loss function, the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation. For example, when |σ-σ_pred|>δ, the second preset loss function HuberLoss=δ*|σ-σ_pred|-0.5*δ 2 , calculate the loss function.
[0087] Step S17: Determine the gradient value according to the loss function;
[0088] For example, the Adam algorithm is used to optimize the loss function Huber Loss to minimize the gap between σ_pred and σ. The gradient δHuberLoss / δW of the model weight value W is obtained through the loss function HuberLoss.
[0089] Step S18: Update the weight value of the preset CNN regression model according to the gradient value to generate a corresponding anonymization processing model.
[0090] Exemplarily, based on the gradient value δHuberLoss / δW, the first preset momentum coefficient β1, the second preset momentum coefficient β2 and the first preset formula v_t=β2*v_{t-1}+(1-β2)*(δL_huber / δW) 2 , calculate the first parameter v_t. Based on the gradient value δHuberLoss / δW, the first preset momentum coefficient β1, the second preset momentum coefficient β2 and the second preset formula m_t=β1*m_{t-1}+(1-β1)*δL_huber / δW, calculate the second parameter m_t. Based on the first parameter v_t, the preset second momentum coefficient β2 and the third preset formula v_hat=v_t / (1-β2 t ), calculate the third parameter v_hat. Based on the second parameter m_t, the preset first momentum parameter β1 and the fourth preset formula m_hat=m_t / (1-β1 t ), calculate the fourth parameter m_hat. Based on the third parameter v_hat, the fourth parameter m_hat, the preset global learning rate η, the preset constant ε and the fifth preset formula Calculate the target weight value W. Update the weight value of the preset CNN regression model with the target weight value to generate the corresponding anonymization processing model.
[0091] In this embodiment, the preset CNN regression model is trained by using the acquired data set to be trained to generate a corresponding anonymization processing model, thereby achieving the effect of improving the anonymization effect and the degree of automation.
[0092] In a second aspect, an embodiment of the present application also provides an image anonymization processing device.
[0093] In one embodiment, referring to Figure 3 , Figure 3 This is a functional module diagram of an embodiment of the image anonymization processing device of the present application. Figure 3 As shown, the image anonymization processing device includes:
[0094] The first generating module 10 is used to train a preset CNN regression model according to the acquired training data set to generate a corresponding anonymization processing model, wherein the training data set includes a face image or a license plate image, and the face image or the license plate image is annotated with sensitive area information and an optimal blur kernel standard deviation;
[0095] A determination module 20, configured to verify the anonymization processing model according to the obtained verification data set, and determine whether the anonymization processing model is an optimal anonymization processing model;
[0096] A prediction module 30, configured to process the image to be anonymized based on the anonymization processing model and predict Gaussian blur kernel parameters of the image to be anonymized if the anonymization processing model is determined to be the optimal anonymization processing model;
[0097] The second generating module 40 is used to perform anonymization processing on the image to be anonymized by using the Gaussian blur kernel parameters to generate an anonymized image.
[0098] Furthermore, in one embodiment, the first generating module 10 is used to:
[0099] Inputting the face image or license plate image into a preset CNN regression model, wherein the preset CNN regression model includes an input layer, a convolution layer, a pooling layer, a fully connected layer and an output layer;
[0100] Normalizing the sensitive area information of the input face image or the license plate image through the input layer to obtain the normalized sensitive area size;
[0101] Extracting the sensitive area size and the optimal blur kernel standard deviation through the convolution layer to obtain input pair features;
[0102] Reducing the dimension of the input pair features by the pooling layer;
[0103] Outputting the predicted Gaussian blur kernel standard deviation through the fully connected layer;
[0104] Determining a loss value according to the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation;
[0105] According to the loss function, a gradient value is determined;
[0106] The weight value of the preset CNN regression model is updated according to the gradient value to generate a corresponding anonymization processing model.
[0107] Furthermore, in one embodiment, the first generating module 10 is used to:
[0108] Comparing the Gaussian blur kernel standard deviation with the optimal blur kernel standard deviation;
[0109] If the absolute difference between the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation is less than or equal to a preset hyperparameter, a loss function is calculated according to a first preset loss function, the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation;
[0110] If the absolute difference between the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation is greater than the preset hyperparameter, a loss function is calculated according to a second preset loss function, the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation.
[0111] Furthermore, in one embodiment, the first generating module 10 is used to:
[0112] Calculating a first parameter based on the gradient value, the first preset momentum coefficient, the second preset momentum coefficient and the first preset formula;
[0113] Calculating a second parameter based on the gradient value, the first preset momentum coefficient, the second preset momentum coefficient, and the second preset formula;
[0114] Calculating a third parameter based on the first parameter, the preset second momentum coefficient and a third preset formula;
[0115] Calculating a fourth parameter based on the second parameter, the preset first momentum parameter and a fourth preset formula;
[0116] Calculating a target weight value based on the third parameter, the fourth parameter, a preset global learning rate, a preset constant and a fifth preset formula;
[0117] The weight value of the preset CNN regression model is updated by the target weight value to generate a corresponding anonymization processing model.
[0118] Furthermore, in one embodiment, the determination module 20 is used to:
[0119] The anonymization processing model is verified by using the obtained verification data set to obtain the corresponding accuracy, recall rate and MAP value;
[0120] If the accuracy is greater than or equal to the preset accuracy, the recall is less than or equal to the preset recall, and the MAP value is greater than or equal to the preset MAP value, it is determined that the anonymization processing model is the optimal anonymization processing model.
[0121] Furthermore, in one embodiment, the image anonymization processing apparatus further includes a new module for:
[0122] If the accuracy is less than the preset accuracy, the recall is greater than the preset recall, and the MAP value is less than the preset MAP value, then determining that the anonymization processing model is the optimal anonymization processing model;
[0123] The hyperparameters of the anonymization processing model are adjusted according to the accuracy, the recall rate and the MAP value, so that the anonymization processing model after adjusting the hyperparameters is an optimal anonymization processing model.
[0124] Furthermore, in one embodiment, the image anonymization processing apparatus further includes a new module for:
[0125] Collect images containing human faces or license plate images;
[0126] Marking the coordinates of the sensitive area and the best blur kernel standard deviation of the face image or license plate image to generate a data set, wherein the data set includes multiple face images or license plate images with the coordinates of the sensitive area and the best blur kernel standard deviation marked;
[0127] According to a preset ratio, the data set is divided into a training data set and a verification data set.
[0128] The functional implementation of each module in the above-mentioned image anonymization processing device corresponds to each step in the above-mentioned image anonymization processing method embodiment, and its functions and implementation processes are not described one by one here.
[0129] In a third aspect, an embodiment of the present application provides an image anonymization processing device, which may be a device with data processing function, such as a personal computer (PC), a laptop computer, or a server.
[0130] Reference Figure 4 , Figure 4 Schematic diagram of the hardware structure of the image anonymization processing device involved in the embodiment of the present application. In the embodiment of the present application, the image anonymization processing device may include a processor, a memory, a communication interface and a communication bus.
[0131] The communication bus may be of any type and is used to interconnect the processor, the memory, and the communication interface.
[0132] The communication interface includes input / output (I / O) interfaces, physical interfaces, and logical interfaces for interconnecting devices within the image anonymization processing device, as well as interfaces for interconnecting the image anonymization processing device with other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, an optical fiber interface, an ATM interface, etc.; the user device can be a display, a keyboard, etc.
[0133] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0134] The processor may be a general-purpose processor, which may call the image anonymization processing program stored in the memory and execute the image anonymization processing method provided in the embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the image anonymization processing program is called may refer to the various embodiments of the image anonymization processing method of the present application, which will not be described in detail here.
[0135] Those skilled in the art will understand that Figure 4 The hardware structure shown in the figure does not constitute a limitation on the present application, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0136] In a fourth aspect, an embodiment of the present application also provides a computer-readable storage medium.
[0137] The computer-readable storage medium of the present application stores an image anonymization processing program, wherein when the image anonymization processing program is executed by a processor, the steps of the above-mentioned image anonymization processing method are implemented.
[0138] The method implemented when the image anonymization processing program is executed can refer to the various embodiments of the image anonymization processing method of the present application, and will not be described in detail here.
[0139] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.
[0140] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.
[0141] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.
[0142] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; the “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.
[0143] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.
[0144] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.
[0145] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for anonymizing an image, characterized in that: The image anonymization processing method comprises: The preset CNN regression model is trained according to the acquired training data set to generate a corresponding anonymization processing model, wherein the training data set includes a face image or a license plate image, and the face image or the license plate image is annotated with sensitive area information and an optimal blur kernel standard deviation; Verifying the anonymization processing model according to the obtained verification data set to determine whether the anonymization processing model is an optimal anonymization processing model; If it is determined that the anonymization processing model is the optimal anonymization processing model, the image to be anonymized is processed based on the anonymization processing model to predict the Gaussian blur kernel parameters of the image to be anonymized; The image to be anonymized is anonymized by using the Gaussian blur kernel parameters to generate an anonymized image.
2. The image anonymization processing method according to claim 1, characterized in that: The method of training a preset CNN regression model according to the acquired training data set to generate a corresponding anonymization processing model includes: Inputting the face image or license plate image into a preset CNN regression model, wherein the preset CNN regression model includes an input layer, a convolution layer, a pooling layer, a fully connected layer and an output layer; Normalizing the sensitive area information of the input face image or the license plate image through the input layer to obtain the normalized sensitive area size; Extracting the sensitive area size and the optimal blur kernel standard deviation through the convolution layer to obtain input pair features; Reducing the dimension of the input pair features by the pooling layer; The Gaussian blur kernel standard deviation predicted after reducing the dimension of the input pair features through the fully connected layer output; Determining a loss value according to the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation; Determine a gradient value according to the loss function; The weight value of the preset CNN regression model is updated according to the gradient value to generate a corresponding anonymization processing model.
3. The image anonymization processing method according to claim 2, characterized in that: The determining of the loss value according to the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation comprises: Comparing the Gaussian blur kernel standard deviation with the optimal blur kernel standard deviation; If the absolute difference between the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation is less than or equal to a preset hyperparameter, a loss function is calculated according to a first preset loss function, the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation; If the absolute difference between the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation is greater than the preset hyperparameter, a loss function is calculated according to a second preset loss function, the Gaussian blur kernel standard deviation and the optimal blur kernel standard deviation.
4. The image anonymization processing method according to claim 2, characterized in that: The step of updating the weight value of the preset CNN regression model according to the gradient value to generate a corresponding anonymization processing model includes: Calculating a first parameter based on the gradient value, the first preset momentum coefficient, the second preset momentum coefficient and the first preset formula; Calculating a second parameter based on the gradient value, the first preset momentum coefficient, the second preset momentum coefficient, and the second preset formula; Calculating a third parameter based on the first parameter, the preset second momentum coefficient and a third preset formula; Calculating a fourth parameter based on the second parameter, the preset first momentum parameter and a fourth preset formula; Calculating a target weight value based on the third parameter, the fourth parameter, a preset global learning rate, a preset constant and a fifth preset formula; The weight value of the preset CNN regression model is updated by the target weight value to generate a corresponding anonymization processing model.
5. The image anonymization processing method according to claim 1, characterized in that: The verifying the anonymization processing model according to the obtained verification data set to determine whether the anonymization processing model is an optimal anonymization processing model includes: The anonymization processing model is verified by using the obtained verification data set to obtain the corresponding accuracy, recall rate and MAP value; If the accuracy is greater than or equal to a preset accuracy, the recall is less than or equal to a preset recall, and the MAP value is greater than or equal to a preset MAP value, it is determined that the anonymization processing model is an optimal anonymization processing model.
6. The image anonymization processing method according to claim 5, characterized in that: After verifying the anonymization processing model with the obtained verification data set to obtain the corresponding accuracy, recall rate and MAP value, the method further includes: If the accuracy is less than the preset accuracy, the recall is greater than the preset recall, and the MAP value is less than the preset MAP value, then determining that the anonymization processing model is the optimal anonymization processing model; The hyperparameters of the anonymization processing model are adjusted according to the accuracy, the recall rate and the MAP value, so that the anonymization processing model after adjusting the hyperparameters is an optimal anonymization processing model.
7. The image anonymization processing method according to claim 1, characterized in that: The method further includes: training the preset CNN regression model according to the acquired training data set to generate a corresponding anonymization processing model; Collect images containing human faces or license plate images; Marking the coordinates of the sensitive area and the best blur kernel standard deviation of the face image or license plate image to generate a data set, wherein the data set includes multiple face images or license plate images with the coordinates of the sensitive area and the best blur kernel standard deviation marked; According to a preset ratio, the data set is divided into a training data set and a verification data set.
8. An image anonymization processing device, characterized in that: The image anonymization processing device comprises: A first generating module is used to train a preset CNN regression model according to the acquired training data set to generate a corresponding anonymization processing model, wherein the training data set includes a face image or a license plate image, and the face image or the license plate image is annotated with sensitive area information and an optimal blur kernel standard deviation; A determination module, used to verify the anonymization processing model according to the obtained verification data set, and determine whether the anonymization processing model is an optimal anonymization processing model; A prediction module, configured to process the image to be anonymized based on the anonymization processing model and predict Gaussian blur kernel parameters of the image to be anonymized if the anonymization processing model is determined to be the optimal anonymization processing model; The second generating module is used to perform anonymization processing on the image to be anonymized by using the Gaussian blur kernel parameters to generate an anonymized image.
9. An image anonymization processing device, characterized in that: The image anonymization processing device includes a processor, a memory, and an image anonymization processing program stored in the memory and executable by the processor, wherein when the image anonymization processing program is executed by the processor, the steps of the image anonymization processing method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer readable storage medium An image anonymization processing program is stored, wherein when the image anonymization processing program is executed by the processor, Implement the steps of the image anonymization processing method according to any one of claims 1 to 7.
Citation Information
Cited By
Target identification system suitable for vehicle image privacy compliance detection
CN121392799A
Standard anonymized region generation method based on calculation of proportion of five sense organs of human face
CN121392943A
Multi-type image anonymization annotation data set construction and target coverage rate judgment method
CN121415403A
Method for constructing multi-type image anonymization labeled dataset and target coverage determination
CN121415403B