Small sample target detection method, system and device

By using the attention convolutional neural network to extract and aggregate features, and combining the small sample database for similarity calculation, the problem of poor robustness in the detection of new types of target objects is solved, and new types of targets with large appearance differences in the pre-training data set are achieved. Effective detection of objects supports robot target object detection in specific fields.

CN114708536BActive Publication Date: 2024-09-27INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202210368041.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-08
Publication Date
2024-09-27
Estimated Expiration
2042-04-08

AI Technical Summary

Technical Problem

Existing small-sample target detection methods have poor detection robustness when the appearance of a new type of target object is significantly different from that of the target object in the pre-training data set, making it difficult to effectively detect the new type of target object.

Method used

Using the trained attention convolutional neural network, including the DenseNet169 backbone network, attention extractor and aggregator, by obtaining the fourth attention map of the image, extracting the rectangular bounding box of the potential target object, cropping the image, scaling and inputting into the network to Obtain image-level encoding vectors and perform similarity calculations combined with the pre-constructed small sample database of new types of target objects to achieve small sample target detection.

Benefits of technology

It effectively detects new types of target objects that are significantly different in appearance from the target objects in the pre-training data set, improving the robot's target object detection capabilities in fields such as assisting the elderly and the disabled, and providing home services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114708536B
    Figure CN114708536B
Patent Text Reader

Abstract

The present invention belongs to the field of robotics technology, and specifically relates to a small sample target detection method, system, and device, which aims to solve the problem of poor detection robustness of new target objects when the appearance of new target objects is greatly different from that of target objects in a pre-training data set. The method includes: obtaining an image of a scene to be detected; obtaining a fourth attention map corresponding to the image of the scene to be detected, extracting a connected domain in the fourth attention map, obtaining a rectangular bounding box of each potential target object, and then cutting out an image corresponding to each potential target object on the image of the scene to be detected; scaling the image corresponding to each potential target object to a set size, and inputting it into a trained attention convolutional neural network to obtain an image-level encoding vector of each potential target object; and obtaining the category of the potential target object. The present invention can utilize a small amount of data of new target objects to effectively detect new target objects that are greatly different in appearance from target objects in a pre-training data set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of robotics technology, and specifically relates to a small sample target detection method, system, and device. Background Art

[0002] With the continuous advancement of science and technology, robots are playing an increasingly important role in people's daily life and production. The ability of robots to detect and identify objects of different categories directly affects their application value. In order to achieve robot target detection, researchers at home and abroad have conducted in-depth research based on deep learning, but most of the existing deep learning-based target detection methods require network training on large-scale labeled data. The cost of large-scale data annotation is high, and it is difficult to obtain sufficient training samples for some categories of objects. For this reason, robot researchers have begun to focus on pre-training existing target detection networks on large-scale data sets, using the trained network to locate each potential target object in the scene, and then using a small number of training samples of new target objects to achieve the classification of new target objects, thereby completing small sample target detection.

[0003] At present, most small-sample target detection methods use existing target detection networks such as SSD (Single Shot MultiBox Detector) and FasterR-CNN to pre-train on large-scale datasets such as ImageNet. The pre-trained network is used to locate each potential target object in the scene. On this basis, the network is further trained with labeled samples of new target objects, and finally the potential target objects are classified by retrieval. For the above small-sample target detection methods, if the appearance of the new target object is very different from that of the target object in the pre-trained large-scale dataset, it will make it difficult to detect the new target object as a potential target object, which will affect the quality of small-sample target detection. To address this problem, image retrieval has become a possible solution due to its inclusiveness in representing various types of objects. Image retrieval usually uses the DenseNet169 backbone network to convert the query image and all images in the retrieval database into corresponding feature maps, and then uses aggregation operations such as GeM (Generalized-mean Pooling) or RMAC (Regional Maximum Activations of Convolutions) to aggregate the feature maps into image-level encoding vectors. The similarity between images is then measured by the matching similarity between image-level encoding vectors corresponding to different images, and the image with the greatest similarity to the query image is selected in the retrieval database as the image retrieval result. Image retrieval network training is often carried out with the help of hard triplet loss. However, existing image retrieval networks cannot be directly applied to small sample target detection.

[0004] To this end, it is necessary for technicians in this field to conduct more in-depth research on small sample target detection based on image retrieval networks to solve the problem of detecting new types of target objects when their appearance is significantly different from that of the target objects in the pre-training dataset. Summary of the invention

[0005] In order to solve the above-mentioned problems in the prior art, that is, to solve the problem that the detection robustness of the new class of target objects is poor when the appearance of the new class of target objects is greatly different from that of the target objects in the pre-training data set, the present invention provides a small sample target detection method, comprising the following steps:

