A method for underwater target classification considering the robustness of deep learning models

Through clustering and feature compensation processing of classification error samples in deep learning models, combined with prior knowledge of adversarial training models, the problems of low accuracy and poor stability in underwater target classification tasks are solved, and the further development of deep learning models is achieved. High classification accuracy and model robustness.

CN114565831BActive Publication Date: 2025-02-25HARBIN ENG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210202911.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-02
Publication Date
2025-02-25
Estimated Expiration
2042-03-02

AI Technical Summary

Technical Problem

The existing deep learning models have low accuracy in underwater target classification tasks and are more sensitive to the perturbed underwater target data input, which is easily affected by adversarial samples, resulting in the instability of the model output results.

Method used

By establishing the original model, obtaining the features of the classification error sample, performing clustering and feature compensation, and generating the original model after feature compensation. Then, an adversarial training model is established, and the robustness of the adversarial training model is improved by introducing prior knowledge of the original samples and adversarial samples during adversarial training. Finally, the original model after feature compensation and the adversarial training model are weighted to generate the integrated deep learning model.

Benefits of technology

The accuracy and stability of deep learning models in the underwater target classification task are improved, the robustness of the model on the underwater target data is enhanced, and the impact on the counter samples is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114565831B_ABST
    Figure CN114565831B_ABST
Patent Text Reader

Abstract

A method for underwater target classification considering the robustness of a deep learning model. In order to solve the problem of low accuracy of underwater target classification by existing deep learning models, the present invention comprises the following steps: using a trained original model to predict a collected underwater target data training set to obtain a set of all correctly classified samples and a set of all incorrectly classified samples; inputting the set of all incorrectly classified samples into the trained original model, clustering and feature compensating the features of the incorrectly classified samples, and obtaining feature compensation for the incorrectly classified samples; inputting the feature compensation into the trained original model to obtain the feature-compensated original model; inputting the underwater target data training set into the feature-compensated original model, and outputting the incorrectly classified samples; establishing an adversarial training model to obtain a trained adversarial training model; and weightedly combining the adversarial training model with the feature-compensated original model to generate a deep learning model. The method belongs to the field of underwater target classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an underwater target classification method, and in particular to an underwater target classification method taking into account the robustness of a deep learning model, and belongs to the field of underwater target classification. Background Art

[0002] It is becoming increasingly difficult to apply traditional methods to underwater classification tasks. In recent years, deep learning models have achieved remarkable results in recognition and classification tasks, so deep learning methods have also been used for underwater classification tasks. However, due to the particularity of the underwater environment, the underwater target data used for recognition and classification is also greatly disturbed by the environment, and the deep learning model is more sensitive to the disturbed underwater target data input, especially susceptible to adversarial samples, resulting in unstable model output results and low underwater target classification accuracy. Therefore, the robustness of deep learning models used for underwater classification needs to be improved. Summary of the invention

[0003] In order to solve the problem of low accuracy of underwater target classification by existing deep learning models, the present invention further proposes a method for underwater target classification taking into account the robustness of deep learning models.

[0004] The technical solution adopted by the present invention is:

[0005] A method for underwater target classification considering the robustness of deep learning models, comprising the following steps:

[0006] S1. Establish an original model, and use the collected underwater target data training set to train the original model until convergence, to obtain a trained original model;

[0007] The trained original model is used to predict the collected underwater target data training set to obtain the set of all correctly classified samples and the set of all incorrectly classified samples;

[0008] S2, inputting the set of all misclassified samples obtained in S1 into the trained original model, clustering the features of the misclassified samples, performing feature compensation on the features of the clustered misclassified samples, and obtaining feature compensation for the misclassified samples;

[0009] S3, input the feature compensation obtained in S2 into the original model trained in S1 for training until convergence, and obtain the original model after feature compensation;

[0010] S4, input the underwater target data training set in S1 into the original model after feature compensation obtained in S3, and output the samples with classification errors;

[0011] S5, establish an adversarial training model, extract some misclassified samples output in S4 as training samples, input the training samples into the adversarial training model, set the loss function, and obtain a trained adversarial training model until the maximum iteration is completed or the loss stops decreasing;

[0012] S6, weightedly combining the trained adversarial training model obtained in S5 and the original model after feature compensation obtained in S3 using an accuracy index form to generate a deep learning model;

