A cross-domain small sample image recognition method based on feature transformation and statistical correction
By embedding FiLM and RSA transform layers and LLA functions into a deep convolutional network, the problem of feature transfer difficulties in cross-domain few-shot learning is solved, achieving efficient and robust image recognition results on the target task.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-03
- Publication Date
- 2026-04-07
AI Technical Summary
Existing cross-domain few-shot learning methods struggle to effectively transfer features when the data distributions in the target and source domains are inconsistent, leading to a decline in the model's recognition performance on the target task.
We employ a deep convolutional network model based on feature transformation and statistical correction. By embedding a feature linear transformation layer (FiLM) and a residual nonlinear transformation layer (RSA) into the deep convolutional network, and combining it with a nonparametric nonlinear activation function (LLA), we achieve feature transformation at both the task level and the dataset level, thus adapting to the target task.
This method achieves robust cross-domain few-sample classification and recognition even when there is very little labeled training data for the target task. It is computationally simple, highly efficient in optimization, widely applicable, and does not depend on the similarity of data distribution between the source and target domains.
Smart Images

Figure CN116844021B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of machine learning and computer vision technology, and more specifically, to a method, apparatus, and medium for cross-domain small sample image recognition based on feature transformation and statistical correction. Background Technology
[0002] Currently, research on few-shot classification and recognition problems is deepening, and meta-learning (also known as few-shot learning) methods are rapidly developing in model construction and algorithm design, such as prototype-based learning models, matching network-based learning models, and model-independent meta-learning algorithms. These models and algorithms have greatly advanced the development of few-shot learning and improved the performance of few-shot classification and recognition. The application of these classic models is based on the premise that the target task data of interest and the large-scale dataset (source domain data) used to train the auxiliary model have the same data distribution. Otherwise, the model learned on the source domain is difficult to effectively transfer to the target task, that is, the model is unable to extract effective data features on the target task to complete the target task.
[0003] Transfer learning is a feasible strategy for addressing situations where the target task data and source domain data have inconsistent distributions. Traditional transfer learning assumes that the data categories in the target task are the same as those in the source domain, but the data have different properties, such as natural images in the source domain and sketches in the target domain. Therefore, the main strategy for transfer learning is to find a common projection space where data of the same category from both the source and target domains have small distances, while data from different categories have large distances. The model can then be trained using source domain data in this space, and once the model has learned, it can be applied to target domain data within this space to complete the target task. However, this learning strategy is no longer applicable when the target and source domain data do not have the same category distribution, because it is impossible to create a model in the projection subspace where data of the same category are close together and data of different categories are far apart.
[0004] Therefore, cross-domain few-shot learning has become a recent research hotspot. Cross-domain few-shot learning primarily addresses the problem of effective model learning when the data and categories in the source domain and the target domain have different distributions. Existing research methods mainly focus on the following two types:
[0005] One approach is to learn multiple models from multiple source domains to construct general cross-domain features. This could involve learning separate feature extraction models in different source domains and then concatenating the features from each model to form a general cross-domain feature; or combining a basic feature extraction model with a domain adaptation module, training on different source domains to obtain features from those different source domains. Ultimately, this strategy constructs features suitable for the target domain task by combining features generated by models from different source domains.
[0006] Another approach is to train the model directly on a single source domain and then transfer the model to the target domain task through a transfer module. This could involve first pre-training the model on the source domain and then fine-tuning the model parameters using a small amount of data from the target domain task, or fixing the parameters learned by the model on the source domain and then optimizing the transfer module parameters using a small amount of data from the target domain task. This would enable the transfer module to effectively adjust the features extracted by the model to meet the requirements of the target domain task.
[0007] The background description provided herein is for the purpose of generally presenting the context of this disclosure. Unless otherwise indicated herein, the material described in this section is not prior art to the claims of this application and should not be acknowledged as prior art by virtue of its inclusion in this section. Summary of the Invention
[0008] To address the aforementioned technical problems in related technologies, this invention proposes a cross-domain small sample image recognition method based on feature transformation and statistical correction, which includes the following steps:
[0009] S1, acquire the image to be recognized;
[0010] S2, input the image to be recognized into a pre-trained deep convolutional network model based on feature transformation and statistical correction, and output the recognition result. The deep convolutional network model based on feature transformation and statistical correction includes:
[0011] A first-level deep convolutional network model f θ , where θ is its parameter, and f θ It consists of NUM concatenated convolutional blocks, where NUM is a positive integer greater than 2. Each convolutional block consists of a convolutional layer, a batch normalization layer (BN), a ReLU nonlinear activation layer, and a maximum convergence layer, which are concatenated in sequence.
[0012] An LLA transform module is connected to the first deep convolutional network model f. θ Subsequently, the LLA conversion module is as follows:
[0013] Where v is the independent variable, k>0 is the hyperparameter controlling the first gradient of σ(v), which indicates that LLA is a Lipschitz continuous function on the half-open interval (-∞,0) and (0,+∞), and 1+k is the corresponding Lipschitz constant.
[0014] A feature transformation module FiLM is added after the BN layer of the first NUM_FiLM convolutional blocks in the first deep convolutional network model. The feature transformation module is used to perform scaling transformation on the output of the BN layer. A residual transformation module RSA is added to each of the last NUM_RSA convolutional blocks in the first deep convolutional network model. The RSA module is used to perform residual calculation on the input features input to the NUM_RSA convolutional blocks.
[0015] A classifier is provided to classify the output of the LLA transform module to output a recognition result.
[0016] Specifically, the FiLM module is as follows:
[0017] The FiLM transform can be represented as the following linear operation:
[0018] u′ l =α⊙u l
[0019] In the formula ⊙ represents element-wise broadcast dot product, that is, the element-wise multiplication of α with u in each dimension. l All h in the corresponding dimension l ×w l Multiplying elements together; u l For the first depthwise convolutional network f θ The output features of the BN layer of the l-th convolutional block.
[0020] Specifically, the RSA module is implemented using the following residual method:
[0021] u′ l′ =Γ(u l′-1 ;ζ l′ )+u l′
[0022] In the formula Γ(u l′-1 ;ζ l′ To construct u l′-1 with u l′ The residual connection between them is a matrix multiplication operation, where u l′-1 u l′ These are the l′-1 and l′ first depth convolutional networks f, respectively. θ Output features of the BN layer of the l′-th convolutional block.
[0023] Specifically, the training process of the deep convolutional network model based on feature transformation and statistical correction is as follows:
[0024] S21, in the source domain Training the first deep convolutional network model f θObtain the first deep convolutional network model f that achieves the preset accuracy. θ The parameter θ;
[0025] S21, with the parameter θ fixed, train the deep convolutional network model based on feature transformation and statistical correction in the target domain to obtain the parameters {α,ζ} of the FiLM module and the RSA module.
[0026] Secondly, another embodiment of the present invention discloses a method for training a deep convolutional network model based on feature transformation and statistical correction, which includes the following steps:
[0027] S1, in the source domain Training the first deep convolutional network model f θ Obtain the first deep convolutional network model f that achieves the preset accuracy. θ The parameter θ; wherein the first depthwise convolutional network model f θ It includes: NUM concatenated convolutional blocks, where NUM is a positive integer greater than 2, and each convolutional block consists of a convolutional layer, a batch normalization layer (BN), a ReLU nonlinear activation layer, and a maximum convergence layer concatenated in sequence;
[0028] S2, with parameters θ fixed, train the deep convolutional network model based on feature transformation and statistical correction in the target domain to obtain the parameters {α,ζ} of the FiLM module and RSA module; wherein the deep convolutional network model based on feature transformation and statistical correction includes:
[0029] An LLA transform module is connected to the first deep convolutional network model f. θ Subsequently, the LLA conversion module is as follows:
[0030] Where v is the independent variable, k>0 is the hyperparameter controlling the first gradient of σ(v), which indicates that LLA is a Lipschitz continuous function on the half-open interval (-∞,0) and (0,+∞), and 1+k is the corresponding Lipschitz constant.
[0031] A feature transformation module FiLM is added after the BN layer of the first NUM_FiLM convolutional blocks in the first deep convolutional network model. The feature transformation module is used to perform scale transformation on the output of the BN layer.
[0032] A residual transformation module (RSA) is added to each of the last NUM_RSA convolutional blocks in the first deep convolutional network model. The RSA module is used to perform residual calculation on the input features input to the NUM_RSA convolutional blocks.
[0033] A classifier is provided to classify the output of the LLA transformation module to output a recognition result.
[0034] Specifically, in step S1, the first deep convolutional network model f... θ The training uses the following loss function:
[0035]
[0036] In the formula, Z represents the number of training set data, and l() is the cross-entropy loss function. Given the data from the training set and the corresponding category labels, P w The classifier is removed after the optimal θ is obtained.
[0037] Specifically, in step S2, the deep convolutional network model based on feature transformation and statistical correction is trained in the target domain using the support set. Minimize the following objective function:
[0038]
[0039] In the formula (x i ,y i ) for tasks support set The image and its corresponding class label, l() is the cross-entropy loss function, σ() is the LLA transform, P is the nearest class center classifier, f θ,α,ζ (x i The deep convolutional network based on feature transformation and statistical correction is applied to the input object x. i The various centers are obtained through the following formula:
[0040]
[0041] In the formula, j∈{1,2,…,N} are the class labels, N is the number of classes, K is the number of training samples in each class, σ() is the LLA transform, and 1(y i =j) is an indicator function, when y i Returns 1 if the category is j, otherwise 0.
[0042] Thirdly, another embodiment of the present invention discloses a cross-domain small sample image recognition device based on feature transformation and statistical correction, which includes the following units:
[0043] An image acquisition unit is used to acquire the image to be recognized.
[0044] A recognition unit is used to input the image to be recognized into a pre-trained deep convolutional network model based on feature transformation and statistical correction, and output the recognition result. The deep convolutional network model based on feature transformation and statistical correction includes:
[0045] A first-level deep convolutional network model f θ , where θ is its parameter, and f θ It consists of NUM concatenated convolutional blocks, where NUM is a positive integer greater than 2. Each convolutional block consists of a convolutional layer, a batch normalization layer (BN), a ReLU nonlinear activation layer, and a maximum convergence layer, which are concatenated in sequence.
[0046] An LLA transform module is connected to the first deep convolutional network model f. θ Subsequently, the LLA conversion module is as follows:
[0047] Where v is the independent variable, k>0 is the hyperparameter controlling the first gradient of σ(v), which indicates that LLA is a Lipschitz continuous function on the half-open interval (-∞,0) and (0,+∞), and 1+k is the corresponding Lipschitz constant.
[0048] A feature transformation module FiLM is added after the BN layer of the first NUM_FiLM convolutional blocks in the first deep convolutional network model. The feature transformation module is used to perform scaling transformation on the output of the BN layer. A residual transformation module RSA is added to each of the last NUM_RSA convolutional blocks in the first deep convolutional network model. The RSA module is used to perform residual calculation on the input features input to the NUM_RSA convolutional blocks.
[0049] A classifier is provided to classify the output of the LLA transformation module to output a recognition result.
[0050] Specifically, the FiLM module is as follows:
[0051] The FiLM transform can be represented as the following linear operation:
[0052] i′ l =α⊙u l
[0053] In the formula ⊙ represents element-wise broadcast dot product, that is, the element-wise multiplication of α with u in each dimension. l All h in the corresponding dimension l ×w l Multiplying elements together; u l For the first depthwise convolutional network f θ The output features of the BN layer of the l-th convolutional block;
[0054] Specifically, the RSA module is implemented using the following residual method:
[0055] u′ l′ =Γ(u l′-1 ;ζ l′ )+u l′
[0056] In the formula Γ(u l′-1 ;ζ l′ To construct u l′-1 with u l′ The residual connection between them is a matrix multiplication operation, where u l′-1 u l′ These are the l′-1 and l′ first depth convolutional networks f, respectively. θ Output features of the BN layer of the l′-th convolutional block.
[0057] Fourthly, another embodiment of the present invention discloses a non-volatile storage medium storing instructions, which, when executed by a processor, are used to implement a cross-domain few-sample image recognition method based on feature transformation and statistical correction as described above, or a deep convolutional network model training method based on feature transformation and statistical correction as described above.
[0058] The present invention provides a cross-domain few-shot image recognition method based on feature transformation and statistical correction. This method achieves task-level feature transformation by embedding a Feature Linear Transform (FiLM) layer and a Residual Nonlinear Transform (RSA) layer onto a deep convolutional network. Furthermore, a nonparametric nonlinear activation function (LAA) is used to statistically correct the activation state of the network output features, achieving dataset-level feature transformation. This method effectively enables cross-domain few-shot classification and recognition tasks, achieving robust classification and recognition even when the target task has very little labeled training data.
[0059] The method of this invention first optimizes the model using other large-scale datasets (also known as source domain data) to equip the model with certain prior knowledge. Then, it fine-tunes the model at the task level and dataset level by using a small amount of labeled data from the target task, making the features generated by the model suitable for the target task. This embodiment of the method is characterized by its computational simplicity, high optimization efficiency, and robust performance. Furthermore, it does not require the source domain data to have the same or similar distribution characteristics as the target task data, further expanding the applicability of this embodiment. Attached Figure Description
[0060] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0061] Figure 1 This is a flowchart of a cross-domain small sample image recognition method based on feature transformation and statistical correction provided in an embodiment of the present invention;
[0062] Figure 2 This is a schematic diagram of a deep convolutional network model based on feature transformation and statistical correction provided in an embodiment of the present invention;
[0063] Figure 3 This is a schematic diagram of a convolutional block provided in an embodiment of the present invention;
[0064] Figure 4 This is a schematic diagram of the FiLM transform provided in an embodiment of the present invention;
[0065] Figure 5 This is a schematic diagram of RSA feature transformation provided in an embodiment of the present invention;
[0066] Figure 6 This is a schematic diagram of the LLA function provided in an embodiment of the present invention;
[0067] Figure 7 This is a schematic diagram of the first derivative function of LLA provided in an embodiment of the present invention, which is a function graph on the symmetric interval [-2, 2].
[0068] Figure 8 This is a schematic diagram of the first derivative function of LLA provided in an embodiment of the present invention, which is a function graph on the interval [0, 6].
[0069] Figure 9 This is a schematic diagram of the CONV4 network structure provided in an embodiment of the present invention;
[0070] Figure 10 This is a schematic diagram of the training method for a deep convolutional network model based on feature transformation and statistical correction provided in an embodiment of the present invention;
[0071] Figure 11 This is a schematic diagram of a cross-domain small sample image recognition method and device based on feature transformation and statistical correction provided in an embodiment of the present invention. Detailed Implementation
[0072] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention are within the scope of protection of the present invention.
[0073] Example 1
[0074] refer to Figure 1 This embodiment discloses a cross-domain small sample image recognition method based on feature transformation and statistical correction, which includes the following steps:
[0075] S1, acquire the image to be recognized;
[0076] Specifically, in this embodiment, the image to be identified can be acquired through a sensor. For example, in medical image recognition, the image to be identified can be acquired through a medical imaging device. In another embodiment, the medical imaging device can also acquire medical images and send them to a server or computing device for image recognition.
[0077] In another embodiment, the image to be identified in this embodiment can also be a remote sensing image, which is acquired by a corresponding sensor.
[0078] Specifically, in this embodiment, images can be directly acquired from the sensor output, or the sensor can upload and store the acquired images in a computing device, which can then acquire the image to be recognized.
[0079] S2, input the image to be recognized into a pre-trained deep convolutional network model based on feature transformation and statistical correction, and output the recognition result. The deep convolutional network model based on feature transformation and statistical correction includes:
[0080] A first-level deep convolutional network model f θ , where θ is its parameter, and f θ It consists of NUM concatenated convolutional blocks, where NUM is a positive integer greater than 2. Each convolutional block consists of a convolutional layer, a batch normalization layer (BN), a ReLU nonlinear activation layer, and a maximum convergence layer, which are concatenated in sequence.
[0081] An LLA transform module is connected to the first deep convolutional network model f. θ Subsequently, the LLA conversion module is as follows:
[0082] Where v is the independent variable, K>0 is the hyperparameter controlling the first gradient of σ(v), which indicates that LLA is a Lipschitz continuous function on the half-open interval (-∞,0) and (0,+∞), and 1+k is the corresponding Lipschitz constant.
[0083] A feature transformation module FiLM is added after the BN layer of the first NUM_FiLM convolutional blocks in the first deep convolutional network model. The feature transformation module is used to perform scaling transformation on the output of the BN layer. A residual transformation module RSA is added to each of the last NUM_RSA convolutional blocks in the first deep convolutional network model. The RSA module is used to perform residual calculation on the input features input to the NUM_RSA convolutional blocks.
[0084] A classifier is provided to classify the output of the LLA transformation module to output a recognition result.
[0085] In one implementation, NUM = NUM_FiLM + NUM_RSA.
[0086] Those skilled in the art will know that the first deep convolutional network model f θ , where θ is its parameter, and f θ It consists of NUM concatenated convolutional blocks, where NUM is a positive integer greater than 2. Each convolutional block consists of a convolutional layer (conv), a batch normalization layer (BN), a ReLU nonlinear activation layer, and a pooling maximization layer (pool) concatenated in sequence.
[0087] The deep convolutional network model in this embodiment, in the first deep convolutional network model f θ The optimization includes: an LLA transform module, which is connected to the first deep convolutional network model f. θ Subsequently, the LLA conversion module is as follows:
[0088] Where v is the independent variable, k>0 is the hyperparameter controlling the first gradient of σ(v), which indicates that LLA is a Lipschitz continuous function on the half-open interval (-∞,0) and (0,+∞), and 1+k is the corresponding Lipschitz constant.
[0089] A feature transformation module FiLM is added after the BN layer of the first NUM_FiLM convolutional blocks in the first deep convolutional network model. The feature transformation module is used to perform scale transformation on the output of the BN layer.
[0090] A residual transformation module (RSA) is added to each of the last NUM_RSA convolutional blocks in the first deep convolutional network model. The RSA module is used to perform residual calculation on the input features input to the NUM_RSA convolutional blocks.
[0091] refer to Figure 2 , Figure 2 This is a schematic diagram of the deep convolutional network model in this embodiment. This embodiment uses two convolutional blocks for illustration. As those skilled in the art will know, the first deep convolutional network model can have more than two convolutional blocks.
[0092] refer to Figure 2 A feature transformation module FiLM is added after the BN layer of the first convolutional block. The feature transformation module FiLM is used to perform scaling transformation on the output of the BN layer.
[0093] Assume a first depthwise convolutional network f θ The output features of the BN layer of the l-th convolutional block are Where c l ,h l and w l Let be the feature dimension, feature length, and feature width, respectively. Then the FiLM transform can be expressed as the following linear operation:
[0094] u′ l =α⊙u l (1)
[0095] In the formula ⊙ represents element-wise broadcast dot product, that is, the element-wise multiplication of α with u in each dimension. l All h in the corresponding dimension l ×w l Multiplying each element together. This operation performs a scaling transformation on the original features. Figure 4 This is a schematic diagram of the FiLM module.
[0096] In this embodiment, this operation is applied to the first depthwise convolutional network f. θ After the BN layer in the front-end convolutional block, it is used to change the property of feature distribution.
[0097] In this embodiment, the front-end convolutional block is the first convolutional block. As those skilled in the art know, when the first depthwise convolutional network has more than two convolutional blocks, its front-end convolutional block can be divided according to the number of convolutional blocks in the first depthwise convolutional network.
[0098] Since the features learned by the convolutional blocks at the front end of a deep convolutional network generally have strong commonalities, that is, the features learned on different datasets (or domains) are not significantly different, feature transfer can be achieved well through simple linear scaling.
[0099] While the FiLM transform module can transform the features of the front-end convolutional blocks of deep convolutional networks to a certain extent, the features learned by the back-end convolutional blocks of deep convolutional networks generally have strong dataset attributes, making it difficult for simple linear transformations to effectively transfer these features. Furthermore, the FiLM transform applies the same scale to features at all locations along the same dimension, ignoring the spatial location attributes of the features. Therefore, this embodiment further employs a Residual Adaptive (RSA) module to perform a nonlinear transformation on the features of the back-end convolutional blocks of deep convolutional networks.
[0100] Assuming a deep convolutional network f θ The input features of the l′-th convolutional block are Where c l′-1 ,h l′-1 and w l′-1 f θ The feature dimension, feature length, and width output by the (l′-1)th convolutional block; then the feature output by the convolutional layer in the l′-th convolutional block. (where c) l′ ,h l′ and w l′ (where denoted by feature dimension, feature length, and feature width, respectively) can be represented as:
[0101] u l′ =θ l′ *u l′-1 (2)
[0102] In the formula, * represents the convolution operation, and θ l′ Represents a deep convolutional network f θ The parameters in the convolutional layer of the l′-th convolutional block. Then for u l′ The RSA transformation can be implemented using the following residual method:
[0103] u′ l′ =Γ(u l′-1 ;ζ l′ )+u l′ (3)
[0104] In the formula Γ(u l′-1 ;ζ l′ To construct u l-1 with u l′ The residual connection between them, its parameters In this embodiment, the specific operation is matrix multiplication. In the implementation, convolution is used; first, ζ... l′ Adjusted to have c l′ The core size is c l′-1 A ×1×1 convolution operator is then used, followed by the input features u from layer l′. l′-1 Perform convolution to obtain an output of size c. l′ ×h l′Features of ×l′ Figure 5 This is a schematic diagram of the RSA module.
[0105] The RSA transform module combines the features generated by the residual concatenation Γ with the features u obtained from the original convolution operation. l By performing addition, position-dependent nonlinear adjustments to features are achieved at different spatial locations, and the adjustment scale at each location is related to the specific content at that location. Unlike FiLM, which applies the same scale to all locations, this method has stronger feature transformation capabilities. In this embodiment, the RSA module is placed in the convolutional layer of the back-end convolutional block of the deep convolutional network.
[0106] In this embodiment, the back-end convolutional block is the second convolutional block. As those skilled in the art know, when the first depthwise convolutional network has more than two convolutional blocks, its back-end convolutional block can be divided according to the number of convolutional blocks in the first depthwise convolutional network.
[0107] The FiLM transform module and the RSA transform module work together within the deep convolutional network to transform the features of the front-end and back-end convolutional blocks, respectively. When using the model across domains, the transformation parameters within these modules need to be learned on the specific target task. Therefore, both can achieve task-level feature transformation. On the other hand, existing research shows that if the target domain is a few-sample task, learning the transformation module parameters on that task is still insufficient to change the system bias formed when the deep convolutional network learns from source domain data. In other words, task-level feature transformation is still insufficient for effective cross-domain transfer of the model. Therefore, this embodiment adopts a dataset-level feature transformation strategy: LLA nonlinear transformation.
[0108] LLA operates on the features output by the final convolutional block of a deep convolutional network. By appropriately amplifying smaller feature values and maintaining larger ones, it ensures that the statistical average of the output features across different small-sample tasks tends to be consistent, thus statistically guaranteeing the effectiveness of all feature dimensions when the model is used across different domains. LLA is not limited to a specific task but focuses on the statistical characteristics of the model across different small-sample tasks in the target domain, thus possessing dataset-level feature transformation capabilities. Furthermore, LLA is a non-parametric model, resulting in extremely high execution efficiency.
[0109] In mathematical modeling, the LLA transform can be expressed as:
[0110]
[0111] In the formula, v is the independent variable, k>0 is the hyperparameter controlling the first gradient of σ(v), which indicates that LLA is a Lipschitz continuous function on the half-open interval (-∞,0) and (0,+∞), and 1+k is the corresponding Lipschitz constant. In this embodiment, k=2 is taken. Figure 6 The graph shows the LLA function. The first and second derivatives of the LLA are calculated as follows:
[0112]
[0113] It can be observed that when the independent variable v < 2, σ″ < 0 and σ′ > 0, and as v increases, σ(v) rapidly approaches 1. This property indicates that: 1) LLA can effectively boost values less than 2 while maintaining their relative relationship; 2) LLA can effectively ensure that larger values remain unchanged. These properties ensure that the statistical means of features with different dimensions are more consistent after LLA transformation. Figure 7 as well as Figure 8 The graph of the first derivative function of LLA is shown.
[0114] In this embodiment, we assume a depthwise convolution model f θ The final convolutional block outputs the following features: Where c, h, and w are the feature dimension, feature length, and feature width, respectively, then first a global aggregation operation is performed on u, making... Then, LLA is applied to each dimension of u independently for transformation, and finally the transformed features are input into the classifier for classification.
[0115] Specifically, the training process of the deep convolutional network model in this embodiment is as follows:
[0116] S21, in the source domain Training the first deep convolutional network model f θ Obtain the first deep convolutional network model f that achieves the preset accuracy. θ The parameter θ;
[0117] This embodiment first uses a source domain containing a large number of samples. For the first depthwise convolutional network model f θ Conduct training;
[0118] In the training of step S21, the first deep convolutional network model f is first trained. θ Train to obtain the first deep convolutional network model f θ The parameter θ. In the first depthwise convolutional network model f θ During training, it does not include the Film module, RSA module, or LAA model; it uses methods known in the art for training deep convolutional networks. For example, it uses the gradient descent learning method.
[0119] Step S21 trains the first deep convolutional network model f θ using the following loss function:
[0120]
[0121] where Z represents the number of data in the training set, l() is the cross-entropy loss function, is the data from the training set and the corresponding class labels, and P w is the classifier, which is removed after obtaining the optimal θ and is no longer needed.
[0122] In step S21, it is necessary to first construct the dataset of the source domain ; assume that there are I image data on the source domain coming from C different classes respectively, where x i and y i represent the image and the corresponding class label respectively, and y i ∈{1,2,…,C}. Keep J images in each class to construct a test set for model evaluation, and the remaining images in each class are constructed as a training set for model learning. Generally, it is assumed that the number of images in each class on is sufficient to meet the requirements for training the deep convolutional network model.
[0123] Specifically, on the source domain data , use the deep neural network model f θ to construct a C-class classification and recognition task, perform conventional gradient descent learning on the constructed source domain training set data, and perform model evaluation on the test set data. Take the parameters that achieve the best performance on the test set data as the optimal parameters θ of the model.
[0124] S22, fix the parameter θ, and train the deep convolutional network model based on feature transformation and statistical correction on the target domain to obtain the parameters {α, ζ} of the FiLM module and the RSA module;
[0125] Specifically, step S22 is trained on the target domain. The target domain is a small sample and generally does not meet the training requirements of the deep convolutional network model. In this embodiment, the data of the source domain is used to train the first deep convolutional network model in advance, and then it is transferred to the small sample for the second training.
[0126] The target domain small sample task includes a support set and a test set where N represents the number of classes, K represents the number of labeled data in each class, and M represents the data obtained by removing its label from each class. Generally, K << M, such as K = 1, M = 15; then the task The goal is to adopt The model is learned from the data and then used for prediction. The true category of the data.
[0127] Due to the single task in the target domain Evaluation results on the target domain are difficult to effectively reflect the true performance of the model. It is generally assumed that a large number of target tasks can be constructed in the target domain. Since the model is sampled from a specific task in the target domain dataset task distribution, its final performance is the average performance of the model across all sampled tasks in the target domain.
[0128] Small sample task in the target domain The above uses data from the support set S to construct an N-class classification and recognition task, and employs the error gradient correction feature transformation module—FiLM—and the parameters {α,ζ} in RSA. Specifically, in the learning process, through the support set... Minimize the following objective function:
[0129]
[0130] In the formula (x i ,y i ) for tasks support set The image and its corresponding class label, l() is the cross-entropy loss function, σ() is the LLA transform, P is the nearest class center classifier, f θ,α,ζ (x i The deep convolutional network based on feature transformation and statistical correction is applied to the input object x. i The various centers are obtained through the following formula:
[0131]
[0132] In the formula, j∈{1,2,…,N} are the class labels, N is the number of classes, K is the number of training samples in each class, σ() is the LLA transform, and 1(y i =j) is an indicator function, when y i Returns 1 if the category is j, otherwise 0.
[0133] refer to Figure 9 This embodiment uses a Conv4 network to illustrate the scheme. The Conv4 network contains four convolutional blocks, arranged in sequence.
[0134] This embodiment uses the NWPU45 dataset (hereinafter referred to as NWPU45) as the source domain dataset and the GID dataset (hereinafter referred to as GID) as the target domain dataset for illustration. It introduces the classification and recognition under the 5-way 5-shot setting, that is, there are 5 categories in the few-shot task, and each category has 5 labeled training samples. The AdaDelta optimization algorithm is used for model optimization and learning, and it is implemented in the PyTorch framework.
[0135] Constructing source domain datasets and target domain few-sample tasks:
[0136] 1. Remove duplicate categories between the source domain NWPU45 and the target domain GID. 42 categories remain in NWPU45, totaling 29,400 image data points (C=42, I=29400); 13 categories remain in GID, totaling 7,800 image data points (C=13, I=7800).
[0137] 2. Divide NWPU45 into training sets. and test set 630 images were selected from each class as training images for that class, and the remaining 70 images from each class were selected as test images for that class.
[0138] 3. Construct a few-sample task in the target domain GID in To support the set, This serves as the test set. The specific process is as follows: From 13 classes, 5 classes are randomly selected, and then 20 images are randomly selected from each class. Of these 20 images, 5 are selected as the support set, and the remaining 15 images from each class are used as the test set. This constitutes a small-sample task. In this case, N=5, K=5, M=15.
[0139] 4. Repeat step 3 until 1000 small sample tasks have been constructed.
[0140] 5. Construct training data packets on the source domain NWPU45. Each data packet contains 64 images, called a batch. Then, in the training set... A total of 413 data packets can be constructed.
[0141] 6. Retrieve one data packet at a time in sequence, and extract the images from each data packet. i = 1, 2, ..., 64, input to Conv4 network f θ In the process, the relevant features are extracted and then input into the classifier P. w In the process, predict the class label of each sample. Right now
[0142] 7. Calculate the current model prediction loss using the following formula:
[0143]
[0144] Where T is the number of data in the current data packet, T = 64, and l() is the cross-entropy loss function. The cross-entropy loss is calculated on the source domain dataset. Based on this loss, the parameters θ of the Conv4 network are updated using the gradient descent algorithm.
[0145] 8. Repeat steps 6-7 until training is complete on 413 data packets.
[0146] 9. Test set The middle sample is input into the current network model, and then the prediction accuracy of the current network model is calculated.
[0147] 10. Repeat steps 5-9 until the Conv4 network model achieves the expected prediction accuracy on the test set, while keeping the parameter θ fixed.
[0148] 11. Add the feature transformation modules FiLM and RSA to the first two and last two convolutional blocks of the network model Conv4, respectively. Then add the nonlinear transformation module LLA to the output of Conv4 and initialize the parameters {α,ζ} of the newly added modules.
[0149] 12. Select one task sequentially from 1000 small sample tasks constructed on the target domain.
[0150] 13. Extract the current small sample task The support set S is input into the network model. The gradient of the model's predicted loss with respect to the parameters {α, ζ} is calculated using the following formula. The gradient descent method is then used to iteratively update the parameters {α, ζ} for a total of 20 iterations to obtain the parameters specific to this task:
[0151]
[0152] In the formula f θ,α,ζ For the Conv4 network after adding the feature transformation module, σ() is the LLA transform. Then, the center of each class on the support set S is calculated, and the calculation formula is as follows:
[0153]
[0154] Where j∈{1,2,…,N} are category labels and in this implementation N=5, 1(y i =j) is an indicator function, when y i The function returns 1 if the category is j, and 0 otherwise. K=5 means that each category center is calculated from 5 samples of the same category. Ultimately, a total of 5 category centers are obtained.
[0155] 14. For the current small sample task Each image in the test set Q is input into a task-specific network model to obtain corresponding features. The obtained features are then compared with the category centers obtained above. Calculate the distance to predict the category, and then calculate the average prediction accuracy for all images in the test set Q.
[0156] 15. Repeat steps 12-13. After predicting the data categories of the test set for 1000 small sample tasks in the target domain, calculate the average prediction accuracy Acc and the 95% confidence interval σ for all tasks. The final performance of the model is: Acc±σ.
[0157] Referring to Table 1, which shows the performance comparison results of the scheme in this embodiment with other related methods, it can be seen from Table 1 that the evaluation accuracy of the scheme in this embodiment is better than that of the other methods.
[0158] Table 1: Evaluation accuracy (%) for each of the 5 classes with 5 training samples, and average accuracy with a confidence interval of 95% across 1000 tasks.
[0159]
[0160] Among them: [1] J.Snell, K.Swersky, and RSZemel, "Prototypical networks forfewshot learning," in NIPS, 2017.
[0161] [2]X.Luo, J.Xu, and Z.Xu, “Channel importance matters in few-shot imageclassification,” 2022.
[0162] [3] W.-H.Li, X.Liu, and H.Bilen, “Cross-domain few-shot learning with task-specific adapters,” in CVPR, 2022.
[0163] This embodiment of the cross-domain few-shot image recognition method based on feature transformation and statistical correction achieves task-level feature transformation by embedding a feature linear transformation layer (FiLM) and a residual nonlinear transformation layer (RSA) on top of a deep convolutional network. Furthermore, a nonparametric nonlinear activation function (LAA) is used to statistically correct the activation state of the network output features, achieving dataset-level feature transformation. This method can effectively achieve cross-domain few-shot classification and recognition tasks, meaning it can achieve robust classification and recognition even when the target task has very little labeled training data.
[0164] The method in this embodiment first optimizes the model using other large-scale datasets (also known as source domain data) to equip the model with certain prior knowledge. Then, it fine-tunes the model at the task level and dataset level by using a small amount of labeled data from the target task, making the features generated by the model suitable for the target task. This method is characterized by its computational simplicity, high optimization efficiency, and robust performance. Furthermore, it does not require the source domain data to have the same or similar distribution characteristics as the target task data, further expanding the applicability of this method.
[0165] Example 2
[0166] refer to Figure 10 This embodiment discloses a method for training a deep convolutional network model based on feature transformation and statistical correction, which includes the following steps:
[0167] S1, in the source domain Training the first deep convolutional network model f θ Obtain the first deep convolutional network model f that achieves the preset accuracy. θ The parameter θ; wherein the first depthwise convolutional network model f θ It includes: NUM concatenated convolutional blocks, where NUM is a positive integer greater than 2, and each convolutional block consists of a convolutional layer, a batch normalization layer (BN), a ReLU nonlinear activation layer, and a maximum convergence layer concatenated in sequence;
[0168] This embodiment first uses a source domain containing a large number of samples. For the first depthwise convolutional network model f θ Conduct training;
[0169] In step S1 of training, the first deep convolutional network model f is first trained. θ Train to obtain the first deep convolutional network model f θ The parameter θ. In the first depthwise convolutional network model f θ When training, methods well-known in the art for training deep convolutional networks are used. For example, gradient descent learning is used.
[0170] Step S1 applies the first deep convolutional network model f θ The training can use the following loss function:
[0171]
[0172] In the formula, Z represents the number of training set data, and l() is the cross-entropy loss function. Given the data from the training set and the corresponding category labels, P w This is a classifier that is removed after obtaining the optimal θ and is no longer needed.
[0173] In step S1, the source domain needs to be constructed first. The dataset; assuming the source domain There are a total of I image data. They come from C different categories, where x i With y i Let represent the image and its corresponding category label, and y ? i Images ∈{1,2,…,C}. J images from each class are retained to construct a test set for model evaluation, and the remaining images from each class are used to construct a training set for model learning. General assumptions... There is a sufficient number of images of various types to meet the requirements for training deep convolutional network models.
[0174] Specifically, in the source domain data The above uses a deep neural network model f θ Construct a C-class classification and recognition task, perform conventional gradient descent learning on the constructed source domain training set data, and evaluate the model on the test set data. Take the parameters that achieve the best performance on the test set data as the optimal parameters θ of the model.
[0175] S2, with parameters θ fixed, train the deep convolutional network model based on feature transformation and statistical correction in the target domain to obtain the parameters {α,ζ} of the FiLM module and RSA module; wherein the deep convolutional network model based on feature transformation and statistical correction includes:
[0176] An LLA transform module is connected to the first deep convolutional network model f. θ Subsequently, the LLA conversion module is as follows:
[0177] Where v is the independent variable, k>0 is the hyperparameter controlling the first gradient of σ(v), which indicates that LLA is a Lipschitz continuous function on the half-open interval (-∞,0) and (0,+∞), and 1+k is the corresponding Lipschitz constant.
[0178] Add a Feature Transformation Module FiLM after the BN layer of the first NUM_FiLM convolutional blocks of the first deep convolutional network model, and the Feature Transformation Module is used to perform scale stretching transformation on the output of the BN layer;
[0179] Add a Residual Transformation Module RSA to each of the last NUM_RSA convolutional blocks of the first deep convolutional network model, and the RSA module is used to perform residual calculation on the input features input to the NUM_RSA convolutional blocks;
[0180] A classifier, which is used to classify the output of the LLA transformation module to output an identification result.
[0181] Specifically, step S2 is to train on the target domain. The target domain is a small sample, which generally does not meet the training requirements of the deep convolutional network model. In this embodiment, the first deep convolutional network model is pre-trained using the data in the source domain, and then it is transferred to the small sample for the second training.
[0182] Target domain small sample task Contains a support set And a test set Where N represents the number of categories, K represents the number of labeled data in each category, and M represents the data obtained by removing its label from each category. Generally, K << M, such as K = 1, M = 15; then the task The goal is to use The data in to perform model learning, and then predict The true category of the data in.
[0183] Since it is difficult for the evaluation result on a single task in the target domain To effectively reflect the true performance of the model, it is generally assumed that a large number of target tasks can be constructed in the target domain, that is Is a specific task sampled from the task distribution of the target domain dataset, so finally the average performance of the model on all sampled tasks in the target domain is used as its final performance.
[0184] In the target domain small sample task Use the data in the support set S to construct an N-class classification and recognition task, and use the error gradient to correct the parameters {α, ζ} in the Feature Transformation Module - FiLM and RSA. In specific learning, by minimizing the following objective function on the support set :
[0185]
[0186] In the formula, (x i , y i ) is from the task Support set The image and its corresponding class label, l() is the cross-entropy loss function, σ() is the LLA transform, P is the nearest class center classifier, f θ,α,ζ (x i The deep convolutional network based on feature transformation and statistical correction is applied to the input object x. i The various centers are obtained through the following formula:
[0187]
[0188] In the formula, j∈{1,2,…,N} are the class labels, N is the number of classes, K is the number of training samples in each class, σ() is the LLA transform, and 1(y i =j) is an indicator function, when y i Returns 1 if the category is j, otherwise 0.
[0189] This embodiment presents a cross-domain few-sample image recognition method based on feature transformation and statistical correction. It achieves task-level feature transformation by embedding a Feature Linear Transform (FiLM) layer and a Residual Nonlinear Transform (RSA) layer onto a deep convolutional network. Furthermore, a nonparametric nonlinear activation function (LAA) is used to statistically correct the activation state of the network's output features, achieving dataset-level feature transformation. This embodiment effectively facilitates the transfer from large-scale datasets to small-sample datasets through the FiLM, RSA, and LAA layers.
[0190] Example 3
[0191] This embodiment discloses a cross-domain small sample image recognition device based on feature transformation and statistical correction, which includes the following units:
[0192] An image acquisition unit is used to acquire the image to be recognized.
[0193] A recognition unit is used to input the image to be recognized into a pre-trained deep convolutional network model based on feature transformation and statistical correction, and output the recognition result. The deep convolutional network model based on feature transformation and statistical correction includes:
[0194] A first-level deep convolutional network model f θ , where θ is its parameter, and f θ It consists of NUM concatenated convolutional blocks, where NUM is a positive integer greater than 2. Each convolutional block consists of a convolutional layer, a batch normalization layer (BN), a ReLU nonlinear activation layer, and a maximum convergence layer, which are concatenated in sequence.
[0195] An LLA transform module is connected to the first deep convolutional network model f.θ Subsequently, the LLA conversion module is as follows:
[0196] Where v is the independent variable, k>0 is the hyperparameter controlling the first gradient of σ(v), which indicates that LLA is a Lipschitz continuous function on the half-open interval (-∞,0) and (0,+∞), and 1+k is the corresponding Lipschitz constant.
[0197] A feature transformation module FiLM is added after the BN layer of the first NUM_FiLM convolutional blocks in the first deep convolutional network model. The feature transformation module is used to perform scaling transformation on the output of the BN layer. A residual transformation module RSA is added to each of the last NUM_RSA convolutional blocks in the first deep convolutional network model. The RSA module is used to perform residual calculation on the input features input to the NUM_RSA convolutional blocks.
[0198] A classifier is provided to classify the output of the LLA transformation module to output a recognition result.
[0199] Example 4
[0200] refer to Figure 11 , Figure 11 This is a schematic diagram of the structure of a cross-domain small-sample image recognition device based on feature transformation and statistical correction according to this embodiment. The cross-domain small-sample image recognition device 20 based on feature transformation and statistical correction according to this embodiment includes a processor 21, a memory 22, and a computer program stored in the memory 22 and executable on the processor 21. When the processor 21 executes the computer program, it implements the steps in the above method embodiments. Alternatively, when the processor 21 executes the computer program, it implements the functions of each module / unit in the above device embodiments.
[0201] For example, the computer program can be divided into one or more modules / units, which are stored in the memory 22 and executed by the processor 21 to complete the present invention. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in the cross-domain small sample image recognition device 20 based on feature transformation and statistical correction. For example, the computer program can be divided into the modules in Embodiment 2; the specific functions of each module are described in the working process of the device described in the above embodiments, and will not be repeated here.
[0202] The cross-domain few-sample image recognition device 20 based on feature transformation and statistical correction may include, but is not limited to, a processor 21 and a memory 22. Those skilled in the art will understand that the schematic diagram is merely an example of a cross-domain few-sample image recognition device 20 based on feature transformation and statistical correction, and does not constitute a limitation on the device. It may include more or fewer components than illustrated, or combine certain components, or use different components. For example, the cross-domain few-sample image recognition device 20 based on feature transformation and statistical correction may also include input / output devices, network access devices, buses, etc.
[0203] The processor 21 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor 21 is the control center of the cross-domain small-sample image recognition device 20 based on feature transformation and statistical correction, connecting all parts of the device 20 via various interfaces and lines.
[0204] The memory 22 can be used to store the computer program and / or modules. The processor 21 implements various functions of the cross-domain small sample image recognition device 20 based on feature transformation and statistical correction by running or executing the computer program and / or modules stored in the memory 22 and calling the data stored in the memory 22. The memory 22 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phone book, etc.). In addition, the memory 22 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0205] The integrated modules / units of the cross-domain small-sample image recognition device 20 based on feature transformation and statistical correction, if implemented as software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by the processor 21, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content contained in the computer-readable medium may be appropriately added to or subtracted from the content as required by the legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium may not include electrical carrier signals and telecommunication signals.
[0206] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0207] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A cross-domain small-sample image recognition method based on feature transformation and statistical correction, comprising the following steps: S1, acquire the image to be recognized; S2, input the image to be recognized into a pre-trained deep convolutional network model based on feature transformation and statistical correction, and output the recognition result. The deep convolutional network model based on feature transformation and statistical correction includes: First-level depthwise convolutional network model ,in Its parameters, and It consists of NUM concatenated convolutional blocks, where NUM is a positive integer greater than 2. Each convolutional block consists of a convolutional layer, a batch normalization layer (BN), a ReLU nonlinear activation layer, and a maximum convergence layer, which are concatenated in sequence. An LLA transform module is connected to the first deep convolutional network model. Subsequently, the LLA conversion module is as follows: ,in As the independent variable, To control The hyperparameters of the first-order gradient indicate the LLA in the half-open interval. and The above is a Lipschitz continuous function, and For the corresponding Lipschitz constant; A feature transformation module FiLM is added after the Batch Normalization (BN) layer of the first NUM_FiLM convolutional blocks in the first deep convolutional network model. The feature transformation module is used to perform scaling transformation on the output of the BN layer. A residual transformation module RSA is added to each of the last NUM_RSA convolutional blocks in the first deep convolutional network model. The residual transformation module RSA is used to calculate the residuals of the input features input to the NUM_RSA convolutional blocks, where NUM = NUM_FiLM + NUM_RSA. A classifier is provided to classify the output of the LLA transformation module to output a recognition result.
2. The method according to claim 1, wherein the feature transformation module FiLM specifically comprises: The FiLM transform can be represented as the following linear operation: ; In the formula , This represents element-wise broadcast dot product, i.e. Elements in each dimension All in the corresponding dimension Multiply the elements together; For the first depthwise convolutional network No. The output features of the BN layer of each convolutional block.
3. The method according to claim 1, wherein the residual transformation module RSA is specifically implemented using the following residual method: ; In the formula To build and The residual join between them is a matrix multiplication operation, where , These are the first depthwise convolutional networks. No. The, the The output features of the BN layer of each convolutional block.
4. The method according to claim 3, wherein the training process of the deep convolutional network model based on feature transformation and statistical correction is as follows: S21, in the source domain Training the first deep convolutional network model Obtain the first deep convolutional network model that achieves the preset accuracy. parameters ; S22, Fixed Parameters In the target domain, a deep convolutional network model based on feature transformation and statistical correction is trained to obtain the parameters of the feature transformation module FiLM and the residual transformation module RSA. .
5. A method for training a deep convolutional network model based on feature transformation and statistical correction, comprising the following steps: S1, in the source domain Training the first deep convolutional network model Obtain the first deep convolutional network model that achieves the preset accuracy. parameters The first depthwise convolutional network model is described above. include: The convolutional block is composed of NUM concatenated convolutional blocks, where NUM is a positive integer greater than 2. Each convolutional block consists of a convolutional layer, a batch normalization layer (BN), a ReLU nonlinear activation layer, and a maximum convergence layer, which are concatenated in sequence. S2, Fixed Parameters In the target domain, a deep convolutional network model based on feature transformation and statistical correction is trained to obtain the parameters of the feature transformation module FiLM and the residual transformation module RSA. The deep convolutional network model for feature transformation and statistical correction includes: An LLA transform module is connected to the first deep convolutional network model. Subsequently, the LLA conversion module is as follows: ,in As the independent variable, To control The hyperparameters of the first-order gradient indicate the LLA in the half-open interval. and The above is a Lipschitz continuous function, and For the corresponding Lipschitz constant; A feature transformation module FiLM is added after the BN layer of the first NUM_FiLM convolutional blocks in the first deep convolutional network model. The feature transformation module is used to perform scale transformation on the output of the BN layer. A residual transformation module RSA is added to each of the last NUM_RSA convolutional blocks in the first deep convolutional network model. The residual transformation module RSA is used to perform residual calculation on the input features input to the NUM_RSA convolutional blocks. A classifier is provided to classify the output of the LLA transformation module to output a recognition result.
6. The method according to claim 5, wherein in step S1 the first deep convolutional network model The training uses the following loss function: ; In the formula Indicates the number of training set data. Let cross-entropy be the loss function. For the data from the training set and the corresponding category labels, This is a classifier that obtains the optimal... It was later removed.
7. The method according to claim 6, wherein in step S2, the deep convolutional network model based on feature transformation and statistical correction is trained in the target domain through the support set. Minimize the following objective function: ; In the formula For the mission support set The images and their corresponding category labels, Let cross-entropy be the loss function. For LLA transformation, For nearest-center classifiers, The deep convolutional network based on feature transformation and statistical correction is applied to the input object. The various centers are obtained through the following formula: ; In the formula For category labels, For the number of categories, The number of training samples in each category. For LLA transformation, For indicator functions, when The category is Returns 1 if the condition is met, otherwise 0.
8. A cross-domain small sample image recognition device based on feature transformation and statistical correction, comprising the following units: An image acquisition unit is used to acquire the image to be recognized. A recognition unit is configured to input the image to be recognized into a pre-trained deep convolutional network model based on feature transformation and statistical correction, and output the recognition result. The deep convolutional network model based on feature transformation and statistical correction includes: First-level depthwise convolutional network model ,in Its parameters, and It consists of NUM concatenated convolutional blocks, where NUM is a positive integer greater than 2. Each convolutional block consists of a convolutional layer, a batch normalization layer (BN), a ReLU nonlinear activation layer, and a maximum convergence layer, which are concatenated in sequence. An LLA transform module is connected to the first deep convolutional network model. Subsequently, the LLA conversion module is as follows: ,in As the independent variable, To control The hyperparameters of the first-order gradient indicate the LLA in the half-open interval. and The above is a Lipschitz continuous function, and The corresponding Lipschitz constant is used; a feature transformation module FiLM is added after the BN layer of the first NUM_FiLM convolutional blocks in the first deep convolutional network model. The feature transformation module is used to perform scaling transformation on the output of the BN layer; a residual transformation module RSA is added to each of the last NUM_RSA convolutional blocks in the first deep convolutional network model. The residual transformation module RSA is used to perform residual calculation on the input features input to the NUM_RSA convolutional blocks. A classifier is provided to classify the output of the LLA transformation module to output a recognition result.
9. The apparatus according to claim 8, wherein the feature transformation module FiLM specifically comprises: The FiLM transform can be represented as the following linear operation: ; In the formula , This represents element-wise broadcast dot product, i.e. Elements in each dimension All in the corresponding dimension Multiply the elements together; For the first depthwise convolutional network No. The output features of the BN layer of each convolutional block; The residual transformation module RSA is specifically implemented using the following residual method: ; In the formula To build and The residual join between them is a matrix multiplication operation, where , These are the first depthwise convolutional networks. No. The, the The output features of the BN layer of each convolutional block.
10. A non-volatile storage medium storing instructions, wherein the instructions, when executed by a processor, are used to implement a cross-domain few-sample image recognition method based on feature transformation and statistical correction as described in any one of claims 1-4, or a deep convolutional network model training method based on feature transformation and statistical correction as described in any one of claims 5-7.