Training method for artificial intelligence model
By combining the teacher model and the student model, using pseudo labels and soft labels to construct the loss function, and combining cross-space learning and multi-scale attention mechanism, the training process of the student model is optimized, which solves the problems of high computing resource consumption and poor small target detection in active millimeter wave detection, and improves the detection accuracy and generalization ability.
Patent Information
- Application Number
- CN202510769425.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-09-16
AI Technical Summary
Existing active millimeter-wave prohibited item detection methods consume large computational resources when processing complex scenarios and have poor detection effects on small targets. Semi-supervised target detection also has deviations in the process of generating pseudo-labels, which affects model performance.
A combination of teacher model and student model is adopted. Pseudo labels and soft labels are generated by the teacher model, and a loss function is constructed to guide the iterative training of the student model. The learning process of the student model is optimized by combining cross-space learning and multi-scale attention mechanism.
It improves the accuracy of hidden object detection, reduces dependence on manual labeling, shortens training time, reduces computing resource consumption, and enhances the model's generalization ability and detection accuracy.
Smart Images

Figure CN120656036A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of active millimeter wave prohibited item detection, and more specifically, to a training method for an artificial intelligence model. Background Art
[0002] Several statistically based methods were initially used for active millimeter wave (AMMW) object classification. These methods primarily target simple scenarios with fixed locations and a limited number of object types, and are not well suited for complex real-world scenarios. With the rapid development of deep learning, more deep learning algorithms have been applied to AMMW hidden object detection. The region-based convolutional neural network (RCNN) family represents a representative deep learning-based detection algorithm. In particular, the Faster Region-based Convolutional Neural Network (Faster-RCNN) has become the most advanced algorithm of this era. Some teams have combined this with online hard example mining (OHEM) strategies in the early stages of training, achieving fast and reliable results in complex scenarios through a voting mechanism. Furthermore, many optimized versions of Faster-RCNN have been developed. Channel and spatial attention mechanisms have been added to the Faster-RCNN feature pyramid to aid in detecting small objects. However, Faster Region-based Convolutional Neural Networks require significant computational resources during training, taking a long time to train on large datasets, and are not very effective at detecting small objects.
[0003] Semi-supervised object detection (SSOD) can be trained using unlabeled data, expanding the training dataset for active mmWave systems. Pseudo-labels generated by the teacher model supervise unlabeled data training and guide the student model's parameter iteration. The accuracy of pseudo-labels is particularly important for training unlabeled data. However, semi-supervised object detection is still immature in the active mmWave field. The pseudo-label generation process can introduce bias, leading to reduced model performance and impacting detection results. Summary of the Invention
[0004] The present invention provides a training method for an artificial intelligence model to solve at least one of the problems existing in the prior art.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] The present invention provides a training method for an artificial intelligence model, wherein the model includes a teacher model and a student model.
[0007] The method comprises
[0008] The labeled millimeter-wave human body images and unlabeled millimeter-wave human body images in the detection library are input into the student model according to a preset ratio for training to obtain the prediction results of the student model;
[0009] Inputting unlabeled millimeter-wave human images in the detection library into the teacher model to obtain the prediction results of the teacher model, and using the prediction results of the teacher model as pseudo labels for the unlabeled millimeter-wave human images in the teacher model;
[0010] Obtaining soft labels for unlabeled millimeter-wave human images in the teacher model according to the neck pyramid network in the teacher model;
[0011] Constructing a loss function according to the pseudo labels of the unlabeled millimeter-wave human images in the teacher model, the soft labels of the unlabeled millimeter-wave human images in the teacher model, and the prediction results of the student model;
[0012] The student model is iterated based on the loss function, and the iterative result of the iterated student model is detected by the teacher model.
[0013] Optionally, the soft label of the unlabeled millimeter wave human image obtained according to the neck pyramid network in the teacher model includes:
[0014] Obtain feature vectors based on the backbone feature extraction network of the teacher model;
[0015] Inputting the feature vector into the neck pyramid network of the teacher model for fusion processing to obtain a fusion feature map;
[0016] The pixels in the fusion feature map whose classification probability is higher than a preset threshold are used as soft labels of the unlabeled millimeter-wave human images in the teacher model.
[0017] Optionally, the constructing of a loss function based on the pseudo labels of the unlabeled millimeter-wave human images, the soft labels of the unlabeled millimeter-wave human images and the prediction results of the student model includes:
[0018] Obtaining recognition results of unlabeled millimeter-wave human images according to the neck pyramid network of the student model;
[0019] According to the soft labels of the unlabeled millimeter-wave human images in the teacher model and the corresponding soft labels in the recognition results of the student model, the distillation loss between the soft labels of the unlabeled millimeter-wave human images in the teacher model and the soft labels of the unlabeled millimeter-wave human images in the student model is obtained.
[0020] Optionally, the loss function constructed according to the pseudo label of the unlabeled millimeter wave human image, the soft label of the unlabeled millimeter wave human image and the prediction result of the student model further includes:
[0021] According to the pseudo labels of the unlabeled millimeter-wave human images in the teacher model and the corresponding pseudo labels in the prediction results of the student model, an unsupervised loss between the pseudo labels of the unlabeled millimeter-wave human images in the teacher model and the pseudo labels of the unlabeled millimeter-wave human images in the student model is obtained.
[0022] Optionally, the loss function is
[0023] L=L S +αL U +βL D ,
[0024] Among them, L represents the loss function, L S represents the supervision loss between the labeled millimeter-wave human images in the detection library and the labeled millimeter-wave human images in the database, L U represents the unsupervised loss, L D represents the distillation loss, and α and β represent weight coefficients.
[0025] Optionally, the detecting the iteration result of the iterated student model by the teacher model includes:
[0026] The student model is iterated according to the iterative formula. After reaching a preset number of iterations, the iterative results of the iterated student model are precision-tested by the teacher model.
[0027] Optionally, the iterative formula is
[0028] EMA t =∝X t +(1-∝)EMA t-1 ,
[0029] Among them, EMA t Represents the parameters of the teacher model at time t, EMA t-1 represents the parameters of the teacher model at time t-1, X t represents the parameters of the student model at time t, and ∝ represents the update speed.
[0030] Optionally, the step of inputting the feature vector into the neck pyramid network of the teacher model for fusion processing includes:
[0031] Dividing the feature vector into a plurality of sub-feature vector groups according to the dimension;
[0032] A cross-space learning method is used to fuse the multiple sub-feature vector groups.
[0033] Optionally, dividing the feature vector into a plurality of sub-feature vector groups according to the dimension includes:
[0034] The sub-feature vector group is branched and divided into the first branch and the second branch through the multi-scale attention mechanism;
[0035] Normalizing the sub-feature vector group of the first branch by using an activation function;
[0036] Convolution processing is performed on the sub-feature vector group of the second branch through a pyramid convolution kernel.
[0037] Optionally, the cross-space learning method is used to fuse the multiple sub-feature vector groups, including:
[0038] Performing a two-dimensional global average pooling operation on the first vector and the second vector respectively to obtain a third vector and a fourth vector;
[0039] A fused fifth vector is obtained according to the first vector, the second vector, the third vector, and the fourth vector.
[0040] The beneficial effects of the present invention are as follows:
[0041] The present invention constructs a loss function based on the pseudo labels of unlabeled millimeter-wave human images in the teacher model, the soft labels of unlabeled millimeter-wave human images in the teacher model, and the prediction results of the student model, which can improve the generalization ability of the student model in learning feature information; the loss function can be used to adjust the learning focus of the student model, conduct targeted optimization training, and alleviate the risk of overfitting; the student model can optimize the loss function through iteration, reduce the gap between the predicted results of the student model and the actual results, and improve the overall performance; greatly improve the detection accuracy of hidden object target detection, and significantly reduce the dependence on manual labeling. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0043] Figure 1 A flowchart illustrating a method for training an artificial intelligence model according to an embodiment of the present invention is provided;
[0044] Figure 2 A schematic diagram of a process based on a semi-supervised target detection model in an embodiment of the present invention is shown;
[0045] Figure 3 Schematic diagram showing the detection results of each model in the embodiment of the present invention;
[0046] Figure 4 A schematic diagram illustrating a process of a multi-scale attention mechanism according to an embodiment of the present invention is shown;
[0047] Figure 5 A schematic diagram showing a pyramid convolution kernel structure in an embodiment of the present invention. DETAILED DESCRIPTION
[0048] In order to more clearly illustrate the present invention, the present invention is further described below in conjunction with preferred embodiments and accompanying drawings. Similar components in the accompanying drawings are represented by the same reference numerals. It should be understood by those skilled in the art that the following detailed description is illustrative rather than restrictive and should not be used to limit the scope of protection of the present invention.
[0049] One embodiment of the present invention provides a training method for an artificial intelligence model, wherein the model includes a teacher model and a student model.
[0050] The method comprises:
[0051] The labeled millimeter-wave human body images and unlabeled millimeter-wave human body images in the detection library are input into the student model according to a preset ratio for training to obtain the prediction results of the student model;
[0052] Inputting unlabeled millimeter-wave human images in the detection library into the teacher model to obtain the prediction results of the teacher model, and using the prediction results of the teacher model as pseudo labels for the unlabeled millimeter-wave human images in the teacher model;
[0053] Obtaining soft labels for unlabeled millimeter-wave human images in the teacher model according to the neck pyramid network in the teacher model;
[0054] Constructing a loss function according to the pseudo labels of the unlabeled millimeter-wave human images in the teacher model, the soft labels of the unlabeled millimeter-wave human images in the teacher model, and the prediction results of the student model;
[0055] The student model is iterated based on the loss function, and the iterative result of the iterated student model is detected by the teacher model.
[0056] The training method for an artificial intelligence model provided in this embodiment greatly improves the detection accuracy of hidden object target detection through information interaction between a student model and a teacher model, significantly reducing reliance on manual labeling. Unlabeled millimeter-wave human body images in the detection library are input into the teacher model, and pseudo-labels for the unlabeled millimeter-wave human body images in the teacher model are generated based on the teacher model, prompting the student model to learn depth predictions that are closer to the true results based on the pseudo-labels, thereby improving detection accuracy. A loss function is constructed based on the pseudo-labels of the unlabeled millimeter-wave human body images in the teacher model, the soft labels of the unlabeled millimeter-wave human body images in the teacher model, and the prediction results of the student model. This can reduce noise, suppress the influence of erroneous samples, and improve the generalization ability of the student model to learn feature information. The two pseudo-labels can also be combined to cover more hidden objects and improve detection accuracy. The loss function can be used to adjust the learning focus of the student model, conduct targeted optimization training, and alleviate the risk of overfitting. The student model can optimize the loss function through iteration to avoid falling into local optimal points, reduce the gap between predicted results and true results, and improve overall performance.
[0057] In a specific example, for example Figure 1 The flowchart of the artificial intelligence model training method shown in the figure inputs the labeled millimeter-wave human body images and unlabeled millimeter-wave human body images in the detection library into the student model in a ratio of 4:6 for training to obtain the prediction results of the student model;
[0058] Input the unlabeled millimeter-wave human images in the detection library into the teacher model to obtain the teacher model's prediction results, and use the teacher model's prediction results as pseudo labels for the unlabeled millimeter-wave human images in the teacher model;
[0059] The unlabeled millimeter-wave human body images in the detection library are input into the teacher model. After passing through the neck pyramid network of the teacher model, the soft labels of the unlabeled millimeter-wave human body images in the teacher model are obtained.
[0060] Constructing a loss function based on the pseudo labels of the unlabeled millimeter-wave human images in the teacher model, the soft labels of the unlabeled millimeter-wave human images in the teacher model, and the prediction results of the student model;
[0061] The student model is iterated based on the loss function, and the iterative results of the student model are tested by the teacher model.
[0062] In a possible implementation, the obtaining of the soft label of the unlabeled millimeter wave human image according to the neck pyramid network in the teacher model includes:
[0063] Obtain feature vectors based on the backbone feature extraction network of the teacher model;
[0064] Inputting the feature vector into the neck pyramid network of the teacher model for fusion processing to obtain a fusion feature map;
[0065] The pixels in the fusion feature map whose classification probability is higher than a preset threshold are used as soft labels of the unlabeled millimeter-wave human images in the teacher model.
[0066] In a specific example, for example Figure 2 The flowchart of the semi-supervised target detection process shown in the figure includes a two-stage network including a backbone feature extraction network, a neck pyramid network, a network region proposal network and a detection head. The backbone feature extraction network is used to obtain the feature vector of the unlabeled millimeter-wave human image in the teacher model, and the feature vector is divided into multiple sub-feature vector groups according to a preset number of channels, and the multiple sub-feature vector groups are input into the neck pyramid network; the multiple sub-feature vector groups are fused through the neck pyramid network to obtain a fused feature map, and the soft label of the unlabeled millimeter-wave human image in the teacher model is obtained based on the fused feature map; the pixel-level monitoring corresponding to the soft label is obtained according to the foreground score obtained by the network region proposal network to supervise the corresponding pixels in the student model; the teacher model outputs the prediction result of the teacher model, and the prediction result of the teacher model is used as the pseudo label of the unlabeled millimeter-wave human image in the teacher model.
[0067] The labeled millimeter-wave human detection images and unlabeled millimeter-wave human images in the detection library are input into the student model in a ratio of 4:6 for training to obtain the prediction results of the student model;
[0068] The unlabeled millimeter-wave human images in the detection library are input into the teacher model to obtain the prediction results of the teacher model, and the prediction results of the teacher model are used as pseudo labels for the unlabeled millimeter-wave human images in the teacher model.
[0069] The backbone feature extraction network of the teacher model is used to obtain a high-dimensional feature vector with a channel count of 16. Based on this channel count, the feature vector is evenly divided into multiple sub-feature vector groups. These sub-feature vector groups are then fed into the teacher model's neck pyramid network for fusion processing to obtain a fused feature map. Pixels in the fused feature map with a classification probability above a preset threshold are considered positive samples using a feature richness scoring method. These pixels form the soft labels for the unlabeled millimeter-wave human images in the teacher model. In this example, the preset threshold is set to 0.
[0070] Compared with traditional target detection, this example adds soft labels for the unlabeled millimeter-wave human images in the teacher model, which are not filtered out by non-maximum suppression (NMS). In traditional target detection, ordinary labels are filtered out by non-maximum suppression. This example can obtain more abstract feature information at the pixel level corresponding to the soft labels.
[0071] This example obtains soft labels for unlabeled millimeter-wave human images from the teacher model, saving training time and computing resources and improving the accuracy of the student model. The soft labels for the unlabeled millimeter-wave human images from the teacher model help the student model learn richer knowledge and reduce the risk of overfitting. By learning the soft labels for the unlabeled millimeter-wave human images from the teacher model, the student model improves its feature extraction and generalization capabilities. Based on the semi-supervised training network, this example further mines effective image information through pixel-level soft labels, achieving the completion of massive data operations with a limited labeled dataset.
[0072] In a possible implementation, the loss function is constructed based on the pseudo labels of the unlabeled millimeter wave human images, the soft labels of the unlabeled millimeter wave human images, and the prediction results of the student model, including:
[0073] Obtaining recognition results of unlabeled millimeter-wave human images according to the neck pyramid network of the student model;
[0074] Obtaining a distillation loss between the soft labels of the unlabeled millimeter-wave human images in the teacher model and the soft labels of the unlabeled millimeter-wave human images in the student model according to the soft labels of the unlabeled millimeter-wave human images in the teacher model and the corresponding soft labels in the recognition results of the student model;
[0075] Obtaining an unsupervised loss between the pseudo labels of the unlabeled millimeter-wave human images in the teacher model and the pseudo labels of the unlabeled millimeter-wave human images in the student model according to the pseudo labels of the unlabeled millimeter-wave human images in the teacher model and the corresponding pseudo labels in the prediction results of the student model;
[0076] Based on the annotated millimeter-wave human images in the detection library and the annotated millimeter-wave human images in the database, the supervision loss between the prediction results of the student model and the database is obtained.
[0077] Continuing with the previous example, for example Figure 2As shown, based on the neck pyramid network of the student model, the recognition results of the unlabeled millimeter-wave human images in the student model are obtained through the neck pyramid network, and the recognition results are used as soft labels for the unlabeled millimeter-wave human images in the student model. The student model is supervised by the soft labels of the unlabeled millimeter-wave human images screened by the teacher model. Specifically, the distillation loss between the soft labels of the unlabeled millimeter-wave human images in the teacher model and the soft labels of the unlabeled millimeter-wave human images in the student model is obtained based on the soft labels of the unlabeled millimeter-wave human images in the teacher model and the corresponding soft labels in the recognition results of the student model. The unsupervised loss between the pseudo labels of the unlabeled millimeter-wave human images in the teacher model and the pseudo labels of the unlabeled millimeter-wave human images in the student model is obtained based on the pseudo labels of the unlabeled millimeter-wave human images in the teacher model and the corresponding pseudo labels in the prediction results of the student model. The labeled millimeter-wave human images in the detection library are input into the student model to obtain the prediction results of the labeled images in the student model; based on the manually labeled millimeter-wave human images in the database and the prediction results, the supervision loss between the prediction results of the student model and the labeled millimeter-wave human images in the database is obtained.
[0078] In one possible implementation, the loss function is
[0079] L=L S +αL U +βL D ,
[0080] Among them, L represents the loss function, L S represents the supervision loss between the labeled millimeter-wave human images in the detection library and the labeled millimeter-wave human images in the database, L U represents the unsupervised loss, L D represents the distillation loss, and α and β represent weight coefficients.
[0081] Continuing with the previous example, both α and β can be adjusted according to actual conditions. In this example, the value of α is set to 0.5 and the value of β is set to 0.00004. The loss function between the teacher model and the student model is obtained based on the distillation loss, unsupervised loss, and supervised loss.
[0082] The loss function enables the teacher model to guide the student model to iterate not only at the label level but also at the pixel level.
[0083] This loss function accelerates the training of the student model under the guidance of the teacher model and shortens training time. Obtaining the loss function between the teacher and student models helps transfer the teacher model's knowledge to the smaller student model, significantly reducing the model's parameters and computational cost, and improving its running speed. The loss function also enables the student model to optimize its own structure and parameters as it learns from the teacher model, improving its running efficiency.
[0084] In a possible implementation, the detecting the iteration result of the iterated student model by the teacher model includes:
[0085] Iterate the student model according to the iterative formula, and after reaching a preset number of iterations, perform accuracy testing on the iteration results of the iterated student model through the teacher model;
[0086] The iterative formula is
[0087] EMA t =∝X t +(1-∝)EMA t-1 ,
[0088] Among them, EMA t Represents the parameters of the teacher model at time t, EMA t-1 represents the parameters of the teacher model at time t-1, X t represents the parameters of the student model at time t, and ∝ represents the update speed.
[0089] Continuing with the previous example, the loss back propagation parameter update is performed according to the iterative formula. Loss back propagation refers to calculating the loss between the labeled millimeter-wave human images and unlabeled millimeter-wave human images in the student model and multiple labels in the teacher model, iterating new parameters and updating them to minimize the loss.
[0090] In this example, semi-supervised training is divided into parameter iteration of the student model and the teacher model. The student model and the teacher model are the same model. The parameters of the teacher model are updated every 500 iterations based on the student model. The iteration formula is EMA t =∝X t +(1-∝)EMA t-1 After reaching the preset number of iterations, the parameters of the teacher model are updated, and the updated teacher model is used as the test model. The accuracy of the student model after the iteration is tested. The output of the teacher model can be used as the prediction box of the teacher model, and the output of the student model can be used as the prediction box of the student model. The prediction result is used as the true value of the detection result of the unlabeled millimeter-wave human image in the student model, and the detection result is obtained through the deviation between the prediction box of the student model and the true value.
[0091] In this example, the iterative process helps reduce the noise caused by frequent updates of the teacher model parameters and improves the performance of the student model. The parameters of the teacher model are updated every 500 iterations of the student model to ensure that the teacher model has accumulated more learning experience at each update, which helps the teacher model provide richer knowledge, thereby improving the learning effect of the student model. In this example, the iterative method can also reduce computational overhead and improve training efficiency.
[0092] This example uses a GeForce RTX 3090 graphics card to complete the target detection training. The training time is 12 hours. The results compared with the traditional model are shown in Table 1. Figure 3 As shown, Figure 3 GT represents the true value.
[0093] Table 1 Comparison of the detection results of this example and the detection results of the traditional model
[0094] Model <![CDATA[AP 50 ]]> <![CDATA[AP 75 ]]> mAP@0.5-0.95 <![CDATA[AP S ]]> <![CDATA[AP M ]]> Soft Teacher 74.6 48.9 44.9 23.0 46.0 Unbiased Teacher 74.7 49.2 43.1 24.1 45.8 PseCo 77.8 51.7 47.4 26.1 47.8 ours 83.1 54.1 50.6 30.8 51.9
[0095] SoftTeacher is an end-to-end semi-supervised object detection project that aims to improve the accuracy of object detection through semi-supervised learning techniques. Unbiased Teacher is a teacher model for semi-supervised object detection. PseCo is a model for semi-supervised object detection.
[0096] In one possible implementation, the step of inputting the feature vector into the neck pyramid network of the teacher model for fusion processing includes:
[0097] Dividing the feature vector into multiple sub-feature vector groups according to the dimension, and performing branch processing on the sub-feature vector groups through a multi-scale attention mechanism to divide them into a first branch and a second branch;
[0098] Normalizing the sub-feature vector group of the first branch by using an activation function;
[0099] Performing convolution processing on the sub-feature vector group of the second branch through a pyramid convolution kernel;
[0100] Using a cross-space learning method to fuse the multiple sub-feature vector groups;
[0101] The adopting of a cross-space learning method to fuse the plurality of sub-feature vector groups includes:
[0102] Performing two-dimensional global average pooling on the first vector and the second vector respectively to obtain a third vector and a fourth vector;
[0103] A fused fifth vector is obtained according to the first vector, the second vector, the third vector, and the fourth vector.
[0104] Continuing with the previous example, for example Figure 4 As shown in , multiple sub-feature vector groups are input into the multi-scale attention mechanism to calculate the vector. Figure 4 In the equation, C represents the number of channels of the vector, H represents the height of the vector, W represents the width of the vector, and G represents the number of channels. In this example, the number of channels is set to 16. The sub-feature vectors are branched according to the average pooling operation in the multi-scale attention mechanism and divided into the first branch and the second branch. In the first branch, two one-dimensional vectors are obtained in the horizontal and vertical dimensions of the sub-feature vector group through the horizontal pooling layer and the vertical pooling layer to obtain the long-range information of the one-dimensional vector. The long-range information is the comprehensive information of the horizontal and vertical dimensions. The two one-dimensional vectors containing the long-range information of each dimension are spliced together according to the first dimension, and then the spliced vectors are decomposed into a horizontal vector C / G×1×W and a vertical vector C / G×H×1. The horizontal vector and the vertical vector are input into the sigmoid activation function for activation, so that the values in the vector are normalized to the range of 0-1. The activation result is used to reweight the original sub-feature vector group. After normalizing the reweighted result, the first vector X11: C / G×H×W is obtained. In the second branch, the feature vector is extracted through the convolution pyramid. Figure 5 The figure shows a schematic diagram of the pyramid convolution kernel structure, and the convolution kernel sizes include 3×3, 5×5, and 7×7. Figure 5 , the dimension of the input feature vector group is C i , is the starting data of the pyramid convolution operation, which adopts the layered convolution method. The first layer of convolution uses a 3×3 convolution kernel with a dimension of C 01 , through the first layer of convolution, the input feature vector group is convolved to extract local features; the second layer of convolution uses a 5×5 convolution kernel with a dimension of C 02 , the second convolution layer captures a wider range of feature information; the third convolution layer uses a 7×7 convolution kernel with a dimension of C 03 , obtain the global features through the third layer of convolution; after the pyramid convolution operation, C 01 、C 02 and C 03The output vector is obtained by fusing feature information of different dimensions, with a dimension of C0. Pyramid convolution uses multi-scale convolution kernels in parallel to effectively extract features at different scales, enhancing the model's ability to capture multi-scale information in data such as images. In this example, pyramid convolution produces a second vector X21: C / G × H × W. The dimensions of this second vector match those of the original sub-feature vector group. Smaller kernels in the pyramid convolution kernel are used to identify object details and textures, while larger kernels are used to identify the overall outline of the object. This example uses pyramid convolution kernels of varying sizes to perform multi-scale feature extraction on the feature vector group, effectively extracting object features and increasing global feature information interaction.
[0105] A cross-space learning method is used to fuse the first vector X11 and the second vector X21. Two-dimensional global average pooling is performed on the first and second vectors X11 and X21, respectively, to generate a third vector X12: C / G × 1 × 1 and a fourth vector X22: C / G × 1 × 1. The first, second, third, and fourth vectors are paired and matrix dot products are performed to achieve the fusion of spatial position information and receptive field information. A dot product operation is again performed on the input original sub-feature vector group C / G × H × W to obtain the fused output fifth vector X: C / G × H × W.
[0106] This example uses grouped convolution and multi-scale attention mechanisms to improve the detection rate of small-sized hidden objects. Grouped convolution reduces computational complexity and improves the diversity of feature learning. The multi-scale attention mechanism captures multi-level information at different scales, improving the quality of feature representation.
[0107] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "upper" and "lower" is based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. Unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be internal communication between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances.
[0108] It should also be noted that, in the description of the present invention, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0109] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not limitations on the implementation methods of the present invention. For ordinary technicians in the relevant field, other different forms of changes or modifications can be made based on the above description. It is impossible to list all the implementation methods here. All obvious changes or modifications derived from the technical solution of the present invention are still within the scope of protection of the present invention.
Claims
1. A training method for an artificial intelligence model, characterized in that: The model includes a teacher model and a student model. The method comprises The labeled millimeter-wave human body images and unlabeled millimeter-wave human body images in the detection library are input into the student model according to a preset ratio for training to obtain the prediction results of the student model; Inputting unlabeled millimeter-wave human images in the detection library into the teacher model to obtain the prediction results of the teacher model, and using the prediction results of the teacher model as pseudo labels for the unlabeled millimeter-wave human images in the teacher model; Obtaining soft labels for unlabeled millimeter-wave human images in the teacher model according to the neck pyramid network in the teacher model; Constructing a loss function according to the pseudo labels of the unlabeled millimeter-wave human images in the teacher model, the soft labels of the unlabeled millimeter-wave human images in the teacher model, and the prediction results of the student model; The student model is iterated based on the loss function, and the iterative result of the iterated student model is detected by the teacher model.
2. The method according to claim 1, characterized in that The soft label of the unlabeled millimeter wave human image obtained according to the neck pyramid network in the teacher model includes Obtain feature vectors based on the backbone feature extraction network of the teacher model; Inputting the feature vector into the neck pyramid network of the teacher model for fusion processing to obtain a fusion feature map; The pixels in the fusion feature map whose classification probability is higher than a preset threshold are used as soft labels for unlabeled millimeter-wave human images in the teacher model.
3. The method according to claim 2, characterized in that The loss function is constructed based on the pseudo labels of the unlabeled millimeter wave human images in the teacher model, the soft labels of the unlabeled millimeter wave human images in the teacher model and the prediction results of the student model. Obtaining recognition results of unlabeled millimeter-wave human images according to the neck pyramid network of the student model; According to the soft labels of the unlabeled millimeter-wave human images in the teacher model and the corresponding soft labels in the recognition results of the student model, the distillation loss between the soft labels of the unlabeled millimeter-wave human images in the teacher model and the soft labels of the unlabeled millimeter-wave human images in the student model is obtained.
4. The method according to claim 3, characterized in that The loss function is constructed based on the pseudo labels of the unlabeled millimeter wave human images in the teacher model, the soft labels of the unlabeled millimeter wave human images in the teacher model and the prediction results of the student model. According to the pseudo labels of the unlabeled millimeter-wave human images in the teacher model and the corresponding pseudo labels in the prediction results of the student model, an unsupervised loss between the pseudo labels of the unlabeled millimeter-wave human images in the teacher model and the pseudo labels of the unlabeled millimeter-wave human images in the student model is obtained.
5. The method according to claim 4, characterized in that The loss function is L=L S +αL U +βL D , Among them, L represents the loss function, L S represents the supervision loss between the labeled millimeter-wave human images in the detection library and the labeled millimeter-wave human images in the database, L U represents the unsupervised loss, L D represents the distillation loss, and α and β represent weight coefficients.
6. The method according to claim 1, characterized in that The detecting of the iteration result of the student model after the iteration by the teacher model includes: The student model is iterated according to the iterative formula. After reaching a preset number of iterations, the iterative results of the iterated student model are precision-tested by the teacher model.
7. The method according to claim 6, characterized in that The iterative formula is MOTHER t =∝X t +(1-∝)EMA t-1 , Among them, EMA t Represents the parameters of the teacher model at time t, EMA t-1 represents the parameters of the teacher model at time t-1, X t represents the parameters of the student model at time t, and ∝ represents the update speed.
8. The method according to claim 2, characterized in that The inputting of the feature vector into the neck pyramid network of the teacher model for fusion processing includes: Dividing the feature vector into a plurality of sub-feature vector groups according to the dimension; A cross-space learning method is used to fuse the multiple sub-feature vector groups.
9. The method according to claim 8, characterized in that The step of dividing the feature vector into a plurality of sub-feature vector groups according to the dimension includes: The sub-feature vector group is branched and divided into the first branch and the second branch through the multi-scale attention mechanism; Normalizing the sub-feature vector group of the first branch by using an activation function to obtain a first vector; Convolution processing is performed on the sub-feature vector group of the second branch through a pyramid convolution kernel to obtain a second vector.
10. The method according to claim 9, characterized in that The adopting of a cross-space learning method to fuse the plurality of sub-feature vector groups includes: Performing a two-dimensional global average pooling operation on the first vector and the second vector respectively to obtain a third vector and a fourth vector; A fused fifth vector is obtained according to the first vector, the second vector, the third vector, and the fourth vector.