Method for image processing

By extracting image latent vectors and combining them with image classification models, the problem of efficiency and accuracy of adversarial attack detection on edge devices is solved, a flexible detection framework is provided, suitable for different application scenarios, and the security and accuracy of image detection are improved. .

CN118570438APending Publication Date: 2024-08-30DELL PROD LP
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202310183393.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-28
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

Existing adversarial attack detection methods cannot be effectively deployed on edge devices or IoT devices with limited computing power, and adversarial attack detection takes a long time to meet the needs of real-time applications. At the same time, different applications and scenarios have different image detection standards. , it is difficult to provide a flexible detection solution.

Method used

By extracting the target area in the image, the first classification result is generated based on the latent vector, and the second classification result is obtained by combining the image classification model to determine the credibility of the image, providing a flexible framework to support different algorithms and prior knowledge in specific fields , improve the safety and accuracy of detection.

Benefits of technology

It achieves efficient detection of adversarial attacks on devices with limited computing power, provides detection solutions suitable for different application scenarios, improves the security and accuracy of image detection, and can improve detection accuracy without affecting processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570438A
    Figure CN118570438A
Patent Text Reader

Abstract

The embodiment of the invention provides an image processing method. The method comprises the steps of extracting a target region in an image, and determining an implicit vector of the image based on the target region; the method further includes generating a first classification result for the image based on the implicit vector, obtaining a second classification result for the image from the image classification model, and determining a credibility of the image based on the first classification result and the second classification result. By using the method, a more flexible framework suitable for different applications can be provided, the framework not only can support machine learning models based on different algorithms, but also can more accurately specify data distribution, and a method for independently detecting antagonistic attacks is provided, so that the security of image detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of image processing, and more particularly, to a method, an electronic device, and a computer program product for image detection. Background Art

[0002] Machine learning / deep learning is the core technology of artificial intelligence. It solves most problems that traditional algorithms cannot solve and plays a pivotal role. With the application of machine learning / deep learning technology in many important fields (such as autonomous driving, identity authentication and security monitoring), its security has also received widespread attention. Summary of the invention

[0003] Embodiments of the present disclosure provide a method, an electronic device, and a computer program product for image processing.

[0004] In a first aspect of the present disclosure, a method for image processing is provided. The method includes extracting a target region in an image, and determining a latent vector of the image based on the target region. The method also includes generating a first classification result for the image based on the latent vector, obtaining a second classification result for the image from an image classification model, and determining the credibility of the image based on the first classification result and the second classification result.

[0005] In a second aspect of the present disclosure, a device for image processing is provided. The device includes a processor, and a memory, which is coupled to the processor and stores instructions, and the instructions cause the device to perform actions when executed by the processor, and the actions include extracting a target area in the image and determining a latent vector of the image based on the target area. The actions also include generating a first classification result for the image based on the latent vector, obtaining a second classification result for the image from an image classification model, and determining the credibility of the image based on the first classification result and the second classification result.

[0006] According to a third aspect of the present disclosure, there is provided a computer program product, which is tangibly stored on a non-volatile computer-readable medium and comprises machine-executable instructions, which when executed cause a machine to perform the steps of the method in the first aspect of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] The above and other objects, features and advantages of the present disclosure will become more apparent through a more detailed description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, wherein like reference numerals generally represent like elements throughout the exemplary embodiments of the present disclosure.

[0008] Figure 1 illustrates schematic diagrams in which devices and / or methods according to embodiments of the present disclosure may be implemented;

[0009] Figure 2 A flowchart for an image processing method according to an embodiment of the present disclosure is illustrated;

[0010] Figure 3 A schematic diagram for defensive training against adversarial attacks on images based on the present disclosure is illustrated;

[0011] Figure 4 A schematic diagram illustrating the relationship between the number of latent vectors in the extracted target region and the accuracy of judging a credible image;

[0012] Figure 5 A schematic diagram illustrating a method for extracting a latent vector in a target region;

[0013] Figure 6 A schematic block diagram of an example device suitable for implementing embodiments of the present disclosure is illustrated. DETAILED DESCRIPTION

[0014] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0015] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below. In addition, all specific numerical values ​​in this document are examples, which are only to help understanding and are not intended to limit the scope.