[0006] Step S10, the robot acquires an image of the scene to be detected through a visual sensor installed on itself;

[0007] Step S20, using the trained attention convolutional neural network DenseNet169 backbone network and the attention extractor to obtain a fourth attention map corresponding to the image of the scene to be detected; extracting the connected domain in the fourth attention map, obtaining the rectangular bounding box of each potential target object, and cropping the image corresponding to each potential target object on the image of the scene to be detected according to the rectangular bounding box;

[0008] Step S30, scaling the image corresponding to each potential target object to a set size, and inputting the image into the trained attention convolutional neural network to obtain an image-level encoding vector corresponding to each potential target object;

[0009] Step S40, calculating the similarity between the image-level coding vector corresponding to each potential target object and each image-level coding vector in the pre-constructed small sample database of new class target objects, and taking the category corresponding to the image with the maximum similarity as the category of the potential target object, thereby realizing small sample target detection;

[0010] The attention convolutional neural network includes a DenseNet169 backbone network, an attention extractor and an aggregator;

[0011] The DenseNet169 backbone network is used to extract convolutional features of the input image, and the output of the 104th layer of the DenseNet169 backbone network is used as the first convolutional feature, and the output of the 169th layer of the DenseNet169 backbone network is used as the second convolutional feature;

[0012] The attention extractor is constructed based on a sequentially connected convolutional layer, a spatial Softmax operation layer, a mean filter, a thresholding operation, and a graph cut operation;

[0013] The convolution layer is used to perform convolution processing on the first convolution feature, and use the feature map after the convolution processing as the first attention map; the spatial softmax operation layer is used to perform softmax operation on the first attention map to obtain a second attention map; the mean filter is used to perform filtering processing on the second attention map to obtain a third attention map;

[0014] The thresholding operation is used to perform thresholding on the third attention map to obtain a fourth attention map; the graph cut operation is used to divide the non-zero elements in the fourth attention map into two optimal subsets, and obtain rectangular bounding boxes corresponding to the two optimal subsets as the first bounding box and the second bounding box respectively;

[0015] The aggregator is used to aggregate the first bounding box, the second bounding box, and the second convolution feature to obtain an image-level encoding vector.

[0016] In some preferred embodiments, a softmax operation is performed on the first attention map to obtain a second attention map, and the method is:

[0017]

[0018] Among them, A 1(a,b) and A 2(a,b) are the elements of the ath row and bth column of the first attention map A1 and the second attention map A2, β is a learnable scaling factor, A 1(h,w) is the element in the hth row and wth column of A1.

[0019] In some preferred implementations, the non-zero elements in the fourth attention map are divided into two optimal subsets, and rectangular bounding boxes corresponding to the two optimal subsets are obtained as the first bounding box and the second bounding box, respectively, and the method is:

[0020] The horizontal and vertical coordinates of the non-zero elements in the fourth attention map form a first set L;

[0021] Performing k-nearest neighbor mapping on the first set L, that is, taking each element in the first set as a node and taking the inverse of the Euclidean distance between the nodes as the weight of the edge connecting the nodes to obtain an adjacency matrix W, where k is a preset constant;

[0022] Based on the adjacency matrix W, the optimal subset is obtained by solving the following formula through the spectral clustering method: and

[0023]

[0024] Among them, W p,qrepresents the element in the pth row and qth column of the adjacency matrix W, L1 and L2 are subsets of L, represents the empty set;

[0025] Based on the optimal subset and Get the first bounding box box1(t1, l1, b1, r1) and the second bounding box box2(t2, l2, b2, r2); t1, l1, b1, r1 are the optimal subsets respectively The minimum ordinate value, minimum abscissa value, maximum ordinate value, and maximum abscissa value of the elements in the graph; t2, l2, b2, and r2 are the optimal subsets respectively. The minimum ordinate value, minimum abscissa value, maximum ordinate value, and maximum abscissa value of the elements in.

[0026] In some preferred implementations, the first bounding box, the second bounding box, and the second convolutional feature are aggregated to obtain an image-level encoding vector, and the method is:

[0027] Combine the first bounding box box1(t1, l1, b1, r1) and the second bounding box box2(t2, l2, b2, r2) respectively, and use the ROI pooling operation in Faster R-CNN to perform a pooling operation on the second convolution feature F2 to obtain the third convolution feature F3 and the fourth convolution feature F4;

