Image processing method, parameter adjusting method and related equipment
By filtering and fusion processing of images to remove perturbations, the problems of complex and poor maintenance in the prior art are solved, the face recognition system's defense ability against attacks is improved, and the deployment and maintenance are simplified.
Patent Information
- Application Number
- CN202310587593.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-23
- Publication Date
- 2024-11-26
AI Technical Summary
In the prior art, the adversarial retraining technology is complex to implement, difficult to deploy and poor maintainability, making it difficult to effectively defend against face recognition systems against attacks.
By denoising the image, including filtering and fusion processing, the disturbance in the image is removed, and the defense capability of the image recognition model is improved without modifying or retraining the image recognition model.
It realizes that without losing the performance of the image recognition model, improves the defense capability against attacks, simplifies deployment and maintenance, and enhances the defense capability of the system.
Smart Images

Figure CN119027992A_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, a parameter adjustment method and related equipment. Background Art
[0002] Facial recognition systems are currently widely used in access control, security, unlocking, finance, payment and other fields. In addition, fields such as financial payment are very sensitive. Once hacked, it will cause huge property losses. Therefore, a large number of attackers try to attack facial recognition systems. It is urgent to enhance the defense capabilities of facial recognition systems.
[0003] Attacking a face recognition system requires deceiving its liveness detection model. Liveness detection is used to determine whether the photos captured by the camera are taken by real people, and returns binary information of "live" (the camera captures a real person's face) or "non-live" (the camera captures a series of non-real faces such as paper, screen, and mask). In order to break the liveness detection model, attackers use performance attack methods such as wearing face masks, wearing printed masks and glasses, printing photos on paper, and displaying photos on the screen to deceive the model. They will also add targeted adversarial noise to the above props to construct an adversarial attack to deceive the liveness detection model.
[0004] In order to defend against the above attacks, the current main defense methods include adding adversarial samples to the liveness detection model for adversarial retraining. Adversarial retraining directly adds adversarial samples to the data set for training, with the goal of allowing the model to learn the attack data in advance. This is a defense technology that modifies the model. Adversarial retraining technology will destroy the parameters of the original prediction performance of the model, causing significant loss to the normal performance of the model. In addition, adversarial retraining technology requires a large number of modifications to the model, with a high deployment cost. When the model is iterated, new adversarial retraining needs to be performed accordingly, which has poor maintainability. Summary of the invention
[0005] The present application provides an image processing method, a parameter adjustment method and related equipment to solve technical problems such as complex implementation, difficult deployment and poor maintainability of adversarial retraining technology.
[0006] In a first aspect, an image processing method is provided. The method includes: performing noise reduction processing on a first image to obtain a second image. The noise reduction processing includes filtering processing and fusion processing. The filtering processing is used to suppress the noise in the first image, and when the first image includes disturbance, the disturbance in the first image can be destroyed. The fusion processing is used to retain the effective information in the first image and improve the recognition accuracy of the image recognition model. The filtering processing is filtering the first image or the fused image. The fusion processing is fusing the first image and the filtered image. The fused image is an image obtained by performing fusion processing on the first image and the filtered image. The filtered image is an image obtained by performing filtering processing on the first image or the fused image. The second image is used to input into the image recognition model, and the image recognition model is used to recognize the second image to obtain a recognition result. Before the first image is recognized, the first image is firstly filtered and denoised to remove the disturbance in the first image, thereby reducing the probability that the disturbance in the first image deceives the image recognition model, without modifying the parameters of the image recognition model, without affecting the performance of the image recognition model, and without retraining and deploying the image recognition model, which is easy to maintain.
[0007] In a possible implementation, performing denoising on the first image to obtain the second image includes: performing denoising on the first image k times of iteration to obtain the second image, where k is an integer greater than or equal to 1. That is, the first image may be subjected to denoising once to obtain the second image, or the first image may be subjected to denoising multiple times to obtain the second image.
[0008] In one possible implementation, k is greater than or equal to 2, that is, the first image is subjected to multiple iterative denoising processes. The first image is subjected to k iterative denoising processes to obtain a second image, including: filtering the first image in the first filtering process to obtain a filtered image. In the first fusion process, the first image and the filtered image obtained in the first filtering process are fused to obtain a fused image. In the kth filtering process, the fused image obtained in the k-1th fusion process is filtered to obtain a filtered image. In the kth fusion process, the first image and the filtered image obtained in the kth filtering process are fused to obtain a second image. Iterative denoising combines simple image processing processes into a denoising function with a powerful defensive effect, which can cope with more complex scenes and produce better results. After iterative denoising, the adversarial information in the first image is destroyed, which can increase the probability of defending against adversarial attacks.
[0009] In a possible implementation, k is equal to 1, that is, the first image is subjected to one filtering process and one fusion process to obtain the second image. Specifically, the first image is subjected to k iterative denoising processes to obtain the second image, including: filtering the first image to obtain a filtered image. Fusion of the first image and the filtered image to obtain the second image.
[0010] In a possible implementation, the filtering process includes: filtering the first image or the fused image by a filtering algorithm, wherein the filtering algorithm includes a bilateral filtering algorithm, a weighted least squares algorithm, a guided filtering algorithm, or a rolling guided filtering algorithm. These filtering algorithms can suppress noise and retain edge information, thereby ensuring the accuracy of the image recognition model in recognizing the second image.
[0011] In a possible implementation, the fusion process includes: fusing the first image and the filtered image according to a fusion ratio. By weightedly fusing the first image and the filtered image through the fusion ratio, effective information in the image can be retained as much as possible, and noise can be effectively suppressed, thereby improving the defense effect of filtering while protecting the normal performance of the image recognition model.
[0012] In a possible implementation, the above image processing method can be applied to a face recognition scenario. The first image includes a facial image of a target object, the image recognition model is a liveness detection model, and the recognition result is a liveness detection result.
[0013] The second aspect provides a parameter adjustment method. The method includes: performing denoising processing on the training images in the training image set according to the denoising parameters to obtain the denoised images, the training images in the training image set include adversarial samples, the adversarial samples are samples with disturbances added, and the denoising processing includes filtering processing and fusion processing; inputting the denoised images into the image recognition model to obtain the predicted recognition results; adjusting the denoising parameters according to the labels and recognition results of the training images. The denoising parameters are parameters that can determine the degree of denoising of the image. By dynamically feedback and adaptively adjusting the denoising parameters to find better image processing parameters, the denoising parameters obtained based on the optimized adjustment have better image processing effects, that is, both higher accuracy and higher defense rate against adversarial attacks.
[0014] In a possible implementation, the noise reduction parameter includes the number of iterations of the noise reduction process.
[0015] In a possible implementation, the filtering process is to filter the training image or the fused image through a filtering algorithm, the fusion process is to fuse the training image and the filtered image according to a fusion ratio, the fused image is an image obtained by fusing the training image and the filtered image, and the filtered image is an image obtained by filtering the training image or the fused image; the denoising parameters include the filtering parameters of the filtering algorithm and the fusion ratio.
[0016] In a possible implementation, the training image includes a facial image of an object to be detected, the image recognition model is a liveness detection model, and the recognition result is a liveness detection result.
[0017] A third aspect provides a device. The device includes:
[0018] A denoising processing module is used to perform denoising on a first image to obtain a second image. The denoising processing includes filtering processing and fusion processing. The filtering processing is filtering the first image or the fused image. The fusion processing is fusing the first image and the filtered image. The fused image is an image obtained by fusing the first image and the filtered image. The filtered image is an image obtained by filtering the first image or the fused image. The second image is used to be input into an image recognition model. The image recognition model is used to recognize the second image to obtain a recognition result.
[0019] In a possible implementation manner, the noise reduction processing module is specifically configured to perform k-iterative noise reduction processing on the first image to obtain a second image, where k is an integer greater than or equal to 1.
[0020] In a possible implementation, k is greater than or equal to 2, and the noise reduction processing module includes a filtering submodule and a fusion submodule. The filtering submodule is used to filter the first image, and the fusion submodule is used to fuse the first image. The filtering submodule is used to filter the first image during the first filtering process to obtain a filtered image. The fusion submodule is used to fuse the first image and the filtered image obtained by the first filtering process during the first fusion process to obtain a fused image. The filtering submodule is used to filter the fused image obtained by the k-1 fusion process during the k-th filtering process to obtain a filtered image. The fusion submodule is used to fuse the first image and the filtered image obtained by the k-1 fusion process during the k-th filtering process to obtain a filtered image. The fusion submodule is used to fuse the first image and the filtered image obtained by the k-th filtering process during the k-th fusion process to obtain a second image.
[0021] In a possible implementation, k is equal to 1, and the processing module includes a filtering submodule and a fusion submodule, wherein the filtering submodule is used to filter the first image, and the fusion submodule is used to fuse the first image. The filtering submodule is used to filter the first image to obtain a filtered image. The fusion submodule is used to fuse the first image and the filtered image to obtain a second image.
[0022] In a possible implementation, the filtering submodule is specifically used to filter the first image or the fused image by using a filtering algorithm, where the filtering algorithm includes a bilateral filtering algorithm, a weighted least squares algorithm, a guided filtering, or a rolling guided filtering.
[0023] In a possible implementation manner, the fusion submodule is specifically configured to fuse the first image and the filtered image according to a fusion ratio.
[0024] In a possible implementation, the first image includes a facial image of the target object, the image recognition model is a liveness detection model, and the recognition result is a liveness detection result.
[0025] A fourth aspect provides a device. The device includes a denoising processing module, an image recognition module and an adjustment module. The denoising processing module is used to perform denoising processing on training images in a training image set according to denoising parameters to obtain denoised images. The training images in the training image set include adversarial samples, which are samples with disturbances added. The denoising processing includes filtering processing and fusion processing. The image recognition module is used to recognize the denoised image to obtain a predicted recognition result. The adjustment module is used to adjust the denoising parameters according to the label of the training image and the recognition result.
[0026] In a possible implementation, the noise reduction parameter includes an iteration number, where the iteration number indicates the iteration number of the noise reduction process.
[0027] In a possible implementation, the filtering process is filtering the training image or the fused image by a filtering algorithm, the fusion process is fusing the training image and the filtered image according to a fusion ratio, the fused image is an image obtained by fusing the training image and the filtered image, and the filtered image is an image obtained by filtering the training image or the fused image. The denoising parameters include filtering parameters of the filtering algorithm and the fusion ratio.
[0028] In a possible implementation, the training image includes a facial image of an object to be detected, the image recognition model is a liveness detection model, and the recognition result is a liveness detection result.
[0029] A fifth aspect provides an electronic device. The electronic device includes a processor and a memory, the processor is coupled to the memory, and the processor is configured to execute the image processing method in the first aspect or any possible implementation of the first aspect, or the parameter adjustment method in the second aspect or any possible implementation of the second aspect based on instructions stored in the memory.
[0030] A sixth aspect provides a computer-readable storage medium. The computer-readable storage medium includes instructions, and when the computer-readable storage medium is run on a computer, the computer executes the steps in the image processing method in the first aspect or any possible implementation of the first aspect, or the steps in the parameter adjustment method in the second aspect or any possible implementation of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A flowchart of a face recognition method provided in this application;
[0032] Figure 2 Schematic diagram of attacking a face recognition system by combining performance attack and adversarial attack;
[0033] Figure 3 A schematic diagram of the architecture of the image processing system provided for this application;
[0034] Figure 4 A schematic diagram of the structure of the defense module provided for this application;
[0035] Figure 5 A flowchart of a noise reduction parameter adjustment method provided in this application;
[0036] Figure 6 A flowchart of an image processing method provided in this application;
[0037] Figure 7a A schematic diagram of the architecture of a face recognition system provided for this application;
[0038] Figure 7b Schematic diagram of another face recognition system provided for this application
[0039] Figure 8 A flowchart of another face recognition method provided for this application;
[0040] Fig. 9 A diagram showing the image denoising method provided in this application in defending against adversarial attacks in a real scenario;
[0041] Fig.10 A schematic diagram of the structure of a device provided in this application;
[0042] Fig.11 A schematic diagram of the structure of another device provided in this application;
[0043] Fig.12 A schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION
[0044] The present application provides an image processing method, a parameter adjustment method and related equipment to improve the defense capability of an image recognition model against adversarial attacks without losing the performance of the image recognition model.
[0045] The following describes the embodiments of the present application in conjunction with the accompanying drawings. Obviously, the described embodiments are only embodiments of a part of the present application, rather than all embodiments. It is known to those skilled in the art that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0046] The terms "first", "second" and the like in the specification and claims of this application and the above drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0047] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0048] First, the relevant concepts involved in this application are explained.
[0049] 1. Deep Learning
[0050] A deep learning model is a machine learning model with a complex structure of a neural network. A neural network is a mathematical model or computational model that imitates the structure and function of a biological neural network (the central nervous system of an animal, especially the brain). A neural network is calculated by connecting a large number of neurons. A neural network can include a variety of neural network layers with different functions, each layer including parameters and calculation rules. Different layers in a neural network have different names depending on the calculation formula or function. For example, the layer that performs convolution calculations is called a convolution layer, which is often used to extract features from input signals (e.g., images). There are many different neural networks with high accuracy for application scenarios such as recognition or classification in the industry. Some neural networks can be trained with specific data sets and used alone to complete a task or combined with other neural networks (or other functional modules) to complete a task. Deep learning is mainly used in perception, decision-making and other scenarios in the field of artificial intelligence, such as image and speech recognition, natural language translation, computer games, etc.
[0051] 2. Face recognition
[0052] A biometric technology that recognizes people based on their facial features. A series of related technologies that use a camera or a webcam to collect images or video streams containing faces, automatically detect and track faces in images, and then perform facial identity recognition on the detected faces. Face recognition mainly includes face collection, face detection, face positioning, face cropping, liveness detection, face comparison and other steps.
[0053] like Figure 1 As shown, Figure 1 A flow chart of a face recognition method provided for this application. The camera of the device captures the image of the object to be verified, preprocesses the image, and then the face recognition system performs face recognition on the preprocessed image. Among them, preprocessing includes face detection (detecting whether there is a face in the image), face positioning (determining the position of the face in the image) and face cropping (cropping out the image of the area where the face is located). The face recognition system includes a liveness detection model and a face comparison model. The liveness detection model is used to determine whether the face in the input image is a real live face or a synthesized non-live face from someone else's photo.
[0054] The face comparison model is used to compare whether the face images in two images are the face images of the same person. Face comparison includes 1:1 face comparison and 1:N face comparison. Among them, 1:1 face comparison is mainly used for identity authentication in scenarios such as identity verification, face unlocking of electronic devices, face recognition payment, and face recognition account login, to verify whether the verified object is the target object. Specifically, the face image of the verified object captured by the camera is compared with the trusted face image of the target object (such as the face image of the ID card and the previously entered face image, etc.) to obtain the similarity of the faces in the two images. If the similarity is greater than the threshold, it is considered that the face images in the two images are the face images of the same person, that is, the verified object can be determined to be the target object. If the similarity is less than the threshold, it is considered that the face images in the two images are not the face images of the same person, that is, it can be determined that the verified object is not the target object. 1:N face comparison is mainly used in scenarios such as face check-in, face recognition access control, and image search. Specifically, the facial image of the object to be verified captured by the camera is compared with the N facial images in the face database to obtain the similarity between the facial image of the object to be verified and the N facial images in the face database. If there is a facial image in the face database with a similarity greater than a threshold value to the facial image of the object to be verified, it is determined that the object to be verified is the same person as the target object with a similarity greater than the threshold value. If there is no facial image in the face database with a similarity greater than the threshold value to the facial image of the object to be verified, the object to be verified does not exist in the database.
[0055] Only when both the liveness detection model and the face comparison model give a positive judgment, that is, the liveness detection model judges that the face in the input image is a live face, and the face comparison model judges that the face in the input image is the face of the target object (target face), the face recognition system will verify the object to be verified, otherwise the verification will fail.
[0056] 3. Performance attack
[0057] In face recognition scenarios, an attack method that deceives the liveness detection model by replaying face photos. This includes printing photos of the target object's face on paper, displaying electronic photos of the target object's face on devices such as screens, and wearing props with local facial features of the target object (such as masks, respirators, or glasses, etc.).
[0058] 4. Adversarial Attacks and Adversarial Examples
[0059] Adversarial attack is a method of attack that deceives deep learning models (such as classification models) by adding specific perturbations to the input image. The perturbations added to the input image are not easily detected by the human eye and do not affect people's judgment of the original label of the input image, but they can completely deceive the deep learning model and cause it to predict the wrong label. Adding perturbations to the input image means changing the pixel values of some pixels in the input image. The input image with perturbations is called an adversarial sample.
[0060] In the face recognition scenario, the attacker cannot interfere with the pixels of the face picture taken by the device at the current moment (i.e. the real-time face picture taken by the camera). Based on this, an attack method combining performance attack and adversarial attack has emerged. Figure 2 As shown, Figure 2 The diagram shows a combination of performance attack and adversarial attack to attack the face recognition system. The attacker uses props such as masks, respirators or glasses with perturbations added to the face, or prints perturbations added to the photo on paper, or displays perturbations added to the photo on the screen to deceive the liveness detection model, so that the liveness detection model mistakenly determines the face in the input image as a live face, and the face recognition system identifies the attacker as the target object.
[0061] Hereinafter, adversarial attack and the combination of adversarial attack and entry attack are collectively referred to as adversarial attack.
[0062] Deep learning is the core technology used in machine learning and artificial intelligence today. In the field of image recognition, it has become the main force in applications such as face recognition, intelligent driving (such as autonomous driving or assisted driving), monitoring, and security. For example, in a face recognition application scenario, after obtaining a face image, it identifies whether the face in the face image is the target face. If so, the corresponding operation is performed (such as allowing login, unlocking the device, opening the door lock, or confirming payment, etc.). Otherwise, the corresponding operation is refused to ensure the security of the target object's property or data. In the intelligent driving application scenario, the car's camera collects road images and identifies traffic signs such as speed limit signs, warning signs, prohibition signs, and instruction signs, and then drives according to the recognition results of traffic signs.
[0063] However, deep learning models are very vulnerable to slight disturbances in the input images. These slight disturbances can cause the deep learning models to output incorrect recognition results, affecting personal and property safety. For example, face recognition systems based on deep learning models are currently widely used in access control, security, unlocking, finance, payment and other fields. Once the face recognition system is broken by adversarial attacks or performance attacks, it will cause huge property losses to users. In intelligent driving scenarios, if the deep learning model recognizes traffic signs incorrectly due to disturbances in the image, it will affect driving safety.
[0064] Therefore, a large number of attackers take advantage of the fact that deep learning models are vulnerable to perturbations in input images and launch adversarial attacks on image recognition systems that contain deep learning models (such as face recognition systems and intelligent driving systems). It is urgent to enhance the defense capabilities of image recognition systems that contain deep learning models.
[0065] In order to defend against adversarial attacks, adversarial retraining and other methods are currently used. Adversarial retraining adds adversarial samples to the training data set to train the deep learning model. The purpose is to allow the deep learning model to learn the attack data in advance, so that the deep learning model has a certain ability to resist adversarial samples, that is, to improve the model's defense against adversarial attacks by modifying the model. However, adversarial retraining will destroy the parameters of the original prediction performance of the model, which will cause a large loss in the normal performance of the model. In addition, adversarial retraining requires a large number of modifications to the model, and the deployment cost is high. When the model is iterated, new adversarial retraining needs to be performed accordingly, which has poor maintainability.
[0066] In order to solve the above technical problems, the present application provides the following embodiments.
[0067] like Figure 3 As shown, Figure 3 The image processing system provided in this application can be widely used in various scenarios in the field of image recognition that need to resist adversarial attacks, such as face recognition, image content classification, medical diagnosis, target detection, intelligent driving, and human key point detection.
[0068] In this embodiment, the image processing system includes a defense module and an image recognition module. The defense module is used to perform noise reduction processing on the image to reduce the disturbance in the image to resist adversarial attacks. The image recognition module includes an image recognition model, which is used to recognize the image processed by the defense module and output the recognition result. The image recognition model is a deep learning model, which can be an image classification model and a target detection model. By adding a defense module, before the image is input into the image recognition module, the defense module is used to perform noise reduction processing on the image to resist adversarial attacks, thereby improving the defense rate against adversarial samples, and there is no need to perform adversarial retraining on the image recognition model in the image recognition module, which will not affect the prediction performance of the image recognition module for normal samples.
[0069] like Figure 4 As shown, Figure 4 A schematic diagram of the structure of the defense module provided in the present application. The defense module is used to perform k-iterative noise reduction processing on the input first image to obtain a second image, and output the second image. Wherein, k is an integer greater than or equal to 1.
[0070] Specifically, the defense module includes a filtering submodule and a fusion submodule. Among them, the filtering submodule is used to filter the input image and output the filtered image after the filtering process. The filtering process can reduce the disturbance in the image and destroy the adversarial information in the image, so as to resist the adversarial attack. The fusion submodule is used to fuse the filtered image output by the filtering submodule with the first image to obtain a fused image after the fusion process. The fusion process can slow down the filtering amplitude, retain the effective information in the image as much as possible, and ensure the accuracy of image recognition based on the image output by the defense module while improving the defense capability. That is, for the image with disturbance, after the disturbance information in the image is destroyed by the filtering process of the defense module, the image recognition module is no longer affected by the disturbance when recognizing the image output by the defense module, so that an accurate recognition result can be obtained. Whether it is an image with disturbance or an image without disturbance, after the filtering process and fusion process of the defense module, although it will cause a certain degree of loss of information in the image, since the effective information is greatly retained through the fusion process, the accuracy of the recognition result obtained by the image recognition module for recognizing the image output by the defense module can still be guaranteed without changing the image recognition model of the image recognition module.
[0071] When k=1, the defense module performs a noise reduction process on the first image, that is, the filtering submodule performs a filtering process on the first image, and the fusion submodule performs a fusion process on the first image. Specifically, the filtering submodule performs a filtering process on the first image to obtain a filtered first image (filtered image), and outputs it to the fusion submodule. The fusion submodule fuses the first image with the filtered image to obtain a fused image (second image).
[0072] When k is greater than 1, the defense module performs k iterative denoising processes on the first image, that is, the filtering submodule performs k filtering processes on the first image, and the fusion submodule performs k fusion processes on the first image. Specifically, during the i-th filtering process, the filtering submodule performs filtering processes on the input image to obtain a filtered image. During the i-th fusion process, the fusion submodule performs fusion processes on the filtered image obtained by the i-th filtering process to obtain a fused image. Wherein, i∈(1,2,…,k), k≥2. When i=1, the input image input to the filtering submodule is the first image. When 1<i≤k, the input image input to the filtering submodule is the fused image obtained by the k-1th fusion process. When i=k, the fused image output by the fusion submodule is the second image. Through iterative denoising processing, multiple filtering and fusion can be integrated into a more complex new filtering, thereby improving the filtering effect and the defense effect without affecting the recognition performance of the image recognition module.
[0073] The filtering submodule includes a filtering algorithm, and the filtering submodule obtains a filtered image by filtering the input first image or fused image through the filtering algorithm. Optionally, the filtering algorithm is a bilateral filtering algorithm, a weighted least squares algorithm, a guided filtering algorithm, or a rolling guided filtering algorithm. Filtering algorithms such as bilateral filtering algorithms, weighted least squares algorithms, guided filtering algorithms, or rolling guided filtering algorithms can suppress disturbances in the image while retaining detail features such as edge information in the image, which can improve the recognition accuracy of the subsequent image recognition module for the second image. Of course, the filtering algorithm can also be a Gaussian filtering algorithm, a mean filtering algorithm, or a median filtering algorithm, which is not limited here.
[0074] The fusion submodule fuses the filtered image and the first image into one image, i.e., the fused image, according to the fusion ratio. The fusion ratio is the proportion of the filtered image and the first image in the fusion process. Specifically, the fusion submodule weights and sums the pixel values of the same pixel in the filtered image and the first image (referring to the pixel with the same coordinates in the first image and the filtered image) according to the fusion ratio to obtain the pixel value of the pixel in the fused image. The pixel value of each pixel is calculated by weighted summation according to the fusion ratio to obtain the fused image. For example, if the fusion ratio of the filtered image is w, and w is greater than 0 and less than 1, then the fusion ratio of the first image is (1-w), and for any pixel j in the fused image, its pixel value is the pixel value of pixel j in the filtered image multiplied by w, plus the pixel value of pixel j in the first image multiplied by (1-w). If the first image is a color image, i.e., each pixel in the first image includes at least two channels, then the fusion submodule fuses each channel of the same pixel in the first image and the filtered image separately, i.e., independently weights and sums the value of each channel according to the fusion ratio. Since the filtered image and the fused image are both obtained based on the first image, the channels of the pixels in the filtered image, the first image, and the fused image are the same. Take the case where the pixel includes three channels of RGB as an example. When the pixel j is fused, the values of the three channels of RGB are calculated respectively. Specifically, the fusion submodule weights and sums the values of the R (red) channel of the pixel j in the first image and the filtered image according to the fusion ratio to obtain the value of the R channel of the pixel j in the fused image; weights and sums the values of the G (green) channel of the pixel j in the first image and the filtered image according to the fusion ratio to obtain the value of the G channel of the pixel j in the fused image; weights and sums the values of the B (blue) channel of the pixel j in the first image and the filtered image according to the fusion ratio to obtain the value of the B channel of the pixel j in the fused image.
[0075] In this embodiment, the defense module realizes image denoising through filtering algorithm and weighted summation. Compared with the neural network model including multi-layer network and a large number of parameters, the defense module is simple to implement, involves fewer parameters, is more lightweight, occupies less storage space, is easy to deploy, and has strong maintainability.
[0076] The noise reduction parameters in the defense module can be obtained through training. Of course, the noise reduction parameters can also be set based on experience. For example, the noise reduction parameters include the fusion ratio w 、 At least one of the number of iterations k and the filtering parameters of the filtering algorithm. The filtering parameters are parameters that affect the filtering effect or filtering degree of the filtering algorithm. The filtering parameters include, for example, at least one of the filtering window size d, the weight coefficient of the filter, the pixel domain size s, and the range kernel size r. The filtering parameters are determined specifically according to the filtering algorithm. For example, the bilateral filtering algorithm may include the filtering window size d, the variance σ of the range kernel, and the range kernel size r. r And filtering parameters such as Gaussian weight s based on the similarity between pixels. Mean filtering can include parameters such as filter window size d, pixel domain size s and value domain kernel size r.
[0077] like Figure 5 As shown, Figure 5 A flowchart of a noise reduction parameter adjustment method provided in this application. Figure 5 The parameter adjustment method shown can be implemented by devices such as servers, computers, laptops, and smart terminals. Before adjustment, the initial noise reduction parameters can be manually configured. In this embodiment, the noise reduction parameters in the defense module are optimized and adjusted using the training images in the training image set, so that when the defense module performs noise reduction processing on the image based on the optimized and adjusted noise reduction parameters, it can not only destroy the disturbance in the image to improve the defense rate, but also retain the detailed features in the image to ensure the subsequent image recognition accuracy. The training image set includes an adversarial sample set and a normal sample set, and the adversarial sample set and the normal sample set both include multiple training images. The training images in the adversarial sample set are adversarial samples, and there are disturbances in the adversarial samples. The training images in the normal sample set are normal samples, and there are no disturbances in the normal samples. The training images in the adversarial sample set and the normal sample set both include labels, and the labels are used to identify the correct answers of the training images on specific tasks.
[0078] The adversarial sample is input into the defense module, and the defense module processes the adversarial sample according to the current denoising parameters to obtain the denoised image corresponding to the adversarial sample. The image recognition module recognizes the denoised image and obtains the recognition result. By comparing the recognition result with the label of the adversarial sample, the defense rate of the adversarial sample under the current denoising parameters can be obtained. Specifically, if the recognition result and the label are consistent, it means that the defense module has effectively destroyed the perturbation in the adversarial sample based on the current denoising parameters, and the defense is successful; if they are inconsistent, it means that the perturbation in the adversarial sample is not destroyed based on the current denoising parameters. There is still perturbation in the image output by the defense module, which causes the image recognition module to recognize incorrectly and the defense fails. The defense rate is the ratio between the number of successful defenses against adversarial samples and the number of denoised images corresponding to the adversarial samples under the current denoising parameters.
[0079] The ordinary sample is input into the defense module, and the defense module processes the ordinary sample according to the current noise reduction parameters to obtain the noise reduction image corresponding to the ordinary sample. The image recognition module recognizes the noise reduction image and obtains the recognition result. By comparing the recognition result with the label of the ordinary sample, the accuracy of the ordinary sample under the current noise reduction parameters can be obtained. If the recognition result and the label are consistent, the recognition is successful, indicating that the loss of some detail features caused by the image processing by the defense module is within the range that the image recognition module can bear; if they are inconsistent, the recognition fails, which may be that the image recognition module itself cannot recognize it, or the image processing by the defense module causes the loss of some detail features, which makes the image recognition module recognize incorrectly. The accuracy rate is the ratio between the number of successful recognitions of ordinary samples and the number of recognitions of the noise reduction image corresponding to the ordinary samples under the current noise reduction parameters.
[0080] According to the labels of the training images and the corresponding recognition results, the defense rate and accuracy under the current noise reduction parameters can be obtained. With the goal of improving the defense rate and accuracy, the noise reduction parameters are continuously optimized and adjusted until the defense rate and accuracy meet the requirements. The defense rate meeting the requirements can be that the defense rate is greater than or equal to the defense threshold. The defense threshold is, for example, any value between 50% and 100%, such as 50%, 60%, 70%, 80%, 90%, 95%, 98% or 100%. The defense threshold is, for example, any value between 80% and 100%, such as 80%, 85%, 90%, 95%, 98% or 100%. Thus, based on the optimized and adjusted noise reduction parameters, the defense module can effectively reduce the disturbance in the image, so that the image processing system can defend against adversarial attacks, and can retain more detailed features to ensure that the image processing system can accurately identify the image.
[0081] It should be noted that in the process of training the noise reduction parameters of the defense module, the parameters in the image recognition module are not changed. That is, the deep learning model in the image recognition module is a previously trained model, and this embodiment only optimizes and adjusts the noise reduction parameters of the defense module so that the defense module after the noise reduction parameters are adjusted can be compatible with the image recognition module. Therefore, there is no need to perform adversarial retraining on the deep learning model in the image recognition module. Without changing the parameters of the deep learning model in the image recognition module, it is ensured that the image recognition module can accurately identify the image processed by the defense module, so that it has both the ability to defend against adversarial attacks and a high recognition accuracy, thereby completing the corresponding classification tasks or target detection tasks, etc.
[0082] like Figure 6 As shown, Figure 6 This is a flow chart of an image processing method provided by the present application. This embodiment includes the following steps:
[0083] S601: Perform noise reduction processing on the first image to obtain a second image, the noise reduction processing includes filtering processing and fusion processing, the filtering processing is filtering the first image or the fused image, the fusion processing is fusing the first image and the filtered image, the fused image is an image obtained by fusing the first image and the filtered image, and the filtered image is an image obtained by filtering the first image or the fused image.
[0084] The first image is an image to be subjected to noise reduction processing. In this embodiment, the noise reduction processing includes filtering processing and fusion processing. The specific processing methods of filtering processing and fusion processing can refer to the above related descriptions, which will not be repeated here.
[0085] The second image may be obtained by performing a noise reduction process on the first image, that is, performing a filtering process and a fusion process on the first image to obtain an image that is output as the second image. The second image may also be obtained by performing k (k is an integer greater than or equal to 2) iterations of noise reduction process on the first image. The specific process of performing k iterations of noise reduction process on the first image can be referred to the above related description, which will not be repeated here.
[0086] S602: Input the second image into the image recognition model to obtain a recognition result.
[0087] The second image is the image after the first image is processed by noise reduction, and the noise is effectively suppressed. Since the image recognition model recognizes the second image obtained after the noise reduction process, rather than directly recognizing the first image, even if there is disturbance in the first image, it cannot deceive the image recognition model. The image recognition model recognizes the second image and can obtain accurate recognition results.
[0088] S601 and S602 can be executed by the same device or by different devices. For example, when the defense module and the image recognition module are deployed on the same device, S601 and S602 are executed by the same device. When the defense module and the image recognition module are deployed on different devices, S601 and S602 are executed by different devices. For example, when the defense module is deployed on the terminal device and the image recognition module is deployed on the cloud server, S601 is executed by the terminal device and S602 is executed by the server.
[0089] The image processing system and image processing method provided by the present application are described in detail below using the face recognition scenario as an example.
[0090] like Figure 7a and Figure 7b As shown, Figure 7a A schematic diagram of the architecture of a face recognition system provided for this application; Figure 7bA schematic diagram of the architecture of another face recognition system provided by the present application. In this embodiment, the image recognition module is specifically a liveness detection module, which is used to detect whether the input face image is a live face image. The face recognition system generally includes a liveness detection module and a face comparison module. Since the face image in the attack sample is very similar to the face of the target object, it is difficult to defend through the face comparison module. Therefore, this embodiment starts from the direction of defense reinforcement of the liveness detection module, and suppresses the disturbance in the image by adding a defense module to pre-process the image input to the liveness detection module to block the attacker from deceiving the liveness detection module, such as blocking the attacker from wearing props such as masks, masks or glasses with the face of the target object added with disturbances, or printing photos of the target object added with disturbances on paper, displaying them on the screen, and other anti-attack means to deceive the liveness detection module, so that the liveness detection module successfully identifies it as "non-live" to ensure the data and property security of the target object. Since the focus of this application is not on the face comparison module, the details of the face comparison module will not be elaborated here.
[0091] Assume that the image input to the face recognition system is a first image, and the first image includes the face of the target object. The defense module performs noise reduction processing on the first image to obtain a second image. The liveness detection module performs liveness detection on the second image to obtain a liveness detection result. The liveness detection module and the face comparison module can be in a series relationship, such as Figure 7a As shown in FIG, when the liveness detection result output by the liveness detection model is "liveness", the face comparison module performs face comparison based on the first image. If the similarity between the face image in the first image and the face image of the target object is greater than a threshold, the face verification succeeds, otherwise the face verification fails. The liveness detection module and the face comparison module can be in parallel, such as Figure 7b As shown, when the defense module processes the first image or the liveness detection module detects the second image, the face comparison module can synchronously perform face comparison based on the first image, and determine whether the verification is successful based on the results output by the liveness detection module and the face comparison module.
[0092] The defense module can be deployed on terminal devices such as mobile phones, tablets, computers, transportation vehicles, attendance clock-in machines, access control gates, monitoring and financial payment machines. Of course, when face recognition is implemented by a cloud server, the defense module can also be deployed on the cloud server. When the face image is collected by the terminal device and the face recognition is implemented by the cloud server, the defense module can be deployed on both the terminal device and the cloud server. Since the defense module involves few parameters and the parameters are easy to obtain, the defense module occupies a small storage space. Compared with retraining the liveness detection model, the liveness detection capability of the face recognition system is improved by adding a defense module, which is easy to deploy and maintain.
[0093] like Figure 8 As shown, Figure 8 A flow chart of another face recognition method provided for the present application. Take the implementation of a face recognition system on a mobile phone, monitoring or other terminal device as an example. The camera of the device captures a third image, and the device preprocesses the third image to obtain a first image. Preprocessing includes, for example, face detection, face positioning, face cropping, etc. The first image obtained by preprocessing is input to the defense module, and the defense module performs noise reduction processing on the first image to obtain a second image. The second image is then input to the liveness detection model, and liveness detection is performed based on the second image to obtain a liveness detection result. Next, the steps of preprocessing, noise reduction processing, etc. are described in detail. In this embodiment, image preprocessing is an optional step.
[0094] During the preprocessing process, face detection can be performed on the third image first to determine whether there is a face in the third image. If no face is detected, the face recognition process is terminated directly. When a face is detected in the third image, the face in the third image is located. Face positioning requires feature positioning of the face in the image. If there are multiple faces in the image, the face with the largest area or the face in the middle of the image can be recognized by default. Face positioning is used to specifically identify the location of the face in the third image and the location of the key features of the face. Face positioning is mostly based on five-point positioning, that is, the position coordinates of the left eye center, right eye center, nose center, left mouth pole, and right mouth pole in the image are given.
[0095] After completing face positioning and obtaining the position of the face in the third image and the position of the key features of the face, the third image can be further cropped to obtain the first image, and the proportion of the face in the first image is greater than the proportion of the face in the third image, so as to reduce invalid information in the image. Cropping is different from ordinary image scaling. Based on the face positioning information obtained by face positioning, the background part that obviously does not belong to the face area is removed, and then the remaining face is stretched and scaled to adjust the image size to the target size. After cropping, the third image becomes the first image that contains the face and meets the size requirements.
[0096] For traditional face recognition systems, the first image obtained after cropping will be sent to the liveness detection model for liveness detection, while in the present application, the first image needs to be processed by denoising before being sent to the liveness detection model. The specific process of obtaining the second image by denoising the first image can be found in the relevant description above, which will not be repeated here. When the number of denoising is greater than 1, after a single filtering and fusion process, the process is looped to form iterative denoising. Iterative denoising combines simple image processing processes into a denoising function with a powerful defensive effect, which can cope with more complex scenes and produce better results. After iterative denoising, the adversarial information in the face image is destroyed, increasing the possibility of defending against adversarial attacks.
[0097] Next, the second image obtained after noise reduction is input into the liveness detection model for liveness detection. The liveness detection model is a classification model, generally a binary deep neural network. When used in terminals such as mobile phones and tablets, the liveness detection model can adopt a mobile network (MobileNet) model. The input of the liveness detection model is a second image including a face image, and the output is a binary classification result with a confidence level, which can be simply understood as a liveness score. The liveness score is between 0 and 1, indicating the possibility that the liveness detection model judges that the person in the second image is live. The closer it is to 1, the more likely it is to be a live person, that is, a real person, and the closer it is to 0, the more likely it is to be a non-live person, that is, a fake face such as a printed photo, a screen display, or a mask. The classification threshold can be 0.5, 0.6, 0.7 or 0.8, etc. If the liveness score is greater than the classification threshold 0.5, a liveness detection result indicating "liveness" is output, otherwise a liveness detection result indicating "non-liveness" is output.
[0098] like Fig. 9 As shown in the figure, the performance of two groups of original images and images after denoising by the defense module in the liveness detection model is shown. The upper left original image is an attack sample in which the attacker wears T-shaped glasses with disturbances. It is judged as "live" in the liveness detection model, and the liveness score is 0.60899; the upper right processed image is the image after denoising the upper left original image by the denoising method of the defense module. Some fine-grained noise points in the original image are removed, and the face area is flatter and smoother. The image after denoising is judged as "non-live" in the liveness detection model, and the liveness score is only 0.18815, achieving successful defense. The original image on the lower left is an attack sample in which the attacker is wearing perturbed straight glasses. It is identified as "alive" in the liveness detection model, and the liveness score is 0.67633. The processed image on the lower right is the image after denoising the original image on the lower left through the denoising process of the defense module. Many noise points on the face are removed, and the edge of the straight glasses is more obvious. The denoising image is identified as "non-live" in the liveness detection model, and the liveness score is only 0.34792, achieving successful defense.
[0099] In order to further verify the actual effect of the application scenario of the present invention, the solution provided by the present application was tested in a real liveness detection service on a mobile phone. The results show that the solution provided by the present application can greatly improve the ability of the liveness detection model to defend against attacks, and almost no loss of the normal performance of the liveness detection model. The test results are shown in Table 1.
[0100] Table 1. The impact of the image processing solution provided in this application on the prediction performance of the liveness detection model
[0101]
[0102] The effect of the image processing solution provided by this application on the normal prediction accuracy of the liveness detection model is tested on the order of 1 million. These 1 million test samples are all real samples collected from the physical world (ordinary samples without adding interference), and the ratio of live samples to non-live samples is about 1:1. The test results are shown in Table 1. "Liveness detection model O" is the original classification model on the business side. It can be seen that on the 1 million data volume, its prediction accuracy is 99.26%; the prediction accuracy Precision, that is, the proportion of samples that are truly live among the samples predicted by the liveness detection model as live, is 99.0%, and 1-Precision is the error situation in which the liveness detection predicts non-liveness as liveness; the prediction recall Recall, that is, the proportion of samples predicted as live by the liveness detection model among all samples that are live, is 99.3%, and 1-Recall is the error situation in which the liveness detection model predicts liveness as non-liveness. "Defense module + liveness detection model O" adds the defense module provided by this application to the original model. On a data volume of 1 million, the prediction accuracy of the liveness detection model still reaches 98.35% after adding the defense module, with an impact of only 0.91%. The Precision has not changed, and the Recall reaches 97.2%. It can be seen that the slight loss of Accuracy mainly comes from the loss of Recall, and there is no loss of Precision. In actual business, the requirements for Precision will be higher, and the business side does not want to mistakenly identify non-live bodies as live bodies, because this will cause incorrect authorization; and the tolerance for Recall is greater. A slight reduction in Recall only requires the user to try one more time when it is mistakenly rejected, and in 97.2% of Recall, the user can hardly feel this subtle change. It can be seen that the performance impact of the present invention on the business model is negligible and can be ignored.
[0103] After testing the normal performance of the liveness detection model, the defense effect of the image processing scheme provided by this application was also systematically tested. The defense effect of the image processing scheme provided by this application was tested by making 10,000 attack samples that can successfully attack the business model. The attack sample segmentation includes mask-wearing attack, replay and noise attack, etc. These 10,000 samples are directly input into the liveness detection model, and the success rate of attacking the liveness detection model is 100%, that is, the defense rate of the liveness detection model against these adversarial samples is 0%. Next, the same 10,000 samples are used to test the defense module + liveness detection model provided by this application to evaluate its defense rate. For the replay and noise adversarial attack, the defense rate is 72.7%, and for the mask-wearing attack, the defense rate is 88.3%, both of which greatly increase the attack cost. It can be seen that the image processing scheme provided by this application can greatly improve the defense performance of the liveness detection model for attack samples, and the defense rate is increased from 0% to 72.7% and 88.3%, while bringing less impact on the accuracy of the liveness detection model.
[0104] like Fig.10 As shown, Fig.10 The schematic diagram of the structure of a device provided in the present application. The device 1000 can be a terminal device such as a mobile phone, a tablet computer, a smart wearable device, a computer, an access control device, a vehicle, or a payment device, or can be a server. Alternatively, the device 1000 can also be a chip in a mobile phone, a tablet computer, a smart wearable device, a computer, an access control device, a vehicle, a payment device, or a server. The device 1000 includes a noise reduction processing module 1001.
[0105] The denoising processing module 1001 is used to perform denoising on the first image to obtain a second image. The denoising processing includes filtering processing and fusion processing. The filtering processing is filtering the first image or the fused image. The fusion processing is fusing the first image and the filtered image. The fused image is an image obtained by fusing the first image and the filtered image. The filtered image is an image obtained by filtering the first image or the fused image. The second image is used to be input into an image recognition model. The image recognition model is used to recognize the second image to obtain a recognition result.
[0106] In a possible implementation, the noise reduction processing module 1001 is specifically configured to perform k-iterative noise reduction processing on the first image to obtain a second image, where k is an integer greater than or equal to 1.
[0107] In a possible implementation, k is greater than or equal to 2, and the noise reduction processing module 1001 includes a filtering submodule 10011 and a fusion submodule 10012. The filtering submodule 10011 is used to filter the first image, and the fusion submodule 10012 is used to fuse the first image. The filtering submodule 10011 is used to filter the first image during the first filtering process to obtain a filtered image. The fusion submodule 10012 is used to fuse the first image and the filtered image obtained by the first filtering process during the first fusion process to obtain a fused image. The filtering submodule 10011 is used to filter the fused image obtained by the k-1 fusion process during the k th filtering process to obtain a filtered image. The fusion submodule 10012 is used to fuse the first image and the filtered image obtained by the k th filtering process during the k th fusion process to obtain a second image.
[0108] In a possible implementation, k is equal to 1, and the processing module includes a filtering submodule 10011 and a fusion submodule 10012. The filtering submodule 10011 is used to filter the first image, and the fusion submodule 10012 is used to fuse the first image. The filtering submodule 10011 is used to filter the first image to obtain a filtered image. The fusion submodule 10012 is used to fuse the first image and the filtered image to obtain a second image.
[0109] In a possible implementation, the filtering submodule 10011 is specifically used to filter the first image or the fused image by using a filtering algorithm, where the filtering algorithm includes a bilateral filtering algorithm, a weighted least squares algorithm, a guided filtering, or a rolling guided filtering.
[0110] In a possible implementation, the fusion submodule 10012 is specifically configured to fuse the first image and the filtered image according to a fusion ratio.
[0111] In a possible implementation, the first image includes a facial image of the target object, the image recognition model is a liveness detection model, and the recognition result is a liveness detection result.
[0112] like Fig.11 As shown, Fig.11A schematic diagram of the structure of another device provided in the present application. The device 1100 can be a terminal device such as a mobile phone, a tablet computer, a smart wearable device, a computer, an access control device, a vehicle or a payment device, or a server. Alternatively, the device 1100 can also be a chip in a mobile phone, a tablet computer, a smart wearable device, a computer, an access control device, a vehicle, a payment device or a server. The device 1100 includes a noise reduction processing module 1101, an image recognition module 1102 and an adjustment module 1103. Among them, the noise reduction processing module 1101 is used to perform noise reduction processing on the training images in the training image set according to the noise reduction parameters to obtain a noise reduction image. The training images in the training image set include adversarial samples. The adversarial samples are samples with disturbances added. The noise reduction processing includes filtering processing and fusion processing. The image recognition module 1102 is used to identify the noise reduction image to obtain a predicted recognition result. The adjustment module 1103 is used to adjust the noise reduction parameters according to the label and recognition result of the training image.
[0113] In a possible implementation, the noise reduction parameter includes the number of iterations of the noise reduction process.
[0114] In one possible implementation, the filtering process is to filter the training image or the fused image through a filtering algorithm, the fusion process is to fuse the training image and the filtered image according to a fusion ratio, the fused image is an image obtained by fusing the training image and the filtered image, the filtered image is an image obtained by filtering the training image or the fused image, and the denoising parameters include the filtering parameters of the filtering algorithm and the fusion ratio.
[0115] In a possible implementation, the training image includes a facial image of an object to be detected, the image recognition model is a liveness detection model, and the recognition result is a liveness detection result.
[0116] like Fig.12 As shown, Fig.12 The electronic device 1200 includes a processor 1201 and a memory 1202, wherein the processor 1201 is coupled to the memory 1202, and the processor 1201 is configured to execute the image processing method in any of the above embodiments, or the parameter adjustment method in any of the above embodiments, based on instructions stored in the memory 1202.
[0117] The present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a computer, the steps in the image processing method or parameter adjustment method of any of the above method embodiments are implemented.
[0118] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0119] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical or other forms.
[0120] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0121] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0122] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the technical solution of the present application can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.
Claims
1. An image processing method, characterized in that: The method comprises: A first image is subjected to denoising processing to obtain a second image, wherein the denoising processing includes filtering processing and fusion processing, wherein the filtering processing is filtering the first image or the fused image, and the fusion processing is fusing the first image and the filtered image, and the fused image is an image obtained by performing the fusion processing on the first image and the filtered image, and the filtered image is an image obtained by performing the filtering processing on the first image or the fused image, and the second image is used to be input into an image recognition model, and the image recognition model is used to recognize the second image to obtain a recognition result.
2. The method according to claim 1, characterized in that Performing noise reduction processing on the first image to obtain a second image includes: Perform k-iterative noise reduction processing on the first image to obtain the second image, where k is an integer greater than or equal to 1.
3. The method according to claim 2, characterized in that The k is greater than or equal to 2, and the performing k-iterative noise reduction processes on the first image to obtain the second image includes: In the first filtering process, filtering the first image to obtain the filtered image; In the first fusion process, the first image is fused with the filtered image obtained by the first filtering process to obtain the fused image; In the kth filtering process, filtering the fused image obtained by the k-1th fusion process to obtain the filtered image; In the kth fusion process, the first image and the filtered image obtained by the kth filtering process are fused to obtain the second image.
4. The method according to claim 2, characterized in that: The step of performing k-iterative noise reduction processing on the first image to obtain the second image includes: filtering the first image to obtain the filtered image; The first image and the filtered image are fused to obtain the second image.
5. The method according to any one of claims 1 to 4, characterized in that The filtering process includes: The first image or the fused image is filtered by a filtering algorithm, wherein the filtering algorithm includes a bilateral filtering algorithm, a weighted least squares algorithm, a guided filtering or a rolling guided filtering.
6. The method according to any one of claims 1 to 5, characterized in that The fusion process includes: The first image and the filtered image are fused according to a fusion ratio.
7. The method according to any one of claims 1 to 6, characterized in that The first image includes a facial image of a target object, the image recognition model is a liveness detection model, and the recognition result is a liveness detection result.
8. A parameter adjustment method, characterized in that: The method comprises: Performing denoising processing on training images in a training image set according to denoising parameters to obtain denoised images, wherein the training images in the training image set include adversarial samples, and the adversarial samples are samples with disturbances added, and the denoising processing includes filtering processing and fusion processing; Inputting the denoised image into an image recognition model to obtain a predicted recognition result; The denoising parameter is adjusted according to the label of the training image and the recognition result.
9. The method according to claim 8, characterized in that The noise reduction parameters include the number of iterations of the noise reduction process.
10. The method according to claim 8 or 9, characterized in that: The filtering process is filtering the training image or the fused image by a filtering algorithm, the fusion process is fusing the training image and the filtered image according to a fusion ratio, the fused image is an image obtained by fusing the training image and the filtered image, and the filtered image is an image obtained by performing the filtering process on the training image or the fused image; The noise reduction parameters include filtering parameters of the filtering algorithm and the fusion ratio.
11. The method according to any one of claims 8 to 10, characterized in that The training image includes a facial image of an object to be detected, the image recognition model is a liveness detection model, and the recognition result is a liveness detection result.
12. A device, characterized in that: The device comprises: A denoising processing module is used to perform denoising on a first image to obtain a second image, wherein the denoising processing includes filtering processing and fusion processing, wherein the filtering processing is filtering the first image or the fused image, and the fusion processing is fusing the first image and the filtered image, and the fused image is an image obtained by performing the fusion processing on the first image and the filtered image, and the filtered image is an image obtained by performing the filtering processing on the first image or the fused image, and the second image is used to be input into an image recognition model, and the image recognition model is used to recognize the second image to obtain a recognition result.
13. The device according to claim 12, characterized in that The denoising processing module is specifically configured to perform k-iterative denoising processing on the first image to obtain the second image, where k is an integer greater than or equal to 1.
14. The device according to claim 13, characterized in that k is greater than or equal to 2, the noise reduction processing module includes a filtering submodule and a fusion submodule, the filtering submodule is used to perform the filtering processing on the first image, and the fusion submodule is used to perform the fusion processing on the first image; The filtering submodule is used to filter the first image to obtain the filtered image during the first filtering process; The fusion submodule is used to fuse the first image and the filtered image obtained by the first filtering process to obtain the fused image during the first fusion process; The filtering submodule is used for filtering the fused image obtained by the k-1th fusion process during the kth filtering process to obtain the filtered image; The fusion submodule is used to fuse the first image and the filtered image obtained by the k-th filtering process during the k-th fusion process to obtain the second image.
15. The device according to claim 13, characterized in that The k is equal to 1, the noise reduction processing module includes a filtering submodule and a fusion submodule, the filtering submodule is used to perform the filtering processing on the first image, and the fusion submodule is used to perform the fusion processing on the first image; The filtering submodule is used to filter the first image to obtain the filtered image; The fusion submodule is used to fuse the first image and the filtered image to obtain the second image.
16. A device, characterized in that: The device comprises: A denoising processing module, configured to perform denoising processing on training images in a training image set according to denoising parameters to obtain denoised images, wherein the training images in the training image set include adversarial samples, and the adversarial samples are samples with disturbances added thereto, and the denoising processing includes filtering processing and fusion processing; An image recognition module, used to recognize the denoised image to obtain a predicted recognition result; An adjustment module is used to adjust the noise reduction parameters according to the label of the training image and the recognition result.
17. The device according to claim 16, characterized in that The noise reduction parameters include the number of iterations of the noise reduction process.
18. The device according to claim 16 or 17, characterized in that The filtering process is to filter the training image or the fused image by a filtering algorithm, the fusion process is to fuse the training image and the filtered image according to a fusion ratio, the fused image is an image obtained by performing the fusion process on the training image and the filtered image, the filtered image is an image obtained by performing the filtering process on the training image or the fused image, and the denoising parameters include the filtering parameters of the filtering algorithm and the fusion ratio.
19. An electronic device, characterized in that: The electronic device includes a processor and a memory, the processor is coupled to the memory, and the processor is configured to execute the image processing method described in any one of claims 1 to 7, or the parameter adjustment method described in any one of claims 8 to 11 based on instructions stored in the memory.
20. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises instructions, which, when the computer-readable storage medium is run on a computer, causes the computer to execute the image processing method according to any one of claims 1 to 7, or the parameter adjustment method according to any one of claims 8 to 11.
Citation Information
Patent Citations
CT image noise reducing method, device and computer equipment
CN107622481A
Adversarial face image generating method and device
CN112052761A
Method for defending image noise attacks in pedestrian re-identification system
CN112668557A
Defense method for non-inductive noise attack in pedestrian re-identification system
CN114299550A
Image processing method and device, equipment and storage medium
CN115619672A