[0016] Adversarial attacks are one of the most serious threats to the security of machine learning / deep learning applications today. Adversarial examples are carefully crafted examples with very small perturbations that cannot be detected by the human eye, but will cause degradation of machine learning / deep learning models, such as misclassification. For example, adding small perturbations to an image of a panda, such as noise, clutter, etc., may eventually cause the image processing model to misjudge or misclassify, such as identifying the panda in the image as a "gibbon".

[0017] In another example, an attacker can impose tiny disturbances on a "30 km / h speed limit" sign on the side of the road, such as shadows of tree branches and trunks at specific angles and directions, mud spots and stains at specific locations on the sign. The image processing system in an autonomous vehicle passing by the sign may identify the "30 km / h speed limit" sign as a "100 km / h speed limit" sign due to these tiny disturbances, which will cause serious safety accidents and endanger personal and property safety. In addition, autonomous vehicles may also fail to accurately identify license plates, road signs, roadblocks, pedestrians, etc. due to adversarial attacks caused by tiny disturbances.

[0018] Some known methods for identifying adversarial attacks often require a lot of computation, and general edge devices or IoT devices cannot match the corresponding computing / memory requirements, making these detection schemes impossible to deploy in edge devices or IoT devices with limited computing power. In addition, since a lot of computation will make the detection time lengthy and the latency high, for real-time applications of online learning (such as autonomous driving), even if the detection is successful, it will not be of much significance.

[0019] In addition, image processing models based on different algorithms or machine learning models often have different detection standards for the images to be detected. For example, in the example of an image processing model based on GMVAE (Gaussian Mixture Variational Autoencoder) and KNN (K-Nearest Neighbors Algorithm), more accurate classification results can be achieved, but this image processing model requires more computation and longer processing time, so this image processing model is more suitable for devices such as cloud server applications with more powerful performance.

[0020] On the other hand, in the example of the image processing model based on GMVAE and Bayesian reasoning, the model has lower detection accuracy, so the computational effort is less and it is more suitable for edge computing devices, such as smart mobile phones, driverless cars, etc. Therefore, different applications and usage scenarios have different detection standards for images, and there is a need to help different users customize image detection solutions for different applications and scenarios.

[0021] Adversarial attacks not only attack deep learning models, but also machine learning models. For example, in image processing models based on GMVAE and VAE, such models are suitable for deep learning models for image classification. In other machine learning models used for audio processing, text processing, malware detection, intrusion detection, and performance optimization, data comes from different collection points and is not related to each other. Adversarial attacks may perturb these data, so adversarial attacks in these examples need to be detected.

[0022] In some adversarial attack examples, the image distribution is not naturally distributed, such as road signs and license plates, so it is difficult to find such a natural distribution only from the organized training data set. Therefore, it is necessary to incorporate domain-specific knowledge such as experts and users into the image processing model, which can improve the accuracy of detection and recognition. In addition, there is a need to detect adversarial attacks in images independently from the current existing image classification model.

[0023] At least to solve the above and other potential problems, an embodiment of the present disclosure provides a method for image processing. The method includes extracting a target area in an image and determining a latent vector of the image based on the target area. The method also includes generating a first classification result for the image based on the latent vector, obtaining a second classification result for the image from an image classification model, and determining the credibility of the image based on the first classification result and the second classification result. By using this method, a more flexible framework suitable for different applications can be provided, which can not only support machine learning models based on different algorithms, but also combine prior knowledge in specific fields to more accurately specify data distribution, and provide a method for independently detecting adversarial attacks, thereby improving the security of image detection.

[0024] The basic principles and several exemplary embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. Figure 1 1 illustrates a schematic diagram 100 in which an apparatus and / or method according to an embodiment of the present disclosure may be implemented. It should be understood that Figure 1 The number and arrangement of components, elements and models shown are only examples, and different numbers and arrangements of components, elements and models may be included in the schematic diagram 100. End users can easily implement the detection framework by selecting different building blocks in different steps according to their application requirements.

[0025] like Figure 1 As shown, a schematic diagram 100 includes an image processing model 101, an extraction module 102, a latent vector processing module 103, a classification module 104, a first classification result 105, an image classification model 106, a second classification result 107, trusted data 111, untrusted data 112, and input data 110.