[0028] Using the GeM aggregation operation, the second convolution feature F2, the third convolution feature F3 and the fourth convolution feature F4 are respectively aggregated into the first encoding vector v1, the second encoding vector v2 and the third encoding vector v3;

[0029] The first coding vector v1, the second coding vector v2 and the third coding vector v3 are added together to obtain an image-level coding vector.

[0030] In some preferred embodiments, the connected domain in the fourth attention map is extracted by using the opencv2.findContours function of the opencv2 library of python to process the fourth attention map to obtain the connected domain in the fourth attention map.

[0031] In a second aspect of the present invention, a small sample target detection system is proposed, the system comprising: an image acquisition module, a potential target object extraction module, a coding vector acquisition module, and a category detection module;

[0032] The image acquisition module is configured so that the robot acquires an image of the scene to be detected through a visual sensor installed on the robot;

[0033] The potential target object extraction module is configured to use the DenseNet169 backbone network of the trained attention convolutional neural network and the attention extractor to obtain a fourth attention map corresponding to the image of the scene to be detected; extract the connected domain in the fourth attention map, obtain the rectangular bounding box of each potential target object, and cut out the image corresponding to each potential target object on the image of the scene to be detected according to the rectangular bounding box;

[0034] The encoding vector acquisition module is configured to scale the image corresponding to each potential target object to a set size and input the image into a trained attention convolutional neural network to obtain an image-level encoding vector corresponding to each potential target object;

[0035] The category detection module is configured to calculate the similarity between the image-level coding vector corresponding to each potential target object and each image-level coding vector in the pre-constructed small sample database of new class target objects, and take the category corresponding to the image with the maximum similarity as the category of the potential target object, thereby realizing small sample target detection;

[0036] The attention convolutional neural network includes a DenseNet169 backbone network, an attention extractor and an aggregator;

[0037] The DenseNet169 backbone network is used to extract convolutional features of the input image, and the output of the 104th layer of the DenseNet169 backbone network is used as the first convolutional feature, and the output of the 169th layer of the DenseNet169 backbone network is used as the second convolutional feature;

[0038] The attention extractor is constructed based on a sequentially connected convolutional layer, a spatial Softmax operation layer, a mean filter, a thresholding operation, and a graph cut operation;

[0039] The convolution layer is used to perform convolution processing on the first convolution feature, and use the feature map after the convolution processing as the first attention map; the spatial softmax operation layer is used to perform softmax operation on the first attention map to obtain a second attention map; the mean filter is used to perform filtering processing on the second attention map to obtain a third attention map;

[0040] The thresholding operation is used to perform thresholding on the third attention map to obtain a fourth attention map; the graph cut operation is used to divide the non-zero elements in the fourth attention map into two optimal subsets, and obtain rectangular bounding boxes corresponding to the two optimal subsets as the first bounding box and the second bounding box respectively;

[0041] The aggregator is used to aggregate the first bounding box, the second bounding box, and the second convolution feature to obtain an image-level encoding vector.

[0042] According to a third aspect of the present invention, a storage device is provided, in which a plurality of programs are stored. The programs are suitable for being loaded and executed by a processor to implement the above-mentioned small sample target detection method.

[0043] In a fourth aspect of the present invention, a processing setting is proposed, comprising a processor and a storage device; the processor is suitable for executing various programs; the storage device is suitable for storing multiple programs; the programs are suitable for being loaded and executed by the processor to implement the above-mentioned small sample target detection method.

[0044] Beneficial effects of the present invention:

[0045] The present invention can utilize a small amount of data on new target objects to effectively detect new target objects that have a large difference in appearance from the target objects in the pre-training data set, providing technical support for target object detection in the fields of robots assisting the elderly and the disabled, and home services. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 It is a flowchart of a small sample target detection method according to an embodiment of the present invention;

[0047] Figure 2 It is a schematic diagram of the framework of a small sample target detection system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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.

[0049] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0050] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application may be combined with each other.

[0051] A small sample target detection method of the present invention, such as Figure 1 As shown, the following steps are included:

[0052] Step S10, the robot acquires an image of the scene to be detected through a visual sensor installed on itself;

[0053] Step S20, using the trained attention convolutional neural network DenseNet169 backbone network and the attention extractor to obtain a fourth attention map corresponding to the image of the scene to be detected; extracting the connected domain in the fourth attention map, obtaining the rectangular bounding box of each potential target object, and cropping the image corresponding to each potential target object on the image of the scene to be detected according to the rectangular bounding box;

[0054] Step S30, scaling the image corresponding to each potential target object to a set size, and inputting the image into the trained attention convolutional neural network to obtain an image-level encoding vector corresponding to each potential target object;