[0013] S7. Input the underwater target data to be classified into the deep learning model generated in S6 to obtain the classification result of the underwater target data.

[0014] Preferably, in S2, the set of all misclassified samples obtained in S1 is input into the trained original model, the features of the misclassified samples are clustered, and feature compensation is performed on the features of the clustered misclassified samples to obtain feature compensation of the misclassified samples. The specific process is:

[0015] S21, input the set of all misclassified samples obtained in S1 into the original model trained in S1, and use the output of the original model as the feature of the corresponding misclassified samples;

[0016] S22, clustering the features of the misclassified samples in S21 using the K-means clustering method to obtain a cluster set;

[0017] S23, performing feature compensation on the features of the misclassified samples after clustering to obtain feature compensation for the misclassified samples.

[0018] Preferably, there is no overlap between any two cluster sets obtained in S22.

[0019] Preferably, in S23, feature compensation is performed on the features of the clustered misclassified samples to obtain feature compensation of the misclassified samples, and the specific process is as follows:

[0020] S231, let some of the misclassified samples in the w-th cluster set after clustering be the i-th category in the underwater target data training set in S1;

[0021] S232, randomly select the correctly classified samples in the i-th category obtained in part S1, input them into the original model trained in S1, and obtain the sample features of the correctly classified samples;

[0022] Randomly select some samples from the w-th cluster set, input them into the original model trained in S1, and obtain the sample features of the samples in the w-th cluster set;

[0023] S233, calculating the feature difference between the sample feature of the Dth correctly classified sample selected in S232 and the sample feature of the sample in the Dth wth cluster set, and sampling the mean of multiple groups of feature differences to obtain feature compensation of the i-th category.

[0024] Preferably, the number of correctly classified samples in the i-th category obtained in the part S1 selected in S232 is equal to the number of samples in the w-th cluster set selected.

[0025] Preferably, the loss function set in S5 is:

[0026]

[0027] Among them, l cs (x t ,y t ) represents the loss function;

[0028] x t represents the tth training sample;

[0029] y t Represents x t The corresponding category label;

[0030] Indicates that the adversarial training model predicts the adversarial sample as the corresponding true category y t The probability of

[0031] Represents the training sample x t Adversarial examples;

[0032] α is a constant term;

[0033] is the cross entropy loss;

[0034] Represents the adversarial training model against adversarial samples The predicted probability of

[0035] β is a constant term;

[0036] represents KL divergence;

[0037] p(x t ) represents the adversarial training model for the training sample x t The predicted probability of

[0038] Indicates that the adversarial training model predicts the training sample as the corresponding true category y t The probability of

[0039] γ is a constant term.

[0040] Preferably, in S6, the trained adversarial training model obtained in S5 and the original model after feature compensation obtained in S3 are weightedly combined in the form of an accuracy index to generate a deep learning model. The specific process is:

[0041] S61. Determine the weight of each model using the model accuracy index form:

[0042] The original model weight after feature compensation is: a 1 q / (a 1 q +a 2 q );

[0043] The weight of the adversarial training model is: a 2 q / (a 1 q +a 2 q );

[0044] a 1 It represents the accuracy of the original model after feature compensation for the underwater target data training set and the adversarial sample set;

[0045] a 2 Represents the accuracy of the adversarial training model for the underwater target data training set and the adversarial sample set;

[0046] q is a hyperparameter, which is a constant term;

[0047] S62. Perform weighted combination using the weights obtained in S61:

[0048]

[0049] Among them, p integrate represents the predicted probability of the deep learning model;

[0050] p 1 Represents the predicted probability vector of the original model after feature compensation;

[0051] p 2 represents the predicted probability vector of the adversarial training model;

[0052] S63. Use the collected underwater target data training set as the input of the deep learning model, use the maximum value of the predicted probability of the deep learning model as the output of the deep learning model, and perform training until convergence to generate a deep learning model.

[0053] Beneficial effects:

