Artificial intelligence-based target detection method, device, equipment and storage medium
By combining the key object detection model and the anchor feature extraction model, the fusion processing of image features and anchor position data is solved, and the problem of insufficient robustness for detection of small targets and non-rigid objects in the prior art is achieved, and the cost of manual labeling is reduced.
Patent Information
- Application Number
- CN202210358349.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-06
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2042-04-06
AI Technical Summary
The existing category-based weakly supervised object detection method is poorly robust to small targets and non-rigid objects, and there is a problem of repeated labeling, the decision-making mechanism of the model is unknown, and there is lack of interpretability.
A target detection method based on artificial intelligence is proposed. By acquiring image features and equally spaced anchor position data, combining the key object detection model and anchor feature extraction model, key object heat map detection and anchor image feature extraction are carried out, and anchor point classification is determined after the fusion process, and the target detection result is finally generated.
It improves the robustness of small targets and non-rigid objects, reduces the cost of manual labeling, enhances the interpretability and credibility of the model, and improves the accuracy of the target detection results.
Smart Images

Figure CN114742990B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to an artificial intelligence-based target detection method, device, equipment and storage medium. Background Art
[0002] In the task of object detection, labeling instance-level annotation information requires a lot of manpower and material resources. In contrast, labeling images by category is a time-saving and labor-saving method that can provide a large amount of data resources for model training. Most existing object detection networks rely on pre-defined anchor boxes. However, in practical applications, the size of the objects to be detected is often complex and changeable. Even if the anchor boxes are carefully designed, the pre-defined anchor boxes often cannot meet all situations. When the shape or size of the object changes significantly, the detection result is poor, so its generalization ability will be limited. Therefore, using weak supervision to learn object detection has become a hot research topic. However, the category-based weak supervision method has poor robustness for small objects and non-rigid objects, and there will also be problems with repeated labeling. The decision mechanism of the model is still unknown and lacks interpretability. Summary of the invention
[0003] The main purpose of this application is to provide an artificial intelligence-based target detection method, device, equipment and storage medium, aiming to solve the technical problems that the current category-based weak supervision method has poor robustness for small targets and non-rigid objects, and there will be problems of repeated labeling, the decision mechanism of the model is still unknown, and there is a lack of explainability.
[0004] In order to achieve the above-mentioned invention object, the present application proposes an artificial intelligence-based target detection method, the method comprising:
[0005] Obtain the image features to be detected and equally spaced anchor point position data corresponding to the initial image;
[0006] Inputting the image features to be detected into a preset key target detection model to perform key target heat map detection, wherein the key target detection model includes: a class activation mapping module and a key target heat map mapping module;
[0007] Inputting the image features to be detected and the equally spaced anchor point position data into a preset anchor point feature extraction model to extract anchor point image features;
[0008] Fusing each of the key target heat maps with the anchor point image features to obtain anchor point fusion features;
[0009] Determining the anchor point classification of each anchor point according to the anchor point fusion feature and a preset anchor point thermal threshold;
[0010] Generate a target detection result according to the anchor point classifications corresponding to the anchor points.
[0011] Furthermore, the step of inputting the image features to be detected into a preset key target detection model to perform key target heat map detection includes:
[0012] Inputting the image features to be detected into a decoder of the class activation mapping module to generate feature mapping data;
[0013] Inputting the feature map data into the global average pooling layer of the class activation map module to generate a classification prediction vector;
[0014] Inputting the classification prediction vector into the heat map generation submodule of the key target heat map mapping module to generate an initial target heat map;
[0015] The initial target heat map is input into the upsampling submodule of the key target heat map mapping module for upsampling to generate the key target heat map.
[0016] Furthermore, the calculation formula K of the initial target thermal map is:
[0017]
[0018]
[0019] Where N is the total number of vector elements in the classification prediction vector, s n is the value of the nth vector element in the classification prediction vector, σ(M n ) is for M n Normalization is performed, C is the number of channels of the last convolutional layer of the decoder, ω i,n is the value of W indexed by (i,n), W∈R C×N , R C×N is the weight matrix of the global average pooling layer, F i is the i-th feature in the feature map data, F i Corresponding to the i-th channel of the last convolutional layer of the decoder.
[0020] Furthermore, the step of inputting the image features to be detected and the equally spaced anchor point position data into a preset anchor point feature extraction model to extract anchor point image features includes:
[0021] Inputting the image features to be detected into the feature extraction module of the anchor feature extraction model for feature extraction to form image features to be analyzed, wherein the feature extraction module sequentially includes: a first convolution layer, a second convolution layer, a third convolution layer, a fourth convolution layer and a fifth convolution layer;
[0022] The feature fusion module of the anchor point feature extraction model is used to multiply the image feature to be analyzed and the equally spaced anchor point position data to form the anchor point image feature.
[0023] Furthermore, the number of channels of the first convolutional layer, the second convolutional layer, and the third convolutional layer are all 256;
[0024] The number of channels of the fourth convolutional layer is 128;
[0025] The number of channels of the fifth convolutional layer is 512.
[0026] Furthermore, the step of fusing each of the key target heat maps with the anchor image features to obtain anchor fusion features includes:
[0027] Calculate the influence weight of each anchor point according to each of the key target heat maps;
[0028] The data at the same anchor point position is multiplied according to each of the influence weights and the anchor point image features to obtain the anchor point fusion feature.
[0029] Furthermore, the step of generating a target detection result according to each of the anchor point classifications corresponding to each of the anchor points includes:
[0030] Using the OPENCV regression method, the rectangular box regression is performed on each anchor point classification corresponding to each anchor point to obtain the anchor rectangular box corresponding to each target;
[0031] The coordinates of the four vertices of each of the anchor rectangles are used as a vertex coordinate set;
[0032] Each of the vertex coordinate sets is used as the target detection result.
[0033] The present application also proposes an artificial intelligence-based target detection device, the device comprising:
[0034] A data acquisition module is used to acquire the image features to be detected and the equally spaced anchor point position data corresponding to the initial image;
[0035] A key target heat map determination module, used for inputting the image features to be detected into a preset key target detection model to perform key target heat map detection, wherein the key target detection model includes: a class activation mapping module and a key target heat map mapping module;
[0036] An anchor point image feature determination module, used for inputting the image features to be detected and the equally spaced anchor point position data into a preset anchor point feature extraction model to extract anchor point image features;
[0037] An anchor fusion feature determination module, used for fusing each of the key target heat maps with the anchor image features to obtain an anchor fusion feature;
[0038] An anchor point classification determination module, used to determine the anchor point classification of each anchor point according to the anchor point fusion feature and a preset anchor point thermal threshold;
[0039] The target detection result determination module is used to generate a target detection result according to the respective anchor point classifications corresponding to the respective anchor points.
[0040] The present application also proposes a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.
[0041] The present application also proposes a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.
[0042] The present application discloses an artificial intelligence-based target detection method, device, equipment and storage medium, wherein the method performs key target heat map detection by inputting the image features to be detected into a preset key target detection model, wherein the key target detection model includes: a class activation mapping module and a key target heat map mapping module; inputting the image features to be detected and the equally spaced anchor point position data into a preset anchor point feature extraction model to extract anchor point image features; fusing each of the key target heat maps and the anchor point image features to obtain an anchor point fusion feature; determining the anchor point classification of each anchor point based on the anchor point fusion feature and a preset anchor point thermal threshold; and generating a target detection result based on each of the anchor point classifications corresponding to each of the anchor points. Firstly, the thermal information of the target’s composition information is realized through the key target detection model. Secondly, the image features of each anchor point are extracted through the anchor point feature extraction model. Then, according to the extracted thermal information of the target and the image features of the anchor point, fusion processing, anchor point classification and target detection result are performed in sequence, thereby realizing the target detection result based on category label combined with class activation mapping, reducing the cost of manual labeling. Class activation mapping makes the model interpretable, explains to the user the reasons why the model makes decisions, and increases the credibility of the model. By introducing equally spaced anchor point position data, it is possible to solve the local focusing problem of objects well, improve the robustness to small targets and non-rigid objects, and improve the accuracy of the determined target detection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1A schematic diagram of a process of an artificial intelligence-based target detection method according to an embodiment of the present application;
[0044] Figure 2 This is a schematic block diagram of the structure of an artificial intelligence-based target detection device according to an embodiment of the present application;
[0045] Figure 3 A schematic block diagram of the structure of a computer device according to an embodiment of the present application.
[0046] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0048] Reference Figure 1 In an embodiment of the present application, a method for target detection based on artificial intelligence is provided, and the method comprises the following steps S1-S6:
[0049] S1: Obtain the image features to be detected and the equally spaced anchor point position data corresponding to the initial image;
[0050] S2: Inputting the image features to be detected into a preset key target detection model to perform key target heat map detection, wherein the key target detection model includes: a class activation mapping module and a key target heat map mapping module;
[0051] S3: Inputting the image features to be detected and the equally spaced anchor point position data into a preset anchor point feature extraction model to extract anchor point image features;
[0052] S4: fusing each of the key target heat maps with the anchor image features to obtain anchor fusion features;
[0053] S5: determining the anchor point classification of each anchor point according to the anchor point fusion feature and a preset anchor point thermal threshold;
[0054] S6: Generate a target detection result according to the anchor point classifications corresponding to the anchor points.
[0055] This embodiment first realizes the thermal information of the target's composition information through a key target detection model, and then extracts the image features of each anchor point through an anchor point feature extraction model, and then performs fusion processing, anchor point classification and target detection result determination in sequence according to the extracted thermal information of the target and the image features of the anchor point, thereby achieving target detection results based on category labels combined with class activation mapping, reducing the cost of manual labeling, and class activation mapping makes the model interpretable, explaining to users why the model makes decisions, and increasing the credibility of the model; by introducing equally spaced anchor point position data, it is possible to solve the local focusing problem of objects well, improve the robustness to small targets and non-rigid objects, and improve the accuracy of the determined target detection results.
[0056] For S1, the image features to be detected and the equally spaced anchor point position data corresponding to the initial image input by the user can be obtained, the image features to be detected and the equally spaced anchor point position data corresponding to the initial image can be obtained from the database, and the image features to be detected and the equally spaced anchor point position data corresponding to the initial image can also be obtained from a third-party application.
[0057] The initial image is an image that needs to be detected, where the target includes but is not limited to: objects, animals, and organisms.
[0058] The image features to be detected are image features extracted from the initial image.
[0059] Optionally, the initial image is input into a preset image feature extraction model to extract image features to obtain the image features to be detected, wherein the image feature extraction model is a model obtained by training the initial model with multiple training samples, and the last fully connected layer of the Resnet50 model is deleted, and the deleted Resnet50 is used as the initial model.
[0060] The Resnet50 model is a type of residual network. The Resnet50 model has very good feature capture capabilities for images.
[0061] It is understandable that the initial model may also adopt other network structures, which are not limited here.
[0062] The training samples include: image samples and image feature calibration data. Image feature calibration data is the accurate result of the image features corresponding to the image samples.
[0063] Optionally, the image samples are images extracted from ImageNet. ImageNet is a large visual database used for visual object recognition software research; more than 14 million image URLs are manually annotated by ImageNet to indicate objects in the pictures; and bounding boxes are also provided in at least one million images. Using images extracted from ImageNet as the image samples is conducive to reducing the training cost of the classification network model (that is, the key target detection model).
[0064] The equally spaced anchor point position data is obtained by using a preset step to obtain equally spaced pixel points from the initial image, taking each obtained pixel point as an anchor point, and taking each pixel position corresponding to each anchor point as the equally spaced anchor point position data. In other words, the equally spaced anchor point position data is a collection of pixel positions of each anchor point.
[0065] Optionally, a preset stride is used in the horizontal direction to obtain equally spaced pixel points from the initial image, and each obtained pixel point is used as an anchor point.
[0066] Optionally, a preset step is used in the vertical direction to obtain equally spaced pixel points from the initial image, and each obtained pixel point is used as an anchor point.
[0067] Optionally, a preset step is used in both the horizontal and vertical directions to obtain equally spaced pixel points from the initial image, and each obtained pixel point is used as an anchor point.
[0068] For S2, the features of the image to be detected are input into the class activation mapping module for classification prediction to achieve coarse positioning of the detection target, and the data obtained by the classification prediction are input into the key target heat map mapping module for key target mapping heat map, and the heat map obtained by mapping is used as the key target heat map.
[0069] Among them, the class activation mapping module is a model trained based on class activation mapping (CAM).
[0070] The key target heat map mapping module is used to calculate the key target mapping heat map according to the output results of the class activation mapping module.
[0071] For S3, the image features to be detected and the equally spaced anchor point position data are input into a preset anchor point feature extraction model to extract anchor point image features, thereby determining the image features of each anchor point, providing a basis for subsequent anchor point classification.
[0072] The anchor feature extraction model is a model obtained by training a convolutional neural network.
[0073] For S4, each of the key target heat maps and the anchor image features is fused with the values of the same anchor position to form an anchor fusion feature.
[0074] For S5, determine whether the feature value of each anchor point in the anchor point fusion feature is greater than the anchor point thermal threshold, classify the anchor point corresponding to each anchor point whose feature value is greater than the anchor point thermal threshold as the target, and classify the anchor point corresponding to each anchor point whose feature value is less than or equal to the anchor point thermal threshold as the background.
[0075] For S6, the anchor rectangle of each target is determined according to the classification of each anchor point corresponding to each anchor point, and the coordinates of the four vertices corresponding to each anchor rectangle are used as the target detection result.
[0076] Optionally, the key target detection model and the anchor feature extraction model are trained simultaneously, and the loss value of the key target detection model and the loss value of the anchor feature extraction model are weightedly summed, and the value obtained by the weighted sum is used as the total loss value, and the network parameters of the key target detection model and the anchor feature extraction model are updated according to the total loss value, wherein the loss function used to calculate the loss value of the key target detection model adopts the cross entropy loss function, and the loss function used to calculate the loss value of the anchor feature extraction model adopts the cross entropy loss function.
[0077] In one embodiment, the step of inputting the image features to be detected into a preset key target detection model to perform key target heat map detection includes the following steps S21-S24:
[0078] S21: inputting the image features to be detected into the decoder of the class activation mapping module to generate feature mapping data;
[0079] S22: Inputting the feature map data into the global average pooling layer of the class activation map module to generate a classification prediction vector;
[0080] S23: inputting the classification prediction vector into the heat map generation submodule of the key target heat map mapping module to generate an initial target heat map;
[0081] S24: Inputting the initial target heat map into the upsampling submodule of the key target heat map mapping module for upsampling to generate the key target heat map.
[0082] This embodiment realizes obtaining a key target heat map based on category labels combined with class activation mapping, reducing the cost of manual labeling. Class activation mapping makes the model interpretable, explains to users why the model makes decisions, and increases the credibility of the model.
[0083] For S21, the image features to be detected are input into the decoder of the class activation mapping module to extract a multi-dimensional feature map, and the extracted data is used as feature map data.
[0084] For S22, the feature map data is input into the global average pooling layer of the class activation mapping module to perform probability prediction based on the category label, and the predicted data is used as a classification prediction vector.
[0085] Category label is the category corresponding to the target.
[0086] For S23, the initial image may contain multiple types of targets, so it is necessary to calculate the key target mapping heat map. The classification prediction vector is input into the heat map generation submodule of the key target heat map mapping module to perform key target mapping heat map, and the mapped heat map is used as the initial target heat map.
[0087] For S24, the initial target heat map is input into the upsampling submodule of the key target heat map mapping module for upsampling, and the upsampled data is used as the key target heat map.
[0088] It can be understood that the image size corresponding to the key target heat map is the same as the size of the initial image.
[0089] In one embodiment, the calculation formula K of the initial target heat map is:
[0090]
[0091]
[0092] Where N is the total number of vector elements in the classification prediction vector, s n is the value of the nth vector element in the classification prediction vector, σ(M n ) is for M n Normalization is performed, C is the number of channels of the last convolutional layer of the decoder, ω i,n is the value of W indexed by (i,n), W∈R C×N , R C×N is the weight matrix of the global average pooling layer, F i is the i-th feature in the feature map data, F i Corresponding to the i-th channel of the last convolutional layer of the decoder.
[0093] This embodiment realizes the calculation of the key target mapping heat map according to the classification prediction vector, thereby extracting the composition information of the key target, and realizes the target detection result based on the category label combined with the class activation mapping, which reduces the cost of manual labeling. The class activation mapping makes the model interpretable, explains to the user the reasons why the model makes decisions, and increases the credibility of the model.
[0094] σ(M n ) can use sigmoid activation function to n Normalization calculation can also be performed using the softmax activation function for M n Perform normalized calculations.
[0095] Sigmoid is a common S-shaped function in biology, also known as the S-shaped growth curve.
[0096] Softmax is a normalized exponential function.
[0097] In one embodiment, the step of inputting the image features to be detected and the equally spaced anchor point position data into a preset anchor point feature extraction model to extract anchor point image features comprises the following steps S31-S32:
[0098] S31: Inputting the image feature to be detected into the feature extraction module of the anchor feature extraction model for feature extraction to form the image feature to be analyzed, wherein the feature extraction module sequentially includes: a first convolution layer, a second convolution layer, a third convolution layer, a fourth convolution layer and a fifth convolution layer;
[0099] S32: using the feature fusion module of the anchor point feature extraction model to multiply the image feature to be analyzed and the equally spaced anchor point position data to form the anchor point image feature.
[0100] This embodiment first uses a feature extraction module to further extract features of the image to be detected, and then multiplies the extracted features with the equally spaced anchor point position data, thereby determining the image features of each anchor point, providing a basis for subsequent classification of the anchor points.
[0101] For S31, the first convolutional layer, the second convolutional layer, the third convolutional layer, the fourth convolutional layer and the fifth convolutional layer are connected in sequence.
[0102] The image features to be detected are input into the feature extraction module of the anchor feature extraction model for feature extraction, and the features output by the fifth convolutional layer of the feature extraction module are used as the image features to be analyzed.
[0103] For S32, the feature fusion module of the anchor point feature extraction model is used to multiply the image feature to be analyzed and the equally spaced anchor point position data, and the multiplied data is used as the anchor point image feature, thereby extracting the image feature of each anchor point.
[0104] In one embodiment, the number of channels of the first convolutional layer, the second convolutional layer and the third convolutional layer are all 256;
[0105] The number of channels of the fourth convolutional layer is 128;
[0106] The number of channels of the fifth convolutional layer is 512.
[0107] In this embodiment, the number of channels of the fifth convolutional layer is set to 512, so that the image size corresponding to the image feature to be analyzed is equal to the image size corresponding to the initial image.
[0108] A feature map is output for each channel of the fifth convolutional layer.
[0109] It can be understood that the number of channels of the first convolutional layer, the second convolutional layer, the third convolutional layer, the fourth convolutional layer and the fifth convolutional layer can also be set to other data, which is not limited here.
[0110] In one embodiment, the above step of fusing each of the key target heat maps with the anchor image features to obtain the anchor fusion features includes the following steps S41-S42:
[0111] S41: Calculating the influence weight of each anchor point according to each of the key target heat maps;
[0112] S42: Perform multiplication processing on the data at the same anchor point position according to each of the influence weights and the anchor point image features to obtain the anchor point fusion feature.
[0113] This embodiment performs data multiplication processing on the same anchor point position according to each of the influence weights and the anchor point image features, thereby enhancing or suppressing the influence of different anchor points, and provides a basis for classifying the anchor points.
[0114] For S41, the calculation formula for the influence weight of the ath anchor point is:
[0115]
[0116] Among them, p(a) is the coordinate of the ath anchor point corresponding to the initial image, K(p(a)) is the thermal value corresponding to the ath anchor point in each of the key target thermal maps, and A is the total number of anchor points corresponding to the initial image.
[0117] For S42, each of the influence weights and the anchor image features is multiplied by data at the same anchor position, and the multiplied data is used as the anchor fusion feature, so as to enhance or suppress the influence of different anchors.
[0118] For example, the influence weight corresponding to the j-th anchor point is multiplied by the image feature corresponding to the j-th anchor point in the anchor image feature, and the multiplied data is used as the fusion feature corresponding to the j-th anchor point in the anchor fusion feature.
[0119] In one embodiment, the step of generating the target detection result according to the classification of each anchor point corresponding to each anchor point comprises the following steps S61-S63:
[0120] S61: using the OPENCV regression method, regressing the rectangular boxes of the anchor point classifications corresponding to the anchor points, and obtaining the anchor rectangular boxes corresponding to each target;
[0121] S62: taking the coordinates of the four vertices of each of the anchored rectangular boxes as a vertex coordinate set;
[0122] S63: taking each of the vertex coordinate sets as the target detection result.
[0123] This embodiment performs rectangular frame regression based on anchor point classification, thereby generating an anchor rectangular frame according to actual conditions, which can effectively solve the local focusing problem of the object, improve the robustness to small targets and non-rigid objects, and improve the accuracy of the determined target detection results.
[0124] For S61, an OPENCV regression method is used to determine a rectangular box corresponding to each target according to the classification of each anchor point corresponding to each anchor point, and the determined rectangular box is used as an anchor rectangular box.
[0125] OPENCV is a cross-platform computer vision and machine learning software library released under the Apache 2.0 license (open source) and can run on Linux, Windows, Android and Mac OS operating systems.
[0126] For S62, the coordinates of the four vertices of each of the anchor rectangular boxes are used as a vertex coordinate set, thereby determining the position data of the anchor rectangular box corresponding to each target.
[0127] For S63, each of the vertex coordinate sets is used as the target detection result, thereby determining the position data of the anchor rectangle corresponding to each target in the initial image.
[0128] Optionally, the step of using each of the vertex coordinate sets as the target detection result includes: using any anchor rectangular box as the anchor rectangular box to be analyzed; using the category corresponding to the key target heat map corresponding to the anchor rectangular box to be analyzed as the corresponding target category corresponding to the anchor rectangular box to be analyzed; using each of the vertex coordinate sets and each of the target categories as the target detection result.
[0129] Among them, the category corresponding to the key target heat map is the category determined according to the value of the corresponding vector element of the key target heat map in the classification prediction vector.
[0130] Reference Figure 2 , the present application also proposes an artificial intelligence-based target detection device, the device comprising:
[0131] The data acquisition module 100 is used to acquire the image features to be detected and the equally spaced anchor point position data corresponding to the initial image;
[0132] A key target heat map determination module 200 is used to input the image features to be detected into a preset key target detection model to perform key target heat map detection, wherein the key target detection model includes: a class activation mapping module and a key target heat map mapping module;
[0133] An anchor image feature determination module 300, used for inputting the image features to be detected and the equally spaced anchor position data into a preset anchor feature extraction model to extract anchor image features;
[0134] An anchor fusion feature determination module 400, used to fuse each of the key target heat maps and the anchor image features to obtain an anchor fusion feature;
[0135] An anchor point classification determination module 500, used to determine the anchor point classification of each anchor point according to the anchor point fusion feature and a preset anchor point thermal threshold;
[0136] The target detection result determination module 600 is used to generate a target detection result according to each of the anchor point classifications corresponding to each of the anchor points.
[0137] This embodiment first realizes the thermal information of the target's composition information through a key target detection model, and then extracts the image features of each anchor point through an anchor point feature extraction model, and then performs fusion processing, anchor point classification and target detection result determination in sequence according to the extracted thermal information of the target and the image features of the anchor point, thereby achieving target detection results based on category labels combined with class activation mapping, reducing the cost of manual labeling, and class activation mapping makes the model interpretable, explaining to users why the model makes decisions, and increasing the credibility of the model; by introducing equally spaced anchor point position data, it is possible to solve the local focusing problem of objects well, improve the robustness to small targets and non-rigid objects, and improve the accuracy of the determined target detection results.
[0138] In one embodiment, the key target heat map determination module 200 includes:
[0139] A feature mapping data generating submodule, used for inputting the image features to be detected into the decoder of the class activation mapping module to generate feature mapping data;
[0140] A classification prediction vector generation submodule, used for inputting the feature map data into the global average pooling layer of the class activation map module to generate a classification prediction vector;
[0141] An initial target heat map generation submodule, used for inputting the classification prediction vector into the heat map generation submodule of the key target heat map mapping module to generate an initial target heat map;
[0142] The key target heat map generation submodule is used to input the initial target heat map into the upsampling submodule of the key target heat map mapping module for upsampling to generate the key target heat map.
[0143] In one embodiment, the calculation formula K of the initial target heat map is:
[0144]
[0145]
[0146] Where N is the total number of vector elements in the classification prediction vector, s n is the value of the nth vector element in the classification prediction vector, σ(M n ) is for M n Normalization is performed, C is the number of channels of the last convolutional layer of the decoder, ω i,n is the value of W indexed by (i,n), W∈R C×N , R C×N is the weight matrix of the global average pooling layer, F iis the i-th feature in the feature map data, F i Corresponding to the i-th channel of the last convolutional layer of the decoder.
[0147] In one embodiment, the anchor image feature determination module 300 includes:
[0148] The image feature generation submodule to be analyzed is used to input the image feature to be detected into the feature extraction module of the anchor feature extraction model for feature extraction to form the image feature to be analyzed, wherein the feature extraction module includes: a first convolution layer, a second convolution layer, a third convolution layer, a fourth convolution layer and a fifth convolution layer in sequence;
[0149] The anchor image feature generation submodule is used to adopt the feature fusion module of the anchor feature extraction model to multiply the image feature to be analyzed and the equally spaced anchor position data to form the anchor image feature.
[0150] In one embodiment, the number of channels of the first convolutional layer, the second convolutional layer and the third convolutional layer are all 256;
[0151] The number of channels of the fourth convolutional layer is 128;
[0152] The number of channels of the fifth convolutional layer is 512.
[0153] In one embodiment, the anchor fusion feature determination module 400 includes:
[0154] An influence weight determination submodule, used to calculate the influence weight of each anchor point according to each of the key target heat maps;
[0155] The anchor point fusion feature determination submodule is used to perform multiplication processing on the data at the same anchor point position according to each of the influence weights and the anchor point image features to obtain the anchor point fusion feature.
[0156] In one embodiment, the target detection result determination module 600 includes:
[0157] The anchored rectangular frame generation submodule is used to use the OPENCV regression method to regress the rectangular frame of each anchor point classification corresponding to each anchor point, so as to obtain the anchored rectangular frame corresponding to each target;
[0158] A vertex coordinate set determination submodule, used for taking the coordinates of the four vertices of each anchoring rectangular box as a vertex coordinate set;
[0159] The target detection result determination submodule is used to use each of the vertex coordinate sets as the target detection result.
[0160] Reference Figure 3 In an embodiment of the present application, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as an artificial intelligence-based target detection method. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a target detection method based on artificial intelligence is implemented. The target detection method based on artificial intelligence includes: obtaining the image features to be detected and the equally spaced anchor point position data corresponding to the initial image; inputting the image features to be detected into a preset key target detection model to perform key target heat map detection, wherein the key target detection model includes: a class activation mapping module and a key target heat map mapping module; inputting the image features to be detected and the equally spaced anchor point position data into a preset anchor point feature extraction model to perform anchor point image feature extraction; fusing each of the key target heat maps and the anchor point image features to obtain anchor point fusion features; determining the anchor point classification of each anchor point according to the anchor point fusion features and the preset anchor point thermal threshold; and generating a target detection result according to each of the anchor point classifications corresponding to each of the anchor points.
[0161] This embodiment first realizes the thermal information of the target's composition information through a key target detection model, and then extracts the image features of each anchor point through an anchor point feature extraction model, and then performs fusion processing, anchor point classification and target detection result determination in sequence according to the extracted thermal information of the target and the image features of the anchor point, thereby achieving target detection results based on category labels combined with class activation mapping, reducing the cost of manual labeling, and class activation mapping makes the model interpretable, explaining to users why the model makes decisions, and increasing the credibility of the model; by introducing equally spaced anchor point position data, it is possible to solve the local focusing problem of objects well, improve the robustness to small targets and non-rigid objects, and improve the accuracy of the determined target detection results.
[0162] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, an artificial intelligence-based target detection method is implemented, comprising the steps of: obtaining image features to be detected and equally spaced anchor point position data corresponding to an initial image; inputting the image features to be detected into a preset key target detection model for key target heat map detection, wherein the key target detection model comprises: a class activation mapping module and a key target heat map mapping module; inputting the image features to be detected and the equally spaced anchor point position data into a preset anchor point feature extraction model for anchor point image feature extraction; fusing each of the key target heat maps and the anchor point image features to obtain an anchor point fusion feature; determining the anchor point classification of each anchor point according to the anchor point fusion feature and a preset anchor point thermal threshold; and generating a target detection result according to each of the anchor point classifications corresponding to each of the anchor points.
[0163] The above-mentioned artificial intelligence-based target detection method first realizes the thermal information of the target's composition information through the key target detection model, and then extracts the image features of each anchor point through the anchor point feature extraction model, and then performs fusion processing, anchor point classification and target detection result determination in sequence according to the extracted thermal information of the target and the image features of the anchor point, thereby realizing the target detection result based on the category label combined with the class activation mapping, reducing the cost of manual labeling, and the class activation mapping makes the model interpretable, explaining to the user the reasons why the model makes decisions, and increasing the credibility of the model; by introducing equally spaced anchor point position data, it is possible to solve the local focusing problem of the object well, improve the robustness to small targets and non-rigid objects, and improve the accuracy of the determined target detection results.
[0164] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0165] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.
[0166] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. An artificial intelligence-based target detection method, characterized in that: The method comprises: Obtain the image features to be detected and equally spaced anchor point position data corresponding to the initial image; Inputting the image features to be detected into a preset key target detection model to perform key target heat map detection, wherein the key target detection model includes: a class activation mapping module and a key target heat map mapping module; Inputting the image features to be detected and the equally spaced anchor point position data into a preset anchor point feature extraction model to perform anchor point image feature extraction; Fusing each of the key target heat maps with the anchor point image features to obtain anchor point fusion features; Determining the anchor point classification of each anchor point according to the anchor point fusion feature and a preset anchor point thermal threshold; Generating a target detection result according to the classification of each anchor point corresponding to each anchor point; The step of inputting the image features to be detected and the equally spaced anchor point position data into a preset anchor point feature extraction model to extract anchor point image features comprises: Inputting the image features to be detected into the feature extraction module of the anchor feature extraction model for feature extraction to form image features to be analyzed, wherein the feature extraction module sequentially includes: a first convolution layer, a second convolution layer, a third convolution layer, a fourth convolution layer and a fifth convolution layer; Using the feature fusion module of the anchor point feature extraction model, multiplying the image feature to be analyzed and the equally spaced anchor point position data to form the anchor point image feature; The step of fusing each of the key target heat maps with the anchor image features to obtain anchor fusion features includes: Calculate the influence weight of each anchor point according to each of the key target heat maps; Performing multiplication processing on data at the same anchor point position according to each of the influence weights and the anchor point image features to obtain the anchor point fusion feature; The step of generating a target detection result according to the classification of each anchor point corresponding to each anchor point comprises: Using the OPENCV regression method, the rectangular box regression is performed on each anchor point classification corresponding to each anchor point to obtain the anchor rectangular box corresponding to each target; The coordinates of the four vertices of each of the anchor rectangles are used as a vertex coordinate set; Each of the vertex coordinate sets is used as the target detection result.
2. The target detection method based on artificial intelligence according to claim 1, characterized in that: The step of inputting the image features to be detected into a preset key target detection model to perform key target heat map detection includes: Inputting the image features to be detected into a decoder of the class activation mapping module to generate feature mapping data; Inputting the feature map data into the global average pooling layer of the class activation map module to generate a classification prediction vector; Inputting the classification prediction vector into the heat map generation submodule of the key target heat map mapping module to generate an initial target heat map; The initial target heat map is input into the upsampling submodule of the key target heat map mapping module for upsampling to generate the key target heat map.
3. The target detection method based on artificial intelligence according to claim 2, characterized in that: The calculation formula K of the initial target thermal map is: Where N is the total number of vector elements in the classification prediction vector, s n is the value of the nth vector element in the classification prediction vector, σ(M n ) is for M n Normalization is performed, C is the number of channels of the last convolutional layer of the decoder, ω i,n is the value of W indexed by (i,n), W∈R C×N , R C×N is the weight matrix of the global average pooling layer, F i is the i-th feature in the feature map data, F i Corresponding to the i-th channel of the last convolutional layer of the decoder.
4. The target detection method based on artificial intelligence according to claim 1, characterized in that: The number of channels of the first convolutional layer, the second convolutional layer and the third convolutional layer are all 256; The number of channels of the fourth convolutional layer is 128; The number of channels of the fifth convolutional layer is 512.
5. An artificial intelligence-based target detection device, used to implement the method described in any one of claims 1 to 4, characterized in that: The device comprises: A data acquisition module is used to acquire the image features to be detected and the equally spaced anchor point position data corresponding to the initial image; A key target heat map determination module, used for inputting the image features to be detected into a preset key target detection model to perform key target heat map detection, wherein the key target detection model includes: a class activation mapping module and a key target heat map mapping module; An anchor point image feature determination module, used for inputting the image features to be detected and the equally spaced anchor point position data into a preset anchor point feature extraction model to extract anchor point image features; An anchor fusion feature determination module, used for fusing each of the key target heat maps with the anchor image features to obtain an anchor fusion feature; An anchor point classification determination module, used to determine the anchor point classification of each anchor point according to the anchor point fusion feature and a preset anchor point thermal threshold; The target detection result determination module is used to generate a target detection result according to the respective anchor point classifications corresponding to the respective anchor points.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Coronary artery angiography image narrow area marking method based on deep convolutional network
CN111369528A
Target detection method based on mixed supervised training
CN114154563A