[0055] Step S40, calculating the similarity between the image-level coding vector corresponding to each potential target object and each image-level coding vector in the pre-constructed small sample database of new class target objects, and taking the category corresponding to the image with the maximum similarity as the category of the potential target object, thereby realizing small sample target detection;

[0056] The attention convolutional neural network includes a DenseNet169 backbone network, an attention extractor and an aggregator;

[0057] The DenseNet169 backbone network is used to extract convolutional features of the input image, and the output of the 104th layer of the DenseNet169 backbone network is used as the first convolutional feature, and the output of the 169th layer of the DenseNet169 backbone network is used as the second convolutional feature;

[0058] The attention extractor is constructed based on a sequentially connected convolutional layer, a spatial Softmax operation layer, a mean filter, a thresholding operation, and a graph cut operation;

[0059] The convolution layer is used to perform convolution processing on the first convolution feature, and use the feature map after the convolution processing as the first attention map; the spatial softmax operation layer is used to perform softmax operation on the first attention map to obtain a second attention map; the mean filter is used to perform filtering processing on the second attention map to obtain a third attention map;

[0060] The thresholding operation is used to perform thresholding on the third attention map to obtain a fourth attention map; the graph cut operation is used to divide the non-zero elements in the fourth attention map into two optimal subsets, and obtain rectangular bounding boxes corresponding to the two optimal subsets as the first bounding box and the second bounding box respectively;

[0061] The aggregator is used to aggregate the first bounding box, the second bounding box, and the second convolution feature to obtain an image-level encoding vector.

[0062] In order to more clearly illustrate the small sample target detection method of the present invention, each step in an embodiment of the method of the present invention is described in detail below with reference to the accompanying drawings.

[0063] In the following embodiments, the construction and training process of the attention convolutional neural network is first described in detail, and then the process of obtaining the category of potential target objects in the image of the scene to be detected by the small sample target detection method is described.

[0064] 1. Construction and training process of attention convolutional neural network

[0065] This embodiment is a better implementation method. An image retrieval network including a DenseNet169 backbone network, an attention extractor and an aggregator is pre-built, which is called an attention convolutional neural network. The attention convolutional neural network is trained on the ImageNet dataset in combination with the triplet loss to obtain the parameters of the attention convolutional neural network. The details are as follows:

[0066] First, the image size in the ImageNet dataset is scaled to a set size, preferably to 512×512 in the present invention, and then the scaled image is sent to the DenseNet169 backbone network, the output of the 104th layer in the DenseNet169 backbone network is obtained and used as the first convolutional feature F1, and the output of the 169th layer is obtained and used as the second convolutional feature F2, wherein the size of the first convolutional feature F1 is 32×32×1280, and the size of the second convolutional feature F2 is 16×16×1664.

[0067] The first convolution feature F1 is input into the attention extractor, where the attention extractor is composed of a convolution layer with a convolution kernel size of 1×1×1280, a spatial Softmax operation layer, a 3×3 mean filter, a threshold processing operation, and a graph cut processing operation. The convolution layer with a convolution kernel size of 1×1×1280 processes the first convolution feature F1 into the first attention map A1, and the size of the first attention map is 32×32×1; the spatial Softmax operation layer processes the first attention map A1 into the second attention map A2. The specific processing is shown in formula (1):

[0068]

[0069] Among them A 1(a,b) and A 2(a,b) are the elements of row a and column b of A1 and A2 respectively, β is the learnable scaling factor, A 1(h,w) is the element in the hth row and wth column of A1;

[0070] The second attention map A2 is filtered by a 3×3 mean filter to obtain a third attention map A3. The 3×3 mean filter is implemented by the openscv2.blur function in the opencv2 library of Python. The thresholding operation uses 0.75 times the maximum value in the third attention map A3 as the threshold, processes the third attention map A3, and sets the elements less than the threshold to 0, thereby obtaining a fourth attention map A4.

[0071] The graph cut operation divides the non-zero elements in the fourth attention graph A4 into two optimal subsets, and obtains the rectangular bounding boxes corresponding to the two optimal subsets respectively. The specific process is as follows:

[0072] The horizontal and vertical coordinates of the non-zero elements in the fourth attention map A4 form the first set Where l is the number of non-zero elements in the fourth attention map A4, (x c ,y c ) is the horizontal and vertical coordinates of the cth non-zero element in the fourth attention map A4, c = 1, 2, ..., l. For the first set Perform k-nearest neighbor mapping, where k is a preset constant, preferably set to 3 in the present invention, take each element in the first set as a node, and take the inverse of the Euclidean distance between nodes as the weight of the edge connecting the nodes to obtain the adjacency matrix W, and then solve equation (2) by the spectral clustering method to obtain the optimal subset and The spectral clustering method is implemented using the sklearn.cluster.SpectralClustering function in the skleam library of Python.

