Small sample remote sensing ground feature classification method and system based on feature generation network
Technical Field
The invention relates to the field of remote sensing intelligent identification, in particular to a small sample remote sensing ground feature classification method and system based on a feature generation network.
Background
The deep learning method is widely applied to remote sensing ground feature classification tasks and refreshes classification accuracy on a public data set, however, with the practical application of the deep learning method in remote sensing ground feature classification, a big problem is exposed, namely the serious dependence of model classification accuracy on huge training data.
In the practical application of intelligent identification in a remote sensing place, certain manpower, material resources and time are consumed for collecting and labeling remote sensing image data, which forms contradiction with the dependence of a deep learning technology on mass data, and is mainly reflected in that:
(1) for a specific ground object scene, such as remote sensing imaging of a region in severe imaging weather and remote sensing data of a secret military base, it is impractical to collect thousands of high-quality remote sensing images for specially training a deep learning model;
(2) training data sets prepared before model deployment are often difficult to fit to actual needs. For example, remote sensing image data under twenty ground feature scenes are prepared for training in model training, but in practical application, the ground feature classification task needs to be expanded, a plurality of new scenes are added to require ground feature classification, and the classification task under the new scenes needs to be completed under the condition of a small amount of samples.
The traditional deep learning algorithm can be seriously overfitted in a ground feature classification task under the condition of a small sample, and the existing method for solving the problem of small sample local feature classification is mainly based on a small sample learning algorithm of sample expansion, specifically, a deep generation model is used for sample expansion to generate a sample, and a generated sample set is used for training the model to deal with the problem of small sample local feature classification. The method has the defects that a deep generation model and a classification model need to be trained independently, the learning efficiency is low, and the universality on various ground object targets is lacked under the condition of low learning efficiency on small samples facing various ground object classification tasks.
Disclosure of Invention
In order to solve the defects in the background technology, the invention provides a small sample remote sensing ground object classification method and system based on a feature generation network, which utilize the generation network to carry out feature generation and expansion on a ground object target at a feature level, and utilize the similarity measurement of the test sample feature and the ground object target generation feature set to complete small sample ground object classification, so that the feature generation and ground object classification of a model can be carried out in an end-to-end mode, and the learning efficiency and classification precision are greatly improved.
The technical scheme provided by the invention is as follows:
dividing remote sensing ground object classification data set into source data set D according to ground object classessourceAnd a target data set DtargetThe method is respectively used for the integral training of the model and the small sample classification performance test on various ground object targets;
in the source data set DsourceTraining the feature extractor F and the generating network G;
based on the target data set DtargetPerforming feature generation by using the feature extractor F and the generation network G to obtain a generated feature set corresponding to each feature type, realizing feature sample expansion on a feature level, and meeting the training requirement of a model under a small sample condition;
and (3) performing feature extraction on the test ground feature image x by using a feature extractor F, performing similarity measurement on the test sample features and the generated feature sets of various ground feature types, giving confidence scores of the test image x on various ground feature types, and further determining the ground feature classification of the tested image x.
Preferably, the remote sensing ground object classification data set is divided into source data sets D based on ground object classessourceAnd a target data set DtargetThe method comprises the following steps:
classifying ground object classes in remote sensing ground object classification data set into source class CsourceObject class CtargetAnd the source class CsourceAnd object class CtargetThe ground feature categories in (1) are mutually exclusive;
based on the source class CsourceDividing the remote sensing ground object classification data set into source data set D according to the target classsourceTarget data set Dtarget;
Wherein the source data set DsourceThe number of samples corresponding to each type of ground object target is not less than 500.
Preferably, in the source data set DsourceTraining the feature extractor F, comprising:
with DsourceThe whole ground object class space is used as a current to-be-classified set;
adding two full-connection layers to the tail end of the feature extractor, wherein the last full-connection layer is responsible for giving confidence scores of each type of ground feature; the other layer is used for carrying out nonlinear operation;
based on the number distribution of samples on the set to be classified, carrying out a balanced weighting strategy on the loss function categories adopted in the training process of the feature extractor F;
and terminating the training after the loss function tends to be stable, eliminating the full-connection layer, and using the parameters of the rest part for initializing the parameters of the feature extractor F.
Preferably, the strategy for performing the equalizing weighting on the categories by using the loss function includes:
under the criterion of cross entropy loss function, the data set D is generated on the basis of various object type samplestrainAnd the frequency distribution is converted into a power-finger residual error form to carry out weighted equalization on the classification loss functions of the samples of each terrain type.
Preferably, in the source data set DsourceTraining the generation network G, comprising:
step 1, in the source data set DsourceRandomly sampling few-sample ground object classification tasks according to ground object types, and dividing the tasks into a training set StrainAnd test set Stest;
Step 2, training set S in the task of classifying the few samplestrainTraining data x in (1)trainExtracted features F (x) determined by the feature extractor Ftrain) With random noise vector z as input to a feature generation network GSource, conducting decoupling learning and feature generation, repeatedly executing feature expansion to obtain a generated feature set F (x)train)aug;
Step 3, for the test set StestTest data x in the low sample classification task of (1)testFeature of feature image F (x) determined by the feature extractor Ftest) And the generating feature set F (x)train)augSending the feature into a classifier C, and carrying out similarity measurement on the feature of the test ground feature image and the generated feature set corresponding to each type of training ground feature image to obtain a test ground feature image x in the classification tasktestConfidence scores on the respective terrain types;
step 4, carrying out surface feature classification on the surface feature images in the few-sample surface feature classification task based on the confidence score;
step 5, carrying out joint optimization on parameters of the feature extractor F, the classifier C and the generation network G according to a cooperative training algorithm under a cross entropy loss function according to a back propagation algorithm;
and 6, repeating the steps 2 to 5, and training the feature extractor F, the generation network G and the classifier C until convergence.
Preferably, said extracted features F (x) determined by said feature extractor Ftrain) Performing decoupling learning and feature generation with random noise vector z as input source of feature generation network G, and repeatedly performing feature expansion to obtain generated feature set F (x)train)augThe method comprises the following steps:
for the generation network G, initializing parameters according to the form of a diagonal identity mapping matrix when feature generation is carried out for the first time;
for the ith type of ground object image, the corresponding input feature F (x)train) And a noise vector z, and obtaining a generation characteristic G (F (x) through a three-layer perceptron accompanied by a ReLU activation functiontrain),z);
Changing the input of the noise vector, and repeatedly generating the features of the ith type ground object type image until the number of the features of the type sample reaches naug. Merging the original characteristic input and the generated characteristic of the ith type of ground object to obtainFinal feature set F (x) generated to the type of ground featuretrain)aug。
Preferably, the feature F (x) of the image of the test ground objecttest) And the generating feature set F (x)train)augSending the feature into a classifier C, and carrying out similarity measurement on the feature of the test ground feature image and the generated feature set corresponding to each type of training ground feature image to obtain a test ground feature image x in the classification tasktestConfidence scores on various terrain types, including:
based on the training set StrainCorresponding set of generated features F (x)train)augCalculating a prototype vector corresponding to each type of the ground object according to the intra-class feature mean value;
and (4) carrying out similarity measurement on the prototype vectors of all the terrain types and the characteristics of the test samples according to a cosine similarity criterion, and taking the similarity measurement as a sample xtestA confidence score for a surface object belonging to class i;
selecting a test sample xtestAnd taking the feature type corresponding to the highest confidence score on each type of feature target as prediction output.
Preferably, the prototype vector is calculated as follows:
in the formula piFor prototype vectors corresponding to type i terrain types, KaugAnd generating the feature set number corresponding to the ith type of ground object.
Preferably, the confidence score is calculated as follows:
in the formula, P (Y ═ i | X) is a confidence score of the test sample X belonging to the i-th type of feature. p is a radical ofiIs a prototype vector of the ith type of ground object, and j represents the prototype direction corresponding to the type of ground object in the ground object class space setQuantity, cosine (.) represents the cosine similarity function;
the cosine similarity function cosine () is calculated as follows:
in the formula, x1、x2Is a one-dimensional vector to be subjected to similarity measurement.
Preferably, the jointly optimizing the parameters of the feature extractor F, the classifier C and the generation network G according to a cooperative training algorithm under the cross entropy loss function according to a back propagation algorithm includes:
and according to a cross entropy loss function and a back propagation algorithm, taking a generated feature set corresponding to a training image and an original feature set together as a batch training unit to be executed, and optimizing the feature extractor F, the classifier C and the generating network G in an end-to-end mode.
Based on the same inventive concept, the invention also provides a small sample remote sensing ground feature classification system, which comprises:
a data set construction module: method for dividing remote sensing ground object classification data set into source data set D based on ground object classificationsourceAnd a target data set Dtarget;
A model training module: for in-source data sets DsourceTraining the feature extractor F and the generating network G;
a feature set generation module: for basing on the target data set DtargetPerforming feature generation by using the feature extractor F and the generation network G to obtain a generation feature set corresponding to each feature type;
a classification module: the feature extractor F is used for extracting features of the tested ground feature image, performing similarity measurement on the features of the tested sample and the generated sample set of various ground feature types, giving confidence scores of the tested image on various ground feature types, and further determining ground feature classification of the tested image.
Compared with the prior art, the invention has the beneficial effects that:
1. the invention provides a small sample remote sensing ground feature classification method and system, which comprises the following steps: dividing remote sensing ground object classification data set into source data set D based on ground object classificationsourceAnd a target data set Dtarget(ii) a In the source data set DsourceTraining the feature extractor F and the generating network G; based on the target data set DtargetPerforming feature generation by using the feature extractor F and the generation network G to obtain a generation feature set corresponding to each feature type; the feature extractor F is used for extracting features of the test ground feature image x, similarity measurement is carried out on the features of the test sample and a generated sample set of various ground feature types, confidence scores of the test image x on various ground feature types are given, and then ground feature classification of the tested image x is determined, wherein parameter initialization of the feature extractor is completed through training of a classification model on a source data set, learning complexity is reduced, and follow-up learning burden is relieved; by generating characteristic mode mining of the network on the source data set and applying the migration application to the target data set, high-quality target data characteristics can be effectively expanded, and the overfitting risk on the source data set is reduced;
2. according to the small sample remote sensing ground feature classification method, end-to-end learning of the feature generation model is achieved through a combined optimization method of the generation network and the classifier, high precision of ground feature classification under the condition of a small sample can be achieved, and the training process is effectively simplified;
3. the small sample remote sensing ground feature classification method provided by the invention is based on the feature generation network, the remote sensing ground feature image features and random noise are taken as input to carry out feature generation on various ground feature types, meanwhile, the various ground feature features are subjected to self-adaptive space mapping learning, and the small sample remote sensing ground feature classification is executed through the feature similarity measurement on the mapping space, so that the feature generalization and expansion of the ground feature types under the condition of insufficient samples are realized, and the problem of the remote sensing ground feature classification under the condition of small samples is solved.
Drawings
FIG. 1 is a schematic general flow chart of a small sample remote sensing ground feature classification method provided in embodiment 1 of the present application;
fig. 2 is a process of training a feature extractor F and a generation network G by using a source data set in the small sample remote sensing ground feature classification method provided in embodiment 1 of the present application;
fig. 3 is a schematic diagram of data set division in the small sample remote sensing surface feature classification method provided in embodiment 1 of the present application;
FIG. 4 is a schematic diagram of a framework of a small-sample remote sensing ground object classification method provided in embodiment 1 of the present application;
fig. 5 is a general block diagram of a small-sample remote sensing ground feature classification system provided in embodiment 2 of the present application.
Detailed Description
For a better understanding of the present invention, reference is made to the following description taken in conjunction with the accompanying drawings and examples.
Example 1
As shown in fig. 1, the method for classifying small sample remote sensing ground features provided by the invention comprises the following steps:
s1: dividing remote sensing ground object classification data set into source data set D based on ground object classificationsourceAnd a target data set Dtarget. As shown in fig. 3, the feature classes are classified into a source class and a test class, and it is ensured that there is no coincidence between the feature classes. Further dividing the remote sensing ground object classification data set into a source data set D according to the source class and the target classsourceTarget data set DtargetAnd ensure the source data set DsourceThe number of the samples in each class is not less than 500. Wherein the surface feature types in the source data set include, but are not limited to: buildings, roads, lawns, for model training; types of surface features in the target dataset include, but are not limited to: water, shrubs and bare land are used for testing the classification task of small sample local objects.
S2: in the source data set DsourceTraining the feature extractor F and the generating network G;
s3: based on the target data set DtargetPerforming feature extraction and feature generation on training samples corresponding to various ground feature types by using the feature extractor F and the generation network G,and obtaining a generated feature set corresponding to each feature type.
S4: and (3) performing feature extraction on the test ground feature image x by using a feature extractor F, performing similarity measurement on the test sample features and the generated sample sets of various ground feature types, giving confidence scores of the test image x on various ground feature types, and further determining the ground feature classification of the detected image x.
Wherein S2 is in the source data set DsourceThe training of the feature extractor F and the generation network G is performed, and a specific training process is shown in fig. 2, and includes:
(1) with DsourceThe above ground feature class space as a whole is used as a set to be classified to pre-train the feature extractor F. The method specifically comprises the following steps:
step 1: adding two full-connection layers to the tail end of the feature extractor, wherein the last full-connection layer is responsible for giving confidence scores of each type of ground feature; the other layer is used for carrying out nonlinear operation;
step 2: a class balancing weighting strategy is performed for the calculation of the loss function: weighting the loss functions of various ground feature types under the cross entropy loss function criterion, wherein the weight is selected based on the loss functions of various ground feature samples in the source data set D
trainUpper frequency distribution, into power-finger residual form
The classification loss functions of various surface feature samples are weighted and balanced, and the purpose is to improve the balance of feature extraction of the feature extractor under various surface feature scenes.
And step 3: and terminating the training after the loss function tends to be stable. And eliminating the full connection layer, and using the parameters of the rest parts for parameter initialization of the feature extractor F.
(2) Based on the source data set DsourceAnd performing collaborative training on the generation network G and the classifier C, wherein the training aims to expect that the generation network G can generate the features with high quality for various samples. The innovation point is that the collaborative training algorithm of the classifier C and the generation network G is mainly carried out according to an end-to-end mode, and the quantity between the generation network and the classifier is increasedThe suitability of (2). As shown in fig. 4, the specific training process is as follows:
step 1, in the source data set DsourceAnd randomly sampling out few samples of ground object classification tasks: the few-sample classification task comprises a training set StrainAnd test set Stest. Training set StrainIncluding N types of ground object targets, each corresponding to K pieces of sample data, and test set StestAnd training set StrainSharing N types of ground object targets and respectively providing N for various types of ground object targetstestThe sheet samples were used for training and test evaluation of the model.
Step 2, inputting the surface feature image x in the few-sample classification task into a feature extractor F to obtain corresponding extraction features F (x) including training surface feature image features F (x)train) And testing the feature F (x) of the ground feature imagetest)
Step 3, training data x in the task of classifying the few samplestrainExtracting the feature F (x)train) And performing decoupling learning and feature generation by taking the random noise vector z as an input source of the feature generation network G. Repeating feature generation, and combining the original feature input and the generated feature to obtain the final generated feature set F (x)train)aug. The structure of the feature generation network is formed by three layers of perceptrons accompanied by a ReLU activation function, and parameters of the feature generation network are initialized according to a diagonal identity mapping matrix form;
step 4, testing the feature F (x) of the ground feature image
test) And the generating feature set F (x)
train)
augSending the feature sets to a classifier C, and performing similarity measurement on the feature sets of the test ground feature images and the generated feature sets corresponding to the various training ground feature images: firstly, the generated feature set of each ground object type is subjected to global average pooling and averaging processing to obtain prototype vectors corresponding to various ground object types, and the calculation process is
(in the formula, p
iFor prototype vectors corresponding to type i terrain types, K
augThe number of generated feature sets corresponding to the ith type of terrain). Then go to each placeAnd (3) carrying out similarity measurement on the prototype vector of the object type and the characteristics of the test sample according to a cosine similarity criterion, and taking the similarity measurement as the confidence score of the sample X belonging to the ith class ground object target, namely the confidence score of the test sample X belonging to the ith class ground object type
Wherein p is
iAnd j represents a prototype vector corresponding to the surface feature type in the surface feature type space set. For the cosine similarity measurement criterion used by the algorithm, the calculation method is as follows:
(x
1、x
2a one-dimensional vector for which a similarity measure is to be performed).
And 5, selecting the highest confidence score of the test sample X on various surface feature targets, and taking the surface feature type corresponding to the test sample X as prediction output.
And 6, carrying out joint optimization on the parameters of the feature extractor F, the classifier C and the generation network G according to a cooperative training algorithm under the cross entropy loss function according to a back propagation algorithm. Specifically, a generated feature set corresponding to a training image and an original feature set are jointly used as a batch training unit to be executed, and a feature extractor F, a classifier C and a generating network G are jointly optimized in an end-to-end mode. Wherein the loss function specifically employed in the classification task of the surface feature for each small sample is a cross-entropy loss function, i.e.
Wherein N represents the number of categories, y
icTo discriminate whether i and c are identical indicative functions, p
icThe probability that the corresponding test sample i belongs to class c.
And 7, repeating the steps 2 to 6, and training the feature extractor F, the generation network G and the classifier C until convergence.
S3: based on the target data set DtargetUsing said feature extractor F and saidGenerating a network G to generate characteristics to obtain a generated characteristic set corresponding to each feature type;
in addition, considering that the number of samples in the training set of the target data set is small and not representative, in order to make the test result of the small sample feature classification performance of the algorithm more reliable, the target data set is generally divided into M times repeatedly, then training and testing of the model are repeated, and finally the average value of the test results in the M times of division is used as the final test result. The division times M are selected according to the fluctuation condition of each test result, the algorithm adopts standard deviation based on F-score to judge, and for the division experiment with the standard deviation value of the classification accuracy rate smaller than 0.01, the classification result tends to be stable under the division condition and can be used as the final experiment evaluation result. Wherein the calculation for F-score is as follows:

p is the precision rate, i.e. the ratio of samples predicted to be positive and samples predicted to be correct to all samples predicted to be positive; r is the recall ratio, i.e., the proportion of samples predicted to be positive and predicted to be correct to all samples that are actually positive.
Example 2
In order to implement the method, the invention further provides a small sample remote sensing ground feature classification system, as shown in fig. 5, including:
a data set construction module: method for dividing remote sensing ground object classification data set into source data set D based on ground object classificationsourceAnd a target data set Dtarget;
A model training module for training the model in the source data set DsourceTraining the feature extractor F and the generating network G;
a feature set generation module for generating a feature set based on the target data set DtargetPerforming feature generation by using the feature extractor F and the generation network G to obtain a generation feature set corresponding to each feature type;
and the classification module is used for performing feature extraction on the test ground feature image x by using the feature extractor F, performing similarity measurement on the test sample features and the generated sample sets of various ground feature types, giving confidence scores of the test image x on the various ground feature types, and further determining the ground feature classification of the detected image x.
The data set construction module is specifically configured to:
classifying ground object classes in remote sensing ground object classification data set into source class CsourceObject class CtargetAnd the source class CsourceAnd object class CtargetThe ground feature categories in (1) are mutually exclusive;
based on the source class CsourceDividing the remote sensing ground object classification data set into source data set D according to the target classsourceTarget data set Dtarget;
Source data set D in this embodimentsourceThe number of samples corresponding to each type of ground object target is not less than 500.
The model training module is specifically configured to:
(1) in the source data set DsourceTraining the feature extractor F, comprising:
with DsourceThe whole ground object class space is used as a to-be-classified set;
adding two full-connection layers to the tail end of the feature extractor, wherein the last full-connection layer is responsible for giving confidence scores of each type of ground feature; the other layer is used for carrying out nonlinear operation;
performing a balanced weighting strategy on the classes by adopting a loss function in the process of training the F by utilizing a to-be-classified set;
and terminating the training after the loss function tends to be stable, eliminating the full-connection layer, and using the parameters of the rest part for initializing the parameters of the feature extractor F.
(2) In the source data set DsourceTraining the generation network G, comprising:
set partitioning subunit for partitioning the source data set DsourceRandomly sampling out few-sample ground feature classification tasks and dividing the tasks into a training set StrainAnd a verification set SvalAnd test set Stest。
A feature set generation subunit for generating a training set StrainTraining data x in the low-sample classification task of (1)trainExtracting features F (x) determined by the feature extractor Ftrain) Performing decoupling learning and feature generation by taking the random noise vector z as an input source of a feature generation network G to obtain a generated feature set F (x)train)aug(ii) a See example 1 for specific procedures;
a confidence determining subunit for determining a confidence level for the test set StestTest data x in the low sample classification task of (1)testFeature of feature image F (x) determined by the feature extractor Ftest) And the generating feature set F (x)train)augSending the feature data to a classifier C, and performing similarity measurement on the feature of the test ground feature image and a generated feature set corresponding to each type of training ground feature images to obtain confidence scores of the ground feature images in the classification task on each ground feature type; the specific implementation mode is shown in example 1;
the classification subunit is used for classifying the surface feature images in the low-sample surface feature classification task based on the confidence score;
the optimization subunit is used for carrying out joint optimization on the parameters of the feature extractor F, the classifier C and the generation network G according to a collaborative training algorithm under a cross entropy loss function according to a back propagation algorithm;
and then, repeatedly calling the feature set generating subunit, the confidence coefficient determining subunit, the classifying subunit and the optimizing subunit to train the feature extractor F, generate the network G and the classifier C until the whole network is converged.