Remote sensing image recognition method in few-sample incremental learning scene
Through the combination of feature extraction network and prototype adaptive module, the over-fitting and catastrophic forgetting problems of few-sample incremental learning in remote sensing image recognition are solved, adaptive learning of new categories is achieved, and the recognition accuracy is significantly improved. It is applicable For tasks such as maritime surveillance and military target identification.
Patent Information
- Application Number
- CN202410704854.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-10-01
AI Technical Summary
In the field of remote sensing image recognition, existing technologies are difficult to effectively handle small-sample incremental learning scenarios. Especially in maritime surveillance and military target recognition tasks, the cost of data collection is high, and targets are highly mobile and concealed, resulting in models that are difficult to deal with in the face of new technologies. New categories in the data require continuous adaptation, and some categories are difficult to collect and can only capture a small number of samples, leading to overfitting and catastrophic forgetting problems.
A method is proposed, including pre-training of feature extraction network, training of prototype adaptive module and pseudo-incremental training, through the construction of meta-learning data set, generation of quasi-orthogonal class prototype matrix and parameter update of prototype adaptive module, Achieve adaptive learning of new categories and avoid overfitting and catastrophic forgetting.
It effectively solves the problems of over-fitting and catastrophic forgetting in small-sample incremental scenarios, and significantly improves the recognition accuracy of remote sensing image classification. Experiments on the MSTAR and NWPU-RESISC45 data sets show that it is better than other methods and has a wide range of applications. Application prospects.
Smart Images