[0073]

[0074] Where W p,q represents the element in the pth row and qth column of the adjacency matrix W, L1 and L2 are subsets of L, Represents the empty set. Based on the optimal subset and Get the first bounding box box1(t1, l1, b1, r1) and the second bounding box box2(t2, l2, b2, r2); t1, l1, b1, r1 are the optimal subsets respectively The minimum ordinate value, minimum abscissa value, maximum ordinate value, and maximum abscissa value of the elements in the graph; t2, l2, b2, and r2 are the optimal subsets respectively. The minimum ordinate value, minimum abscissa value, maximum ordinate value, and maximum abscissa value of the elements in.

[0075] The first bounding box box1(t1, l1, b1, r1), the second bounding box box2(t2, l2, b2, r2) and the second convolutional feature F2 are input into the aggregator to obtain an image-level encoding vector. First, the first bounding box box1(t1, l1, b1, r1) and the second bounding box box2(t2, l2, b2, r2) are combined respectively, and the ROI pooling operation in Faster R-CNN is used to perform a pooling operation on the second convolution feature F2 to obtain the third convolution feature F3 and the fourth convolution feature F4, where the size of the third convolution feature is 5×5×1664, and the size of the fourth convolution feature is 5×5×1664; then, the GeM aggregation operation is used to aggregate the second convolution feature F2, the third convolution feature F3 and the fourth convolution feature F4 into the first encoding vector v1, the second encoding vector v2 and the third encoding vector v3 respectively, and the first encoding vector v1, the second encoding vector v2 and the third encoding vector v3 are added to obtain the image-level encoding vector v4, which is the final output of the attention convolutional neural network.

[0076] In the ImageNet dataset, select a batch of ImageNet images and use the attention convolutional neural network to convert them into corresponding image-level encoding vectors. These image-level encoding vectors construct a triplet loss, and use this loss to train the attention convolutional neural network. Then, replace another batch of ImageNet images and continue to train the attention convolutional neural network in the above way until all the images of the ImageNet dataset are traversed. Finally, the parameters of the attention convolutional neural network are obtained.

[0077] 2. Small Sample Target Detection Method

[0078] The trained attention convolutional neural network is applied to the small sample target detection method of the present invention. The specific steps are as follows:

[0079] Step S10, the robot acquires an image of the scene to be detected through a visual sensor installed on itself;

[0080] In this embodiment, the robot collects an image I of the scene to be detected through a visual sensor ZED2 installed on itself, and the image size is 1920×1024.

[0081] Step S20, using the trained attention convolutional neural network DenseNet169 backbone network and the attention extractor to obtain a fourth attention map corresponding to the image of the scene to be detected; extracting the connected domain in the fourth attention map, obtaining the rectangular bounding box of each potential target object, and cropping the image corresponding to each potential target object on the image of the scene to be detected according to the rectangular bounding box;

[0082] In this embodiment, the image I of the scene to be detected is input into the trained attention convolutional neural network to obtain the corresponding fourth attention map, and the fourth attention map is processed by the opencv2.findContours function of the opencv2 library of Python to obtain all the connected domains therein, which are recorded as Among them, C j represents the coordinate set of each element in the jth connected domain, j = 1, 2, ..., d, d is the number of connected domains; each connected domain corresponds to a potential target object, according to Get the rectangular bounding box of each potential target object where pbox j Represents the rectangular bounding box of the jth potential target object, pt j ,pl j , pb j ,pr j Respectively represent the minimum ordinate value, minimum abscissa value, maximum ordinate value, and maximum abscissa value of the elements in the jth connected domain; according to the rectangular bounding box of each potential target object, the image I corresponding to each potential target object is cut out on the image I of the scene to be detected. j , j = 1, 2, ... d, I j is the image corresponding to the jth potential target object.

[0083] Step S30, scaling the image corresponding to each potential target object to a set size, and inputting the image into the trained attention convolutional neural network to obtain an image-level encoding vector corresponding to each potential target object;

[0084] In this embodiment, the image I corresponding to each potential target object j (j=1, 2, ...d) is first scaled to a set size, i.e., 512×512, where the scaling is implemented using the opencv2.resize function in the opencv2 library in Python; the scaled images are sequentially input into the trained attention convolutional neural network to obtain the image-level encoding vector v corresponding to each potential target object. 4,j , j=1,2,...d.