[0026] exist Figure 1 In the example, the input data 110 is an image that may contain adversarial attack data, which may include images of any image content, any size and any image format type, and the present disclosure does not impose any restrictions on this. As an example, in the present disclosure, the input data 110 is an image of a panda.

[0027] Additionally or alternatively, in some embodiments, the input data 110 may also be data such as video, audio, text, etc. that may contain adversarial attack data, and the corresponding adversarial attack data may be perturbed video data, perturbed audio data, perturbed text data, etc. The present disclosure does not impose any limitations on this.

[0028] In the input data 110, the attacker can use a variety of adversarial attack algorithms to process and perturb the input data 110 to generate interference that is difficult for the human eye to detect but can be detected by the processing model or classification model, and ultimately affect the judgment of the processing model or classification model. The general principle of these adversarial attack algorithms is to use optimization algorithms to find the minimum perturbation of each feature in the original feature space, so that the final aggregated perturbation is large enough to push over the decision boundary of the processing model or classification model:

[0029] x′: D(x, x′)<η, f(x)=y, f(x′)≠f(x) (1)

[0030] Where x is the input data 110 without adversarial attack data, x' is the input data 110 containing adversarial attack data, and η is the applied perturbation data. In order to make the distribution D(x, x') < η small enough to be imperceptible to the human eye, but large enough so that the classification result f(x') ≠ f(x), the attack algorithm must be able to find a suitable perturbation direction so that the perturbations can accumulate rather than cancel each other out, and try to utilize as many features as possible.

[0031] As an example, in the present disclosure, FGSM (Fast Gradient Sign Method) can be used as an example of an adversarial attack algorithm. FGSM includes using the same gradient descent in the classification model to find a suitable ascending perturbation direction, and approving the perturbation in the first hidden layer so that all dimensions in x can be used for the attack. Since the input data x and the corresponding parameter matrix w T is very high-dimensional, even if the perturbation ||ρ|| is very small, the accumulated ||w T It is also easy for ρ|| to be large enough so that the classification result f(x′)≠f(x).

[0032] For example, the input data can be expressed as f(x)=σ(w Tx), and the data after adding disturbance can be expressed as f(x′)=f(x+ρ)=σ(w T (x+ρ))=σ(w T x+w T ρ). FGSM can first determine the direction of minimum disturbance, that is, when the feature ρ is In the same direction f(x′) increases fastest when , and the perturbation can then be applied to x.

[0033] The input data 110 may then be input to the image processing model 101. The image processing model 101 may be a processing model capable of digitally processing input data such as images and based on an application of a deep learning model, a machine learning model, or both according to the present disclosure, and the present disclosure does not impose any limitation on this.

[0034] Application examples based on deep learning models and machine learning models may include, but are not limited to, one or more of the following: PCA (Principle Component Analysis), PPCA (Probalistic PCA), kernel PCA, FA (Factor Analysis), AE (autoencoder, including but not limited to denoising AE, shrinkage AE, sparse AE, etc.), manifold learning, MDS (Multi-Dimensional Scaling), ISOMap, MVU (Maximum Variance Unfolding), LLE (Local Linear Embedding), Laplacian Eigenmaps, VAE (Variational Auto-Encoder), GAN (Generative Adversarial Network), multi-layer perceptron (MLP), recurrent neural network model, recursive neural network model, deep convolutional network model (CNN), deep generative model (DNN), etc., and the present disclosure does not impose any limitation on this. In the present disclosure, as an example, the image processing model 101 may be a model that has been trained to have image processing capabilities based on multiple deep learning models and machine learning models.

[0035] According to an embodiment of the present disclosure, the image processing model 101 can be implemented in various devices with computing capabilities, such as personal computers, server computers, handheld or laptop computers, vehicle-mounted electronic devices, wearable electronic devices, mobile devices, drones, self-driving cars, smart home devices, consumer electronics, server computer systems, large computer systems, or distributed cloud computing environments including any of the above. It should be noted that the above-mentioned examples of the image processing model 101 and the devices implementing the image processing model 101 are only exemplary and non-restrictive, and the image processing model 101 can also include more applications, and the devices implementing 101 can also include more devices, which are not limited by the present disclosure.

[0036] The image processing model 101 may include an extraction module 102. The extraction module 102 may extract target data to be processed from the input data 110. For example, Figure 1 In the example, the extraction module 102 may remove the background image data in the input data 110 and retain only the processed target data “panda” itself.

[0037] The extraction module 102 may also determine the range of the target area to be extracted based on the type of image processing model or different types of algorithms used in the current image processing model 101. For example, when the algorithm needs to perform linear calculations on latent vectors in the image (e.g., traverse from one embedding to another embedding, or combine two embeddings into another new embedding), and therefore requires a continuous latent vector.

[0038] For example, when the machine learning model adopted by the image processing model 101 is GMVAE (Gaussian Mixture Variational Autoencoder) and KNN or Bayesian reasoning is used, the extraction module 102 can embed all extracted features into a continuous latent vector, so that the distance between the input data 110 with perturbation data and the original input data can be intuitively observed. As an example, in some embodiments, the extraction module 102 can remove redundant areas around the target area of ​​the input data 110, and only retain the complete and continuous target area itself.

[0039] On the other hand, when the method or machine learning model adopted by the image processing model 101 is PCA, FA or AE, or is used for malware detection, intrusion detection or system optimization, the extraction module 102 may only extract a partial, discrete target area. In some embodiments, the extraction module 102 may only retain a few pixels in the target area, such as retaining only the pixels required to form the outline of the target area and removing the remaining pixels, so as to further reduce the amount of data to be calculated.

[0040] In some embodiments, the extraction module 102 may also reduce the dimensionality of the input data 110 to map the data points in the original high-dimensional space to a low-dimensional space. In some embodiments, the extraction module 102 may also reduce information such as the color channels of the input image to simplify subsequent calculations and identify disturbance data.

[0041] Additionally or alternatively, in an example where the input data 110 is a video, the extraction module 102 may only extract key frames in the video to reduce the amount of subsequent calculations. Additionally or alternatively, in an example where the input data 110 is an audio, the extraction module 102 may only extract part of the audio components in the audio.

[0042] According to the embodiments of the present disclosure, the extraction module 102 can reduce the dimensionality of the original feature space and extract as few features as possible for the next step of processing, which can effectively block the adversarial attack features. On the other hand, the features extracted by the extraction module 102 are also sufficient and will not affect the subsequent classification accuracy. It should be noted that the above-mentioned examples of the extraction method of the extraction module 102 for input data are only exemplary and not restrictive, and the extraction module 102 can also include more extraction methods, which are not limited by the present disclosure.

[0043] The extracted target region data may then be fed to the latent vector processing module 103 via the extraction module 102. The latent vector processing module 103 may determine the latent vector in the target region data based on the target region data.

[0044] The image distribution of the input data 110 with adversarial attack data is usually unnatural relative to the image distribution without adversarial attack data, such as not conforming to the normal distribution or Gaussian mixture distribution. However, currently known algorithms for defending or detecting adversarial attacks focus on how to find the natural distribution of normal samples. This approach is difficult to implement because it is difficult to find such unnatural distributions and adversarial samples in adversarial training from the training data set.

[0045] In the currently known training data, the data is organized in an orderly manner, that is, the distribution of all categories is balanced. In actual applications, the distribution of different categories is not so balanced. For example, in the context of autonomous driving, the probability of a "under construction" warning traffic sign appearing may be much lower than the probability of a speed limit sign appearing. For speed limit signs, the probability of a 30 km or 120 km speed limit sign appearing may be much lower than the probability of a 60 km speed limit sign appearing.

[0046] Therefore, the latent vector processing module 103 can assign multiple baseline truth labels associated with the target area data to the target area data, and the multiple baseline truth labels have been captured and labeled by the latent vector processing module 103 based on a specific context on sample data features in the training sample set, rather than directly classifying the target area data or embedding the labels into the input of the conditional GAN ​​or conditional VAE.

[0047] As an example, in the context of animal images in a wildlife park, the latent vector processing module 103 can extract features, capture and label image elements such as "panda", "gibbon", "tiger", etc. that appear in the image, thereby obtaining multiple baseline truth labels associated with these image elements, and then applying the multiple baseline truth labels to the target area data.

[0048] Subsequently, the latent vector processing module 103 can set the probability that the target area data may be a panda to 60% and the probability that the target area data may be a tiger to 10% based on the prior knowledge that the animal image is taken in an area where vegetarian animals such as pandas appear, rather than in an area where carnivorous animals such as tigers appear. The latent vector processing module 103 can support users to more accurately specify data distribution for their application data. Such data distribution helps to improve detection accuracy.

[0049] Subsequently, the latent vector processing module 103 can feed the label probability that the latent vector belongs to multiple reference truth labels and the latent vector itself as intermediate data to the classification module 104. The classification module 104 can perform a final classification on the target area data based on these intermediate data. The classification method of the classification module 104 can be based on various deep learning models or machine learning models, such as KNN algorithm, Bayesian inference algorithm, CNN, residual neural network, etc.

[0050] As an example, the present disclosure may use Bayesian reasoning as the classification method of the classification module 104, and the algorithm may be expressed as follows:

[0051]

[0052]

[0053] Where k is the label in the latent vector, and in the context of the speed limit sign example, k can be 1 to 10. k is the number of latent vectors of training samples in the training set, and N = ∑N k is the total number of example samples in the training set. For ease of illustration, the MNIST handwritten digit dataset is used as an example. In this MNIST example, N 1 =N2 =…=N 10 =5,000, and N = ∑N k =50,000. It should be noted that this is only exemplary and not restrictive. k is the sample mean of label k in the latent vector, and Σ k is the sample variance of label k in the latent vector. The classification module 104 obtains Σ k Later, we can calculate

[0054] Through the above classification process, the image processing model 101 can obtain the first classification result 105k for the target area through the classification module 104. C At the same time, the image processing model 101 obtains a second classification result 107 generated by another image classification model 106 .

[0055] For example, the image classification model 106 can be based on a Gaussian mixture variational autoencoder GMVAE encoder model. The image classification model 106 can classify the input data 110 in parallel and calculate Where X represents the latent vector of the input image, μ k is the sample mean of label k in the latent vector of the training set, and Σ k is the sample variance of label k in the latent vector of the training set, P k is the probability of belonging to label k. The second classification result 107 of the image classification model 106 for the input data 110 can be k D ,and

[0056] The image processing model 101 may then classify the first classification result 105k C The second category results are 107k D Compare. If the first classification result is 105k C The second category results are 107k D The results are inconsistent, that is, k C ≠k D , the image processing model 101 can report to the user or system that the input data 110 is untrusted data 112, that is, there is a possibility that the input data 110 includes adversarial attack data and has been tampered with or applied adversarial attacks by others. On the contrary, if the first classification result 105k C The second category results are 107k D If the results are consistent, the image processing model 101 can report to the user or system that the input data 110 is credible data 111 and has no possibility of being tampered with or subjected to adversarial attacks by others.

[0057] For example, if the image processing model 101 classifies the input data 110 as "panda", and the image classification model 106 classifies the same input data 110 as "gibbon", the image processing model 101 can determine that the input data 110 is untrusted data 112. On the contrary, if the judgment results are the same, the input data 110 is credible data 111. Additionally or alternatively, in some embodiments, the image processing model 101 can also calculate the matching scores of the first classification result 105 and the second classification result 107 with the reference truth label, and determine whether the input data 110 is credible data based on whether the scores reach the matching threshold defined by the user. The matching threshold can be any value defined by the user. For example, if the matching scores of the first classification result 105 and the second classification result 107 with the reference truth label both reach 80% defined by the user, then it can be considered that the first classification result is inconsistent with the second classification result.

[0058] Figure 2 A flowchart 200 for an image processing method according to an embodiment of the present disclosure is illustrated.

[0059] like Figure 2 As shown, at block 201, the image processing model 101 can extract the target area in the image. Depending on factors such as the device environment where the current image processing model 101 is located, the algorithm used, and the required computing time, the image processing model 101 can adaptively extract the target area.

[0060] In some examples, for example, if the current image processing model 101 is based on a deep learning model, or the current image processing model 101 is located in a device with strong computing power such as a supercomputer or server, or the current computing process can withstand a longer processing time, the image processing model 101 can extract the complete target area.

[0061] In some examples, for example, if the current image processing model 101 is based on a machine learning model, or the current image processing model 101 is located in a terminal device with low computing power such as a drone, a smart phone, an unmanned car, or the current computing process requires instant or instantaneous processing, the image processing model 101 can extract part of the target area.

[0062] At block 202, the image processing model 101 may determine a latent vector of the image based on the target region. For example, the image processing model 101 may generate a latent vector associated with the target region based on various known or unknown algorithms or models such as PCA, PPCA, FA, VAE, etc. The present disclosure does not impose any limitation on the method of determining the latent vector of the image.

[0063] At box 203, the image processing model 101 can then generate a first classification result for the image based on the determined latent vector. The image processing model 101 can determine the probability that the latent vector belongs to each reference truth label based on the reference truth labels formed by the data trained in the specific training set and the prior knowledge.

[0064] For example, in the context of a speed limit sign as an example, the latent vector processing module 103 in the image processing model 101 can capture and mark each digital element of the numbers "0" to "9" that appear on the speed limit sign, thereby obtaining multiple reference truth labels associated with these digital elements, and then applying the multiple reference truth labels to the target area data. Additionally or alternatively, the latent vector processing module 103 can also capture and mark elements such as "road", "street", "district" and the like in the road sign, thereby obtaining multiple reference truth labels associated with these words.

[0065] In the context of the speed limit sign as an example, the probability of each number appearing is not always the same. For example, in practice, there is some prior knowledge that the probability of the numbers "1" and "7" appearing on the speed limit sign is much greater than the probability of the numbers "4" and "8" appearing.

[0066] Therefore, the latent vector processing module 103 can predict and analyze the probability of the target area data being a certain type of benchmark truth label or assign different weights based on these prior knowledge. For example, since the probability of the numbers "1" and "7" appearing is much greater than that of the numbers "4" and "8", the latent vector processing module 103 can set the probability of the target area data being the numbers "1" or "7" to 30%, and the probability of the target area data being the numbers "4" or "8" to 10%. These prior knowledge can be set and assigned different weights by the developer or experienced staff based on actual work experience.

[0067] For example, experienced staff can assign more weight to elements in training that appear frequently and less weight to elements that appear less frequently, and the weights can be adjusted in real time as the usage scenarios, conditions, etc. change.

[0068] Additionally or alternatively, the latent vector processing module 103 may also set the probability of occurrence of the sample data based on the actual data distribution of the sample data in the training set. where p c represents the sample probability, N c represents the sample data distribution, N represents the actual data distribution in the training set.

[0069] The image processing model 101 can then combine the probability that the latent vector belongs to each benchmark truth label, the latent vector itself, and various known or unknown classification algorithms, such as the KNN algorithm combined with GMVAE or the Bayesian inference algorithm, CNN to classify the target area, thereby concluding which label the target area belongs to. For example, in the context of a speed limit sign as an example, the image processing model 101 can determine that the target area is a number such as "70" or "30".

[0070] At block 204, the image processing model 101 may obtain a second classification result from another image classification model. The image classification model may be a known or unknown image classification model with different algorithms, processing rules, and architectures from the image processing model 101, and the present disclosure does not impose any limitation on this.

[0071] At box 205, the image processing model 101 can compare the first classification result with the second classification result, and determine the credibility of the image based on the comparison result. For example, in some embodiments, the first classification result from the image processing model 101 is "70", and the second classification result from another image classification model is "20", and the results of the two are inconsistent, then the image processing model 101 can determine that the input image has been subjected to an adversarial attack and the image is untrustworthy. On the contrary, in some embodiments, the first classification result is consistent with the second classification result, then the image processing model 101 can determine that the image is credible.

[0072] Figure 3 A schematic diagram 300 for defensive training against image adversarial attacks based on the present disclosure is illustrated. Figure 3 It includes an input image 301, an extraction module 302, a latent vector processing module 303, and an image processing model 304.

[0073] like Figure 3 As shown, the input image 301 can be fed into the extraction module 302 to remove redundant and unnecessary image elements while making the adversarial attack have insufficient features to apply perturbations. The extraction module 302 can be Figure 1 The extraction module 102 is the same module as in FIG.

[0074] The extraction module 302 can then feed the extracted target region to the latent vector processing module 303. In one aspect, the latent vector processing module 303 can extract the latent vector of the target region and feed it to the classification module 305 for further detection. The classification module 305 can be Figure 1The latent vector processing module 303 is a module with the same function as the classification module 104. On the other hand, the latent vector processing module 303 can make the target area as close to the natural distribution as possible, and feed the generated result into the image processing model 304 for iterative training, thereby performing defensive attack training against image adversarial attacks.

[0075] As an example, the latent vector processing module 303 can use the data of the target area to improve the training method of the deep learning model to enhance its robustness defense, such as designing a training loss function, or regularization, controlling the Lipschitz coefficient of the model, increasing the norm of the minimum perturbation, etc. In addition, the latent vector processing module 303 can also use a deep generative model to map adversarial samples to the real data distribution for defense.

[0076] The latent vector processing module 303 can also add randomness to the image processing model 304 based on the latent vector of the target area and average the prediction results of different random models to perform defense.

[0077] The image processing model 304 may be Figure 1 The image processing model 304 may be the same model as the image processing model 101 in FIG. Additionally or alternatively, the image processing model 304 may also be based on a downstream learning model such as ResNet, Inception, or Bert, and the present disclosure does not impose any limitation on this.

[0078] Figure 4 A schematic diagram 400 is shown showing the relationship between the number of latent vectors extracted from the target region and the accuracy of judging a credible image, wherein the horizontal axis represents the number of latent vectors extracted from the target region and the vertical axis represents the accuracy of judging a credible image. Figure 4 It can be seen that as the number of latent vectors in the extracted target area increases, the accuracy of judging credible images also increases.

[0079] However, after the number of latent vectors increases to a certain number, the accuracy of judging credible images does not improve significantly, such as in Figure 4 In the example above, after extracting 300 latent vectors, the accuracy (95%) did not increase significantly. Extracting more latent vectors means longer processing time. The implementation provided by the present disclosure can find a balance between accuracy and processing efficiency, while improving accuracy without losing too much processing efficiency.

[0080] Figure 5 A schematic diagram 500 of a method for extracting a latent vector in a target region is shown. Figure 5 As shown, the extraction module 102 can determine the range of the target area to be extracted based on the image processing model type or different types of algorithms used in the current image processing model 101.

[0081] For example, the extraction module 102 may extract all latent vectors associated with the number "4" in response to the machine learning model used by the image processing model being GMVAE and using KNN or Bayesian reasoning. In another example, when the method or machine learning model used by the image processing model 101 is PCA, FA or AE, the extraction module 102 may only extract a partial, discrete number of latent vectors, which may be located at Figure 5 The image is within the white box in and is sufficient to represent the number "4".

[0082] Figure 6 A schematic block diagram of an example device 600 that may be used to implement embodiments of the present disclosure is shown. Figure 1 The nodes in the device 600 can be implemented using the device 600. As shown in the figure, the device 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 602 or computer program instructions loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0083] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0084] The various processes and processing described above, such as method 200, may be performed by processing unit 601. For example, in some embodiments, method 200 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by CPU 601, one or more actions of method 200 described above may be performed.