[0054] The present invention takes into account that there are still erroneous samples that cannot be correctly identified after the existing deep learning model is trained. First, an original model is established, and the original model is used to obtain a set of all misclassified samples. The set of all misclassified samples is subjected to feature clustering analysis to obtain a cluster set. According to the cluster set, a category for which feature compensation can be obtained is determined, so as to obtain the corresponding feature compensation. The feature compensation is combined with the original model to obtain the original model after feature compensation. Then, the underwater target data training set is input into the original model after feature compensation. According to the obtained classification results, the erroneous samples are divided into easy-to-improve samples and difficult-to-improve samples. The easy-to-improve samples can be correctly classified after the original model after feature compensation, while the samples that are still misclassified after the original model after feature compensation are difficult-to-improve samples. For the difficult-to-improve samples, the present invention proposes an adversarial training method combined with the classification situation, establishes an adversarial training model, and introduces prior knowledge of the original samples and adversarial samples in the adversarial training process so that the adversarial training model can better train the difficult-to-distinguish adversarial samples, thereby obtaining an adversarial training model with good robustness. Finally, the original model after feature compensation and the adversarial training model are weightedly combined in the form of accuracy index, so that the adversarial training model is combined with the original model after feature compensation to obtain an integrated deep learning model, which further improves the robustness of the deep learning model for underwater classification, obtains a deep learning model with more accurate classification, and improves the accuracy of the deep learning model in classifying underwater targets. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 It is a structural flow chart of the present invention; DETAILED DESCRIPTION

[0056] Specific implementation method 1: Combination Figure 1 This embodiment describes a method for underwater target classification considering the robustness of a deep learning model, which includes the following steps:

[0057] S1. Establish an original model, and use the collected underwater target data training set to train the original model until convergence, to obtain a trained original model;

[0058] The trained original model is used to predict the collected underwater target data training set to obtain the set of all correctly classified samples and the set of all incorrectly classified samples;

[0059] Establish an original model, use the collected underwater target data training set to train the original model until convergence, and obtain a trained original model. The original model can be any deep learning model. Use the trained original model to predict the collected underwater target data training set to obtain a set of all correctly classified samples and a set of all incorrectly classified samples Sfalse , the S obtained in this step false It provides a basis for subsequent modification of the original model and improving the accuracy of the original model. The types of underwater targets are ships, etc. All correctly classified samples are used for subsequent feature compensation calculations.

[0060] S2: Input the set of all misclassified samples obtained in S1 into the trained original model, cluster the features of the misclassified samples, perform feature compensation on the features of the clustered misclassified samples, and obtain feature compensation for the misclassified samples. The specific process is as follows:

[0061] S21, input the set of all misclassified samples obtained in S1 into the original model trained in S1, and use the output of the original model as the feature of the corresponding misclassified samples;

[0062] S22, clustering the features of the misclassified samples in S21 using a K-means clustering method to obtain a cluster set, wherein there is no overlap between any two obtained cluster sets;

[0063] The result of clustering the features of misclassified samples can actually be seen as a two-dimensional matrix, in which each column corresponds to a cluster set, and the values ​​in each column correspond to the number of samples contained in this cluster set, that is, each column is a further analysis of the constituent elements of the cluster set. Since misclassified samples contain multiple features, when clustering, features with similar or identical features will be clustered into a cluster set, then multiple features will generate multiple cluster sets, and there is no overlap between any two cluster sets obtained. At the same time, the number of rows of this two-dimensional matrix is ​​the number of categories contained in the entire underwater target data training set used to train the original model. The content of each row is related to each cluster set, that is, it represents all samples corresponding to a certain original label in these cluster sets. These samples are actually all misclassified samples corresponding to a certain original label in the underwater target data training set.

[0064] S23, feature compensation is performed on the features of the misclassified samples after clustering to obtain feature compensation of the misclassified samples. The specific process is as follows:

[0065] In the cluster set corresponding to the ith category, if each item contains samples and the number of samples contained in each item is not much different, it means that these features are difficult to use for classification and cannot extract more useful information; if there is a certain ith category, the number of all misclassified samples clustered to the wth cluster is significantly greater than other values, that is, most of the features of the misclassified samples of this category can still be clustered into a certain cluster set, which also shows that these features actually still contain certain information, but the features can easily cause the current model classifier to use this information incorrectly, resulting in some samples of this category being misclassified. In order to further utilize these features and better utilize underwater target samples, a feature compensation method is proposed.

[0066] S231, let some of the misclassified samples in the w-th cluster set after clustering be the i-th category in the underwater target data training set in S1;

[0067] 1 / 2, 2 / 3 or 3 / 4 of the misclassified samples in the w-th cluster set after clustering are defined as belonging to the i-th category in the underwater target data training set in S1; that is, not all misclassified samples in the w-th cluster set are samples of the i-th category.