[0085] Step S40, calculating the similarity between the image-level coding vector corresponding to each potential target object and each image-level coding vector in the pre-constructed small sample database of new class target objects, and taking the category corresponding to the image with the maximum similarity as the category of the potential target object, thereby realizing small sample target detection;

[0086] In this embodiment, a small sample database is constructed offline for new target objects. Specifically, for each new target object, N images of different perspectives are collected, and the proportion of the new target object in the image is required to be no less than 50%. In this embodiment, N is preferably set to 20. These collected images are sent to the trained attention convolutional network to obtain the corresponding image-level encoding vector; the image-level encoding vectors corresponding to the images of different perspectives of each new target object and their corresponding categories constitute a small sample database of new target objects {Y f , v 4,f,g}, f = 1, 2, ..., M, g = 1, 2, ..., N, where Y f is the category of the fth new class target object, and M is the number of new class target objects;

[0087] For the image-level encoding vector v of the jth potential target object 4,j , j = 1, 2, ... d, and the similarity is calculated between it and each image-level encoding vector in the small sample database of the new class of target objects constructed offline. The calculation formula is as described in formula (3):

[0088]

[0089] where v 4,j,t and v 4,f,g,t Represent the image-level encoding vector v 4,j and v 4,f,g The t-th element of , t = 1, 2, ..., C, where C represents the dimension of the image-level coding vector.

[0090] For the jth potential target object (j=1, 2, ...d), according to formula (4), the index f of the image with the maximum similarity to it is retrieved from the small sample database of new target objects. * and g * , according to the index f * Corresponding The category of the jth potential target object is obtained; the categories of all potential target objects are obtained, and the small sample target detection of the image of the scene to be detected is completed.

[0091]

[0092] The present invention can realize the detection of new types of target objects and effectively detect new types of target objects that have a large difference in appearance from the target objects in the pre-training data set, providing technical support for target object detection in the fields of robots assisting the elderly and the disabled, and home services.

[0093] A small sample target detection system according to a second embodiment of the present invention is as follows: Figure 2As shown, it includes: an image acquisition module 100, a potential target object extraction module 200, a coding vector acquisition module 300, and a category detection module 400;

[0094] The image acquisition module 100 is configured so that the robot acquires an image of the scene to be detected through a visual sensor installed on the robot;

[0095] The potential target object extraction module 200 is configured to use the trained attention convolutional neural network DenseNet169 backbone network and the attention extractor to obtain a fourth attention map corresponding to the image of the scene to be detected; extract the connected domain in the fourth attention map, obtain the rectangular bounding box of each potential target object, and cut out the image corresponding to each potential target object on the image of the scene to be detected according to the rectangular bounding box;

[0096] The encoding vector acquisition module 300 is configured to scale the image corresponding to each potential target object to a set size and input the image into the trained attention convolutional neural network to obtain the image-level encoding vector corresponding to each potential target object;

[0097] The category detection module 400 is configured to calculate the similarity between the image-level coding vector corresponding to each potential target object and each image-level coding vector in the pre-constructed small sample database of new class target objects, and take the category corresponding to the image with the maximum similarity as the category of the potential target object, thereby realizing small sample target detection;

[0098] The attention convolutional neural network includes a DenseNet169 backbone network, an attention extractor and an aggregator;

[0099] The DenseNet169 backbone network is used to extract convolutional features of the input image, and the output of the 104th layer of the DenseNet169 backbone network is used as the first convolutional feature, and the output of the 169th layer of the DenseNet169 backbone network is used as the second convolutional feature;

[0100] The attention extractor is constructed based on a sequentially connected convolutional layer, a spatial Softmax operation layer, a mean filter, a thresholding operation, and a graph cut operation;

[0101] The convolution layer is used to perform convolution processing on the first convolution feature, and use the feature map after the convolution processing as the first attention map; the spatial softmax operation layer is used to perform softmax operation on the first attention map to obtain a second attention map; the mean filter is used to perform filtering processing on the second attention map to obtain a third attention map;

[0102] The thresholding operation is used to perform thresholding on the third attention map to obtain a fourth attention map; the graph cut operation is used to divide the non-O elements in the fourth attention map into two optimal subsets, and obtain rectangular bounding boxes corresponding to the two optimal subsets as the first bounding box and the second bounding box respectively;

[0103] The aggregator is used to aggregate the first bounding box, the second bounding box, and the second convolution feature to obtain an image-level encoding vector.

