Image processing method, electronic device, storage medium and program product
Through the pre-trained image conversion model, the sample image and noise are used to convert the image conversion model trained by the neural network to convert the image to be processed, which solves the problem of privacy data leakage in artificial intelligence image classification technology and achieves improvement while protecting privacy. Image realistic effects.
Patent Information
- Application Number
- CN202411231645.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-09-04
AI Technical Summary
In artificial intelligence image classification technology, directly using original user data will leak private data, such as human image data used in autonomous driving systems. How to protect privacy without affecting the fidelity of image processing.
Through the pre-trained image conversion model, sample images and noise are used to train the neural network, and the image conversion model is obtained to convert the image to be processed, prevent privacy data leakage, and generate target images while ensuring image fidelity.
Effectively protect user data privacy, improve the fidelity of processed images, avoid privacy data leakage, and meet the needs of image processing.
Smart Images

Figure CN118734367A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image processing method, electronic equipment, storage medium and program product. Background Art
[0002] At present, with the rapid development of artificial intelligence technology, the application of artificial intelligence technology is becoming more and more extensive, and has been applied to many fields such as image analysis, speech recognition, text processing, intelligent recommendation, security detection, etc. Image classification technology based on artificial intelligence has always been a cutting-edge hotspot in the field of artificial intelligence, but in some application scenarios, directly using the original user data will leak the user's privacy data. For example, the image data of people collected on the road is used to train the visual model of the autonomous driving system. However, in order to protect the facial information of the person and avoid the leakage and abuse of the facial information, the person image needs to be processed for privacy protection before use. Therefore, how to ensure that the privacy data in the user data is not leaked and does not affect the normal image processing business is an urgent problem to be solved. Summary of the invention Some embodiments of the present application aim to provide an image processing method, an electronic device, a storage medium and a program product. Through the technical solutions of the embodiments of the present application, an image to be processed is obtained; the image to be processed is converted according to a pre-trained image conversion model to obtain a target image corresponding to the image to be processed, wherein the pre-trained image conversion model is obtained by training a neural network with sample images and noise, and the image conversion model is used to convert the sample image. In the embodiments of the present application, an image conversion model is obtained by training a neural network with sample images and noise, and the image conversion model is used to convert the sample image to prevent the leakage of privacy data. After the image to be processed is obtained, the image conversion model can be used to convert data in the image to be processed that is not wanted to be leaked to obtain a processed image. The realism of the processed image can be improved as much as possible under the premise of ensuring that the generated image does not leak the privacy of user data.
[0003] In a first aspect, some embodiments of the present application provide an image processing method, including: Get the image to be processed; According to a pre-trained image conversion model, the image to be processed is converted to obtain a target image corresponding to the image to be processed, wherein the pre-trained image conversion model is obtained by training a neural network using sample images and noise, and the image conversion model is used to convert the sample image.
[0004] Some embodiments of the present application obtain an image conversion model by training a neural network with sample images and noise. The image conversion model is used to convert sample images to prevent privacy data from being leaked. After obtaining the image to be processed, the image conversion model can be used to convert data in the image to be processed that do not want to be leaked to obtain a processed image. The realism of the processed image can be maximized while ensuring that the generated image does not leak user data privacy.
[0005] Optionally, the pre-trained image conversion model is obtained by: Get a sample image; According to the sample image, determining a first eigenvector of the sample image and a mean value of a first latent variable corresponding to the sample image; Determine a second eigenvector corresponding to the sample image according to a mean value and an initial noise of a first latent variable corresponding to the sample image; constructing a generalized Lagrangian function according to the first eigenvector and the second eigenvector; Using a dual gradient method, determining a target noise corresponding to the generalized Lagrangian function; The image conversion model is determined according to the target noise and the mean of the first latent variable corresponding to the sample image.
[0006] Some embodiments of the present application use a method of quantitatively adding noise to the input data of a generative adversarial network, so that the generated image data has higher realism compared to inputting completely random noise.
[0007] Optionally, determining, according to the sample image, a first eigenvector of the sample image and a mean value of a first latent variable corresponding to the sample image includes: Using a known VAE / GAN model architecture, training is performed according to the sample data to obtain parameters of a data generation branch, and determining a probability distribution of a first latent variable according to the parameters of the data generation branch, wherein the probability distribution includes at least a mean of the first latent variable and a variance of the first latent variable; Randomly obtain a first latent variable sample from the probability distribution of the first latent variable; Decoding the first latent variable sample to generate a first decoded sample; According to the sample image, a first eigenvector corresponding to the one-dimensionalized eigentensor output by the Lth layer is determined, where L is a natural number greater than 0.
[0008] Some embodiments of the present application adopt the known variational autoencoder / generative adversarial network (VAE / GAN) model architecture to obtain a data generation branch based on sample image training.
[0009] Optionally, determining a second eigenvector corresponding to the sample image according to a mean value and an initial noise of a first latent variable corresponding to the sample image includes: Acquiring the initial noise; Determine a second latent variable sample according to the mean of the first latent variable corresponding to the sample image and the initial noise; Generate a second decoding sample according to the second latent variable sample; According to the second decoded sample, a second eigenvector corresponding to the one-dimensionalized eigentensor output by the Lth layer is determined.
[0010] In some embodiments of the present application, by using a method of quantitatively adding noise to the input data of a generative adversarial network, the generated image data has higher realism compared to inputting completely random noise.
[0011] Optionally, constructing a generalized Lagrangian function according to the first eigenvector and the second eigenvector includes: The generalized Lagrangian function is determined according to the first eigenvector, the second eigenvector and a test result threshold constant, wherein the test result threshold constant is determined by the maximum value of all squares of the second norm of the difference between the first eigenvector and the second eigenvector obtained based on multiple sample images and minimum random noise, under the condition that the size of the random noise reaches the effect of protecting the privacy of user data.
[0012] Some embodiments of the present application calculate the corresponding , the mean of the first latent variable corresponding to sample X and noise The added hidden variable samples are input into the training privacy protection branch, where: is the optimal solution or approximate optimal solution of the parameter ε in the generalized Lagrangian function, and the decoded samples output by the training privacy protection branch are used as the generated training samples corresponding to the sample image X.
[0013] Optionally, the generalized Lagrangian function is: ; in, is the first eigenvector, is the second eigenvector, Represents the vector The square of the second norm of is the Lagrange multiplier, , is the test result threshold constant, For noise.
[0014] Some embodiments of the present application calculate the generalized Lagrangian function by using the first eigenvector and the second eigenvector, and solve the maximum and minimum problems of the generalized Lagrangian function by using the dual gradient method, so as to obtain the optimal noise.
[0015] Optionally, the adopting a dual gradient method to determine a target noise corresponding to the generalized Lagrangian function includes: The dual gradient method is used to process the generalized Lagrangian function to obtain the optimal solution or approximate optimal solution corresponding to the generalized Lagrangian function. ; The optimal solution or the approximate optimal solution is determined as the target noise corresponding to the generalized Lagrangian function.
[0016] Some embodiments of the present application calculate the generalized Lagrangian function by using the first eigenvector and the second eigenvector, and solve the maximum and minimum problems of the generalized Lagrangian function by using the dual gradient method, so as to obtain the optimal noise.
[0017] In a second aspect, some embodiments of the present application provide an image processing device, including: An acquisition module, used for acquiring an image to be processed; A modification module is used to convert the image to be processed according to a pre-trained image conversion model to obtain a target image corresponding to the image to be processed, wherein the pre-trained image conversion model is obtained by training a neural network using sample images and noise, and the image conversion model is used to convert the sample image.
[0018] Some embodiments of the present application obtain an image conversion model by training a neural network with sample images and noise. The image conversion model is used to convert sample images to prevent privacy data from being leaked. After obtaining the image to be processed, the image conversion model can be used to convert data in the image to be processed that do not want to be leaked to obtain a processed image. The realism of the processed image can be maximized while ensuring that the generated image does not leak user data privacy.
[0019] Optionally, the device further comprises a training module, wherein the training module is used to: Get a sample image; According to the sample image, determining a first eigenvector of the sample image and a mean value of a first latent variable corresponding to the sample image; Determine a second eigenvector corresponding to the sample image according to a mean value and an initial noise of a first latent variable corresponding to the sample image; constructing a generalized Lagrangian function according to the first eigenvector and the second eigenvector; Using a dual gradient method, determining a target noise corresponding to the generalized Lagrangian function; The image conversion model is determined according to the target noise and the mean of the first latent variable corresponding to the sample image.
[0020] Some embodiments of the present application use a method of quantitatively adding noise to the input data of a generative adversarial network, so that the generated image data has higher realism compared to inputting completely random noise.
[0021] Optionally, the training module is used to: Encoding the sample image to obtain a probability distribution of a first latent variable, wherein the probability distribution includes at least a mean value of the first latent variable and a variance of the first latent variable; Randomly obtain a first latent variable sample from the probability distribution of the first latent variable; Decoding the first latent variable sample to generate a first decoded sample; According to the sample image, a first eigenvector corresponding to the one-dimensionalized eigentensor output by the Lth layer is determined, where L is a natural number greater than 0.
[0022] Some embodiments of the present application adopt the known variational autoencoder / generative adversarial network (VAE / GAN) model architecture to obtain a data generation branch based on sample image training.
[0023] Optionally, the training module is used to: Acquiring the initial noise; Determine a second latent variable sample according to the mean of the first latent variable corresponding to the sample image and the initial noise; Generate a second decoding sample according to the second latent variable sample; According to the second decoded sample, a second eigenvector corresponding to the one-dimensionalized eigentensor output by the Lth layer is determined.
[0024] In some embodiments of the present application, by using a method of quantitatively adding noise to the input data of a generative adversarial network, the generated image data has higher realism compared to inputting completely random noise.
[0025] Optionally, the training module is used to: The generalized Lagrangian function is determined according to the first eigenvector, the second eigenvector and a test result threshold constant, wherein the test result threshold constant is determined by the maximum value of all squares of the second norm of the difference between the first eigenvector and the second eigenvector obtained based on multiple sample images and minimum random noise, under the condition that the size of the random noise reaches the effect of protecting the privacy of user data.
[0026] Some embodiments of the present application calculate the corresponding , the mean of the first latent variable corresponding to sample X and noise The latent variable samples obtained by adding are input into the training privacy protection branch, and the decoded samples output by the training privacy protection branch are used as the generated training samples corresponding to the sample image X.
[0027] Optionally, the generalized Lagrangian function is: ; in, is the first eigenvector, is the second eigenvector, Represents the vector The square of the second norm of is the Lagrange multiplier, , is the test result threshold constant, For noise.
[0028] Some embodiments of the present application calculate the generalized Lagrangian function by using the first eigenvector and the second eigenvector, and solve the maximum and minimum problems of the generalized Lagrangian function by using the dual gradient method, so as to obtain the optimal noise.
[0029] Optionally, the training module is used to: The generalized Lagrangian function is processed by using a dual gradient method to obtain an optimal solution or a near-optimal solution corresponding to the generalized Lagrangian function; The optimal solution or the approximate optimal solution is determined as the target noise corresponding to the generalized Lagrangian function.
[0030] Some embodiments of the present application calculate the generalized Lagrangian function by using the first eigenvector and the second eigenvector, and solve the maximum and minimum problems of the generalized Lagrangian function by using the dual gradient method, so as to obtain the optimal noise.
[0031] In a third aspect, some embodiments of the present application provide an electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor, when executing the program, can implement the image processing method as described in any embodiment of the first aspect.
[0032] In a fourth aspect, some embodiments of the present application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the image processing method as described in any embodiment of the first aspect.
[0033] In a fifth aspect, some embodiments of the present application provide a computer program product, wherein the computer program product comprises a computer program, wherein when the computer program is executed by a processor, it can implement the image processing method as described in any embodiment of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions of some embodiments of the present application, the drawings required for use in some embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 A flowchart of an image processing method provided in an embodiment of the present application; Figure 2 A flowchart of another image processing method provided in an embodiment of the present application; Figure 3 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application; Figure 4 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] The technical solutions in some embodiments of the present application will be described below in conjunction with the drawings in some embodiments of the present application.
[0037] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0038] At present, with the rapid development of artificial intelligence technology, the application of artificial intelligence technology is becoming more and more extensive, and has been applied to many fields such as image analysis, speech recognition, text processing, intelligent recommendation, security detection, etc. Image classification technology based on artificial intelligence has always been a cutting-edge hotspot in the field of artificial intelligence, but in some application scenarios, directly using the original user data will leak the user's privacy data. For example, the image data of people collected on the road is used to train the visual model of the autonomous driving system. However, in order to protect the facial information of the person and avoid the leakage and abuse of the facial information, the person image needs to be processed for privacy protection before use. Therefore, how to ensure that the privacy data in the user data is not leaked and does not affect the normal image processing business is an urgent problem to be solved. In view of this, some embodiments of the present application provide an image processing method, which includes obtaining an image to be processed; according to a pre-trained image conversion model , converting the image to be processed to obtain a target image corresponding to the image to be processed, wherein the pre-trained image conversion model is obtained by training a neural network with a sample image and noise, and the image conversion model is used to convert the sample image. In the embodiment of the present application, the image conversion model is obtained by training a neural network with a sample image and noise, and the image conversion model is used to convert the sample image to prevent the leakage of privacy data. After obtaining the image to be processed, the image conversion model can be used to convert the data that does not want to be leaked in the image to be processed to obtain a processed image. The realism of the processed image can be maximized under the premise of ensuring that the generated image does not leak the privacy of user data.
[0039] like Figure 1 As shown, an embodiment of the present application provides an image processing method, the method comprising: S101, obtaining an image to be processed; Specifically, the terminal device obtains an image to be processed, where the image to be processed includes private data. For example, the private data may be a face of a person, and data that is not to be disclosed.
[0040] S102. According to a pre-trained image conversion model, the image to be processed is converted to obtain a target image corresponding to the image to be processed, wherein the pre-trained image conversion model is obtained by training a neural network using sample images and noise, and the image conversion model is used to convert the sample image.
[0041] Specifically, an image conversion model is pre-stored on the terminal device. The image conversion model uses a large amount of sample image privacy data to train the neural network with images and noise. The sample image contains privacy data. The trained model can convert the sample image, for example, deform it, change the original privacy data, and prevent the privacy data from being leaked. After obtaining the image to be processed, the terminal device inputs the image to be processed into the image conversion model, deforms the image at different positions in the image to be processed, and obtains a processed target image. The processed target image deforms the privacy data relative to the original image, and ensures that the pixels are the same as the original image to avoid privacy data leakage.
[0042] For example, the person image data collected on the road is used to train the visual model of the autonomous driving system. However, in order to protect the facial information of the person and prevent the facial information from being leaked and abused, the person image needs to be processed for privacy protection before use to avoid the leakage of private data.
[0043] Some embodiments of the present application obtain an image conversion model by training a neural network with sample images and noise. The image conversion model is used to convert sample images to prevent privacy data from being leaked. After obtaining the image to be processed, the image conversion model can be used to convert data in the image to be processed that do not want to be leaked to obtain a processed image. The realism of the processed image can be maximized while ensuring that the generated image does not leak user data privacy.
[0044] Another embodiment of the present application further supplements the image processing method provided by the above embodiment.
[0045] Optionally, a pre-trained image conversion model is obtained as follows: Get a sample image; According to the sample image, determining a first eigenvector of the sample image and a mean value of a first latent variable corresponding to the sample image; Determine a second eigenvector corresponding to the sample image according to the mean value of the first latent variable corresponding to the sample image and the initial noise; Constructing a generalized Lagrangian function according to the first eigenvector and the second eigenvector; The dual gradient method is used to determine the target noise corresponding to the generalized Lagrangian function; The image conversion model is determined according to the mean of the first latent variable corresponding to the target noise and the sample image.
[0046] Specifically, Figure 2 As shown, the image conversion model provided in the embodiment of the present application includes at least two branches, one is a training data generation branch, and the other is a training privacy protection branch; in: (1) Training data generation branch The specific steps of training the data generation branch are: using the known variational autoencoder / generative adversarial network (VAE / GAN) model architecture, and training the data generation branch based on the data set D that needs to protect data privacy.
[0047] The data generation branch includes three parts: encoding unit Enc, decoding unit Dec1 and differentiation unit Dsc1; The input of the encoding unit Enc is any sample X in the data set D, and the output is the mean of the probability distribution of the latent variable Z. and variance .
[0048] The input of the decoding unit Dec1 is from the Gaussian distribution Hidden variable samples randomly sampled from , the output is the decoded sample of sample X .
[0049] The distinguishing unit Dsc1 contains 1 input and 2 outputs. When the input is sample X, the distinguishing unit output 1 is the probability that sample X is a true sample, and output 2 is the feature vector corresponding to the one-dimensional feature tensor of sample X output by the Lth layer of the distinguishing unit Dsc1; when the input is a decoded sample When , the output 1 is the decoded sample is the probability of a true sample, and output 2 is the decoded sample output by the Lth layer of the distinguishing unit Dsc1 The corresponding eigenvector after the eigentensor is converted to one dimension.
[0050] (2) Training the privacy-preserving branch The specific steps for training the privacy-preserving branch are: 1) The privacy protection branch includes a decoding unit Dec2 and a distinguishing unit Dsc2, wherein the decoding unit Dec2 has the same structure and parameter values as the decoding unit Dec1, and the distinguishing unit Dsc2 has the same structure and parameter values as the distinguishing unit Dsc1.
[0051] The input of the decoding unit Dec2 is the mean of the first latent variable corresponding to sample X and noise The hidden variable samples obtained by adding , the output is the decoded sample of sample X .
[0052] The input of the distinguishing unit Dsc2 is the decoded sample , the output is the feature vector corresponding to the one-dimensional feature tensor output by the Lth layer of the distinguishing unit Dsc2, where and have the same dimensions.
[0053] 2) The output 2 of the Lth layer of the distinguishing unit Dsc1 of the data generation branch for sample X is recorded as , the Lth layer of the privacy protection branch’s distinguishing unit Dsc2 is targeted at the decoded sample The output of .
[0054] The objective function for training the privacy-preserving branch is defined as , All model parameters of the two branches are fixed, and the dual gradient method is used to solve the generalized Lagrangian function. The minimax problem , get the optimal solution or approximate optimal solution .
[0055] in, Represents the vector The square of the second norm of is the Lagrange multiplier, , is a threshold constant determined based on the test results.
[0056] (3) The specific steps of generating training data are as follows: for each sample image X in the data set D, the mean μ of the first latent variable corresponding to the sample image is calculated through the training data branch, and the mean μ of the first latent variable corresponding to the sample image X is converted to and noise The hidden variable samples obtained by adding are input into the decoding unit Dec2, and the decoded samples output by Dec2 are used as the generated training samples corresponding to sample X. All generated training samples together constitute the image training data that protects data privacy. . It can provide realistic training data for the training of other image classification models while protecting the data privacy of D.
[0057] Some embodiments of the present application use a method of quantitatively adding noise to the input data of a generative adversarial network, so that the generated image data has higher realism compared to inputting completely random noise.
[0058] Optionally, determining, according to the sample image, a first eigenvector of the sample image and a mean value of a first latent variable corresponding to the sample image includes: Encoding the sample image to obtain a probability distribution of the first latent variable, wherein the probability distribution includes at least a mean value of the first latent variable and a variance of the first latent variable; Randomly obtain a first latent variable sample from the probability distribution of the first latent variable; Decoding the first latent variable sample to generate a first decoded sample; According to the sample image, the first eigenvector corresponding to the one-dimensionalized feature tensor output by the Lth layer is determined, where L is a natural number greater than 0.
[0059] Specifically, some embodiments of the present application adopt the known variational autoencoder / generative adversarial network (VAE / GAN) model architecture to obtain a data generation branch based on sample image training.
[0060] Optionally, determining a second eigenvector corresponding to the sample image according to a mean value and an initial noise of the first latent variable corresponding to the sample image includes: Get the initial noise; Determine a second latent variable sample according to the mean value and initial noise of the first latent variable corresponding to the sample image; Generate a second decoding sample according to the second latent variable sample; According to the second decoded sample, a second eigenvector corresponding to the one-dimensionalized eigentensor output by the Lth layer is determined.
[0061] In some embodiments of the present application, by using a method of quantitatively adding noise to the input data of a generative adversarial network, the generated image data has higher realism compared to inputting completely random noise.
[0062] Optionally, constructing a generalized Lagrangian function according to the first eigenvector and the second eigenvector includes: The generalized Lagrangian function is determined according to the first eigenvector, the second eigenvector and a test result threshold constant, wherein the test result threshold constant is determined by the maximum value of all squares of the second norm of the difference between the first eigenvector and the second eigenvector obtained based on multiple sample images and minimum random noise, under the condition that the size of the random noise reaches the effect of protecting the privacy of user data.
[0063] Among them, the multiple sample images are obtained by random sampling based on all the sample images, and can also be all the sample images, which is not specifically limited in the embodiments of the present application.
[0064] Some embodiments of the present application calculate the corresponding , the mean of the first latent variable corresponding to sample X and noise The latent variable samples obtained by adding are input into the training privacy protection branch, and the decoded samples output by the training privacy protection branch are used as the generated training samples corresponding to the sample image X.
[0065] Optionally, the generalized Lagrangian function is based on the first eigenvector and the second eigenvector, and Confirmed, specifically: ; in, is the first eigenvector, is the second eigenvector, Represents the vector The square of the second norm of is the Lagrange multiplier, , is the test result threshold constant, For noise, is the optimal solution or approximate optimal solution of the parameter ε in the generalized Lagrangian function.
[0066] Some embodiments of the present application calculate the generalized Lagrangian function by using the first eigenvector and the second eigenvector, and solve the maximum and minimum problems of the generalized Lagrangian function by using the dual gradient method, so as to obtain the optimal noise.
[0067] Optionally, a dual gradient method is used to determine a target noise corresponding to the generalized Lagrangian function, including: The dual gradient method is used to process the generalized Lagrangian function to obtain the optimal solution or approximate optimal solution corresponding to the generalized Lagrangian function; The optimal solution or the approximate optimal solution is determined as the target noise corresponding to the generalized Lagrangian function.
[0068] Specifically, in the embodiment of the present application, after obtaining the generalized Lagrangian function, the dual gradient method is used to solve the optimal solution or the approximate optimal solution. The process is as follows: a) Choose an initial Lagrange multiplier , which can usually be set to 0 or a small positive number to set the number of iterations .
[0069] b) For the current Lagrange multiplier , using the gradient descent method to solve .
[0070] c) For the updated , update using the gradient ascent method ,in is the learning rate.
[0071] d) If If the value is less than a preset smaller threshold or the maximum number of iterations has been reached, the iteration stops; otherwise, the loop repeats steps b), c), and d).
[0072] e) When the iteration stops, output the final The value of is taken as the optimal solution or approximate optimal solution .
[0073] That is to say, for the noise added during the model training process, the optimal noise that meets the requirements is obtained by calculating the optimal solution or approximate optimal solution of the generalized Lagrangian function.
[0074] Some embodiments of the present application calculate the generalized Lagrangian function by using the first eigenvector and the second eigenvector, and solve the maximum and minimum problems of the generalized Lagrangian function by using the dual gradient method, so as to obtain the optimal noise.
[0075] In the embodiment of the present application, a known VAE / GAN model architecture is adopted, and the data generation branch of the model is obtained by training based on a sensitive target image dataset D for which data privacy needs to be protected.
[0076] Specifically, the terminal device randomly samples a number of image samples, namely, sample images, from the data set D, and for each sample image X, inputs the sample image into the distinction unit to obtain the Lth layer output of the distinction unit ; The first latent variable of the sample image corresponds to and random noise After adding, input the distinguishing unit to get the L-th layer output of the distinguishing unit ; Start from 0 and keep increasing random noise The size of the two L-th layer outputs is large enough to protect the privacy of user data. Record this time The value of ; Find all the image samples The maximum value is taken as The value of .
[0077] Then, for each sample image X in the dataset D, based on the generalized Lagrangian function Find the optimal solution or approximate optimal solution , the first latent variable of the sample image X corresponds to and noise The latent variable samples obtained by adding are input into the decoding unit of the privacy protection branch, and the decoded image output by the decoding unit is used as the generated training image corresponding to the image X.
[0078] All generated training images together constitute image training data that protects data privacy and can be used for training sensitive target recognition models.
[0079] The embodiment of the present application proposes a novel method for generating image training data that protects data privacy, which can maximize the fidelity of generated image data while ensuring that the generated image data does not leak user data privacy. The generated image data can be used as training data for other image classification or image recognition models. The method for quantitatively adding noise to the input data of the generative adversarial network provided in the embodiment of the present application, compared with inputting completely random noise, the image data generated by the embodiment of the present application has higher fidelity. The image data generation method that balances the privacy protection and fidelity of the generated data provided in the embodiment of the present application achieves a balance between the two technical indicators by solving the minimization problem of the generalized Lagrangian function.
[0080] It should be noted that each implementable method in this embodiment may be implemented separately, or may be implemented in combination in any combination without conflict, and this application is not limited thereto.
[0081] Another embodiment of the present application provides an image processing device for executing the image processing method provided in the above embodiment.
[0082] like Figure 3 , which is a schematic diagram of the structure of an image processing device provided in an embodiment of the present application. The image processing device includes an acquisition module 301 and a modification module 302, wherein: The acquisition module 301 is used to acquire the image to be processed; The modification module 302 is used to convert the image to be processed according to a pre-trained image conversion model to obtain a target image corresponding to the image to be processed, wherein the pre-trained image conversion model is obtained by training a neural network using sample images and noise, and the image conversion model is used to convert the sample image.
[0083] Regarding the device in this embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0084] Some embodiments of the present application obtain an image conversion model by training a neural network with sample images and noise. The image conversion model is used to convert sample images to prevent privacy data from being leaked. After obtaining the image to be processed, the image conversion model can be used to convert data in the image to be processed that do not want to be leaked to obtain a processed image. The realism of the processed image can be maximized while ensuring that the generated image does not leak user data privacy.
[0085] Another embodiment of the present application further supplements the image processing device provided in the above embodiment.
[0086] Optionally, the device further comprises a training module, the training module being used for: Get a sample image; According to the sample image, determining a first eigenvector of the sample image and a mean value of a first latent variable corresponding to the sample image; Determine a second eigenvector corresponding to the sample image according to the mean value of the first latent variable corresponding to the sample image and the initial noise; Constructing a generalized Lagrangian function according to the first eigenvector and the second eigenvector; The dual gradient method is used to determine the target noise corresponding to the generalized Lagrangian function; The image conversion model is determined according to the mean of the first latent variable corresponding to the target noise and the sample image.
[0087] Some embodiments of the present application use a method of quantitatively adding noise to the input data of a generative adversarial network, so that the generated image data has higher realism compared to inputting completely random noise.
[0088] Optionally, the training module is used to: Using a known VAE / GAN model architecture, training is performed according to the sample data to obtain parameters of a data generation branch, and determining a probability distribution of a first latent variable according to the parameters of the data generation branch, wherein the probability distribution includes at least a mean of the first latent variable and a variance of the first latent variable; Randomly obtain a first latent variable sample from the probability distribution of the first latent variable; Decoding the first latent variable sample to generate a first decoded sample; According to the sample image, the first eigenvector corresponding to the one-dimensionalized feature tensor output by the Lth layer is determined, where L is a natural number greater than 0.
[0089] Some embodiments of the present application adopt the known variational autoencoder / generative adversarial network (VAE / GAN) model architecture to obtain a data generation branch based on sample image training.
[0090] Optionally, the training module is used to: Get the initial noise; Determine a second latent variable sample according to the mean value and initial noise of the first latent variable corresponding to the sample image; Generate a second decoding sample according to the second latent variable sample; According to the second decoded sample, a second eigenvector corresponding to the one-dimensionalized eigentensor output by the Lth layer is determined.
[0091] In some embodiments of the present application, by using a method of quantitatively adding noise to the input data of a generative adversarial network, the generated image data has higher realism compared to inputting completely random noise.
[0092] Optionally, the training module is used to: A generalized Lagrangian function is determined according to the first eigenvector, the second eigenvector and a test result threshold constant, wherein the test result threshold constant is determined by calculating the maximum value of the square of the second norm of the first eigenvector and the second eigenvector of the sample image.
[0093] Some embodiments of the present application calculate the corresponding , the first latent variable corresponding to sample X and noise The latent variable samples obtained by adding are input into the training privacy protection branch, and the decoded samples output by the training privacy protection branch are used as the generated training samples corresponding to the sample image X.
[0094] Optionally, the generalized Lagrangian function is: ; in, is the first eigenvector, is the second eigenvector, Represents the vector The square of the second norm of is the Lagrange multiplier, , is the test result threshold constant, For noise.
[0095] Some embodiments of the present application calculate the generalized Lagrangian function by using the first eigenvector and the second eigenvector, and solve the maximum and minimum problems of the generalized Lagrangian function by using the dual gradient method, so as to obtain the optimal noise.
[0096] Optionally, the training module is used to: The dual gradient method is used to process the generalized Lagrangian function to obtain the optimal solution or approximate optimal solution corresponding to the generalized Lagrangian function; The optimal solution or the approximate optimal solution is determined as the target noise corresponding to the generalized Lagrangian function.
[0097] Some embodiments of the present application calculate the generalized Lagrangian function by using the first eigenvector and the second eigenvector, and solve the maximum and minimum problems of the generalized Lagrangian function by using the dual gradient method, so as to obtain the optimal noise.
[0098] Regarding the device in this embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0099] It should be noted that each implementable method in this embodiment may be implemented separately, or may be implemented in combination in any combination without conflict, and this application is not limited thereto.
[0100] An embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the operation of the method corresponding to any embodiment of the image processing method provided in the above embodiments can be implemented.
[0101] An embodiment of the present application further provides a computer program product, wherein the computer program product includes a computer program, wherein when the computer program is executed by a processor, it can implement the operations of the method corresponding to any embodiment of the image processing method provided in the above embodiments.
[0102] like Figure 4 As shown, some embodiments of the present application provide an electronic device 400, which includes: a memory 410, a processor 420, and a computer program stored in the memory 410 and executable on the processor 420, wherein the processor 420 can implement a method of any embodiment included in the above-mentioned image processing method when reading the program from the memory 410 through a bus 430 and executing the program.
[0103] Processor 420 can process digital signals and can include various computing structures, such as complex instruction set computer structure, reduced instruction set computer structure, or a structure that implements a combination of multiple instruction sets. In some examples, processor 420 can be a microprocessor.
[0104] The memory 410 may be used to store instructions executed by the processor 420 or data related to the execution of instructions. These instructions and / or data may include codes for implementing some or all functions of one or more modules described in the embodiments of the present application. The processor 420 of the disclosed embodiment may be used to execute instructions in the memory 410 to implement the method shown above. The memory 410 includes a dynamic random access memory, a static random access memory, a flash memory, an optical memory, or other memory known to those skilled in the art.
[0105] The above are only embodiments of the present application and are not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0106] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0107] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
Claims
1. An image processing method, It is characterized in that The method comprises: Get the image to be processed; According to a pre-trained image conversion model, the image to be processed is converted to obtain a target image corresponding to the image to be processed, wherein the pre-trained image conversion model is obtained by training a neural network using sample images and noise, and the image conversion model is used to convert the sample image.
2. The image processing method according to claim 1, It is characterized in that The pre-trained image conversion model is obtained by: Get a sample image; According to the sample image, determining a first eigenvector of the sample image and a mean value of a first latent variable corresponding to the sample image; Determine a second eigenvector corresponding to the sample image according to a mean value and an initial noise of a first latent variable corresponding to the sample image; constructing a generalized Lagrangian function according to the first eigenvector and the second eigenvector; Using a dual gradient method, determining a target noise corresponding to the generalized Lagrangian function; The image conversion model is determined according to the target noise and the mean of the first latent variable corresponding to the sample image.
3. The image processing method according to claim 2, It is characterized in that The step of determining, according to the sample image, a first eigenvector of the sample image and a mean value of a first latent variable corresponding to the sample image comprises: Using a known VAE / GAN model architecture, training is performed according to the sample data to obtain parameters of a data generation branch, and determining a probability distribution of a first latent variable according to the parameters of the data generation branch, wherein the probability distribution includes at least a mean of the first latent variable and a variance of the first latent variable; Randomly obtain a first latent variable sample from the probability distribution of the first latent variable; Decoding the first latent variable sample to generate a first decoded sample; According to the sample image, a first eigenvector corresponding to the one-dimensionalized eigentensor output by the Lth layer is determined, where L is a natural number greater than 0.
4. The image processing method according to claim 2, It is characterized in that The step of determining a second eigenvector corresponding to the sample image according to the mean value and initial noise of the first latent variable corresponding to the sample image comprises: Acquiring the initial noise; Determine a second latent variable sample according to the mean of the first latent variable corresponding to the sample image and the initial noise; Generate a second decoding sample according to the second latent variable sample; According to the second decoded sample, a second eigenvector corresponding to the one-dimensionalized eigentensor output by the Lth layer is determined.
5. The image processing method according to claim 4, It is characterized in that The constructing a generalized Lagrangian function according to the first eigenvector and the second eigenvector comprises: The generalized Lagrangian function is determined according to the first eigenvector, the second eigenvector and a test result threshold constant, wherein the test result threshold constant is determined by the maximum value of all squares of the second norm of the difference between the first eigenvector and the second eigenvector obtained based on multiple sample images and minimum random noise, under the condition that the size of the random noise reaches the effect of protecting the privacy of user data.
6. The image processing method according to claim 5, It is characterized in that The generalized Lagrangian function is: ; in, is the first eigenvector, is the second eigenvector, Represents the vector The square of the second norm of is the Lagrange multiplier, , is the test result threshold constant, For noise.
7. The image processing method according to claim 2, It is characterized in that The dual gradient method is used to determine the target noise corresponding to the generalized Lagrangian function, including: The generalized Lagrangian function is processed by using a dual gradient method to obtain an optimal solution or a near-optimal solution corresponding to the generalized Lagrangian function; The optimal solution or the approximate optimal solution is determined as the target noise corresponding to the generalized Lagrangian function.
8. An electronic device, It is characterized in that The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor can implement the image processing method described in any one of claims 1 to 7 when executing the program.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, wherein the program, when executed by a processor, can implement the image processing method described in any one of claims 1 to 7.
10. A computer program product, comprising a computer program, in, When the computer program is executed by a processor, the image processing method described in any one of claims 1 to 7 can be implemented.
Citation Information
Patent Citations
Image processing method and device, electronic equipment and storage medium
CN113920566A
CT image reconstruction method and device, equipment and storage medium
CN114708345A
Image processing method and device, equipment and medium
CN117078789A
Generating completed responses via primal networks trained with dual networks
US20200250272A1