[0068] S232, randomly select the correctly classified samples in the i-th category obtained in part S1, input them into the original model trained in S1, and obtain the sample features of the correctly classified samples;

[0069] Randomly select some samples from the w-th cluster set, input them into the original model trained in S1, and obtain the sample features of the samples in the w-th cluster set;

[0070] The number of correctly classified samples in the i-th category obtained in the selected part S1 is equal to the number of samples in the w-th cluster set of the selected part.

[0071] S233, calculating the feature difference between the sample feature of the Dth correctly classified sample selected in S232 and the sample feature of the sample in the Dth wth cluster set, and sampling the mean of multiple groups of feature differences to obtain feature compensation of the i-th category.

[0072] For example, 10 samples are selected from all correctly classified samples in the i-th category, and the sample features of the 10 selected samples are obtained respectively, and they are named A 1 -A 10 ; In the wth cluster set, 10 samples are also selected, and the sample features of the 10 selected samples are obtained respectively, and they are named B 1 -B 10 ; Calculate A in sequence 1 With B 1,……,A 10 With B 10 After obtaining 10 sets of feature differences, the mean of the 10 sets of feature differences is calculated to obtain the feature compensation of the i-th category.

[0073] S3, input the feature compensation obtained in S2 into the original model trained in S1 for training until convergence, and obtain the original model after feature compensation;

[0074] The feature compensation is combined with the original model, and the feature compensation is input into the original model for training until convergence, so as to obtain the original model after feature compensation, which is convenient for reclassifying all underwater target data training sets again and improves the accuracy of classification.

[0075] S4, input the underwater target data training set in S1 into the original model after feature compensation obtained in S3, and output the samples with classification errors;

[0076] The underwater target data training set in S1 is input into the original model after feature compensation for classification, and the classification results are counted. The classification results are divided into easy-to-improve samples and difficult-to-improve samples. For easy-to-improve samples, according to the feature compensation method of sample feature level proposed previously, it is used as the feature difference of the corresponding target category, and feature compensation is performed on the easy-to-improve sample set. In this step, the set S of all misclassified samples is false All samples that were previously misclassified and are classified correctly after using feature compensation on the original model are called easy-to-improve samples, while samples that are still misclassified by the original model at this time are called difficult-to-improve samples.

[0077] S5, establish an adversarial training model, extract some misclassified samples output in S4 as training samples, input the training samples into the adversarial training model, set the loss function, and obtain a trained adversarial training model until the maximum iteration is completed or the loss stops decreasing;

[0078] The loss function is:

[0079]

[0080] Among them, l cs (x t ,y t ) represents the loss function;

[0081] x t represents the tth training sample;

[0082] y t Represents x t The corresponding category label;

[0083] Indicates that the adversarial training model predicts the adversarial sample as the corresponding true category y t The probability of

[0084] Represents the training sample x t Adversarial examples;

[0085] α is a constant term;

[0086] is the cross entropy loss;

[0087] Represents the adversarial training model against adversarial samples The predicted probability of

[0088] β is a constant term;

[0089] represents KL divergence;

[0090] p(x t ) represents the adversarial training model for the training sample x t The predicted probability of

[0091] Indicates that the adversarial training model predicts the training sample as the corresponding true category y t The probability of

[0092] γ is a constant term.

[0093] Since the easy-to-improve samples in S4 have been correctly classified, this step starts to process the hard-to-improve samples that are still misclassified. For hard-to-improve samples, the traditional PGD adversarial training method is generally used. All training samples are treated the same when generating adversarial samples and calculating losses. It does not consider whether the training samples are correctly classified by the adversarial training model during the training process, nor does it consider that the generated adversarial samples will have different degrees of impact on the adversarial training model. Therefore, in order to better use the adversarial training method to learn hard-to-improve samples, the classification of the original samples and adversarial samples by the adversarial training model can be introduced into the adversarial training process in the form of prior knowledge.