[0104] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process and related instructions of the system described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0105] It should be noted that the small sample target detection system provided in the above embodiment is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the modules or steps in the embodiments of the present invention can be decomposed or combined. For example, the modules in the above embodiments can be combined into one module, or further divided into multiple sub-modules to complete all or part of the functions described above. The names of the modules and steps involved in the embodiments of the present invention are only for distinguishing the modules or steps and are not regarded as improper limitations of the present invention.

[0106] A storage device according to a third embodiment of the present invention stores a plurality of programs, wherein the programs are suitable for being loaded by a processor and implementing the small sample target detection method described above.

[0107] A processing device according to the fourth embodiment of the present invention includes a processor and a storage device; the processor is suitable for executing various programs; the storage device is suitable for storing multiple programs; the programs are suitable for being loaded and executed by the processor to implement the above-mentioned small sample target detection method.

[0108] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process and related instructions of the storage device and processing device described above can refer to the corresponding process in the aforementioned method example and will not be repeated here.

[0109] Those skilled in the art should be able to appreciate that the modules and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software or a combination of the two, and the programs corresponding to the software modules and method steps can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the technical field. In order to clearly illustrate the interchangeability of electronic hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in electronic hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0110] The terms "first", "second", "third", etc. are used to distinguish similar objects rather than to describe or indicate a particular order or sequence.

[0111] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

Claims

1. A small sample target detection method, characterized in that: The method comprises the following steps: Step S10, the robot acquires an image of the scene to be detected through a visual sensor installed on itself; Step S20, using the trained attention convolutional neural network DenseNet169 backbone network and the attention extractor to obtain a fourth attention map corresponding to the image of the scene to be detected; extracting the connected domain in the fourth attention map, obtaining the rectangular bounding box of each potential target object, and cropping the image corresponding to each potential target object on the image of the scene to be detected according to the rectangular bounding box; Step S30, scaling the image corresponding to each potential target object to a set size, and inputting the image into the trained attention convolutional neural network to obtain an image-level encoding vector corresponding to each potential target object; Step S40, calculating the similarity between the image-level coding vector corresponding to each potential target object and each image-level coding vector in the pre-constructed small sample database of new class target objects, and taking the category corresponding to the image with the maximum similarity as the category of the potential target object, thereby realizing small sample target detection; The attention convolutional neural network includes a DenseNet169 backbone network, an attention extractor and an aggregator; The DenseNet169 backbone network is used to extract convolutional features of the input image, and the output of the 104th layer of the DenseNet169 backbone network is used as the first convolutional feature, and the output of the 169th layer of the DenseNet169 backbone network is used as the second convolutional feature; The attention extractor is constructed based on a sequentially connected convolutional layer, a spatial Softmax operation layer, a mean filter, a thresholding operation, and a graph cut operation; The convolution layer is used to perform convolution processing on the first convolution feature, and use the feature map after the convolution processing as the first attention map; the spatial softmax operation layer is used to perform softmax operation on the first attention map to obtain a second attention map; the mean filter is used to perform filtering processing on the second attention map to obtain a third attention map; The thresholding operation is used to perform thresholding on the third attention map to obtain a fourth attention map; the graph cut operation is used to divide the non-zero elements in the fourth attention map into two optimal subsets, and obtain rectangular bounding boxes corresponding to the two optimal subsets as the first bounding box and the second bounding box respectively; The aggregator is used to aggregate the first bounding box, the second bounding box, and the second convolution feature to obtain an image-level encoding vector.

2. The small sample target detection method according to claim 1, characterized in that: Perform a softmax operation on the first attention map to obtain a second attention map, and the method is as follows: Among them, A 1(a,b) and A 2(a,b) are the elements of the ath row and bth column of the first attention map A1 and the second attention map A2, β is a learnable scaling factor, A 1(h,w) is the element in the hth row and wth column of A1.

3. The small sample target detection method according to claim 1, characterized in that: The non-zero elements in the fourth attention map are divided into two optimal subsets, and the rectangular bounding boxes corresponding to the two optimal subsets are obtained as the first bounding box and the second bounding box respectively. The method is: The horizontal and vertical coordinates of the non-zero elements in the fourth attention map form a first set L; Performing k-nearest neighbor mapping on the first set L, that is, taking each element in the first set as a node and taking the inverse of the Euclidean distance between the nodes as the weight of the edge connecting the nodes to obtain an adjacency matrix W, where k is a preset constant; Based on the adjacency matrix W, the optimal subset is obtained by solving the following formula through the spectral clustering method: and Among them, W p,q represents the element in the pth row and qth column of the adjacency matrix W, L1 and L2 are subsets of L, represents the empty set; Based on the optimal subset and Get the first bounding box box1(t1,l1,b1,r1) and the second bounding box box2(t2,l2,b2,r2); t1,l1,b1,r1 are the optimal subsets respectively The minimum ordinate value, minimum abscissa value, maximum ordinate value, and maximum abscissa value of the elements in the graph; t2, l2, b2, and r2 are the optimal subsets respectively. The minimum ordinate value, minimum abscissa value, maximum ordinate value, and maximum abscissa value of the elements in.