Figure CN118736430A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a remote sensing image recognition method, and in particular to a remote sensing image recognition method in a scenario of incremental learning with fewer samples of incremental categories. Background Art
[0002] In recent years, deep neural networks have become a standard technology in the remote sensing community due to their accuracy and efficiency in extracting features from remote sensing signals. In some remote sensing application scenarios, such as maritime surveillance and military target recognition tasks, imaging platforms are limited by spatial range and regional accessibility, resulting in high data acquisition costs. In addition, the targets we are concerned with are usually highly mobile, hidden, and difficult to sample, which brings up the problem of few-shot learning in the field of remote sensing. Few-shot learning aims to solve the problem of performing classification or recognition tasks when only a small number of labeled samples are available. At present, there are many remote sensing image recognition studies based on deep neural networks that solve the problem of target recognition when there are few training samples in a closed set.
[0003] At the same time, in the recognition task, it may be necessary to identify categories that do not exist in the classification data set according to the task requirements, which brings up the problem of incremental learning of classes. However, in some practical situations, a single recognition task may have both the problem of few samples and incremental classes. This is because in the real-world remote sensing image target recognition, a large amount of remote sensing data is difficult to collect at one time, but arrives in batches, which means that the model needs to constantly adapt to new categories in the new data. And because some categories are difficult to collect, only a small number of samples can be captured. This situation puts forward new requirements for remote sensing image classification models, that is, the ability to gradually learn new classes from very few training samples. This learning ability is called incremental learning with few samples. Therefore, developing remote sensing image recognition methods with incremental learning capabilities with few samples is of great significance to solving the problem of incremental recognition with few samples in the field of remote sensing image recognition. Summary of the invention
[0004] Based on the research and analysis of remote sensing image recognition in a scenario with few sample increments, the present invention proposes a remote sensing image recognition method in a scenario with few sample increments, which specifically includes the following steps:
[0005] Step 1: Pre-train the feature extraction network;
[0006] On the basic dataset D for basic tasks 0 The feature extraction network is trained on the basic data set, which consists of a large number of remote sensing images of different categories; each remote sensing image sample x is transformed into i Mapping from the original image space to the new embedding space is equivalent to an embedding function: In the formula represents the d-dimensional embedding vector, ψ represents the parameters of the feature extraction network, and f ψ (.) represents the feature extraction network, x represents the remote sensing image sample input to the feature extraction network, and h represents the output of the feature extraction network; the feature extraction network is connected to the cosine classifier, and the weights of each type of the cosine classifier are composed of the initial prototype of the basic data set, and its loss function is:
[0007] L F =CE(cos(f ψ (x i ),E 0 ),y i ) (1)
[0008] Where CE represents the cross entropy loss function well known in the art, and f ψ (x i ) means to convert x i Input to the feature extraction network, f ψ (.) represents the feature extraction network, the subscript i represents the sample number of the remote sensing image, and y i Represents the i-th remote sensing image sample x i The corresponding category label; E 0 Denotes the basic data set D 0 The initial prototype matrix of all classes in the class is formed by the initial prototypes; the initial prototype matrix E = (e1, e2, ..., e n ) T The formula is, the superscript T represents the matrix rank:
[0009]
[0010] Among them, e1, e2, …, e n They represent the row vectors of E, n represents the number of basic categories, and they represent the initial prototypes of remote sensing images of different categories. The subscript c represents the category, which represents the initial prototype of the remote sensing image of category c. c (D,ψ) represents the class prototype of the c-class sample obtained by using the feature extraction network and the sample dataset D, N c is the number of training samples of remote sensing images of type c, and In(·) is the selection indicator function representing the samples:
[0011]
[0012] The method for training the parameters of the feature extraction network is the gradient descent method, which updates the parameters ψ of the feature extraction network by minimizing the loss function of formula (1);
[0013] Step 2: training the prototype adaptive module;
[0014] The specific steps include:
[0015] Step 1: Construction of meta-learning dataset
[0016] From the basic data set D 0 Extract m types of samples from the training set S, the number of samples in each class is n, and divide the samples of each class into training set S t and the test set Q t , forming a sampling data set (S t ,Q t );From the sampled data set S t and Q t Generate training sets S of pseudo incremental data sets respectively p and the test set Q p samples and constitute a pseudo incremental data set (S p ,Q p ); The generating function of a certain type of pseudo-incremental sample is expressed as:
[0017] x p =λx i +(1-λ)x j (i≠j) (4)
[0018] Among them, x i and x j is from the basic training set D 0 Two training samples of different categories are randomly selected from the , the subscripts i and j represent the sequence numbers of the samples, i≠j means taking different samples of the same category; p is the generated pseudo-incremental sample, λ is the mixing coefficient; then the training set S of the sampling data set and the pseudo-incremental data set is used t and S p Together they form the meta-learning dataset D m The training set (S t and S p ), similarly, using the test set Q of the sampled data set and pseudo-incremental data set t and Q p The samples are combined together to form the meta-learning dataset D m The test set (Q t and Q p );
[0019] Step 2: Obtain the quasi-orthogonal prototype matrix
[0020] After obtaining the training set (S t and S p ) and the test set (Q t and Q p ), then generate the initial class prototype matrix E corresponding to the meta-learning dataset based on formula (2) p, where the superscript P represents the initial class prototype matrix in the meta-learning training process; replace the dataset D in formula (2) with the meta-learning dataset D m , and take the samples of the training set, that is, the initial class prototype matrix E corresponding to the meta-learning data set can be obtained through formula (2) p Each row vector of ; then according to the principle of hyperdimensional computing, the initial class prototype matrix E is converted into p Convert to quasi-orthogonal prototype matrix P p :
[0021] P p =sign(E p ) (5)
[0022] Where sign() represents the sign function, P p represents the quasi-orthogonal prototype matrix obtained by projecting the initial prototype into the hyperdimensional space, and the superscript P represents the quasi-orthogonal prototype matrix corresponding to the meta-learning training stage; after obtaining the quasi-orthogonal prototype, a trained fully connected layer is used to transform E p Convert to P p ; During the training process of the fully connected layer, the training loss function L1(θ; P, E) of the fully connected layer is:
[0023]
[0024] Among them, P and E represent the quasi-orthogonal prototype matrix and the initial prototype matrix respectively. represents the number of row vectors in P and E, that is, the number of categories, g θ g θ (e i ), which represents a fully connected layer with a weight parameter of θ; e i and p i denote the row vectors of P and E respectively; the cosine function cos() is used to calculate the cosine distance between two vectors, as shown in formula (6), which is used to obtain p i and g θ (e i ), |||| represents the modulus of the vector; (·) T represents the transpose of the matrix; the update of the parameter θ of the fully connected layer is as follows:
[0025]
[0026] Where the superscript m represents the number of update iterations, β is the update rate, and L1(θ; P, E) represents the loss function of the fully connected layer. After M iterations, the weight parameter θ of the fully connected layer is fixed, and then E is used to pAs the input of the fully connected layer, the quasi-orthogonal prototype matrix P in the meta-learning training phase can be obtained from the output of the fully connected layer. p ;
[0027] Step 3: Train the parameters of the prototype adaptive module
[0028] The query vector and P of the training set samples p The query vector is the embedding vector obtained after the training samples of the training set are processed by the feature extraction network and the fully connected layer.
[0029] P p and query vector together as the input I of the prototype adaptive module, by respectively combining the input I with the first query matrix Second query matrix The third query matrix Multiply them together to get the input query matrix Q, key matrix K and value matrix V. Represents a d×d dimensional real matrix, as shown below:
[0030]
[0031] Among them, q1,q2,...,q n+1 ,k1,k2,...,k n+1 、v1,v2,...,v n+1 Respectively represent the row vectors of matrices Q, K, and V. The subscript n+1 represents the number of vectors, and n represents the number of class prototypes; i1,i2,...,i n+1 Represents the row vector of input I respectively; then multiply the query matrix Q by the key matrix K, and pass QK T The value is scaled, that is, divided by α is the scaling factor, and the Softmax function is used to Processing is performed to obtain the attention weights between each input row vector and itself and other row vectors; the attention weights are multiplied by the value matrix V, and then linearly transformed through a fully connected FC layer to obtain the corresponding input change ΔI; this process is expressed as:
[0032]
[0033] Among them, FC represents the fully connected layer in the prototype adaptive module; the final output I' of the prototype adaptive module is:
[0034] I'=I+ΔI (10)
[0035] The prototype adaptive module executes the data processing flow; the row vectors of the first m rows of I' (i1′, i′2, …, i′ m) as the weight of the cosine classifier, the m+1th row vector i′ of I′ m+1 As the new query vector, replace the row vectors of the first m rows (i′1, i′2, …, i′ m ) as the weight of the cosine classifier, and calculate the row vector of the first m rows of I' and i' m+1 The cosine distance between them is used to obtain its classification vector; the cross entropy loss function CE is used to obtain the cross entropy loss L between the classification vector and the sample label y of the query vector, as shown in formula (11);
[0036] L=CE[(cos(i1',i' m+1 ),cos(i'2,i' m+1 ),...,cos(i' m ,i' m+1 )),y] (11)
[0037] Among them, y is the label of the sample; the parameter weights of the prototype adaptive module are updated using the gradient descent method SGD, including W Q , W K , W V and the weight parameter of the fully connected layer FC in formula (9);
[0038] Step 4: Pseudo-incremental training
[0039] Repeat step1, step2, step3, the number of repetitions is N p ;
[0040] Step 3: Take the incremental task as a new task and update the model;
[0041] Step 1: Update the initial prototype matrix
[0042] Set the corresponding remote sensing image dataset of the series incremental recognition task as D 1 , D 2 , …, D t , the superscript represents the serial number of the incremental task, where the data set of each incremental task contains remote sensing image samples of different categories; for the feature extraction network and prototype adaptation module trained in step 1 and step 2, all their parameters are frozen and kept frozen in the subsequent incremental learning tasks; for each remote sensing image category newly added in the incremental learning task, the initial class prototype (e n+1 ,…,e n+m ) and add it as a row vector to the initial class prototype matrix (E t =(e1,e2,…,e n ,…,e n+m )), the superscript t indicates the incremental learning process, and m indicates the number of newly added categories. A row vector representing the newly added categories;
[0043] Step 2: Retraining Figure 1 The fully connected layer in
[0044] According to step 2 in step 2, retrain the fully connected layer through equations (5) and (6);
[0045] Step 3: For each test sample, it passes through the feature extraction network and the fully connected layer trained in step 3 Step 2 to obtain the query vector of the test sample; the query vector corresponding to the test sample and the quasi-orthogonal class prototype matrix E t spliced together and input into the prototype adaptation module to obtain a new query vector and quasi-orthogonal class prototype (I t ′), and then the classification vector V is obtained to predict the category of the test sample. The formula of the classification vector V is as follows
[0046] V=[cos(i1',i' n+m+1 ),cos(i'2,i' n+m+1 ),...,cos(i' n+m ,i' n+m+1 )] (12)
[0047] Among them, n is the number of basic categories, m is the number of incremental categories, i' p For the quasi-orthogonal prototype (I t ′), p = 1, ..., n + m, cos() is the cosine function, which is used to find the cosine distance between vectors, and its function form is the cosine function form in formula (6); the cosine distance between the query vector and the quasi-orthogonal class prototype corresponding to each category is obtained through V, and the category corresponding to the minimum value of the cosine distance of the query vector is the predicted category of the query vector; the cosine distance between the test sample and each category can be obtained from the composition of the classification vector V, and the category with the closest distance is the predicted result.
[0048] In a specific embodiment of the present invention, in Step 1, λ is a random value between 0.4 and 0.6.
[0049] The present invention proposes a remote sensing image classification method for a small sample increment scenario. The method realizes small sample incremental learning of remote sensing images through three parts: feature extraction network, hyperdimensional computing and adaptive attention. Using this method, the problems of overfitting and catastrophic forgetting in small sample increment scenarios can be effectively solved. Experiments on two commonly used remote sensing image datasets, MSTAR and NWPU-RESISC45, show that the method of the present invention is significantly superior to other methods, has obvious advantages in recognition accuracy, and has broad application prospects in remote sensing image classification in small sample increment scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is the overall framework diagram of the present invention;
[0051] Figure 2 It is the model structure of the feature extraction network;
[0052] Figure 3 is the schematic diagram of the prototype adaptive module;
[0053] Figure 4 Schematic diagram of the method for generating pseudo-incremental samples. DETAILED DESCRIPTION
[0054] The present invention will be further described below in conjunction with the accompanying drawings.
[0055] The present invention provides a remote sensing image classification method for a small sample increment scenario. The overall framework is as follows: Figure 1 As shown, the specific steps include the following steps.
[0056] Step 1: Pre-train the feature extraction network;
[0057] In the initial stage of model training, the first step is to obtain the basic dataset D for the basic task. 0 The feature extraction network is trained on the Figure 2 As shown in FIG. 1 , the basic data set consists of a large number of remote sensing images of different categories (the number of each type of remote sensing images is usually greater than one hundred). The convolution layer, Relu activation function layer, maximum pooling layer, global average pooling layer and regularization layer in the feature extraction network and their connection and control relationships are well known in the art and will not be described in detail. i Mapping from the original image space to the new embedding space is equivalent to an embedding function: In the formula represents the d-dimensional embedding vector, ψ represents the parameters of the feature extraction network, and f ψ (.) represents the feature extraction network, x represents the remote sensing image sample input to the feature extraction network, and h represents the output of the feature extraction network. 0 There are a large number of training samples on the network, so the feature extraction network can be better trained to extract useful information. The feature extraction network is connected to the cosine classifier. The weights of each type of the cosine classifier are composed of the initial prototype of the basic data set, and its loss function is:
[0058] L F =CE(cos(f ψ (x i ),E 0 ),y i) (1)
[0059] Where CE represents the cross entropy loss function well known in the art, and f ψ (x i ) means to convert x i Input to the feature extraction network, f ψ (.) represents the feature extraction network, the subscript i represents the sample number of the remote sensing image, and y i Represents the i-th remote sensing image sample x i The corresponding category label. 0 Denotes the basic data set D 0 The matrix composed of the initial prototypes of all classes in is called the initial class prototype matrix in the present invention. In the following description, E represents the initial class prototype matrix, but there are differences in the superscripts. Different superscripts represent the initial class prototype matrices obtained from different data sets. Generate the initial class prototype matrix E = e1, e2, ..., e n T The formula is, the superscript T represents the matrix rank:
[0060]
[0061] Among them, e1, e2, ..., e n They represent the row vectors of E, n represents the number of basic categories, and they represent the initial prototypes of remote sensing images of different categories. The subscript c represents the category, which represents the initial prototype of the remote sensing image of category c. c (D,ψ) represents the class prototype of the c-class sample obtained by using the feature extraction network and the sample dataset D, N c is the number of training samples of remote sensing images of type c, and In(·) is the selection indicator function representing the samples:
[0062]
[0063] The method for training the parameters of the feature extraction network is the gradient descent method well known in the art, and the parameters ψ of the feature extraction network are updated by minimizing the loss function of formula (1).
[0064] Step 2: Training Figure 1 The prototype adaptive module in Figure 3 As shown, it will be described in detail in the subsequent step 3;
[0065] A pseudo-incremental dataset is constructed to simulate the incremental process, and the pseudo-incremental dataset is used to train the prototype adaptive module according to the idea of meta-learning (Finn C, Abbeel P, Levine S. Model-agnostic meta-learning for fast adaptation of deepnetworks[C]. Proceedings of the 34th International Conference on Machine Learning-Volume 70. JMLR.org, 2017: 1126-1135.).
[0066] The specific steps include:
[0067] Step 1: Construction of meta-learning dataset
[0068] In the process of constructing the pseudo-incremental learning task dataset, we first start from the basic dataset D 0 Extract m types of samples from the training set S, the number of samples in each class is n, and divide the samples of each class into training set S t and the test set Q t , forming a sampling data set (S t ,Q t ). Using the method given in "H. Zhang, M. Cisse, Y. N. Dauphin, and D. Lopez-Paz,"mixup:Beyondempirical risk minimization,"arXiv preprint arXiv:1710.09412,2017.", we can extract the S t and Q t Generate training sets S of pseudo incremental data sets respectively p and the test set Q p samples and constitute a pseudo incremental data set (S p ,Q p ), Figure 4 An example showing how samples of a dataset are generated. Figure 4 As shown, the generating function of a certain type of pseudo-incremental samples can be expressed as:
[0069] x p =λx i +(1-λ)x j (i≠j) (4)
[0070] Among them, x i and x j is from the basic training set D 0Two training samples of different categories are randomly selected from the training set. The subscripts i and j represent the sequence numbers of the samples. i≠j means taking different samples of the same category. p is the generated pseudo-increment class sample, λ is the mixing coefficient, which is a random value between 0.4 and 0.6, used to reduce the similarity between the pseudo-increment class and the base class. Then, the training set S of the sampling data set and the pseudo-increment data set is used t and S p Together they form the meta-learning dataset D m The training set (S t and S p ), similarly, using the test set Q of the sampled data set and pseudo-incremental data set t and Q p The samples are combined together to form the meta-learning dataset D m The test set (Q t and Q p ), the “merge” mentioned above is simply combining the samples of the two data sets together.
[0071] Step 2: Obtain the quasi-orthogonal prototype matrix
[0072] After obtaining the training set (S t and S p ) and the test set (Q t and Q p ), then generate the initial class prototype matrix E corresponding to the meta-learning dataset based on formula (2) p , where the superscript P represents the initial class prototype matrix in the meta-learning training process. Replace the dataset D in (2) with the meta-learning dataset D m , and take the samples of the training set, then we can get the initial class prototype matrix E corresponding to the meta-learning data set through formula (2) p The row vectors of c (D t ,ψ)). Then, according to the principle of hyperdimensional computing (P. Kanerva, "Hyperdimensional computing: An introduction to computing in distributed representation with high-dimensional random vectors," Cognitive computation, vol. 1, pp. 139-159, 2009.), the initial prototype matrix E is converted into p Convert to quasi-orthogonal prototype matrix P p :
[0073] Pp =sign(E p ) (5)
[0074] Where sign() represents the sign function, P p represents the quasi-orthogonal prototype matrix obtained by projecting the initial prototype into the hyperdimensional space, and the superscript P represents the quasi-orthogonal prototype matrix corresponding to the meta-learning training stage. In the following description, P represents the quasi-orthogonal prototype matrix, and its superscript represents different training processes. After obtaining the quasi-orthogonal prototype, because the operation of the symbol function is not differentiable, it cannot be directly converted into a quasi-orthogonal prototype matrix using the symbol function. Therefore, the method used in the present invention is to use a trained fully connected layer to convert E p Convert to P p During the training process of the fully connected layer, the training loss function L1(θ; P, E) of the fully connected layer is:
[0075]
[0076] Among them, P and E represent the quasi-orthogonal prototype matrix and the initial prototype matrix respectively. represents the number of row vectors in P and E, that is, the number of categories, g θ g θ (e i ), which represents a fully connected layer with a weight parameter of θ. i and p i denote the row vectors of P and E respectively. The cosine function cos() is used to calculate the cosine distance between two vectors, as shown in formula (6), which is used to obtain p i and g θ (e i ), where |||| represents the magnitude of the vector. (·) T represents the transpose of the matrix. The update of the parameter θ of the fully connected layer is as follows:
[0077]
[0078] Where the superscript m represents the number of update iterations, β is the update rate, and L1(θ; P, E) represents the loss function of the fully connected layer. After M iterations, the weight parameter θ of the fully connected layer is fixed, and then E is calculated by p As the input of the fully connected layer, the quasi-orthogonal prototype matrix P in the meta-learning training phase can be obtained from the output of the fully connected layer. p .
[0079] Step 3: Train the parameters of the prototype adaptive module
[0080] After getting the quasi-orthogonal prototype matrix P pAfter that, the query vector of the training set sample and P p The query vector is the embedding vector obtained after the training samples of the training set are processed by the feature extraction network and the fully connected layer, as shown in Figure 3 The structural combination of the prototype adaptive module Figure 3 Provide explanation.
[0081] First, P p and the query vector together as the input I of the prototype adaptation module, such as Figure 3 The structure shown in FIG. 1 (the vector concatenation method is well known to those skilled in the art), by respectively combining the input I with the first query matrix Second query matrix The third query matrix Multiply them together to get the input query matrix Q, key matrix K and value matrix V. Represents a d×d dimensional real matrix, as shown below:
[0082]
[0083] Among them, q1,q2,...,q n+1 ,k1,k2,...,k n+1 、v1,v2,...,v n+1 Respectively represent the row vectors of matrices Q, K, and V. The subscript n+1 represents the number of vectors, and n represents the number of class prototypes. i1,i2,...,i n+1 Respectively represent the row vectors of input I. Then the query matrix Q is multiplied by the key matrix K, and QK T Scale the value (divide by α is a scaling factor), and the Softmax function well known in the art (Murphy, KP (2012). Machine Learning: A Probabilistic Perspective. MIT Press. (Chapter 8.5.1)) is used to After processing, the attention weights between each input row vector and itself and other row vectors are obtained. The purpose of scaling is to ensure the stability of the value. After obtaining the attention weights, the attention weights are multiplied by the value matrix V, and then linearly transformed through a fully connected (FC) layer to obtain the corresponding input change ΔI. This process can be expressed as:
[0084]
[0085] Among them, FC represents the fully connected layer in the prototype adaptation module. The final output of the prototype adaptation module is
[0086]
[0087] The prototype adaptive module is a data processing module proposed by the present invention, which performs the following steps: Figure 3 The data processing flow shown in Figure 2 is as follows. The prototype adaptive module can adaptively adjust the quasi-orthogonal class prototype and query vector according to the context information to make the decision boundary of the model more reasonable. After obtaining I', the row vectors of the first m rows (i1′, i′2, …, i′ m ) as the weight of the cosine classifier, the m+1th row vector i′ of I′ m+1 As the new query vector, replace the row vectors of the first m rows (i′1, i′2, …, i′ m ) as the weight of the cosine classifier, and calculate the row vector of the first m rows of I' and i' m+1 The cosine distance between them is used to obtain its classification vector, and then the cross entropy loss function CE (Murphy, KP (2012). Machine Learning: A Probabilistic Perspective. MIT Press. (Chapter 8)) known in the art is used to obtain the cross entropy loss L between the classification vector and the sample label y of the query vector, as shown in formula (11).
[0088] L=CE[(cos(i1',i' m+1 ),cos(i'2,i' m+1 ),...,cos(i' m ,i' m+1 )),y] (11)
[0089] Where y is the label of the sample. Then, the well-known gradient descent method SGD (Murphy, KP (2012). Machine Learning: A Probabilistic Perspective. MIT Press. (Chapter 14)) is used to update the parameter weights of the prototype adaptive module, including W Q , W K , W V and the weight parameter of the fully connected layer FC in formula (9).
[0090] Step 4: Pseudo-incremental training
[0091] Repeat step1, step2, step3, the number of repetitions is N p It should be noted that in each repetition process, each sampling data set is randomly sampled from the basic data set, so the data set for training the prototype adaptive module each time is also different.
[0092] Step 3: Take the incremental task as a new task and update the model of the present invention.
[0093] Step 1: Update the initial prototype matrix
[0094] Set the corresponding remote sensing image dataset of the series incremental recognition task as D 1 , D 2 , …, D t , the superscript represents the serial number of the incremental task, where the data set of each incremental task contains remote sensing image samples of different categories. For the feature extraction network and prototype adaptive module trained in step 1 and step 2, freeze all their parameters (that is, all the parameters of the trained feature extraction network and prototype adaptive module), and keep them frozen in the subsequent incremental learning tasks. For the newly added remote sensing image category in each incremental learning task (that is, the remote sensing image category that is not in the basic data set), find the initial class prototype (e) corresponding to the newly added category according to formula (2) n+1 ,…,e n+m ) and add it as a row vector to the initial class prototype matrix (E t =(e1,e2,…,e n ,…,e n+m )), the superscript t indicates the incremental learning process, and m indicates the number of newly added categories. A row vector representing the newly added categories.
[0095] Step 2: Retraining Figure 1 The fully connected layer in
[0096] According to step 2 in step 2, retrain the fully connected layer through equations (5) and (6).
[0097] Step 3: For each test sample, Figure 1 As shown in , the query vector of the test sample is obtained by passing through the feature extraction network and the fully connected layer trained in step 3 Step 2. Figure 3 As shown, the query vector corresponding to the test sample and the quasi-orthogonal class prototype matrix E t spliced together and input into the prototype adaptation module to obtain a new query vector and quasi-orthogonal class prototype (I t ′), and then the classification vector V is obtained to predict the category of the test sample. The formula of the classification vector V is as follows
[0098] V=[cos(i1',i' n+m+1 ),cos(i'2,i' n+m+1 ),...,cos(i' n+m ,i' n+m+1 )] (12)
[0099] Among them, n is the number of basic categories, m is the number of incremental categories, i' p For the quasi-orthogonal prototype (I t ′), p=1,…,n+m, cos() is the cosine function, which is used to find the cosine distance between vectors. Its function form is the cosine function form in formula (6). The cosine distance between the query vector and the quasi-orthogonal class prototype corresponding to each category can be obtained through V, and the category corresponding to the minimum value of the cosine distance of the query vector is the predicted category of the query vector (test sample). The cosine distance between the test sample and each category can be obtained from the composition of the classification vector V. For example, V=[0.7,0.2,0.2,0.3,0.1] indicates that the distance to the fifth category is the closest, and the predicted result is the fifth category.
Claims
1. A remote sensing image recognition method in a few-sample incremental learning scenario, characterized in that: Specifically include the following steps: Step 1: Pre-train the feature extraction network; On the basic dataset D for basic tasks 0 The feature extraction network is trained on the basis of a large number of remote sensing images of different categories. Each remote sensing image sample xi is mapped from the original image space to the new embedding space through the feature extraction network, which is equivalent to an embedding function: In the formula represents the d-dimensional embedding vector, ψ represents the parameters of the feature extraction network, and f ψ (.) represents the feature extraction network, x represents the remote sensing image sample input to the feature extraction network, and h represents the output of the feature extraction network; the feature extraction network is connected to the cosine classifier, and the weights of each type of the cosine classifier are composed of the initial prototype of the basic data set, and its loss function is: IT F =CE(cos(f ψ (x i ),E 0 ),y i ) (1) Where CE represents the cross entropy loss function well known in the art, and f ψ (x i ) means to convert x i Input to the feature extraction network, f ψ (.) represents the feature extraction network, the subscript i represents the sample number of the remote sensing image, and y i represents the category label corresponding to the i-th remote sensing image sample xi; E 0 Denotes the basic data set D 0 The initial prototype matrix of all classes in the class is formed by the initial prototypes; the initial prototype matrix E = e1, e2, ..., e n T The formula is, the superscript T represents the matrix rank: Among them, e1, e2, ..., e n They represent the row vectors of E, n represents the number of basic categories, and they represent the initial prototypes of remote sensing images of different categories. The subscript c represents the category, which represents the initial prototype of the remote sensing image of category c. c (D,ψ) represents the class prototype of the c-class sample obtained by using the feature extraction network and the sample dataset D, N c is the number of training samples of remote sensing images of type c, and In(·) is the selection indicator function representing the samples: The method for training the parameters of the feature extraction network is the gradient descent method, which updates the parameters ψ of the feature extraction network by minimizing the loss function of formula (1); Step 2: training the prototype adaptive module; The specific steps include: Step 1: Construction of meta-learning dataset From the basic data set D 0 Extract m types of samples from the training set S, the number of samples in each class is n, and divide the samples of each class into training set S t and the test set Q t , forming a sampling data set (S t ,Q t );From the sampled data set S t and Q t Generate training sets S of pseudo incremental data sets respectively p and the test set Q p samples and constitute a pseudo incremental data set (S p ,Q p ); The generating function of a certain type of pseudo-incremental sample is expressed as: x p =λx i +(1-λ)x j (i≠j) (4) Among them, x i and x j is from the basic training set D 0 Two training samples of different categories are randomly selected from the , the subscripts i and j represent the sequence numbers of the samples, i≠j means taking different samples of the same category; p is the generated pseudo-incremental sample, λ is the mixing coefficient; then the training set S of the sampling data set and the pseudo-incremental data set is used t and S p Together they form the meta-learning dataset D m The training set (S t and S p ), similarly, using the test set Q of the sampled data set and pseudo-incremental data set t and Q p The samples are combined together to form the meta-learning dataset D m The test set (Q t and Q p ); Step 2: Obtain the quasi-orthogonal prototype matrix After obtaining the training set (S t and S p ) and the test set (Q t and Q p ), then generate the initial class prototype matrix E corresponding to the meta-learning dataset based on formula (2) p , where the superscript P represents the initial class prototype matrix in the meta-learning training process; replace the dataset D in formula (2) with the meta-learning dataset D m , and take the samples of the training set, that is, the initial class prototype matrix E corresponding to the meta-learning data set can be obtained through formula (2) p Each row vector of ; then according to the principle of hyperdimensional computing, the initial class prototype matrix E is converted into p Convert to quasi-orthogonal prototype matrix P p : P p =sign(E p ) (5) Where sign() represents the sign function, P p represents the quasi-orthogonal prototype matrix obtained by projecting the initial prototype into the hyperdimensional space, and the superscript P represents the quasi-orthogonal prototype matrix corresponding to the meta-learning training stage; after obtaining the quasi-orthogonal prototype, a trained fully connected layer is used to transform E p Convert to P p ; During the training process of the fully connected layer, the training loss function L1(θ; P, E) of the fully connected layer is: Among them, P and E represent the quasi-orthogonal prototype matrix and the initial prototype matrix respectively. represents the number of row vectors in P and E, that is, the number of categories, g θ g θ (e i ), which represents a fully connected layer with a weight parameter of θ; e i and p i denote the row vectors of P and E respectively; the cosine function cos() is used to calculate the cosine distance between two vectors, as shown in formula (6), which is used to obtain p i and g θ (e i ), |||| represents the modulus of the vector; (·) T represents the transpose of the matrix; the update of the parameter θ of the fully connected layer is as follows: Where the superscript m represents the number of update iterations, β is the update rate, and L1(θ; P, E) represents the loss function of the fully connected layer. After M iterations, the weight parameter θ of the fully connected layer is fixed, and then E is used to p As the input of the fully connected layer, the quasi-orthogonal prototype matrix P in the meta-learning training phase can be obtained from the output of the fully connected layer. p ; Step 3: Train the parameters of the prototype adaptive module The query vector and P of the training set samples p The query vector is the embedding vector obtained after the training samples of the training set are processed by the feature extraction network and the fully connected layer. P p and query vector together as the input I of the prototype adaptive module, by respectively combining the input I with the first query matrix Second query matrix The third query matrix Multiply them together to get the input query matrix Q, key matrix K and value matrix V. Represents a d×d dimensional real matrix, as shown below: Among them, q1,q2,...,q n+1 ,k1,k2,...,k n+1 、v1,v2,...,v n+1 Respectively represent the row vectors of matrices Q, K, and V. The subscript n+1 represents the number of vectors, and n represents the number of class prototypes; i1,i2,...,i n+1 Represents the row vector of input I respectively; then multiply the query matrix Q by the key matrix K, and pass QK T The value is scaled by dividing α is the scaling factor, and the Softmax function is used to Processing is performed to obtain the attention weights between each input row vector and itself and other row vectors; the attention weights are multiplied by the value matrix V, and then linearly transformed through a fully connected FC layer to obtain the corresponding input change ΔI; this process is expressed as: Among them, FC represents the fully connected layer in the prototype adaptive module; the final output I' of the prototype adaptive module is: I'=I+ΔI (10) The prototype adaptive module executes the data processing flow; the row vectors of the first m rows of I' (i1′, i′2, …, i′ m ) as the weight of the cosine classifier, the m+1th row vector i′ of I′ m+1 As the new query vector, replace the row vectors of the first m rows (i′1, i′2, …, i′ m ) as the weight of the cosine classifier, and calculate the row vector of the first m rows of I' and i' m+1 The cosine distance between them is used to obtain its classification vector; the cross entropy loss function CE is used to obtain the cross entropy loss L between the classification vector and the sample label y of the query vector, as shown in formula (11); L=CE[(cos(i′1,i' m+1 ),cos(i'2,i' m+1 ),...,cos(i' m ,i' m+1 )),y] (11) Among them, y is the label of the sample; the parameter weights of the prototype adaptive module are updated using the gradient descent method SGD, including W Q , W K , W V and the weight parameter of the fully connected layer FC in formula (9); Step 4: Pseudo-incremental training Repeat step1, step2, step3, the number of repetitions is N p ; Step 3: Take the incremental task as a new task and update the model; Step 1: Update the initial prototype matrix Set the corresponding remote sensing image dataset of the series incremental recognition task as D 1 , D 2 , …, D t , the superscript represents the serial number of the incremental task, where the data set of each incremental task contains remote sensing image samples of different categories; for the feature extraction network and prototype adaptation module trained in step 1 and step 2, all their parameters are frozen and kept frozen in the subsequent incremental learning tasks; for each remote sensing image category newly added in the incremental learning task, the initial class prototype (e n+1 ,…,e n+m ) and add it as a row vector to the initial class prototype matrix (E t =(e1,e2,…,e n ,…,e n+m )), the superscript t indicates the incremental learning process, and m indicates the number of newly added categories. A row vector representing the newly added categories; Step 2: Retrain the fully connected layer in Figure 1 According to step 2 in step 2, retrain the fully connected layer through equations (5) and (6); Step 3: For each test sample, it passes through the feature extraction network and the fully connected layer trained in step 3 Step 2 to obtain the query vector of the test sample; the query vector corresponding to the test sample and the quasi-orthogonal class prototype matrix E t spliced together and input into the prototype adaptation module to obtain a new query vector and quasi-orthogonal class prototype (I′ t ), and then obtain the classification vector V to predict the category of the test sample. The formula of the classification vector V is as follows V=[cos(i′1,i' n+m+1 ),cos(i'2,i' n+m+1 ),...,cos(i' n+m ,i' n+m+1 )] (12) Among them, n is the number of basic categories, m is the number of incremental categories, i' p is the quasi-orthogonal prototype (I′ t ), p = 1, ..., n + m, cos() is the cosine function, which is used to find the cosine distance between vectors, and its function form is the cosine function form in formula (6); the cosine distance between the query vector and the quasi-orthogonal class prototype corresponding to each category is obtained through V, and the category corresponding to the minimum value of the cosine distance of the query vector is the predicted category of the query vector; the cosine distance between the test sample and each category can be obtained from the composition of the classification vector V, and the category with the closest distance is the prediction result.
2. The remote sensing image recognition method in a few-sample incremental learning scenario as claimed in claim 1, characterized in that: In Step 1, λ is a random value between 0.4 and 0.6.
Citation Information
Cited By
Small sample class increment gait recognition method in multi-activity scene
CN119475068A
Small sample incremental fault diagnosis method based on prototype adaptive network
CN119848619A
A small sample incremental fault diagnosis method based on prototype adaptive network
CN119848619B
Test time self-adaptive small sample increment action recognition method and device
CN121640566A