[0085] The present disclosure may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.

[0086] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above. More specific examples (non-exhaustive list) of computer readable storage medium include: portable computer disk, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, such as a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination of the above. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (e.g., a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.

[0087] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0088] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0089] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0090] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0091] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0092] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0093] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. An image processing method, the method comprising: Extracting a target area in the image; Determining a latent vector of the image based on the target region; generating a first classification result for the image based on the latent vector; Obtaining a second classification result for the image from an image classification model; as well as The credibility of the image is determined based on the first classification result and the second classification result.

2. The method according to claim 1, wherein extracting the target area in the image comprises: The range of the target area to be extracted is determined based on the type of image processing model.

3. The method according to claim 2, wherein determining the range of the target area to be extracted based on the type of the image processing model further comprises: In response to the type of the image processing model being based on a deep learning model, a complete target area is extracted.

4. The method according to claim 2, wherein determining the range of the target area to be extracted based on the type of the image processing model further comprises: In response to the type of the image processing model being based on another type different from the deep learning model, a portion of the target area is extracted.

5. The method according to claim 1, wherein generating the first classification result for the image based on the latent vector comprises: Determine the label category to which the latent vector belongs based on multiple benchmark truth labels and prior knowledge; as well as The latent vector is classified based on the label category to obtain the first classification result. 6 . The method according to claim 5 , wherein the plurality of reference truth labels are obtained by capturing and labeling feature representations of the training samples using a training sample set to obtain the plurality of reference truth labels for the training sample set. The method according to claim 6 , wherein the prior knowledge is obtained by assigning different weights to samples in the training sample set.

