A method and system for determining feature sample priority based on significant feature variation
By extracting and mutating the high-frequency and gradient feature pixels in the image, as well as the difference in neuron activation values, generating cascade combination features and training the classifier, the problem of low sample priority detection efficiency and unstable results of the infrared pedestrian detection model is solved. , achieving efficient and accurate priority judgment.
Patent Information
- Application Number
- CN202310532146.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-12
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2043-05-12
AI Technical Summary
The existing infrared pedestrian detection model sample priority detection method is inefficient, the results are not guaranteed, and it relies on manual marking, consumes a lot of resources, has a single mutation rule, and the effect is not ideal.
By extracting high-frequency and gradient feature pixels in the image for mutation, combined with differences in neuron activation values, mutation samples and models are generated to form cascade combination features, and the classifier is trained to make priority judgments.
It improves the effect of sample and model variation, achieves reliable judgment on the priority of infrared target detection model samples, reduces manual intervention, and improves detection efficiency and accuracy.
Smart Images

Figure CN116664876B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of data processing technology, and in particular, relates to a method and system for determining feature sample priorities based on significant feature variation. Background Art
[0002] In recent years, as the research of machine learning continues to advance, in the digital field, researchers have found that by designing specific noise, neural networks can misclassify images with extremely high confidence, and some people have also studied adversarial samples in the real world to influence neural networks. For example, tattooing an adversarial pattern on the back of a turtle can make the neural network classify the turtle as a rifle, and someone holding an adversarial pattern can easily avoid YOLOv2's target detection, making it impossible to detect the person.
[0003] Due to the principle that thermal radiation can reflect human body temperature and infrared rays have certain perspective characteristics, infrared pedestrian recognition technology has been widely used in pedestrian temperature measurement systems. Using thermal radiation, pedestrian temperature measurement systems can quickly measure the temperature of pedestrians passing by, thereby detecting potential patients. Since the system also uses neural networks, this invention still has some safety hazards in practical applications. Last year, researchers successfully escaped the detection of infrared detectors by holding a small light bulb board. The experiment used the characteristics that the infrared image of the small light bulb is similar to a two-dimensional Gaussian image to adjust the position of the small light bulb on the board, thereby realizing adversarial samples for infrared pedestrian detectors in the physical world. Using this board, it is easy to avoid infrared pedestrian detectors. Later, some researchers created an "infrared detection invisible cloak" through research. They printed adversarial samples on thermal insulation materials and finally randomly cut them into clothes. Wearing this kind of clothes can easily deceive infrared detection devices and are not easily detected by detectors at all angles.
[0004] In the above experiments, the sample priority test of the infrared detection model is an important method to improve efficiency. Through the sample priority test of the infrared model, we can quickly detect samples that are likely to cause errors in the infrared detection model results in a non-manual way, thereby reducing a lot of work for subsequent manual operations.
[0005] Most of the model sample priority detection methods used in the past have adopted the mutation method, which determines the combined features through random mutations of samples and models, and then trains a classifier to detect the sample priority.
[0006] The defects of the above scheme include: mutation through random methods leads to unsatisfactory mutation effects of samples and models, which makes the result output unsafe; the mutation rules are single and the mutation effect is less than ideal; a large amount of manual labeling is used, which is inefficient and consumes a lot of resources. Summary of the invention
[0007] The present invention proposes a scheme for determining the priority of feature samples based on significant feature variation, with the aim of using significant feature variation to train a sample classifier so as to perform a sample priority test for an infrared target detection model.
[0008] The first aspect of the present invention discloses a method for determining the priority of feature samples based on significant feature variation. The method comprises: step S1, obtaining several original feature images as sample images, extracting pixels with significant features in each of the sample images, performing variation processing on the pixels with significant features, and obtaining variation sample images; step S2, inputting the sample images and the variation sample images into a detection model M to extract neurons with significant features in the detection model M, performing variation processing on the neurons with significant features, and obtaining a variation detection model; step S3, determining the cascade combination features of each of the sample images based on the sample images, the variation sample images, the detection model M, and the variation detection model, and extracting samples corresponding to correct features and samples corresponding to incorrect features from them; step S4, generating a test set and a training set based on the samples corresponding to the correct features and the samples corresponding to the incorrect features, the training set being used to train a classifier, and the trained classifier classifying the cascade combination features and the corresponding sample images in the test set; wherein, when the classification result is correct, the priority of the sample image is low; otherwise, it is high.
[0009] According to the method of the first aspect, in the step S1, the pixel points with significant features in each of the sample images are extracted, specifically including: storing a number of the sample images into an empty sample set S, performing Fourier transform on each sample image in S to obtain a frequency response image of each sample image; extracting high-frequency pixel points in the frequency response image as high-frequency significant feature pixel points of the sample image, and establishing an empty matrix Ma0 with the same size as the sample image, setting the corresponding positions of the high-frequency significant feature pixel points in Ma0 to 1, and setting other positions to 0, to obtain a first position matrix; inputting each sample image in S into the detection model M to determine the loss function of the detection model M Regarding the loss function of each sample image, calculate the partial derivative of the loss function of each sample image with respect to the sample image to obtain the partial derivative values of all pixels in the sample image, and calculate the mean of the partial derivative values of all pixels; extract the pixel points whose partial derivative values are greater than the mean of the partial derivative values as the gradient feature pixel points of the sample image, establish an empty matrix Ma1 with the same size as the sample image, set the positions corresponding to the gradient feature pixel points in Ma1 to 1, and set other positions to 0 to obtain a second position matrix; add the first position matrix and the second position matrix to obtain a comprehensive position matrix Ma, and the pixel points with element values of 1 in Ma are the pixel points with significant features in the sample image.
[0010] According to the method of the first aspect, in the step S1, the following operations are randomly selected for the pixel points with significant features to obtain the variant sample set S1: Gaussian blur: adding noise that conforms to the Gaussian distribution to the selected pixel points with significant features; pixel whitening: setting the color of the selected pixel points with significant features to white; pixel blackening: setting the color of the selected pixel points with significant features to black; grayscale adjustment: if the grayscale value of the selected pixel points with significant features is less than 0.5, then add 0.5 to its grayscale value; if the grayscale value of the selected pixel points with significant features is not less than 0.5, then subtract 0.5 from its grayscale value; pixel assimilation: setting the color of the selected pixel points with significant features to the color of the previous pixel point adjacent to it; wherein each of the sample images has n variant sample images.
[0011] According to the method of the first aspect, in the step S2, the neurons with significant features in the detection model M are extracted, specifically including: inputting the sample image in S into the detection model M to calculate the first activation value Ac1(x) of each neuron in the detection model M; inputting n mutated sample images in S1 into the detection model M to calculate the mean activation value of each neuron in the detection model M as the second activation value Ac2(x); obtaining the activation value change Ac of each sample image for the same neuron before and after the mutation, Ac=Ac1(x)-Ac2(x); calculating the mean activation value change AcA of the same neuron, sorting the neurons in order of AcA from large to small, and selecting the top 5 neurons as the neurons with significant features.
[0012] According to the method of the first aspect, in step S2, the following operations are randomly selected for the neurons with significant features to obtain m variation models: neuron assimilation: changing the weight of the neuron with significant features to the weight of the previous adjacent neuron in the same layer; neuron blocking: changing the weight of the neuron with significant features to 0; Gaussian blurring: adding noise to the weight of the neuron with significant features according to Gaussian distribution.
[0013] According to the method of the first aspect, in the step S3, n+1 images consisting of 1 sample image and the corresponding n variant sample images are respectively input into 1 detection model M and m+1 models consisting of the corresponding n variant detection models to obtain (n+1)*(m+1) features, and the cascaded combined features of the sample image are obtained by cascading the (n+1)*(m+1) features.
[0014] According to the method of the first aspect, in step S4, training the classifier specifically includes: training the classifier using a back propagation algorithm, using cross entropy as a loss function, and continuously optimizing the parameters of the classifier by minimizing the loss function.
[0015] The second aspect of the present invention proposes a system for determining the priority of feature samples based on significant feature variation. The system comprises: a first processing unit configured to obtain a number of original feature images as sample images, extract pixels with significant features in each of the sample images, perform variation processing on the pixels with significant features, and obtain a variation sample image; a second processing unit configured to input the sample image and the variation sample image into a detection model M to extract neurons with significant features in the detection model M, perform variation processing on the neurons with significant features, and obtain a variation detection model; a third processing unit configured to determine the cascade combination features of each of the sample images based on the sample image, the variation sample image, the detection model M, and the variation detection model, and extract samples corresponding to correct features and samples corresponding to incorrect features from the samples; a fourth processing unit configured to generate a test set and a training set based on the samples corresponding to the correct features and the samples corresponding to the incorrect features, the training set being used to train a classifier, and the trained classifier classifies the cascade combination features and the corresponding sample images in the test set; wherein, when the classification result is correct, the priority of the sample image is low; otherwise, it is high.
[0016] According to the system of the second aspect, the first processing unit is specifically configured to: extract the pixel points with significant features in each of the sample images, specifically including: storing a number of the sample images into an empty sample set S, performing Fourier transform on each sample image in S to obtain a frequency response image of each sample image; extracting high-frequency pixel points in the frequency response image as high-frequency significant feature pixel points of the sample image, and establishing an empty matrix Ma0 with the same size as the sample image, setting the positions corresponding to the high-frequency significant feature pixel points in Ma0 to 1, and setting other positions to 0, to obtain a first position matrix; inputting each sample image in S into the detection model M to determine the loss of the detection model M; The loss function is a loss function of each sample image, and the partial derivative of the loss function of each sample image with respect to the sample image is calculated to obtain the partial derivative values of all pixels in the sample image, and the mean of the partial derivative values of all pixels is obtained; the pixel points whose partial derivative values are greater than the mean of the partial derivative values are extracted as the gradient feature pixel points of the sample image, and an empty matrix Ma1 with the same size as the sample image is established, and the positions corresponding to the gradient feature pixel points in Ma1 are set to 1, and the other positions are set to 0 to obtain a second position matrix; the first position matrix and the second position matrix are added to obtain a comprehensive position matrix Ma, and the pixel points whose element values in Ma are 1 are the pixel points with significant features in the sample image.
[0017] According to the system of the second aspect, the first processing unit is specifically configured to: randomly select the following operations for the pixel points with significant features to obtain a variant sample set S1: Gaussian blur: add noise that conforms to the Gaussian distribution to the selected pixel points with significant features; pixel whitening: set the color of the selected pixel points with significant features to white; pixel blackening: set the color of the selected pixel points with significant features to black; grayscale adjustment: if the grayscale value of the selected pixel points with significant features is less than 0.5, add 0.5 to its grayscale value; if the grayscale value of the selected pixel points with significant features is not less than 0.5, subtract 0.5 from its grayscale value; pixel assimilation: set the color of the selected pixel points with significant features to the color of the previous pixel point adjacent to it; wherein each of the sample images has n variant sample images.
[0018] According to the system of the second aspect, the second processing unit is specifically configured to: extract the neurons with significant features in the detection model M, specifically including: inputting the sample image in S into the detection model M to calculate the first activation value Ac1(x) of each neuron in the detection model M; inputting n mutated sample images in S1 into the detection model M to calculate the mean activation value of each neuron in the detection model M as the second activation value Ac2(x); obtaining the activation value change Ac of each sample image for the same neuron before and after the mutation, Ac=Ac1(x)-Ac2(x); calculating the mean activation value change AcA of the same neuron, sorting the neurons in order of AcA from large to small, and selecting the top 5 neurons as the neurons with significant features.
[0019] According to the system of the second aspect, the second processing unit is specifically configured to: randomly select the following operations for the neuron with significant features to obtain m variation models: neuron assimilation: changing the weight of the neuron with significant features to the weight of the previous adjacent neuron in the same layer; neuron blocking: changing the weight of the neuron with significant features to 0; Gaussian blur: adding noise to the weight of the neuron with significant features according to Gaussian distribution.
[0020] According to the system of the second aspect, the third processing unit is specifically configured to: input n+1 images consisting of 1 sample image and the corresponding n variant sample images into 1 detection model M and m+1 models consisting of the corresponding n variant detection models, respectively, to obtain (n+1)*(m+1) features, and obtain the cascaded combined features of the sample image by cascading the (n+1)*(m+1) features.
[0021] According to the system of the second aspect, the fourth processing unit is specifically configured to: training the classifier specifically includes: training the classifier using a back propagation algorithm, using cross entropy as a loss function, and continuously optimizing the parameters of the classifier by minimizing the loss function.
[0022] The third aspect of the present invention discloses an electronic device. The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps in the method for determining the priority of feature samples based on significant feature variation described in any one of the first aspects of the present disclosure are implemented.
[0023] The fourth aspect of the present invention discloses a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any one of the methods for determining the priority of feature samples based on significant feature variation described in the first aspect of the present disclosure are implemented.
[0024] In summary, the technical solution provided by the present invention achieves the effect of efficiently finding the key pixel points in the image based on the key pixel point determination method based on high-frequency information and high-gradient features; the key neuron determination method based on the activation value difference value achieves the effect of efficiently finding the key neurons in the model; the model and sample mutation method realizes the judgment of multiple situations of the same sample and realizes the effect of forming reliable combined features; and the method of training feature classifiers achieves the effect of unsupervised judgment of infrared object priority test. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0026] Figure 1 A flowchart of a method for determining feature sample priorities based on significant feature variation according to an embodiment of the present invention;
[0027] Figure 2 The figure is a structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0029] The purpose of the present invention is to train a sample classifier using significant feature variation to perform sample priority testing on an infrared target detection model.
[0030] A first aspect of the present invention discloses a method for determining the priority of feature samples based on significant feature variation. Figure 1 FIG. 4 is a flow chart of a method for determining the priority of feature samples based on significant feature variation according to an embodiment of the present invention; Figure 1 As shown, the method includes: step S1, obtaining several original feature images as sample images, extracting pixels with significant features in each of the sample images, performing mutation processing on the pixels with significant features, and obtaining a mutation sample image; step S2, inputting the sample image and the mutation sample image into the detection model M to extract neurons with significant features in the detection model M, performing mutation processing on the neurons with significant features, and obtaining a mutation detection model; step S3, determining the cascade combination features of each of the sample images based on the sample image, the mutation sample image, the detection model M and the mutation detection model, and extracting samples corresponding to correct features and samples corresponding to incorrect features from them; step S4, generating a test set and a training set based on the samples corresponding to the correct features and the samples corresponding to the incorrect features, the training set is used to train a classifier, and the trained classifier classifies the cascade combination features and the corresponding sample images in the test set; wherein, when the classification result is correct, the priority of the sample image is low; otherwise, it is high.
[0031] In step S1, a number of original feature images are obtained as sample images, pixels with significant features in each of the sample images are extracted, and mutation processing is performed on the pixels with significant features to obtain mutated sample images.
[0032] In some embodiments, in the step S1, the pixel points with significant features in each of the sample images are extracted, specifically including: storing a number of the sample images into an empty sample set S, performing Fourier transform on each sample image in S to obtain a frequency response image of each sample image; extracting high-frequency pixel points in the frequency response image as high-frequency significant feature pixel points of the sample image, and establishing an empty matrix Ma0 with the same size as the sample image, setting the positions corresponding to the high-frequency significant feature pixel points in Ma0 to 1, and setting other positions to 0, to obtain a first position matrix; inputting each sample image in S into the detection model M to determine the loss function of the detection model M. Based on the loss function of each sample image, calculate the partial derivative of the loss function of each sample image with respect to the sample image to obtain the partial derivative values of all pixels in the sample image, and calculate the mean of the partial derivative values of all pixels; extract the pixel points whose partial derivative values are greater than the mean of the partial derivative values as the gradient feature pixel points of the sample image, establish an empty matrix Ma1 with the same size as the sample image, set the positions corresponding to the gradient feature pixel points in Ma1 to 1, and set other positions to 0, to obtain a second position matrix; add the first position matrix and the second position matrix to obtain a comprehensive position matrix Ma, and the pixel points with element values of 1 in Ma are the pixel points with significant features in the sample image.
[0033] Specifically, the pixels with significant features in the sample are extracted. The specific steps are as follows:
[0034] Randomly select 20,000 samples from the existing data set and store them in the empty sample set S. Perform Fourier transform on the samples in S, where the formula for Fourier transform is:
[0035]
[0036] Perform 1.2 operations on all samples in S to obtain the frequency response image of each sample, and extract the pixel points of the high-frequency part of the image, which is one of the significant features of the sample, and record it as the pixel points containing the high-frequency significant features of the sample. Create an empty matrix Ma0 of the same size as the sample as the position matrix. Set the position matrix element values corresponding to the pixel points containing the high-frequency features of the sample to 1, and set the position matrix element values corresponding to the non-high-frequency positions to 0. Input the samples in S into the original model M to obtain the loss function J(θ, x, y) of the model M, where x is the original sample, θ is the weight parameter of the model (i.e., w), and y is the true category of x. For the loss function J(θ, x, y), find the partial derivative with respect to x. The specific formula is as follows:
[0037]
[0038] Perform 1.5 operations on all samples in S to obtain the partial derivative of the loss function after each pixel in each sample is input into the model M. For all pixels in each sample, find the mean η0, and extract the pixel whose gradient value η is greater than the mean η0 of the sample, which is one of the significant features of the sample and is recorded as the pixel with sample gradient feature. Create an empty matrix Ma1 of the same size as the sample as the position matrix. Set the position matrix element value corresponding to the pixel with sample gradient feature to 1, and the position matrix element value corresponding to the pixel without gradient feature to 0. Add the matrices Ma0 and Ma1, and the pixel with element value 1 in the obtained position matrix Ma is the pixel with significant feature obtained in the final sample.
[0039] In some embodiments, in the step S1, the following operations are randomly selected for the pixel points with significant features to obtain the variant sample set S1: Gaussian blur: adding noise that conforms to the Gaussian distribution to the selected pixel points with significant features; pixel whitening: setting the color of the selected pixel points with significant features to white; pixel blackening: setting the color of the selected pixel points with significant features to black; grayscale adjustment: if the grayscale value of the selected pixel points with significant features is less than 0.5, then add 0.5 to its grayscale value; if the grayscale value of the selected pixel points with significant features is not less than 0.5, then subtract 0.5 from its grayscale value; pixel assimilation: setting the color of the selected pixel points with significant features to the color of the previous pixel point adjacent to it; wherein each of the sample images has n variant sample images.
[0040] Specifically, the salient feature pixels in the sample are mutated, and the specific rules are as follows: (I) Gaussian blur: Add a Gaussian distribution N(μ,δ 2 ) noise. (II) Pixel whitening: mutate the color of the selected pixel to white. (III) Pixel blackening: mutate the color of the selected pixel to black. (IV) Pixel grayscale adjustment: Since the grayscale value of the infrared image is [0,1], for pixels with grayscale values less than 0.5, the grayscale value is increased by 0.5, and for pixels with grayscale values greater than 0.5, the grayscale value is reduced by 0.5. (V) Pixel assimilation: mutate the color of the selected pixel to the color of the adjacent previous pixel. For all pixels with significant features in the sample, randomly use the above rules to mutate, and you can get n mutated samples, where n is the number of mutated samples to be obtained. The mutated samples are stored in the empty sample set S1.
[0041] In step S2, the sample image and the variant sample image are input into the detection model M to extract neurons with significant features in the detection model M, and the neurons with significant features are mutated to obtain a variant detection model.
[0042] In some embodiments, in the step S2, the neurons with significant features in the detection model M are extracted, specifically including: inputting the sample image in S into the detection model M to calculate the first activation value Ac1(x) of each neuron in the detection model M; inputting n mutated sample images in S1 into the detection model M to calculate the mean activation value of each neuron in the detection model M as the second activation value Ac2(x); obtaining the activation value change Ac of each sample image for the same neuron before and after the mutation, Ac=Ac1(x)-Ac2(x); calculating the mean activation value change AcA of the same neuron, sorting the neurons in order of AcA from large to small, and selecting the top 5 neurons as the neurons with significant features.
[0043] Specifically, neurons with significant features in the model are extracted as follows:
[0044] Input the samples in the original sample set S into the original model M, and calculate the activation value Ac1(x) of each neuron. x represents the xth sample. The activation value is calculated as follows:
[0045]
[0046] The superscript represents the layer number of the neuron, the subscript represents the sequence number of the neuron in the network layer, b represents the bias value, and σ is the activation function.
[0047] Input the samples in the mutated sample set S1 into the original model M, and use formula (3) to calculate the activation value of each neuron. After the n mutated samples obtained by mutating the same sample in S are input into the model, the activation value of the same neuron is calculated to be the average value Ac2(x). Calculate the change between the average activation value of a neuron after the sample mutated sample is input into the model and the activation value of the same neuron after the original sample is input into the model. The specific formula is as follows:
[0048] Ac(x)=Ac1(x)-Ac2(x) (4)
[0049] Perform step 3.4 for all samples in S and their corresponding variant samples to obtain the change Ac of each sample in S for the same neuron before and after the mutation. Calculate the average AcA of all changes for the same neuron, and then sort the neurons according to this average AcA. Take the five neurons with the largest change AcA as the neurons with significant features in the model.
[0050] In some embodiments, in step S2, the following operations are randomly selected for the neurons with significant features to obtain m variation models: neuron assimilation: changing the weight of the neuron with significant features to the weight of the previous adjacent neuron in the same layer; neuron blocking: changing the weight of the neuron with significant features to 0; Gaussian blurring: adding noise to the weight of the neuron with significant features according to Gaussian distribution.
[0051] Specifically, the mutation operation is performed on the significant feature neurons, and the specific rules are as follows: (I) Neuron assimilation: the weight of the neuron is changed to the weight of the previous adjacent neuron in the same layer. (II) Neuron blocking: the weight of the neuron is changed to 0, so that the neuron has no effect on the lower layer network. (III) Gaussian blurring: according to the Gaussian distribution N(μ, δ 2 ) Add noise to the weights of the neurons. Randomly use the above rules to mutate all neurons with significant features in the model, and you can get m variant models, where m is the number of variant models you need to get.
[0052] In step S3, based on the sample image, the variant sample image, the detection model M and the variant detection model, the cascade combination features of each sample image are determined, and samples corresponding to correct features and samples corresponding to incorrect features are extracted therefrom.
[0053] In some embodiments, in step S3, n+1 images consisting of 1 sample image and corresponding n variant sample images are respectively input into m+1 models consisting of 1 detection model M and corresponding n variant detection models to obtain (n+1)*(m+1) features, and the cascaded combined features of the sample image are obtained by cascading the (n+1)*(m+1) features.
[0054] Specifically, after completing the neuron and model mutation, one sample in the original sample set S becomes n+1 samples, and the original model M becomes m+1 models. It is known that one sample will output one feature after entering one model. If n+1 samples are input into m+1 models, (m+1)*(n+1) features can be output. These features are cascaded, so one sample in the original sample set S can correspond to one combined feature.
[0055] In step S4, a test set and a training set are generated based on the samples corresponding to the correct features and the samples corresponding to the incorrect features. The training set is used to train a classifier. The trained classifier classifies the cascade combination features and the corresponding sample images in the test set. When the classification result is correct, the priority of the sample image is low; otherwise, it is high.
[0056] In some embodiments, in step S4, training the classifier specifically includes: training the classifier using a back propagation algorithm, using cross entropy as a loss function, and continuously optimizing the parameters of the classifier by minimizing the loss function.
[0057] Specifically, by performing the above operation on all samples in the sample set S, the combined features corresponding to 20,000 samples can be obtained. Manual classification is performed on the 20,000 combined features, and the features are divided into erroneous features and correct features. 3,000 samples corresponding to erroneous features and 7,000 samples corresponding to correct features are selected and stored in the empty sample set S2.
[0058] Use the samples in S2 to train the classifier model. The specific method is as follows:
[0059] The samples in S2 are randomly assigned, 80% of the samples are selected as the training set, and the remaining 20% of the samples are selected as the test set. The trainer is trained using the back propagation method, and the cross entropy is used as the loss function. The loss function is minimized to update the parameters. The specific loss function is as follows:
[0060]
[0061] y is the true label value (positive value is 1, negative value is 0), is the predicted probability value. Use the test set to test the classifier.
[0062] After completing the classifier training, you can use the classifier to perform the infrared target detection model sample priority test method. The specific method is as follows: For the newly input sample, obtain the combined features of the sample. Input the sample and its combined features into the trained classifier. If the output result is correct, the priority is lower, and if the output result is wrong, the priority is higher.
[0063] The second aspect of the present invention proposes a system for determining the priority of feature samples based on significant feature variation. The system comprises: a first processing unit configured to obtain a number of original feature images as sample images, extract pixels with significant features in each of the sample images, perform variation processing on the pixels with significant features, and obtain a variation sample image; a second processing unit configured to input the sample image and the variation sample image into a detection model M to extract neurons with significant features in the detection model M, perform variation processing on the neurons with significant features, and obtain a variation detection model; a third processing unit configured to determine the cascade combination features of each of the sample images based on the sample image, the variation sample image, the detection model M, and the variation detection model, and extract samples corresponding to correct features and samples corresponding to incorrect features from the samples; a fourth processing unit configured to generate a test set and a training set based on the samples corresponding to the correct features and the samples corresponding to the incorrect features, the training set being used to train a classifier, and the trained classifier classifies the cascade combination features and the corresponding sample images in the test set; wherein, when the classification result is correct, the priority of the sample image is low; otherwise, it is high.
[0064] According to the system of the second aspect, the first processing unit is specifically configured to: extract the pixel points with significant features in each of the sample images, specifically including: storing a number of the sample images into an empty sample set S, performing Fourier transform on each sample image in S to obtain a frequency response image of each sample image; extracting high-frequency pixel points in the frequency response image as high-frequency significant feature pixel points of the sample image, and establishing an empty matrix Ma0 with the same size as the sample image, setting the positions corresponding to the high-frequency significant feature pixel points in Ma0 to 1, and setting other positions to 0, to obtain a first position matrix; inputting each sample image in S into the detection model M to determine the loss of the detection model M; The loss function is a loss function of each sample image, and the partial derivative of the loss function of each sample image with respect to the sample image is calculated to obtain the partial derivative values of all pixels in the sample image, and the mean of the partial derivative values of all pixels is obtained; the pixel points whose partial derivative values are greater than the mean of the partial derivative values are extracted as the gradient feature pixel points of the sample image, and an empty matrix Ma1 with the same size as the sample image is established, and the positions corresponding to the gradient feature pixel points in Ma1 are set to 1, and the other positions are set to 0 to obtain a second position matrix; the first position matrix and the second position matrix are added to obtain a comprehensive position matrix Ma, and the pixel points whose element values in Ma are 1 are the pixel points with significant features in the sample image.
[0065] According to the system of the second aspect, the first processing unit is specifically configured to: randomly select the following operations for the pixel points with significant features to obtain a variant sample set S1: Gaussian blur: add noise that conforms to the Gaussian distribution to the selected pixel points with significant features; pixel whitening: set the color of the selected pixel points with significant features to white; pixel blackening: set the color of the selected pixel points with significant features to black; grayscale adjustment: if the grayscale value of the selected pixel points with significant features is less than 0.5, add 0.5 to its grayscale value; if the grayscale value of the selected pixel points with significant features is not less than 0.5, subtract 0.5 from its grayscale value; pixel assimilation: set the color of the selected pixel points with significant features to the color of the previous pixel point adjacent to it; wherein each of the sample images has n variant sample images.
[0066] According to the system of the second aspect, the second processing unit is specifically configured to: extract the neurons with significant features in the detection model M, specifically including: inputting the sample image in S into the detection model M to calculate the first activation value Ac1(x) of each neuron in the detection model M; inputting n mutated sample images in S1 into the detection model M to calculate the mean activation value of each neuron in the detection model M as the second activation value Ac2(x); obtaining the activation value change Ac of each sample image for the same neuron before and after the mutation, Ac=Ac1(x)-Ac2(x); calculating the mean activation value change AcA of the same neuron, sorting the neurons in order of AcA from large to small, and selecting the top 5 neurons as the neurons with significant features.
[0067] According to the system of the second aspect, the second processing unit is specifically configured to: randomly select the following operations for the neuron with significant features to obtain m variation models: neuron assimilation: changing the weight of the neuron with significant features to the weight of the previous adjacent neuron in the same layer; neuron blocking: changing the weight of the neuron with significant features to 0; Gaussian blur: adding noise to the weight of the neuron with significant features according to Gaussian distribution.
[0068] According to the system of the second aspect, the third processing unit is specifically configured to: input n+1 images consisting of 1 sample image and the corresponding n variant sample images into 1 detection model M and m+1 models consisting of the corresponding n variant detection models, respectively, to obtain (n+1)*(m+1) features, and obtain the cascaded combined features of the sample image by cascading the (n+1)*(m+1) features.
[0069] According to the system of the second aspect, the fourth processing unit is specifically configured to: training the classifier specifically includes: training the classifier using a back propagation algorithm, using cross entropy as a loss function, and continuously optimizing the parameters of the classifier by minimizing the loss function.
[0070] The third aspect of the present invention discloses an electronic device. The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps in the method for determining the priority of feature samples based on significant feature variation described in any one of the first aspects of the present disclosure are implemented.
[0071] The fourth aspect of the present invention discloses a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any one of the methods for determining the priority of feature samples based on significant feature variation described in the first aspect of the present disclosure are implemented.
[0072] In summary, the technical solution provided by the present invention is designed to target the task requirements of key neuron determination, and a key neuron determination method based on activation value difference is designed. The key neuron position is determined by the change of activation value after the input of the original sample and the variant sample, which is used for the subsequent model mutation operation; for the task requirements of determining the combined features of the sample, an amplification based on sample and model mutation is designed, and the number of samples that can be used is increased through the mutation operation of the key pixel points, so as to form the sample combination features, thereby increasing the accuracy of feature judgment; for the task requirements of unsupervised judgment, a classifier for judging sample features is designed, and the purpose of reducing manual judgment of infrared sample priority is achieved through the classifier. The above scheme achieves the effect of efficiently finding the key pixel points in the image based on the key pixel determination method of high-frequency information and high-gradient features; the key neuron determination method based on activation value difference is achieved to efficiently find the key neurons in the model; the model and sample mutation method realizes the judgment of multiple situations of the same sample and forms a reliable combined feature; the method of training the feature classifier achieves the effect of unsupervised judgment of infrared object priority test.
[0073] Please note that the technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. The above-mentioned embodiments only express several implementation methods of the present application, and their descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present application, several variations and improvements can be made, which all belong to the scope of protection of the present application. Therefore, the scope of protection of the patent in this application shall be based on the attached claims.
Claims
1. A method for determining the priority of feature samples based on significant feature variation, characterized in that: The method comprises: Step S1, obtaining a number of original feature images as sample images, extracting pixels with significant features in each of the sample images, performing mutation processing on the pixels with significant features, and obtaining a mutated sample image; Step S2, inputting the sample image and the variant sample image into the detection model M to extract neurons with significant features in the detection model M, performing a variant process on the neurons with significant features, and obtaining a variant detection model; Step S3, determining the cascade combination features of each of the sample images based on the sample image, the variant sample image, the detection model M and the variant detection model, and extracting samples corresponding to correct features and samples corresponding to incorrect features; Step S4, generating a test set and a training set based on the samples corresponding to the correct features and the samples corresponding to the incorrect features, wherein the training set is used to train a classifier, and the trained classifier classifies the cascade combination features and the corresponding sample images in the test set; Wherein, when the classification result is correct, the priority of the sample image is low; otherwise, it is high; Wherein, in the step S1, extracting the pixel points with significant features in each of the sample images specifically includes: Storing a number of the sample images into an empty sample set S, and performing Fourier transform on each sample image in S to obtain a frequency response image of each sample image; Extract high-frequency pixel points in the frequency response image as high-frequency significant feature pixel points of the sample image, and establish an empty matrix Ma0 with the same size as the sample image, set the positions corresponding to the high-frequency significant feature pixel points in Ma0 to 1, and set other positions to 0, to obtain a first position matrix; Input each sample image in S into the detection model M to determine the loss function of the detection model M with respect to each sample image, calculate the partial derivative of the loss function of each sample image with respect to the sample image to obtain the partial derivative values of all pixels in the sample image, and calculate the mean of the partial derivative values of all pixels; Extract the pixel points whose partial derivative values are greater than the mean of the partial derivative values as the gradient feature pixel points of the sample image, establish an empty matrix Ma1 with the same size as the sample image, set the positions corresponding to the gradient feature pixel points in Ma1 to 1, and set the other positions to 0, to obtain a second position matrix; The first position matrix and the second position matrix are added together to obtain a comprehensive position matrix Ma, wherein the pixel points with element values of 1 in Ma are the pixel points with significant features in the sample image.
2. A method for determining the priority of feature samples based on significant feature variation according to claim 1, characterized in that: In step S1, the following operations are randomly selected for the pixel points with significant features to obtain a variation sample set S1: Gaussian blur: adding noise that conforms to Gaussian distribution to the selected pixels with significant features; Pixel whitening: setting the color of the selected pixel with significant features to white; Pixel blackening: setting the color of the selected pixel with significant features to black; Grayscale adjustment: if the grayscale value of the selected pixel with significant features is less than 0.5, then add 0.5 to its grayscale value; if the grayscale value of the selected pixel with significant features is not less than 0.5, then subtract 0.5 from its grayscale value; Pixel assimilation: setting the color of the selected pixel with significant features to the color of the previous pixel adjacent to it; Each of the sample images has n variant sample images.
3. The method for determining the priority of feature samples based on significant feature variation according to claim 2, characterized in that: In the step S2, extracting the neurons with significant features in the detection model M specifically includes: Input the sample image in S into the detection model M to calculate the first activation value Ac1(x) of each neuron in the detection model M; Input the n variant sample images in S1 into the detection model M to calculate the mean activation value of each neuron in the detection model M as the second activation value Ac2(x); Obtaining the activation value change Ac of each sample image for the same neuron before and after the mutation, Ac=Ac1(x)-Ac2(x); The average activation value variation AcA of the same neuron is calculated, and the neurons are sorted in descending order of AcA, and the top 5 neurons are selected as the neurons with significant characteristics.
4. The method for determining the priority of feature samples based on significant feature variation according to claim 3, characterized in that: In step S2, the following operations are randomly selected for the neurons with significant features to obtain m variant models: Neuron assimilation: changing the weight of the neuron with significant features to the weight of the previous adjacent neuron in the same layer; Neuron blocking: changing the weight of the neuron with significant features to 0; Gaussian blur: Add noise to the weights of the neurons with significant features according to Gaussian distribution.
5. The method for determining the priority of feature samples based on significant feature variation according to claim 4, characterized in that: In the step S3, n+1 images consisting of 1 sample image and the corresponding n variant sample images are respectively input into 1 detection model M and m+1 models consisting of the corresponding n variant detection models to obtain (n+1)*(m+1) features, and the cascaded combination features of the sample image are obtained by cascading the (n+1)*(m+1) features.
6. A method for determining the priority of feature samples based on significant feature variation according to claim 5, characterized in that: In the step S4, training the classifier specifically includes: training the classifier using a back propagation algorithm, using cross entropy as a loss function, and continuously optimizing the parameters of the classifier by minimizing the loss function.
7. A system for determining the priority of feature samples based on significant feature variation, characterized in that: The system comprises: The first processing unit is configured to: obtain a number of original feature images as sample images, extract pixel points with significant features in each of the sample images, perform mutation processing on the pixel points with significant features, and obtain a mutated sample image; The second processing unit is configured to: input the sample image and the variant sample image into the detection model M to extract neurons with significant features in the detection model M, perform mutation processing on the neurons with significant features, and obtain a variant detection model; The third processing unit is configured to: determine the cascade combination features of each of the sample images based on the sample image, the variant sample image, the detection model M and the variant detection model, and extract samples corresponding to correct features and samples corresponding to incorrect features from them; A fourth processing unit is configured to: generate a test set and a training set based on the samples corresponding to the correct features and the samples corresponding to the incorrect features, wherein the training set is used to train a classifier, and the trained classifier classifies the cascade combination features and the corresponding sample images in the test set; Wherein, when the classification result is correct, the priority of the sample image is low; otherwise, it is high; The first processing unit is configured to extract the pixel points with significant features in each sample image; specifically including: Storing a number of the sample images into an empty sample set S, and performing Fourier transform on each sample image in S to obtain a frequency response image of each sample image; Extract high-frequency pixel points in the frequency response image as high-frequency significant feature pixel points of the sample image, and establish an empty matrix Ma0 with the same size as the sample image, set the positions corresponding to the high-frequency significant feature pixel points in Ma0 to 1, and set other positions to 0, to obtain a first position matrix; Input each sample image in S into the detection model M to determine the loss function of the detection model M with respect to each sample image, calculate the partial derivative of the loss function of each sample image with respect to the sample image to obtain the partial derivative values of all pixels in the sample image, and calculate the mean of the partial derivative values of all pixels; Extract the pixel points whose partial derivative values are greater than the mean of the partial derivative values as the gradient feature pixel points of the sample image, establish an empty matrix Ma1 with the same size as the sample image, set the positions corresponding to the gradient feature pixel points in Ma1 to 1, and set the other positions to 0, to obtain a second position matrix; The first position matrix and the second position matrix are added together to obtain a comprehensive position matrix Ma, wherein the pixel points with element values of 1 in Ma are the pixel points with significant features in the sample image.
8. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps in the method for determining the priority of feature samples based on significant feature variation as described in any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the method for determining the priority of feature samples based on significant feature variation described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Deep learning model test method and device based on neural pathway activation state
CN111428818A
Image generation method for improving robustness of neural network model
CN112329935A
Deep learning sample level adversarial attack defense method and device based on neuron activation mode
CN113297572A
Deep learning input set priority test method based on variation strategy
CN114048817A
Adaptive Fourier calculation correlated imaging method and system
CN114414050A