4. The small sample target detection method according to claim 3, characterized in that: The first bounding box, the second bounding box, and the second convolution feature are aggregated to obtain an image-level encoding vector, and the method is: Combine the first bounding box box1(t1,l1,b1,r1) and the second bounding box box2(t2,l2,b2,r2) respectively, and use the ROI pooling operation in FasterR-CNN to perform a pooling operation on the second convolution feature F2 to obtain the third convolution feature F3 and the fourth convolution feature F4; Using the GeM aggregation operation, the second convolution feature F2, the third convolution feature F3 and the fourth convolution feature F4 are respectively aggregated into the first encoding vector v1, the second encoding vector v2 and the third encoding vector v3; The first coding vector v1, the second coding vector v2 and the third coding vector v3 are added together to obtain an image-level coding vector.

5. The small sample target detection method according to claim 1, characterized in that: The connected domain in the fourth attention map is extracted by using the opencv2.findContours function of the opencv2 library of Python to process the fourth attention map to obtain the connected domain in the fourth attention map.

6. A small sample target detection system, characterized in that: The system includes: an image acquisition module, a potential target object extraction module, a coding vector acquisition module, and a category detection module; The image acquisition module is configured so that the robot acquires an image of the scene to be detected through a visual sensor installed on the robot; The potential target object extraction module is configured to use the DenseNet169 backbone network of the trained attention convolutional neural network and the attention extractor to obtain a fourth attention map corresponding to the image of the scene to be detected; extract the connected domain in the fourth attention map, obtain the rectangular bounding box of each potential target object, and cut out the image corresponding to each potential target object on the image of the scene to be detected according to the rectangular bounding box; The encoding vector acquisition module is configured to scale the image corresponding to each potential target object to a set size and input the image into a trained attention convolutional neural network to obtain an image-level encoding vector corresponding to each potential target object; The category detection module is configured to calculate the similarity between the image-level coding vector corresponding to each potential target object and each image-level coding vector in the pre-constructed small sample database of new class target objects, and take the category corresponding to the image with the maximum similarity as the category of the potential target object, thereby realizing small sample target detection; The attention convolutional neural network includes a DenseNet169 backbone network, an attention extractor and an aggregator; The DenseNet169 backbone network is used to extract convolutional features of the input image, and the output of the 104th layer of the DenseNet169 backbone network is used as the first convolutional feature, and the output of the 169th layer of the DenseNet169 backbone network is used as the second convolutional feature; The attention extractor is constructed based on a sequentially connected convolutional layer, a spatial Softmax operation layer, a mean filter, a thresholding operation, and a graph cut operation; The convolution layer is used to perform convolution processing on the first convolution feature, and use the feature map after the convolution processing as the first attention map; the spatial softmax operation layer is used to perform softmax operation on the first attention map to obtain a second attention map; the mean filter is used to perform filtering processing on the second attention map to obtain a third attention map; The thresholding operation is used to perform thresholding on the third attention map to obtain a fourth attention map; the graph cut operation is used to divide the non-zero elements in the fourth attention map into two optimal subsets, and obtain rectangular bounding boxes corresponding to the two optimal subsets as the first bounding box and the second bounding box respectively; The aggregator is used to aggregate the first bounding box, the second bounding box, and the second convolution feature to obtain an image-level encoding vector.

7. A storage device storing a plurality of programs, characterized in that: The program is suitable for being loaded and executed by a processor to implement the small sample target detection method described in any one of claims 1-5.

8. A processing device, comprising a processor and a storage device; the processor is adapted to execute each program; the storage device is adapted to store a plurality of programs; characterized in that: The program is suitable for being loaded and executed by a processor to implement the small sample target detection method described in any one of claims 1-5.

Citation Information

Patent Citations

  • Method for detecting image salient target

    CN110956185A

  • Construction method and device for genetic disease face recognition model

    CN111368672A

  • Rotating target detection method based on multi-scale feature integration and attention mechanism

    CN111539428A

  • Lightweight video action recognition method

    CN113673307A

  • System and Method for Extremely Efficient Image and Pattern Recognition and Artificial Intelligence Platform

    US20180204111A1