8. The method according to claim 1, determining the credibility of the image based on the first classification result and the second classification result comprises: comparing the first classification result with the second classification result; In response to the first classification result being inconsistent with the second classification result, determining that the image is an untrustworthy image; and In response to the first classification result being consistent with the second classification result, determining that the image is a credible image; as well as The method of comparing the first classification result with the second classification result comprises: Calculating the matching scores of the first classification result and the second classification result with the benchmark truth label respectively; as well as It is determined whether the matching score reaches a matching threshold defined by the user.

9. The method according to claim 1, further comprising: The latent vector is applied as input to the image processing model to further train the image processing model for identifying the target region.

10. A device for image processing, comprising: processor, and A memory is coupled to the processor and stores instructions, which, when executed by the processor, cause the device to perform the following actions: Extracting a target area in the image; Determining a latent vector of the image based on the target region; generating a first classification result for the image based on the latent vector; Obtaining a second classification result for the image from an image classification model; as well as The credibility of the image is determined based on the first classification result and the second classification result.

11. The apparatus according to claim 10, wherein extracting the target area in the image comprises: The range of the target area to be extracted is determined based on the type of image processing model.

12. The device according to claim 11, wherein determining the range of the target area to be extracted based on the type of the image processing model further comprises: In response to the type of the image processing model being based on a deep learning model, a complete target area is extracted.