[0094] First, establish an adversarial training model. The adversarial training model can be any network model, such as the VGG network. Extract some misclassified samples output in S4 as training samples. Use the adversarial training model to classify the original samples and obtain the loss function for the training samples combined with the classification of the original samples. Input the training samples into the adversarial training model and output the adversarial samples. At this time, the adversarial samples are known quantities, and the adversarial samples are convenient for calculating the loss function. In the generated adversarial samples, the adversarial training model should pay more attention to the samples that are misclassified or correctly classified but with low prediction probabilities. Therefore, this step will consider the loss function of the classification of the original samples and the classification of the generated adversarial samples at the same time, and the two are collectively referred to as the loss function of the combined classification situation (i.e., the above-mentioned loss function, see formula (1)). Use the loss function of the combined classification situation to perform adversarial training. Corresponding to the adversarial training method of the combined classification situation, use this method to iteratively train the difficult-to-improve samples until the maximum iteration is completed or the loss stops decreasing, and then the trained adversarial training model is obtained.

[0095] S6: The trained adversarial training model obtained in S5 and the original model after feature compensation obtained in S3 are weightedly combined in the form of accuracy index to generate a deep learning model. The specific process is as follows:

[0096] In order to better utilize the difference between the adversarial training model and the original model after feature compensation, the present invention uses the exponential form of accuracy to make the adversarial training model and the original model after feature compensation obtain more effective weights to generate a deep learning model.

[0097] S61. Determine the weight of each model using the model accuracy index form:

[0098] The original model weight after feature compensation is: a 1 q / (a 1 q +a 2 q );

[0099] The weight of the adversarial training model is: a 2 q / (a 1 q +a 2 q );

[0100] a 1 It represents the accuracy of the original model after feature compensation for the underwater target data training set and the adversarial sample set;

[0101] a 2 Represents the accuracy of the adversarial training model for the underwater target data training set and the adversarial sample set;

[0102] q is a hyperparameter, which is a constant term;

[0103] S62. Perform weighted combination using the weights obtained in S61:

[0104]

[0105] Among them, p intergrate represents the predicted probability of the deep learning model;

[0106] p 1 Represents the predicted probability vector of the original model after feature compensation;

[0107] p 2 represents the predicted probability vector of the adversarial training model;

[0108] According to the decision weights of the two models, the formula (2) of S62 can be determined. By adjusting the difference between the decision weights of the two models, p integrate . Where p integrate The category with the largest probability value is the final prediction result of the deep learning model, such as p integrate The probability values ​​are 0.4, 0.2, 0.3, and 0.1, among which 0.4 is the largest, so the category corresponding to 0.4 is the prediction result, which can be obtained with only one calculation after determining the weight.

[0109] S63. Use the collected underwater target data training set as the input of the deep learning model, use the maximum value of the predicted probability of the deep learning model as the output of the deep learning model, and perform training until convergence to generate a deep learning model.

[0110] S7. Input the underwater target data to be classified into the deep learning model generated in S6 to obtain the classification result of the underwater target data.

[0111] Example 1

[0112] First, the original model is established, and the original model is trained using the collected underwater target data training set until convergence to obtain the trained original model. The trained original model is used to predict the underwater target data training set to obtain the set of all correctly classified samples and the set of all incorrectly classified samples S false , and then the obtained S false The original model is input again, and the output of the original model is used as the feature of the corresponding misclassified sample. The features of the misclassified sample are clustered using the K-means clustering method to obtain the corresponding k cluster sets represented as {KM 1 , KM 2 , ..., KM k}, and there is no overlap between any two cluster sets, the formula can be obtained as follows:

[0113]

[0114] Among them, Card() represents the number of elements in the collection, Card(S false ) represents the number of all misclassified samples, Card(KM w ) represents the number of samples in the wth cluster set. For any cluster set KM w , according to the true label corresponding to each sample contained in it, the formula can be obtained:

[0115]

[0116] Where m represents the number of categories in the underwater target data training set, KM jw Indicates that among the samples contained in the obtained w-th cluster set, all samples whose original label category is the j-th category, Card(KM jw ) represents the number of all misclassified samples in the j-th category clustered into the w-th cluster.

[0117] Therefore, the result of clustering the features of misclassified samples can actually be regarded as a two-dimensional matrix, in which each column corresponds to a cluster set, that is, KM w , and the values ​​in each column correspond to KM jw The number of samples contained in , that is, each column is a further analysis of the constituent elements of the cluster set. The number of rows of this two-dimensional matrix is ​​equal to the number of categories contained in the underwater target data training set used to train the original model. The content of each row is related to each cluster set, that is, it represents all samples corresponding to a certain original label in these cluster sets. These samples are actually all misclassified samples corresponding to a certain original label in the underwater target data training set, as shown in the following formula:

