Multi-source domain target identification method and system based on multi-level feature attention guidance
By using a multi-source domain target recognition method guided by multi-level feature attention during ship navigation, combining real and virtual environment data, optimizing the target recognition model solves the problem of low recognition accuracy caused by the difference between the virtual environment and the real environment, and improves Recognition capability and accuracy under complex weather conditions.
Patent Information
- Application Number
- CN202410612319.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-16
- Publication Date
- 2024-08-30
AI Technical Summary
In the existing technology, the difference between the virtual environment and the real environment results in low target recognition accuracy in ship navigation scenarios. Model training and testing are costly and risky, and it is difficult to achieve accurate recognition in complex weather.
A multi-source domain target recognition method based on attention guidance of multi-level features is adopted. By constructing a target recognition model and combining image data of real and virtual environments, multi-level features are extracted, attention weights are calculated, multi-scale features are aggregated, and multi-scale features are extracted using The feature consistency loss function optimizes the model and enhances the learning ability of domain-invariant features.
It improves the recognition accuracy of ship navigation objects in the real environment, reduces the cost and risk of model training and testing, and enhances the recognition ability in complex weather.
Smart Images

Figure CN118570780A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of multi-source domain target recognition, and in particular to a multi-source domain target recognition method and system based on multi-level feature attention guidance. Background Art
[0002] In the prior art, in order to realize target recognition in ship navigation scenarios, special recognition models are generally required. In order to ensure the effectiveness of the model, a lot of training and testing are required in the early stage. In the process of model training, if a model ship or a real ship experiment is used, there will be problems such as high time resource cost, high risk of unknown experiments, and data loss in complex weather conditions; if virtual ocean environment data is used to simulate the marine data collected in the process of intelligent ship perception under complex weather conditions, the efficiency of the development of intelligent ship navigation perception modules can be improved, the test cost and risk can be reduced, and the training and test cycle of the model can be shortened. However, there are obvious differences between virtual environment and real environment. If the model trained and tested with virtual environment data is directly applied to the ship navigation scene in the real environment, it is difficult to achieve accurate target recognition. Even if the structure of the existing model is further improved, the target recognition accuracy in the real environment is not high. Summary of the invention
[0003] The purpose of the embodiments of the present invention is to provide a multi-source domain target recognition method and system based on multi-level feature attention guidance, which improves the target recognition accuracy of ships sailing in a real environment.
[0004] To achieve the above purpose, the embodiment of the present invention provides the following solution:
[0005] A multi-source domain target recognition method based on multi-level feature attention guidance, the method comprising:
[0006] Acquire an original image set; the original image set at least includes: a sunny weather image in a real environment and a complex weather image in a virtual environment; the complex weather image at least includes: a dusk weather image, a strong light weather image and a cloudy weather image; the sunny weather image and the complex weather image at least include one target object to be identified;
[0007] Constructing a target body recognition model; the target body recognition model at least includes: a feature map determination module and a scale feature aggregation module; the feature map determination module is constructed based on a convolution layer and an average pooling layer;
[0008] Based on the original image set, the feature map determination module is used to extract the features of the target and perform a pooling operation to obtain a plurality of multi-level feature maps under each image in the original image set;
[0009] Based on all multi-level feature maps of each image in the original image set, the scale feature aggregation module is used to calculate attention weights and aggregate multi-level and multi-scale features to obtain a real-domain feature map of each image in the original image set;
[0010] Based on the real domain feature maps of all images in the original image set, style features of two different source domains are arbitrarily exchanged to obtain a virtual domain feature map of each image in the original image set;
[0011] Based on the real domain feature maps and virtual domain feature maps of all images in the original image set, feature map loss is calculated using a feature consistency loss function, and the object recognition model is optimized with the goal of minimizing the feature map loss;
[0012] The image to be identified is input into the optimized target body recognition model to determine the target body in the image to be identified.
[0013] Optionally, the feature map determination module includes: multiple convolution layers and multiple average pooling layers; the convolution layers include: a first convolution layer and a second convolution layer; the sizes of the multiple average pooling layers are different; based on the original image set, the feature map determination module is used to extract the features of the target body and perform a pooling operation to obtain multiple multi-level feature maps under each image in the original image set, specifically including:
[0014] Extracting the target body features of each image in the original image set by using the first convolutional layer to obtain an initial feature map of each image in the original image set;
[0015] Performing a pooling operation on the initial feature map of each image in the original image set using average pooling layers of different sizes to obtain a plurality of pooling feature maps for each image in the original image set;
[0016] Acquire a set of annotated images; the annotated image set at least includes: an annotated image of sunny weather and an annotated image of complex weather; the annotated image of sunny weather and the annotated image of complex weather are both annotated with multiple target features of the target body;
[0017] All target features of each image in the annotated image set are fused with all pooled feature maps of each image in the original image set by using multiple second convolutional layers to obtain multiple multi-level feature maps for each image in the original image set.
[0018] Optionally, the scale feature aggregation module includes: a weight calculation module and a compression excitation module; based on all multi-level feature maps of each image in the original image set, the scale feature aggregation module is used to calculate the attention weight and aggregate the multi-level and multi-scale features to obtain the real domain feature map of each image in the original image set, specifically including:
[0019] Based on all multi-level feature maps of each image in the original image set, a first weight formula in the weight calculation module is used to calculate a plurality of multi-level attention weights for each image in the original image set;
[0020] Based on all multi-level attention weights of each image in the original image set, a plurality of attention feature vectors for each image in the original image set are calculated using the attention feature vector formula in the compression excitation module;
[0021] Based on all attention feature vectors of each image in the original image set, a second weight formula in the compression excitation module is used to calculate multiple channel-level attention weights for each image in the original image set;
[0022] Based on all channel-level attention weights of each image in the original image set, the real-domain feature map of each image in the original image set is calculated using the multi-level aggregate feature formula in the compression excitation module.
[0023] Optionally, based on the real domain feature maps of all images in the original image set, style features of two different source domains are arbitrarily exchanged to obtain a virtual domain feature map of each image in the original image set, specifically:
[0024]
[0025] In the formula, is the virtual domain feature map, X S is the real domain feature map, x is the content of the real domain feature map, y is the style feature of the real domain feature map, σ() is the channel level standard deviation, and μ() is the channel level mean.
[0026] Optionally, based on the real domain feature maps and virtual domain feature maps of all images in the original image set, feature map loss is calculated using a feature consistency loss function, and the object recognition model is optimized with the goal of minimizing the feature map loss, specifically including:
[0027] Calculating the feature map loss of the real domain feature map and the virtual domain feature map of each image in the original image set by using a feature consistency loss function;
[0028] The feature map losses of all images in the original image set are weighted summed, and the target body recognition model is optimized with the goal of minimizing the feature map losses after the weighted summation.
[0029] Optionally, the feature consistency loss function is:
[0030]
[0031] In the formula, is the feature map loss, P is the posterior probability of each object in the RoI feature input classifier of the real domain feature map, The posterior probability of each object in the classifier input for the RoI feature of the virtual domain feature map, P and , Q is the mean of the feature map of the real domain and the feature map of the virtual domain and satisfies D KL [P||Q] is the KL divergence difference between P and Q, for The KL divergence difference between Q and .
[0032] Optionally, the first weight formula is:
[0033]
[0034] In the formula, w n (i, j) is the multi-level attention weight of the n-th multi-level feature map (i, j) position, P n (i, j) is the feature of the nth multi-level feature map (i, j) position, H n is the height of the n-th multi-level feature map, W n is the width of the n-th multi-level feature map.
[0035] A computer system includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the multi-source domain target recognition method based on multi-level feature attention guidance.
[0036] According to the specific embodiments provided by the embodiments of the present invention, the present invention discloses the following technical effects:
[0037] In the process of training the target recognition model, the present invention not only uses the complex weather images in the virtual environment as part of the training samples, but also adds the sunny weather images in the real environment as another part of the training samples. The comprehensive consideration of the real environment and the virtual environment images enables the trained model to be effectively applied to the real ship navigation. In addition, the present invention first extracts the target body features in sunny weather in the real environment and complex weather in the virtual environment, and then obtains the real domain feature map by aggregating multi-level and multi-scale features, and adds a new style style to each source domain by exchanging the style features of different source domains arbitrarily. Secondly, the feature map loss of the real domain feature map and its corresponding virtual domain feature map after the style exchange is calculated, and the loss is used to optimize the entire target body recognition model, enhance the model's ability to learn domain-invariant features, so that the domain-invariant features finally extracted are used for accurate recognition of the target body. Therefore, the present invention improves the target body recognition accuracy of ship navigation in the real environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0039] Figure 1 A flowchart of a multi-source domain target recognition method based on multi-level feature attention guidance provided by an embodiment of the present invention;
[0040] Figure 2 A diagram of the fusion process of the real domain feature map provided by an embodiment of the present invention;
[0041] Figure 3 Four complex weather maps in a virtual environment provided by an embodiment of the present invention;
[0042] Figure 4 The island and reef images under four kinds of complex weather conditions in the virtual environment provided by the embodiment of the present invention;
[0043] Figure 5 Ship images under four complex weather conditions in a virtual environment provided by an embodiment of the present invention;
[0044] Figure 6 A navigation simulation diagram of an intelligent ship in a virtual environment provided by an embodiment of the present invention;
[0045] Figure 7 This is a diagram of target recognition results in a real environment at dusk provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] The purpose of the present invention is to provide a multi-source domain target recognition method and system based on multi-level feature attention guidance, which improves the target recognition accuracy of ships sailing in a real environment.
[0048] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0049] Example 1
[0050] This embodiment provides a multi-source domain target recognition method based on multi-level feature attention guidance. Figure 1 As shown, the method specifically includes:
[0051] Step S1: Acquire an original image set; the original image set includes at least: sunny weather images in a real environment and complex weather images in a virtual environment; complex weather images include at least: dusk weather images, strong light weather images and cloudy weather images; sunny weather images and complex weather images include at least one target object to be identified.
[0052] Step S2: constructing a target body recognition model; the target body recognition model at least includes: a feature map determination module and a scale feature aggregation module; the feature map determination module includes: multiple convolutional layers and multiple average pooling layers; the convolutional layer includes: a first convolutional layer and a second convolutional layer; the sizes of the multiple average pooling layers are different; the scale feature aggregation module includes: a weight calculation module and a compression excitation module. In addition, the target body recognition model also includes a target recognition module, which is used to classify and locate the target body in the image under the constraint of feature consistency, and finally outputs the target body recognition result, that is, the target category and the detection box.
[0053] Step S3: Based on the original image set, the feature map determination module is used to extract the features of the target body and perform a pooling operation to obtain multiple multi-level feature maps under each image in the original image set.
[0054] In this embodiment, step S3 specifically includes:
[0055] Step S31: Use the first convolutional layer to extract the target body features of each image in the original image set, and obtain the initial feature map of each image in the original image set. The feature map is obtained by using a two-dimensional convolutional layer for extracting the target body features in the real environment and the virtual environment and constructing the initial feature map. ( H and W represent feature maps respectively In order to reduce the number of parameters in the model and improve the operating efficiency of the model, three 1×1 convolutional layers are used to reduce The number of channels is , and the initial feature map is obtained At this time, the initial feature map The number of channels C in is 256.
[0056] Step S32: Use average pooling layers of different sizes to perform pooling operations on the initial feature maps of each image in the original image set to obtain multiple pooling feature maps for each image in the original image set. Specifically, first, N average pooling layers of different sizes need to be constructed to pool the initial feature maps. Perform a pooling operation, the size of the pooling operation is (k n is the size of the nth average pooling layer), Each position of size is k n The rectangular pooling area is downsampled to the average value of each area to obtain N pooling feature maps {f 1 ,f 2 ,...,f n}, the nth pooling feature map (H n is the height of the nth pooling feature map, W n is the width of the nth pooling feature map), different pooling feature maps can encode different semantic information of the target or layout in the image. In addition, because the pooling feature map is obtained after the pooling operation based on the average pooling layer of different sizes, the number of pooling feature maps is the same as the number of average pooling layers, which is N.
[0057] Step S33: Obtain an annotated image set; the annotated image set includes at least: an annotated image of sunny weather and an annotated image of complex weather; both the annotated image of sunny weather and the annotated image of complex weather are annotated with multiple target features of the target object. In order to enrich the semantic information of different scales and multiple levels, it is necessary to annotate the target features in the annotated box of the source domain data set. It is also used as the input of the model. Therefore, before fusing the feature map, it is necessary to obtain the target features in the source domain dataset, that is, the target features in the annotated image set.
[0058] Step S34: Use multiple second convolutional layers to fuse all target features of each image in the annotated image set with all pooled feature maps of each image in the original image set to obtain multiple multi-level feature maps for each image in the original image set. With f n , get the fusion target feature map The fusion target feature map The size is adjusted to C×H n ×W n , and the resized fusion target feature map The pooling feature map f of the corresponding size n After fusion, the obtained multi-level feature map {p 1 ,p 2 ,...,p n}, the nth multi-level feature map (Here, H n Represents the height of the n-th multi-level feature map, W n Represents the width of the nth multi-level feature map. Since the multi-level feature map has the same height and width as the pooling feature map, it is represented by a set of letters).
[0059] Step S4: Based on all the multi-level feature maps of each image in the original image set, the scale feature aggregation module is used to calculate the attention weight and aggregate the multi-level and multi-scale features to obtain the real domain feature map of each image in the original image set.
[0060] In this embodiment, step S4 specifically includes:
[0061] Step S41: Based on all the multi-level feature maps of each image in the original image set, the first weight formula in the weight calculation module is used to calculate multiple multi-level attention weights for each image in the original image set. By calculating the multi-level attention weights, the model pays more attention to the target's discriminative features, which is more conducive to obtaining detailed information such as the texture of the target. Among them, the first weight formula is:
[0062]
[0063] In the formula, w n (i, j) is the multi-level attention weight of the n-th multi-level feature map (i, j) position, P n (i, j) is the feature of the nth multi-level feature map (i, j) position.
[0064] Step S42: Based on all the multi-level attention weights of each image in the original image set, multiple attention feature vectors for each image in the original image set are calculated using the attention feature vector formula in the compression excitation module. The attention feature vector formula is:
[0065]
[0066] Where V n is the nth attention feature vector.
[0067] Step S43: Based on all the attention feature vectors of each image in the original image set, the second weight formula in the compression excitation module is used to calculate multiple channel-level attention weights for each image in the original image set. Specifically, the attention vectors are first fused by element-by-element addition. Secondly, feature z is used to guide the adaptive selection of batch normalization, and the dimension of feature z is set to C / 2; then, each attention vector V is calculated n Channel-level attention weights Among them, the second weight formula is:
[0068]
[0069] In the formula, a n is the nth learnable parameter (the learnable parameters in the fully connected layer of each scale are different).
[0070] Step S44: Based on all channel-level attention weights of each image in the original image set, the real domain feature map of each image in the original image set is calculated using the multi-level aggregate feature formula in the compression excitation module. The multi-level aggregate feature formula is:
[0071]
[0072] Where, X S It is the feature map of the real domain.
[0073] Step S5: Based on the real domain feature maps of all images in the original image set, the style features of two different source domains are arbitrarily exchanged to obtain the virtual domain feature map of each image in the original image set, specifically:
[0074]
[0075] In the formula, is the virtual domain feature map, x is the content of the real domain feature map, y is the style feature of the real domain feature map, σ() is the channel level standard deviation, and μ() is the channel level mean.
[0076] The execution process of the above steps S3 to S5 can be found in Figure 2.
[0077] Step S6: Based on the real domain feature maps and virtual domain feature maps of all images in the original image set, the feature map loss is calculated using the feature consistency loss function, and the target body recognition model is optimized with the goal of minimizing the feature map loss. The feature consistency loss function is:
[0078]
[0079] In the formula, is the feature map loss, P is the posterior probability of each object in the RoI feature input classifier of the real domain feature map, The posterior probability of each object in the classifier input for the RoI feature of the virtual domain feature map, P and , Q is the mean of the feature map of the real domain and the feature map of the virtual domain and satisfies D KL [P||Q] is the KL divergence difference between P and Q, for The KL divergence difference between Q and JS divergence emphasizes the invariance of semantics between different styles, thereby promoting the consistency of feature information extracted by the model under different weather conditions, so that it is not disturbed by complex unknown environments.
[0080] Furthermore, the extracted domain-invariant features are used for the recognition, positioning and classification of targets through the feature consistency constraint loss function, which improves the target recognition performance in complex environments of the real domain. In addition, in the process of training the target recognition model, in addition to considering the feature consistency loss, the target recognition loss is also considered, that is:
[0081]
[0082] In the formula, is the target identification loss, is the classification loss, is the detection box regression loss.
[0083] In this embodiment, the classification loss Cross entropy loss is used to measure the classification prediction error of the model, and its expression is:
[0084]
[0085] In the formula, J is the real category label of the target object, represented by a one-hot encoding vector, and p is the predicted probability distribution vector of the model, representing the predicted probability of each category. The category here refers to the category of the target object, such as bulk cargo, container, cruise ship, island reef, sailboat, etc.
[0086] In this embodiment, the detection box regression loss The smooth_L1 loss is used to measure the detection box prediction error of the model, and its expression is:
[0087]
[0088] In the formula, smooth_L1 is the smooth L1 loss function, which uses L1 loss when the prediction error is small and L2 loss when the error is large to reduce the impact of outliers. d is the position and size of the detection box predicted by the model, and d_true is the position and size of the true detection box.
[0089] In order to better optimize the target recognition model, this embodiment can also use feature map loss and target recognition loss Jointly constrain the training model, that is, by reducing the total loss (It is a manually adjusted hyperparameter, which is set to 0.1 in this embodiment) to improve the target recognition accuracy in different source domains such as cloudy days, dusk days and foggy days in real ocean scenes.
[0090] Step S7: input the image to be identified into the optimized target body recognition model to determine the target body in the image to be identified.
[0091] Example 2
[0092] In order to verify the effectiveness of the above multi-source domain target recognition method based on multi-level feature attention guidance, this embodiment uses sunny weather in the real environment and four complex weather conditions in the virtual environment as training sets, and dusk, cloudy and foggy weather in the real environment as test sets. Among them, the virtual data set in the virtual environment comes from the Unity3D ocean environment construction platform.
[0093] The virtual data set built based on Unity3D mainly includes four weather conditions: dusk, sunny, strong light and cloudy, as well as islands, reefs and ships under different complex weather conditions. Figure 3 Shows weather data for dusk, cloudy, strong light and sunny days in a virtual environment; Figure 4 The island and reef data under four complex weather conditions in the virtual environment are shown; Figure 5 Ship data under four complex weather conditions in a virtual environment; Figure 6 It provides navigation simulation data for smart ships in a virtual environment, which reduces the risk and cost of training and validating models directly in complex weather.
[0094] The sunny weather in the real environment and the strong light environment, dusk, cloudy and sunny days in the virtual environment are used as multi-source domain training models, and the foggy day, dusk and cloudy days in the real environment are used as unknown target domain test models. Among them, the complex virtual environment includes 1742 sunny days, 1400 dusk days, 1537 cloudy days and 1193 strong light environment data, and the real sunny day environment is 1218. The real environment data set includes 1370 foggy days, 329 dusks and 1819 cloudy days. During model training, the model cannot access the data of the test set. This embodiment uses 6 public categories of the data set: bulk carriers, container ships, cruise ships, sailboats, other ships and islands and reefs, and uses the mean average precision (mAP) with a threshold of 0.5 as the category measurement indicator to verify the effectiveness of the above-mentioned multi-source domain target recognition method guided by multi-level feature attention.
[0095] The design of the comparative experiment is as follows:
[0096] Design 1: Verify only in virtual datasets. The purpose is to verify the generalization performance of multi-scale, multi-pose and unknown environments in different complex environments in the same virtual environment. Among them, the source domain of the dataset is divided into two parts: dusk weather combined with clear weather, and clear weather, cloudy weather and strong light environment, which correspond to the unknown target domains of cloudy weather combined with strong light weather and dusk weather. For specific verification results, see Table 1 and Table 2.
[0097] Table 1 Comparison results of virtual environment S+D->C+H (%)
[0098]
[0099] As shown in Table 1, in the virtual dataset, the ship recognition accuracy reaches 80.3% mAP when the training set is sunny (S) and dusk (D), and the test set is cloudy (C) and high light environment (H), which is 2.9%, 1.3%, 1.5% and 1.2% higher than other classic target recognition generalization models GPA, GDIFD, VDD and DIDN, respectively.
[0100] Table 2 Comparison results of S+C+H->D in virtual environment (%)
[0101]
[0102] As shown in Table 2, in the virtual dataset, the ship recognition accuracy reaches 67.8% mAP when the training set is sunny (S), cloudy (C) and high light environment (H), and the test set is dusk, which is 5.0%, 1.5%, 4.6% and 2.2% higher than that of GPA, GDIFD, VDD and DIDN methods respectively.
[0103] Design 2: Use virtual data sets and real sunny data to train the model, and test the recognition performance of the model in real environments under dusk, foggy and cloudy weather. The purpose is to verify the generalization performance of the target recognition model in multi-scale, multi-pose and unknown environment models in the virtual-real environment. See Tables 3 to 5 for specific verification results.
[0104] Table 3 Test results of cloudy weather under real environment (%)
[0105]
[0106] As shown in Table 3, the training set (source domain) is sunny, cloudy, high-light environment, dusk weather in the virtual environment and sunny weather in the real environment, and the test set (unknown target domain) is cloudy weather in the real environment. The result of marine target recognition is 57.2% mAP, which is 1.7%, 0.4%, 1.0% and 0.8% higher than other classic target recognition generalization models GPA, GDIFD, VDD and DIDN respectively.
[0107] Table 4 Test results of foggy weather under real environment (%)
[0108]
[0109] As shown in Table 4, the training set (source domain) is sunny, cloudy, bright, dusk in a virtual environment, and sunny in a real environment, and the test set (unknown target domain) is foggy in a real environment. The result of sea target recognition is 58.7% mAP, which is 1.9%, 0.5%, 1.4%, and 0.9% higher than other classic target recognition generalization models GPA, GDIFD, VDD, and DIDN, respectively.
[0110] Table 5 Test results of dusk weather under real environment (%)
[0111]
[0112] As shown in Table 5, the training set (source domain) is sunny, cloudy, bright, dusk in the virtual environment and sunny in the real environment, and the test set (target domain) is dusk in the real environment. The result of maritime target recognition is 58.3% mAP, which is 1.6%, 0.3%, 1.2% and 0.5% higher than other classic target recognition generalization models GPA, GDIFD, VDD and DIDN respectively.
[0113] In addition, the present invention also provides a computer system, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-mentioned multi-source domain target recognition method based on multi-level feature attention guidance.
[0114] In summary, in the virtual-real generalization process, this embodiment uses sunny weather in the real environment and sunny, strong light, dusk and cloudy weather in the virtual environment as five source domain training models, and uses cloudy, dusk and foggy weather in the real ocean scene as unknown target domain test models. Figure 7 This is the recognition result of the target object in the real environment. Figure 7 It can be seen from the results that the multi-source domain target recognition method based on multi-level feature attention guidance of the present invention can show better recognition results, can effectively improve the generalization recognition ability of virtual and real in complex ocean scenes, and improve the target recognition accuracy of ships sailing in real environments.
[0115] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0116] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A multi-source domain target recognition method based on multi-level feature attention guidance, characterized in that: The method comprises: Acquire an original image set; the original image set at least includes: a sunny weather image in a real environment and a complex weather image in a virtual environment; the complex weather image at least includes: a dusk weather image, a strong light weather image and a cloudy weather image; the sunny weather image and the complex weather image at least include one target object to be identified; Constructing a target body recognition model; the target body recognition model at least includes: a feature map determination module and a scale feature aggregation module; the feature map determination module is constructed based on a convolution layer and an average pooling layer; Based on the original image set, the feature map determination module is used to extract the features of the target and perform a pooling operation to obtain a plurality of multi-level feature maps under each image in the original image set; Based on all multi-level feature maps of each image in the original image set, the scale feature aggregation module is used to calculate attention weights and aggregate multi-level and multi-scale features to obtain a real-domain feature map of each image in the original image set; Based on the real domain feature maps of all images in the original image set, style features of two different source domains are arbitrarily exchanged to obtain a virtual domain feature map of each image in the original image set; Based on the real domain feature maps and virtual domain feature maps of all images in the original image set, feature map loss is calculated using a feature consistency loss function, and the object recognition model is optimized with the goal of minimizing the feature map loss; The image to be identified is input into the optimized target body recognition model to determine the target body in the image to be identified.
2. The multi-source domain target recognition method based on multi-level feature attention guidance according to claim 1 is characterized in that: The feature map determination module includes: multiple convolution layers and multiple average pooling layers; the convolution layers include: a first convolution layer and a second convolution layer; the sizes of the multiple average pooling layers are different; based on the original image set, the feature map determination module is used to extract the features of the target body and perform a pooling operation to obtain multiple multi-level feature maps under each image in the original image set, specifically including: Extracting the target body features of each image in the original image set by using the first convolutional layer to obtain an initial feature map of each image in the original image set; Performing a pooling operation on the initial feature map of each image in the original image set using average pooling layers of different sizes to obtain a plurality of pooling feature maps for each image in the original image set; Acquire a set of annotated images; the annotated image set at least includes: an annotated image of sunny weather and an annotated image of complex weather; the annotated image of sunny weather and the annotated image of complex weather are both annotated with multiple target features of the target body; All target features of each image in the annotated image set are fused with all pooled feature maps of each image in the original image set by using multiple second convolutional layers to obtain multiple multi-level feature maps for each image in the original image set.
3. The multi-source domain target recognition method based on multi-level feature attention guidance according to claim 1 is characterized in that: The scale feature aggregation module includes: a weight calculation module and a compression excitation module; based on all multi-level feature maps of each image in the original image set, the scale feature aggregation module is used to calculate the attention weight and aggregate the multi-level and multi-scale features to obtain the real domain feature map of each image in the original image set, specifically including: Based on all multi-level feature maps of each image in the original image set, a first weight formula in the weight calculation module is used to calculate a plurality of multi-level attention weights for each image in the original image set; Based on all multi-level attention weights of each image in the original image set, a plurality of attention feature vectors for each image in the original image set are calculated using the attention feature vector formula in the compression excitation module; Based on all attention feature vectors of each image in the original image set, a second weight formula in the compression excitation module is used to calculate multiple channel-level attention weights for each image in the original image set; Based on all channel-level attention weights of each image in the original image set, the real-domain feature map of each image in the original image set is calculated using the multi-level aggregate feature formula in the compression excitation module.
4. The multi-source domain target recognition method based on multi-level feature attention guidance according to claim 1 is characterized in that: Based on the real domain feature maps of all images in the original image set, the style features of two different source domains are arbitrarily exchanged to obtain the virtual domain feature map of each image in the original image set, specifically: In the formula, is the virtual domain feature map, X S is the real domain feature map, x is the content of the real domain feature map, y is the style feature of the real domain feature map, σ() is the channel level standard deviation, and μ() is the channel level mean.
5. The multi-source domain target recognition method based on multi-level feature attention guidance according to claim 1 is characterized in that: Based on the real domain feature maps and virtual domain feature maps of all images in the original image set, the feature map loss is calculated using a feature consistency loss function, and the target body recognition model is optimized with the goal of minimizing the feature map loss, specifically including: Calculating the feature map loss of the real domain feature map and the virtual domain feature map of each image in the original image set by using a feature consistency loss function; The feature map losses of all images in the original image set are weighted summed, and the target body recognition model is optimized with the goal of minimizing the feature map losses after the weighted summation.
6. The multi-source domain target recognition method based on multi-level feature attention guidance according to claim 5 is characterized in that: The feature consistency loss function is: In the formula, is the feature map loss, P is the posterior probability of each object in the RoI feature input classifier of the real domain feature map, The posterior probability of each object in the classifier input for the RoI feature of the virtual domain feature map, P and , Q is the mean of the feature map of the real domain and the feature map of the virtual domain and satisfies D KL [P||Q] is the KL divergence difference between P and Q, for The KL divergence difference between Q and .
7. The multi-source domain target recognition method based on multi-level feature attention guidance according to claim 3 is characterized in that: The first weight formula is: In the formula, w n (i, j) is the multi-level attention weight of the n-th multi-level feature map (i, j) position, P n (i, j) is the feature of the nth multi-level feature map (i, j) position, H n is the height of the n-th multi-level feature map, W n is the width of the n-th multi-level feature map.
8. A computer system comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the multi-source domain target recognition method based on multi-level feature attention guidance as described in any one of claims 1-7.