13. The device according to claim 11, wherein determining the range of the target area to be extracted based on the type of the image processing model further comprises: In response to the type of the image processing model being based on another type different from the deep learning model, a portion of the target area is extracted.

14. The apparatus of claim 10, wherein generating the first classification result for the image based on the latent vector comprises: Determine the label category to which the latent vector belongs based on multiple benchmark truth labels and prior knowledge; as well as The latent vector is classified based on the label category to obtain the first classification result. 15 . The apparatus according to claim 14 , wherein the plurality of reference truth labels are obtained by capturing and labeling feature representations of the training samples using a training sample set, thereby obtaining the plurality of reference truth labels for the training sample set.

16. The apparatus according to claim 15, wherein the prior knowledge is obtained by assigning different weights to samples in the training sample set.

17. The device according to claim 10, wherein determining the credibility of the image based on the first classification result and the second classification result comprises: comparing the first classification result with the second classification result; In response to the first classification result being inconsistent with the second classification result, determining that the image is an untrustworthy image; and In response to the first classification result being consistent with the second classification result, determining that the image is a credible image; as well as The method of comparing the first classification result with the second classification result comprises: Calculating the matching scores of the first classification result and the second classification result with the benchmark truth label respectively; as well as It is determined whether the matching score reaches a matching threshold defined by the user.

18. The apparatus of claim 10, further comprising: The latent vector is applied as input to the image processing model to further train the image processing model for identifying the target region.

19. A computer program product tangibly stored on a non-transitory computer readable storage medium and comprising computer executable instructions that, when executed, cause a computer to perform: Extract the target area in the image; Determining a latent vector of the image based on the target region; generating a first classification result for the image based on the latent vector; Obtaining a second classification result for the image from an image classification model; as well as The credibility of the image is determined based on the first classification result and the second classification result.

20. The computer program product of claim 19, wherein generating the first classification result for the image based on the latent vector comprises: Determine the label category to which the latent vector belongs based on multiple benchmark truth labels and prior knowledge; as well as The latent vector is classified based on the label category to obtain the first classification result.

Citation Information

Patent Citations

  • Image processing method and image processing device

    CN107516105A

  • Electromechanical equipment fault diagnosis method based on deep neural network

    CN111666982A

  • Adversarial sample detection method and device, electronic equipment and medium

    CN112329837A

  • Zero-sample picture classification method based on auto-encoder

    CN112487193A

  • Visual interpretation method and system for deep neural network model.

    CN112861933A