[0118]

[0119] Among them, Card(L i ) is the number of samples with all classification prediction errors in the i-th category in the underwater target data training set of the original model, L i represents all the samples with classification prediction errors in the i-th category in the underwater target data training set of the original model, Card(KM iw ) represents the number of all misclassified samples in the i-th category clustered into the w-th cluster, KM iw It means that among the samples contained in the obtained w-th cluster set, all samples corresponding to the original label category of the i-th category may contain L in each cluster set.i The samples in .

[0120] Therefore, clustering the samples that are currently misclassified by the original model is actually equivalent to clustering the misclassified samples in each category separately. More importantly, if the features of the misclassified samples of a certain category can be clustered into the same cluster set, it means that these features may still have a certain classification ability. Specifically, in the k cluster sets {KM i1 , KM i2 , ..., KM ik}, if each item contains samples, and the number of samples contained in each item is not much different, it means that these features are difficult to use for classification and it is impossible to extract more useful information; if there is a Card (KM iw ) is significantly greater than other values, that is, most of the features of the misclassified samples of this category can still be clustered into a certain cluster set, which also shows that these features actually still contain certain information, but the features can easily cause the current model classifier to use this information incorrectly, resulting in some samples of this category being misclassified. Therefore, in order to further utilize these features and better utilize underwater target samples, a feature compensation method is proposed.

[0121] Assume that most of the misclassified samples in the i-th category of the entire underwater target data training set of the original model are clustered into the w-th cluster set, that is, L i Most of the samples in are clustered into KM iw At the same time, for the i-th category, use R i represents all correctly classified samples corresponding to the i-th category in the underwater target data training set. iw Characteristics of samples in R i The difference between the features of the samples in can obtain the feature compensation expected by the target category, that is, the feature compensation fg corresponding to the i-th category i , the formula is as follows:

[0122]

[0123] Among them, F() represents the extracted sample features, random r () represents the rth random selection operation. i and KM iw We randomly select samples from each of them, obtain the corresponding features, calculate a set of feature differences, and then sample the mean of multiple sets of differences, that is, the distance between the feature sampling center points of the two sample sets, as the feature compensation of the i-th category. This feature compensation actually reduces R i and KM iw The variance between .

[0124] Take the original model's current predictions for the i-th category and the j-th category as an example. As mentioned above, L i represents all misclassified samples in the i-th category, YC ij Indicates L i The samples that are incorrectly predicted as the jth category in , assuming that YC ij The samples included are L i The largest number among them, and much larger than other L i The rest of the part indicates that among all the samples of the jth category currently predicted by the original model, except for the samples whose true labels are the jth category, that is, the correctly classified samples, most of the remaining misclassified samples have true labels of the ith category. These samples are YC ij According to the meaning of feature compensation, YC ij The reason why the sample is misclassified may be that it lacks some feature information required to be classified as the i-th category, so the feature compensation fg corresponding to the i-th category i Will help YC ij The samples in are correctly classified. Therefore, for the original model, the above method can be used to add corresponding feature compensation to the categories that may need to add feature compensation. At the same time, for all samples classified as the jth category by the original model, from the prediction situation, the probability of these samples being predicted as the jth category is the highest, and for some of these samples whose true labels are the i-th category, the probability of being predicted as the i-th category is generally second only to the probability of being predicted as the j-th category, and the gap between the two is not large. The smaller the gap, the more ambiguous the corresponding sample features are, and it is also easy to be misclassified. ij Most of the samples in should also meet this condition. Considering that the true label of the sample cannot be obtained during prediction, combined with the sample prediction situation, it can be decided whether to use feature compensation for the sample during prediction.

[0125] According to the above method, the feature compensation is input into the current original model, and then the entire underwater target data training set data is classified again, and the classification results are counted. All the samples that were previously misclassified and correctly classified after using the feature compensation method on the original model are called easy-to-improve samples, and the samples that are still misclassified by the original model at this time are called difficult-to-improve samples.

[0126] For samples that are difficult to improve, the traditional PGD adversarial training method is generally used. All training samples are treated the same when generating adversarial samples and calculating losses. It does not consider whether the training samples are correctly classified by the adversarial training model during the training process, nor does it consider whether the generated adversarial samples will have different degrees of impact on the adversarial training model. Therefore, in order to better use the adversarial training method to learn samples that are difficult to improve, the classification of the original samples and adversarial samples by the adversarial training model can be introduced into the adversarial training process in the form of prior knowledge.

[0127] First, establish an adversarial training model. The adversarial training model can be any network model, such as the VGG network. Use the adversarial training model to classify the original samples and obtain the loss function for the training samples combined with the original sample classification, as shown in the following formula:

[0128]

[0129] Among them, l oscs (x t ,y t ) represents the loss function combined with the original sample classification;

[0130] x t represents the tth training sample;

[0131] y t Represents x t The corresponding category label;

[0132] Represents the training sample x t Adversarial examples;

[0133] Represents the adversarial training model against adversarial samples The predicted probability of

[0134] p(x t ) represents the adversarial training model for the training sample x t The predicted probability of

[0135] Indicates that the adversarial training model predicts the training sample as the corresponding true category y t probability.

[0136] in is the cross entropy loss,

[0137] in is the KL divergence, This term helps the adversarial training model reduce the number of original samples that it misclassifies during adversarial training. Since the KL divergence term is not needed when the original sample is correctly classified, it is used Controls whether to add KL divergence, so that when the original sample is classified correctly, Combined with the constant term γ, this makes Compare The better it is, the closer it is to 0, which is equivalent to no KL divergence loss. When the original sample is misclassified, Generally smaller, If it can still remain relatively large, the corresponding KL divergence loss will take effect. The constant term β is used to achieve a better combination of the cross entropy loss term and the KL divergence term.

[0138] In the generated adversarial samples, the adversarial training model should pay more attention to its misclassified samples or samples that are correctly classified but have a low prediction probability. In fact, for the samples x t Generated adversarial examples For example, Indicates that the adversarial training model predicts it as the corresponding true category y t The probability of Misclassification can also mean is correctly classified, but the predicted probability is low. Smaller value It has a greater impact on the adversarial training model, which means that the adversarial training model needs to pay more attention to it and make its weight larger. Larger value Its weight should be reduced, so it can be used As the corresponding weight, the constant term α can control the influence of this term. Combined with the previous loss function, the classification of the generated adversarial samples can also be considered. Therefore, the loss function that considers both the classification of the original samples and the classification of the generated adversarial samples is called the loss function combined with the classification, as shown in the following formula:

[0139]

[0140] Among them, l cs (x t ,y t ) represents the loss function combined with the classification situation;

[0141] Using the above loss function combined with classification to perform adversarial training, the corresponding adversarial training method combined with classification is used to iteratively train the difficult-to-improve samples until the maximum iteration is completed or the loss stops decreasing, and then an adversarial training model is obtained, which is integrated with the original model after feature compensation. In order to better utilize the difference between the two models, the accuracy index form can be used to make the two models obtain more effective weights.

[0142] For the original model of feature compensation, the accuracy of the underwater target data training set and the adversarial sample set generated corresponding to the training set is expressed as a 1 , similarly for the adversarial training model, the corresponding accuracy is expressed as a 2 , so the final integration result of the two models is shown in the following formula:

[0143]

[0144] where p 1 and p 2 They represent the prediction results of the original model with feature compensation and the adversarial training model, respectively. At this time, the decision weights of the two models are a 1 q / (a 1 q +a 2 q ) and a 2 q / (a 1 q +a 2 q ), q is a hyperparameter, which is a constant term and can adjust the difference between the decision weights of the two models, p integrate It represents the prediction probability of the final deep learning integration model, where the category with the largest corresponding probability value is the final prediction result of the deep learning integration model.

Claims

1. A method for underwater target classification considering the robustness of deep learning models, characterized by: It includes the following steps: S1. Establish an original model, and use the collected underwater target data training set to train the original model until convergence, to obtain a trained original model; The trained original model is used to predict the collected underwater target data training set to obtain the set of all correctly classified samples and the set of all incorrectly classified samples; S2, inputting the set of all misclassified samples obtained in S1 into the trained original model, clustering the features of the misclassified samples, performing feature compensation on the features of the clustered misclassified samples, and obtaining feature compensation for the misclassified samples; S3, input the feature compensation obtained in S2 into the original model trained in S1 for training until convergence, and obtain the original model after feature compensation; S4, input the underwater target data training set in S1 into the original model after feature compensation obtained in S3, and output the samples with classification errors; S5, establish an adversarial training model, extract some misclassified samples output in S4 as training samples, input the training samples into the adversarial training model, set the loss function, and obtain a trained adversarial training model until the maximum iteration is completed or the loss stops decreasing; S6, weightedly combining the trained adversarial training model obtained in S5 and the original model after feature compensation obtained in S3 using an accuracy index form to generate a deep learning model; S7. Input the underwater target data to be classified into the deep learning model generated in S6 to obtain the classification result of the underwater target data.

2. A method for underwater target classification considering the robustness of a deep learning model according to claim 1, characterized in that: In S2, the set of all misclassified samples obtained in S1 is input into the trained original model, the features of the misclassified samples are clustered, and feature compensation is performed on the features of the clustered misclassified samples to obtain feature compensation of the misclassified samples. The specific process is as follows: S21, input the set of all misclassified samples obtained in S1 into the original model trained in S1, and use the output of the original model as the feature of the corresponding misclassified samples; S22, clustering the features of the misclassified samples in S21 using the K-means clustering method to obtain a cluster set; S23, performing feature compensation on the features of the misclassified samples after clustering to obtain feature compensation for the misclassified samples.

3. A method for underwater target classification considering the robustness of a deep learning model according to claim 2, characterized in that: There is no overlap between any two cluster sets obtained in S22.

4. A method for underwater target classification considering the robustness of a deep learning model according to claim 3, characterized in that: In S23, feature compensation is performed on the features of the clustered misclassified samples to obtain feature compensation for the misclassified samples. The specific process is as follows: S231, let some of the misclassified samples in the w-th cluster set after clustering be the i-th category in the underwater target data training set in S1; S232, randomly select the correctly classified samples in the i-th category obtained in part S1, input them into the original model trained in S1, and obtain the sample features of the correctly classified samples; Randomly select some samples from the w-th cluster set, input them into the original model trained in S1, and obtain the sample features of the samples in the w-th cluster set; S233, calculating the feature difference between the sample feature of the Dth correctly classified sample selected in S232 and the sample feature of the sample in the Dth wth cluster set, and sampling the mean of multiple groups of feature differences to obtain feature compensation of the i-th category.

5. A method for underwater target classification considering the robustness of a deep learning model according to claim 4, characterized in that: The number of correctly classified samples in the i-th category obtained in the part S1 selected in S232 is equal to the number of samples in the w-th cluster set selected.

6. A method for underwater target classification considering the robustness of a deep learning model according to claim 5, characterized in that: The loss function set in S5 is: Among them, l cs (x t ,y t ) represents the loss function; x t represents the tth training sample; y t Represents x t The corresponding category label; Indicates that the adversarial training model predicts the adversarial sample as the corresponding true category y t probability; Represents the training sample x t Adversarial examples; α is a constant term; is the cross entropy loss; Represents the adversarial training model against adversarial samples The predicted probability of β is a constant term; represents KL divergence; p(x t ) represents the adversarial training model for the training sample x t The predicted probability of Indicates that the adversarial training model predicts the training sample as the corresponding true category y t probability; γ is a constant term.

7. A method for underwater target classification considering the robustness of a deep learning model according to claim 6, characterized in that: In S6, the trained adversarial training model obtained in S5 and the original model after feature compensation obtained in S3 are weightedly combined in the form of an accuracy index to generate a deep learning model. The specific process is as follows: S61. Determine the weight of each model using the model accuracy index form: The original model weight after feature compensation is: a1 q / (a1 q +a2 q ); The weight of the adversarial training model is: a2 q / (a1 q +a2 q ); a1 represents the accuracy of the original model after feature compensation for the underwater target data training set and the adversarial sample set; a2 represents the accuracy of the adversarial training model for the underwater target data training set and the adversarial sample set; q is a hyperparameter, which is a constant term; S62. Perform weighted combination using the weights obtained in S61: Among them, p integrate represents the predicted probability of the deep learning model; p1 represents the prediction probability vector of the original model after feature compensation; p2 represents the predicted probability vector of the adversarial training model; S63. Use the collected underwater target data training set as the input of the deep learning model, use the maximum value of the predicted probability of the deep learning model as the output of the deep learning model, and perform training until convergence to generate a deep learning model.

Citation Information

Patent Citations

  • Image classification model training method and system capable of automatically generating training data set

    CN110598752A

  • Image classification method based on misclassification perception regularization training

    CN112270368A