Target detection method, device and computer readable storage medium
By performing feature enhancement operations based on the similarity of feature points in the target detection method, the accuracy and speed of target detection are improved, and the problem of difficulty in balancing accuracy and speed in the existing technology is solved.
Patent Information
- Application Number
- CN201811427403.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-11-27
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2039-08-28
AI Technical Summary
When existing target detection methods improve detection accuracy, they often lead to a decrease in detection speed, making it difficult to meet the requirements of high accuracy and high speed at the same time.
By performing enhancement operations based on the similarity of feature points on the preset feature extraction convolutional neural network, the accuracy of feature extraction and classification is improved, thereby improving the accuracy and speed of target detection.
This method improves the accuracy of target detection without slowing down the detection speed, and solves the problem of low target detection accuracy or low speed in the existing technology.
Smart Images

Figure CN110210279B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of the Internet, and in particular to a target detection method, device and computer-readable storage medium. Background Art
[0002] Image target detection refers to the position detection and classification of targets in an image. For example, the position of an airplane in an image is detected and the category it belongs to is given. Currently, the image target detection frameworks based on CNN (Convolutional Neural Network) networks in the industry mainly include image target detection frameworks headed by faster rcnn (faster Regions with CNN features) and image target detection frameworks headed by yolo. The former focuses on target detection accuracy, while the latter focuses on target detection speed. In all algorithms, it is difficult to simultaneously meet both target detection accuracy and target detection speed.
[0003] Real-time and high-precision target detection has always been an important problem to be solved, but improving accuracy often requires more calculations, which will affect the speed of target detection. Therefore, existing target detection methods have technical problems of low target detection accuracy or low target detection speed. Summary of the invention
[0004] The embodiments of the present invention provide a target detection method and a target detection device with high detection accuracy and high detection speed, so as to solve the technical problems of low target detection accuracy or low target detection speed in the existing target detection methods and target detection devices.
[0005] An embodiment of the present invention provides a target detection method, which includes:
[0006] Obtain a detection image, and use a preset feature extraction convolutional neural network to extract features from the detection image;
[0007] Based on the similarity of the feature points of the detection image on at least one layer of the preset feature extraction convolutional neural network, an enhancement operation is performed on the feature points on the preset feature extraction convolutional neural network of the corresponding layer;
[0008] Outputting a feature map of the detection image using a preset feature extraction convolutional neural network after the enhancement operation; and
[0009] A preset detection classification convolutional neural network is used to classify and detect the feature map of the detection image to obtain the detection target in the detection image.
[0010] The embodiment of the present invention further provides a target detection device, which includes:
[0011] A feature extraction module is used to obtain a detection image and use a preset feature extraction convolutional neural network to extract features from the detection image;
[0012] A feature enhancement module, configured to enhance the feature points of the preset feature extraction convolutional neural network on a corresponding layer based on the similarity of the feature points of the detection image on at least one layer of the preset feature extraction convolutional neural network;
[0013] A feature output module, used to output a feature map of the detection image using a preset feature extraction convolutional neural network after an enhancement operation; and
[0014] The classification detection module is used to use a preset detection classification convolutional neural network to perform classification detection on the feature map of the detection image to obtain the detection target in the detection image.
[0015] An embodiment of the present invention further provides a computer-readable storage medium, which stores processor-executable instructions, and the instructions are loaded by one or more processors to execute the above-mentioned target detection method.
[0016] Compared with the prior art, the target detection method and target detection device of the present invention perform feature enhancement operations on feature points based on the similarity of feature points in the detected image, thereby improving the target detection accuracy and target detection speed; and effectively solve the technical problems of low target detection accuracy or low target detection speed of the existing target detection methods and target detection devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is a flow chart of a first embodiment of a target detection method of the present invention;
[0018] Figure 2 is a flow chart of a second embodiment of the target detection method of the present invention;
[0019] Figure 3 This is a flow chart of step S202 of the second embodiment of the target detection method of the present invention;
[0020] Figure 4 is a schematic structural diagram of a first embodiment of an object detection device of the present invention;
[0021] Figure 5 is a schematic structural diagram of a second embodiment of an object detection device of the present invention;
[0022] Figure 6 It is a structural schematic diagram of a feature enhancement module of a second embodiment of an object detection device of the present invention;
[0023] Figure 7It is a structural schematic diagram of a similarity calculation unit of a feature enhancement module of a second embodiment of an object detection device of the present invention;
[0024] Figure 8 A structural schematic diagram of a feature enhancement unit of a feature enhancement module of a second embodiment of an object detection device of the present invention;
[0025] Fig. 9 It is a structural schematic diagram of a specific embodiment of the target detection method and target detection device of the present invention;
[0026] Fig.10 A detection flow diagram of a specific embodiment of the target detection method and target detection device of the present invention;
[0027] Fig.11 It is a schematic diagram of an algorithm of a feature enhancement module of a specific embodiment of the target detection method and target detection device of the present invention;
[0028] Fig.12 It is a schematic diagram of the working environment structure of the electronic device where the target detection device of the present invention is located. DETAILED DESCRIPTION
[0029] Please refer to the drawings, in which the same component symbols represent the same components, and the principle of the present invention is illustrated by implementing it in an appropriate computing environment. The following description is based on the illustrated specific embodiment of the present invention, which should not be considered as limiting other specific embodiments of the present invention that are not described in detail herein.
[0030] In the following description, specific embodiments of the present invention will be described with reference to steps and symbols of operations performed by one or more computers, unless otherwise stated. Therefore, it will be understood that these steps and operations, which are several times referred to as being performed by a computer, include manipulation by a computer processing unit of electronic signals representing data in a structured form. This manipulation transforms the data or maintains it at a location in the memory system of the computer, which can be reconfigured or otherwise change the operation of the computer in a manner familiar to those skilled in the art. The data structure in which the data is maintained is a physical location in the memory, which has specific characteristics defined by the data format. However, the principles of the present invention are described in the above text, which does not represent a limitation, and those skilled in the art will understand that the various steps and operations described below can also be implemented in hardware.
[0031] The target detection method and device of the present invention can be arranged in any electronic device, for detecting the dynamic and static targets in the detection picture. The electronic device includes but is not limited to wearable devices, head-mounted devices, medical and health platforms, personal computers, server computers, handheld or laptop devices, mobile devices (such as mobile phones, personal digital assistants (PDAs), media players, etc.), multiprocessor systems, consumer electronic devices, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The electronic device is preferably a fixed terminal or mobile terminal for performing target detection in an image, so that a user can quickly and accurately perform image target detection operations.
[0032] Please refer to Figure 1 , Figure 1 Flow chart of the first embodiment of the target detection method of the present invention. The target detection method of this embodiment can be implemented using the above electronic device, and the target detection method of this embodiment includes:
[0033] Step S101, obtaining a detection image, and using a preset feature extraction convolutional neural network to extract features from the detection image;
[0034] Step S102, based on the similarity of the feature points of the detected image on at least one layer of the preset feature extraction convolutional neural network, an enhancement operation is performed on the feature points on the corresponding layer of the preset feature extraction convolutional neural network;
[0035] Step S103, using the preset features after the enhancement operation to extract the convolutional neural network output feature map of the detection image;
[0036] Step S104, using a preset detection classification convolutional neural network to perform classification detection on the feature map of the detection image to obtain the detection target in the detection image.
[0037] The specific process of each step of the target detection method of this embodiment is described in detail below.
[0038] In step S101, the target detection device obtains a detection picture, where the detection picture refers to a detection picture used to detect dynamic and static objects in the picture, such as an airplane in the sky in the detection picture.
[0039] The target detection device then uses a preset feature extraction convolutional neural network to extract features from the acquired detection image. The preset feature extraction convolutional neural network may be composed of an input layer, a convolutional layer, an activation function, a pooling layer, and a fully connected layer.
[0040] The input layer is used to input the pixel features of each area of the detection image, such as the pixel grayscale value of each area; the convolution layer is used to extract the pixel features of each area of the detection image; the activation function is used to add nonlinear factors to the extracted feature data to improve the feature representation effect of the feature data; the pooling layer is used to compress the features and simplify the computational complexity of the preset feature extraction convolutional neural network; the fully connected layer is used to output the features extracted by the preset feature extraction convolutional neural network.
[0041] The calculation process of the convolution layer is the most important feature extraction process. Each preset feature extraction convolutional neural network can design multiple convolution layers. Each convolution layer may include the size of the feature map of the input layer, the convolution kernel for feature traversal, and the traversal step of the convolution kernel on the feature map of the input layer. For example, if the size of the feature map of the input layer is 32*32*3, the size of the convolution kernel is 5*5, and the traversal step is 1, then the size of the feature map output by the convolution layer is 28*28*3.
[0042] In step S102, when the target detection device uses the preset feature extraction convolutional neural network to perform feature extraction, the target detection device will enhance the feature points on the preset feature extraction convolutional neural network based on the similarity of the feature points of the detection image on at least one layer of the preset feature extraction convolutional neural network.
[0043] In order to avoid the reduction of certain feature weights in the multi-level feature extraction of the preset feature extraction convolutional neural network, in this step, the target detection device will first obtain the similarity of feature points on at least one layer of the preset feature extraction convolutional neural network, and use the above similarity to enhance the feature points on the preset feature extraction convolutional neural network of the corresponding layer, so that the feature weights in the multi-level feature extraction process can be better maintained, solving the technical problem of insufficient long-distance dependence of the existing preset feature extraction convolutional neural network.
[0044] Here, the target detection device can enhance the feature points of the preset feature extraction convolutional neural network of each layer, and can also choose to enhance the feature points of the preset feature extraction convolutional neural network of some layers.
[0045] For the specific feature point enhancement process, please refer to the detailed description in the following embodiment.
[0046] In step S103, the target detection device uses the preset feature extraction convolutional neural network output after the enhancement operation in step S102 to detect the feature map of the image in order to perform target classification detection.
[0047] In step S104, the target detection device uses a preset detection classification convolutional neural network to perform classification detection on the feature map obtained in step S103 to obtain the detection target in the detection image.
[0048] The structure of the preset detection classification convolutional neural network here is the same as or similar to the structure of the preset feature extraction convolutional neural network. The fully connected layer of the preset detection classification convolutional neural network not only outputs the features extracted by the preset detection classification convolutional neural network, but also classifies the extracted features to confirm the detection target in the detection image.
[0049] This completes the image target detection process of the target detection method of this embodiment.
[0050] The target detection method of this embodiment performs feature enhancement operations on feature points based on the similarity of feature points in the detected image, thereby improving target detection accuracy and target detection speed.
[0051] Please refer to Figure 2 , Figure 2 Flow chart of the second embodiment of the target detection method of the present invention. The target detection method of this embodiment can be implemented using the above electronic device, and the target detection method of this embodiment includes:
[0052] Step S201, obtaining a detection image, and using a preset feature extraction convolutional neural network to extract features from the detection image;
[0053] Step S202, based on the similarity of the feature points of the detected image on at least one layer of the preset feature extraction convolutional neural network, an enhancement operation is performed on the feature points on the corresponding layer of the preset feature extraction convolutional neural network;
[0054] Step S203, using a batch normalization layer to normalize the feature vectors of the feature points on the enhanced and corrected preset feature extraction convolutional neural network;
[0055] Step S204, using the preset features after the enhancement operation to extract the convolutional neural network output feature map of the detection image;
[0056] Step S205, using a preset detection classification convolutional neural network to perform classification detection on the feature map of the detection image to obtain the detection target in the detection image.
[0057] The specific process of each step of the target detection method of this embodiment is described in detail below.
[0058] In step S201, the target detection device obtains a detection picture, where the detection picture refers to a detection picture used to detect dynamic and static objects in the picture, such as an airplane in the sky in the detection picture.
[0059] The target detection device then uses a preset feature extraction convolutional neural network to extract features from the acquired detection image.
[0060] In step S202, when the target detection device uses the preset feature extraction convolutional neural network to perform feature extraction, the target detection device will enhance the feature points on the corresponding layer of the preset feature extraction convolutional neural network based on the similarity of the feature points of the detection image on at least one layer of the preset feature extraction convolutional neural network.
[0061] Please refer to Figure 3 , Figure 3 This is a flow chart of step S202 of the second embodiment of the target detection method of the present invention. Step S202 includes:
[0062] In step S301, the target detection device obtains feature vectors of feature points at different positions of the detection image on each layer of the preset feature extraction convolutional neural network, so as to subsequently calculate the similarity between the feature vectors of feature points at different positions.
[0063] Step S302, the target detection device uses a preset similarity function to calculate the similarity between the feature vectors of feature points at different positions on at least one layer of the preset feature extraction convolutional neural network and the feature vectors of feature points at other positions on the preset feature extraction convolutional neural network of the corresponding layer;
[0064] The preset similarity function here may be a Gaussian function (Gaussian), an embedded Gaussian function (embeddedGaussian), a dot product function (dot_product), and the like.
[0065] Specifically, here, a first preset linear mapping function can be used to perform a first dimensionality reduction operation on the feature vector of the feature point on the preset feature extraction convolutional neural network, and a second preset linear mapping function can be used to perform a second dimensionality reduction operation on the feature vector of the feature point on the preset feature extraction convolutional neural network. This can effectively reduce the amount of calculation of the similarity function, and using the first preset linear mapping function and the second preset linear mapping function to represent the feature vector of the feature point can further improve the expressiveness of the feature vector, avoiding the missing of the feature vector on the preset feature extraction convolutional neural network.
[0066] The first preset linear mapping function here may be different from or the same as the second preset linear mapping function. The target detection device then uses a preset similarity function to calculate the similarity between the feature vector of the feature point after the first dimensionality reduction operation on at least one layer of the preset feature extraction convolutional neural network and the feature vector of the feature point after the second dimensionality reduction operation at other positions on the corresponding layer of the preset feature extraction convolutional neural network.
[0067] Furthermore, the target detection device may also use a third preset linear mapping function to perform a third dimensionality reduction operation on the feature vector of the feature point on the preset feature extraction convolutional neural network, and use the feature vector of the feature point after the third dimensionality reduction operation to correct the acquired similarity. Here, the target detection device may use the feature vector of the feature point after the third dimensionality reduction operation at other positions on the preset feature extraction convolutional neural network of the corresponding layer to scale and correct the similarity, so that the corrected similarity is more accurate.
[0068] Here, the third preset linear mapping function may be different from or the same as the first preset linear mapping function.
[0069] In step S303, the target detection device uses a preset weight matrix and the similarity of the feature vectors of the feature points to enhance and correct the feature vectors of the feature points on the preset feature extraction convolutional neural network.
[0070] Specifically, here the target detection device first uses a preset weight matrix to perform dimensionality restoration on the similarity of the feature vectors of the feature points, so that the similarity of the feature vectors of the feature points matches the dimensional size of the feature points.
[0071] The target detection device then uses the similarity after dimensionality restoration to correct the feature vector of the feature point on the preset feature extraction convolutional neural network, such as directly adding the original feature vector of the feature point on the preset feature extraction convolutional neural network to the similarity after dimensionality restoration, so that the enhanced and corrected feature vector has similarity information without losing the original feature vector information.
[0072] The preset weight matrix here can be obtained and optimized through back propagation when training the preset feature extraction convolutional neural network.
[0073] In step S203, the target detection device uses a batch normalization layer (BN) to normalize the feature vectors of the feature points on the enhanced and corrected preset feature extraction convolutional neural network to ensure the accuracy of the feature map of the output detection image and avoid the slow convergence or gradient explosion of the preset feature extraction convolutional neural network.
[0074] In step S204, the target detection device uses the preset feature extraction convolutional neural network output after the enhancement operation in step S203 to detect the feature map of the image in order to perform target classification detection.
[0075] In step S205, the target detection device uses a preset detection classification convolutional neural network to perform classification detection on the feature map obtained in step S204 to obtain the detection target in the detection image.
[0076] The structure of the preset detection classification convolutional neural network here is the same as or similar to the structure of the preset feature extraction convolutional neural network. The fully connected layer of the preset detection classification convolutional neural network not only outputs the features extracted by the preset detection classification convolutional neural network, but also classifies the extracted features to confirm the detection target in the detection image.
[0077] This completes the image target detection process of the target detection method of this embodiment.
[0078] On the basis of the first embodiment, the target detection method of this embodiment further improves the target detection accuracy by setting a similarity function.
[0079] The present invention also provides a target detection device, please refer to Figure 4 , Figure 4 The target detection device of this embodiment can be implemented using the first embodiment of the target detection method described above. The target detection device 40 of this embodiment includes a feature extraction module 41, a feature enhancement module 42, a feature output module 43 and a classification detection module 44.
[0080] The feature extraction module 41 is used to obtain a detection image and use a preset feature extraction convolutional neural network to extract features from the detection image; the feature enhancement module 42 is used to enhance the feature points on the preset feature extraction convolutional neural network of the corresponding layer based on the similarity of the feature points of the detection image on at least one layer of the preset feature extraction convolutional neural network; the feature output module 43 is used to output the feature map of the detection image using the preset feature extraction convolutional neural network after the enhancement operation; the classification detection module 44 is used to perform classification detection on the feature map of the detection image using the preset detection classification convolutional neural network to obtain the detection target in the detection image.
[0081] When the target detection device 40 of this embodiment is used, the feature extraction module 41 first obtains a detection image, where the detection image refers to a detection image used to detect dynamic and static objects in the image, such as an airplane in the sky in the detection image.
[0082] Then, the feature extraction module 41 uses a preset feature extraction convolutional neural network to extract features from the acquired detection image. The preset feature extraction convolutional neural network may be composed of an input layer, a convolutional layer, an activation function, a pooling layer, and a fully connected layer.
[0083] The input layer is used to input the pixel features of each area of the detection image, such as the pixel grayscale value of each area; the convolution layer is used to extract the pixel features of each area of the detection image; the activation function is used to add nonlinear factors to the extracted feature data to improve the feature representation effect of the feature data; the pooling layer is used to compress the features and simplify the computational complexity of the preset feature extraction convolutional neural network; the fully connected layer is used to output the features extracted by the preset feature extraction convolutional neural network.
[0084] Subsequently, when the feature extraction module 41 uses the preset feature extraction convolutional neural network to perform feature extraction, the feature enhancement module 42 will enhance the feature points on the preset feature extraction convolutional neural network based on the similarity of the feature points of the detected image on at least one layer of the preset feature extraction convolutional neural network.
[0085] In order to avoid the reduction of certain feature weights in the multi-level feature extraction of the preset feature extraction convolutional neural network, in this step, the feature enhancement module 42 will first obtain the similarity of feature points on at least one layer of the preset feature extraction convolutional neural network, and use the above similarity to enhance the feature points on the preset feature extraction convolutional neural network of the corresponding layer, so that the feature weights in the multi-level feature extraction process can be better maintained, solving the technical problem of insufficient long-distance dependence of the existing preset feature extraction convolutional neural network.
[0086] Here, the feature enhancement module 42 can enhance the feature points of the preset feature extraction convolutional neural network of each layer, and can also choose to enhance the feature points of the preset feature extraction convolutional neural network of some layers.
[0087] For the specific feature point enhancement process, please refer to the detailed description in the following embodiment.
[0088] Then the feature output module 43 uses the preset feature extraction convolutional neural network after the enhancement operation to output the feature map of the detection image for target classification detection.
[0089] Finally, the classification detection module 44 uses a preset detection classification convolutional neural network to perform classification detection on the feature map obtained by the feature output module 43 to obtain the detection target in the detection image.
[0090] The structure of the preset detection classification convolutional neural network here is the same as or similar to the structure of the preset feature extraction convolutional neural network. The fully connected layer of the preset detection classification convolutional neural network not only outputs the features extracted by the preset detection classification convolutional neural network, but also classifies the extracted features to confirm the detection target in the detection image.
[0091] This completes the image object detection process of the object detection device 40 of this embodiment.
[0092] The target detection device of this embodiment performs feature enhancement operation on the feature points based on the similarity of the feature points in the detected image, thereby improving the target detection accuracy and target detection speed.
[0093] Please refer to Figure 5 , Figure 5 Schematic diagram of the structure of the second embodiment of the target detection device of the present invention. The target detection device of this embodiment can be implemented using the second embodiment of the target detection method described above. The target detection device 50 of this embodiment includes a feature extraction module 51, a feature enhancement module 52, a feature output module 54, a classification detection module 55 and a normalization processing module 53.
[0094] The feature extraction module 51 is used to obtain a detection image and use a preset feature extraction convolutional neural network to extract features from the detection image; the feature enhancement module 52 is used to enhance the feature points on the preset feature extraction convolutional neural network of the corresponding layer based on the similarity of the feature points of the detection image on at least one layer of the preset feature extraction convolutional neural network; the feature output module 54 is used to output the feature map of the detection image using the preset feature extraction convolutional neural network after the enhancement operation; the classification detection module 55 is used to use the preset detection classification convolutional neural network to perform classification detection on the feature map of the detection image to obtain the detection target in the detection image; the normalization processing module 53 is used to use a batch normalization layer to normalize the feature vectors of the feature points on the enhanced and corrected preset feature extraction convolutional neural network.
[0095] Please refer to Figure 6 , Figure 6 Schematic diagram of the structure of the feature enhancement module of the second embodiment of the object detection device of the present invention. The feature enhancement module 52 includes a feature vector acquisition unit 61, a similarity calculation unit 62 and a feature enhancement unit 63.
[0096] The feature vector acquisition unit 61 is used to obtain the feature vectors of the feature points at different positions of the detection image on the preset feature extraction convolutional neural network; the similarity calculation unit 62 is used to use a preset similarity function to calculate the feature vectors of the feature points at different positions on at least one layer of the preset feature extraction convolutional neural network, and the similarity of the feature vectors of the feature points at other positions on the preset feature extraction convolutional neural network of the corresponding layer; the feature enhancement unit 63 is used to use the preset weight matrix and the similarity of the feature vectors of the feature points to enhance and correct the feature vectors of the feature points on the preset feature extraction convolutional neural network of the corresponding layer.
[0097] Please refer to Figure 7 , Figure 7The similarity calculation unit 62 of the feature enhancement module of the second embodiment of the target detection device of the present invention comprises a first dimension reduction subunit 71, a second dimension reduction subunit 72, a similarity calculation subunit 73, a third dimension reduction subunit 74 and a similarity correction subunit 75.
[0098] The first dimension reduction subunit 71 is used to perform a first dimension reduction operation on the feature vectors of the feature points on the preset feature extraction convolutional neural network using a first preset linear mapping function; the second dimension reduction subunit 72 is used to perform a second dimension reduction operation on the feature vectors of the feature points on the preset feature extraction convolutional neural network using a second preset linear mapping function; the similarity calculation subunit 73 is used to calculate the similarity between the feature vectors of the feature points after the first dimension reduction operation on at least one layer of the preset feature extraction convolutional neural network and the feature vectors of the feature points after the second dimension reduction operation at other positions on the preset feature extraction convolutional neural network of the corresponding layer using a preset similarity function; the third dimension reduction subunit 74 is used to perform a third dimension reduction operation on the feature vectors of the feature points on the preset feature extraction convolutional neural network using a third preset linear mapping function; the similarity correction subunit 75 is used to correct the similarity using the feature vectors of the feature points after the third dimension reduction operation.
[0099] Please refer to Figure 8 , Figure 8 The feature enhancement unit 63 of the feature enhancement module of the second embodiment of the object detection device of the present invention comprises a dimension restoration subunit 81 and a feature correction subunit 82 .
[0100] The dimension recovery subunit 81 is used to restore the dimension of the similarity of the feature vector of the feature point using a preset weight matrix; the feature correction subunit 82 is used to correct the feature vector of the feature point on the preset feature extraction convolutional neural network of the corresponding layer using the similarity after dimension recovery.
[0101] When the target detection device 50 of this embodiment is used, first, the feature extraction module 51 obtains a detection picture. The detection picture here refers to a detection picture used to detect dynamic and static objects in the picture, such as an airplane in the sky in the detection picture.
[0102] Then, the feature extraction module 51 uses a preset feature extraction convolutional neural network to extract features from the acquired detection image.
[0103] Then, in the process of feature extraction using the preset feature extraction convolutional neural network by the feature extraction module 51, the feature enhancement module 52 will enhance the feature points on the preset feature extraction convolutional neural network of the corresponding layer based on the similarity of the feature points of the detected image on at least one layer of the preset feature extraction convolutional neural network. Specifically, it includes:
[0104] The feature vector acquisition unit 61 of the feature enhancement module 52 acquires the feature vectors of feature points at different positions of the detection image on each layer of the preset feature extraction convolutional neural network, so as to subsequently calculate the similarity between the feature vectors of feature points at different positions.
[0105] The similarity calculation unit 62 of the feature enhancement module 52 uses a preset similarity function to calculate the similarity between the feature vectors of feature points at different positions on at least one layer of the preset feature extraction convolutional neural network and the feature vectors of feature points at other positions on the preset feature extraction convolutional neural network of the corresponding layer;
[0106] The preset similarity function here may be a Gaussian function (Gaussian), an embedded Gaussian function (embeddedGaussian), a dot product function (dot_product), and the like.
[0107] Specifically, the first dimension reduction subunit 71 of the similarity calculation unit 62 can use the first preset linear mapping function to perform a first dimension reduction operation on the feature vector of the feature point on the preset feature extraction convolutional neural network; the second dimension reduction subunit 72 of the similarity calculation unit 62 uses the second preset linear mapping function to perform a second dimension reduction operation on the feature vector of the feature point on the preset feature extraction convolutional neural network. This can effectively reduce the amount of calculation of the similarity function, and using the first preset linear mapping function and the second preset linear mapping function to represent the feature vector of the feature point can further improve the expressiveness of the feature vector, avoiding the missing of the feature vector on the preset feature extraction convolutional neural network.
[0108] The first preset linear mapping function here may be different from or the same as the second preset linear mapping function. Subsequently, the similarity calculation subunit 73 of the similarity calculation unit 62 uses the preset similarity function to calculate the similarity between the feature vector of the feature point after the first dimensionality reduction operation on at least one layer of the preset feature extraction convolutional neural network and the feature vector of the feature point after the second dimensionality reduction operation at other positions on the corresponding layer of the preset feature extraction convolutional neural network.
[0109] Further, the third dimension reduction subunit 74 of the similarity calculation unit 62 may also use a third preset linear mapping function to perform a third dimension reduction operation on the feature vector of the feature point on the preset feature extraction convolutional neural network, and the similarity correction subunit 75 of the similarity calculation unit 62 uses the feature vector of the feature point after the third dimension reduction operation to correct the acquired similarity. Here, the similarity correction subunit 75 may use the feature vector of the feature point after the third dimension reduction operation at other positions on the preset feature extraction convolutional neural network of the corresponding layer to scale and correct the similarity, so that the corrected similarity is more accurate.
[0110] Here, the third preset linear mapping function may be different from or the same as the first preset linear mapping function.
[0111] Then, the feature enhancement unit 63 uses the preset weight matrix and the similarity of the feature vectors of the feature points to enhance and correct the feature vectors of the feature points on the preset feature extraction convolutional neural network.
[0112] Specifically, the dimension restoration subunit 81 of the feature enhancement unit 63 performs dimension restoration on the similarity of the feature vectors of the feature points using a preset weight matrix, so that the similarity of the feature vectors of the feature points matches the dimension size of the feature points.
[0113] Subsequently, the feature correction subunit 82 of the feature enhancement unit 63 uses the similarity after dimensionality restoration to correct the feature vector of the feature point on the preset feature extraction convolutional neural network, such as directly adding the original feature vector of the feature point on the preset feature extraction convolutional neural network to the similarity after dimensionality restoration, so that the enhanced and corrected feature vector has similarity information without losing the original feature vector information.
[0114] The preset weight matrix here can be obtained and optimized through back propagation when training the preset feature extraction convolutional neural network.
[0115] Then the normalization processing module 53 uses a batch normalization layer (BN) to normalize the feature vectors of the feature points on the enhanced and corrected preset feature extraction convolutional neural network to ensure the accuracy of the feature map of the output detection image and avoid the slow convergence or gradient explosion of the preset feature extraction convolutional neural network.
[0116] The feature output module 54 then uses the preset feature extraction convolutional neural network after the enhancement operation to output the feature map of the detection image for target classification detection.
[0117] Finally, the classification detection module 55 uses a preset detection classification convolutional neural network to perform classification detection on the feature map obtained by the feature output module to obtain the detection target in the detection image.
[0118] The structure of the preset detection classification convolutional neural network here is the same as or similar to the structure of the preset feature extraction convolutional neural network. The fully connected layer of the preset detection classification convolutional neural network not only outputs the features extracted by the preset detection classification convolutional neural network, but also classifies the extracted features to confirm the detection target in the detection image.
[0119] This completes the image target detection process of the target detection device 50 of this embodiment.
[0120] On the basis of the first embodiment, the target detection device of this embodiment further improves the target detection accuracy by setting a similarity function.
[0121] The following is a specific example to illustrate the working principle of the target detection method and target detection device of the present invention. Figures 9 to 11 , Fig. 9 is a schematic diagram of a structure of a specific embodiment of the target detection method and target detection device of the present invention, Fig.10 is a detection flow diagram of a specific embodiment of the target detection method and target detection device of the present invention, Fig.11 It is a schematic diagram of an algorithm of a feature enhancement module of a specific embodiment of the target detection method and target detection device of the present invention.
[0122] The target detection device of this specific embodiment is set in a fixed terminal for detecting targets in an image. Fig. 9 The target detection device 90 includes a feature extraction module 91, a feature enhancement module 92 and a feature classification detection module 93.
[0123] The process of performing target detection by the target detection device 90 of this specific embodiment includes:
[0124] Step S1001, the target detection device 90 inputs the detection picture 94 to be detected into the feature extraction module 91, and the feature extraction module 91 performs a target feature extraction operation on the detection picture through a preset feature extraction convolutional neural network;
[0125] In step S1002 , the target detection device 90 inputs the target features extracted by the feature extraction module 91 into the feature enhancement module 92 for feature enhancement operation.
[0126] The feature enhancement module 92 can calculate the similarity of feature points on at least one layer of the preset feature extraction convolutional neural network, and then enhance the feature points on the preset feature extraction convolutional neural network of the corresponding layer according to the similarity. Here, the feature points of the preset feature extraction convolutional neural network of each layer can be enhanced, and the feature points of the preset feature extraction convolutional neural network of some layers can also be enhanced.
[0127] Specifically, the feature enhancement module 92 can perform a dimensionality reduction operation on the feature vectors of the feature points output by each layer of the preset feature extraction convolutional neural network, and then calculate the similarity between the feature vector of each feature point output by each layer of the preset feature extraction convolutional neural network and the feature vectors of other feature points output by the preset feature extraction convolutional neural network of the corresponding layer, thereby obtaining a similarity weight (similarity).
[0128] Then, this process is repeated to obtain the similarity weight corresponding to the feature vector of each feature point output by each layer of the preset feature extraction convolutional neural network.
[0129] like Fig.11 As shown, x is a feature vector set of feature points output by a preset feature extraction convolutional neural network of a certain layer, and the size of the feature vector set x is N*H*W*B, where N is the output batch size of the preset feature extraction convolutional neural network output of the corresponding layer, B is the number of output channels of the preset feature extraction convolutional neural network of the corresponding layer, W is the output feature width of the preset feature extraction convolutional neural network of the corresponding layer, and H is the output feature height of the preset feature extraction convolutional neural network of the corresponding layer.
[0130] Then the similarity weight y is:
[0131]
[0132] f(x i ,x j )=θ(x i ) T φ(x j ), C(x) = N;
[0133] Where i is the order of all feature points output by the preset feature extraction convolutional neural network, j is the order of all feature points output by the preset feature extraction convolutional neural network, θ, φ, and g are three arbitrary linear mapping functions, and the linear mapping function θ and the linear mapping function φ are used to improve the feature vector x i 、x j expressiveness, and by reducing the eigenvector x i 、x j The dimension of is used to reduce the computational complexity of the similarity function, and the linear mapping function g is used to scale and correct the similarity so that the corrected similarity is more accurate. Here, the output dimensions of the linear mapping function θ, the linear mapping function φ, and the linear mapping function g are all half of the input dimensions.
[0134] The similarity function f here is a dot product function, and of course the similarity function f here can also be a Gaussian function or an embedded Gaussian function. Function C(x) is a normalization factor.
[0135] In this way, the similarity weight y corresponding to the feature vector of each feature point output by each layer of the preset feature extraction convolutional neural network is obtained. i .
[0136] Then, the similarity weight y of the feature vector of the preset weight matrix and feature point is calculated. i, enhance and modify the feature vector of the feature point on the preset feature extraction convolutional neural network of the corresponding layer, that is, i Weighted.
[0137] Then the weighted eigenvector is:
[0138] z i =W z y i +x i ;
[0139] Where W z is a preset weight matrix, which can restore the weighted eigenvector to its previous dimension so that it can be combined with the output eigenvector x i Perform a weighted operation so that the weighted feature vector z i More accurate. The preset weight matrix W here z It can be obtained and optimized through back propagation when training a preset feature extraction convolutional neural network.
[0140] Finally, the feature enhancement module 92 uses a batch normalization layer (BN, Batch Normalization) to normalize the weighted feature vector to obtain the final output feature vector Z BN .
[0141] Z BN =BN(z).
[0142] In this way, the feature enhancement operation of the target features extracted by the preset feature extraction convolutional neural network is completed.
[0143] In step S1003, the feature classification detection module 93 uses a preset detection classification convolutional neural network to classify and detect the feature map formed by the target features after the feature enhancement operation to obtain the detection target in the detection image. Since the target features after the feature enhancement operation can avoid the problem of insufficient long-distance feature dependence through feature similarity, the accuracy and speed of target detection are improved.
[0144] The preset feature extraction convolutional neural network and the preset detection classification convolutional neural network here can be implemented in many ways, such as mobilenet framework, darknet framework, etc.
[0145] This completes the image target detection process of the target detection method and target detection device of this specific embodiment.
[0146] The target detection method and target detection device of the present invention perform feature enhancement operations on feature points based on the similarity of feature points in the detection image, thereby improving the target detection accuracy and target detection speed; and effectively solve the technical problems of low target detection accuracy or low target detection speed of existing target detection methods and target detection devices.
[0147] As used herein, the terms "component," "module," "system," "interface," "process," and the like are generally intended to refer to a computer-related entity: hardware, a combination of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable application, a thread of execution, a program, and / or a computer. By way of illustration, both an application running on a controller and the controller can be components. One or more components can be within a process and / or thread of execution, and a component can be located on one computer and / or distributed between two or more computers.
[0148] Fig.12 The following discussion provides a brief, general description of the working environment of the electronic device in which the object detection apparatus described in the present invention is implemented. Fig.12 The working environment is merely one example of a suitable working environment and is not intended to suggest any limitation as to the scope of use or functionality of the working environment. Example electronic devices 1212 include, but are not limited to, wearable devices, head mounted devices, healthcare platforms, personal computers, server computers, handheld or laptop devices, mobile devices (such as mobile phones, personal digital assistants (PDAs), media players, etc.), multi-processor systems, consumer electronic devices, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like.
[0149] Although not required, embodiments are described in the general context of "computer readable instructions" being executed by one or more electronic devices. Computer readable instructions may be distributed via computer readable media (discussed below). Computer readable instructions may be implemented as program modules, such as functions, objects, application programming interfaces (APIs), data structures, etc. that perform specific tasks or implement specific abstract data types. Typically, the functionality of the computer readable instructions may be arbitrarily combined or distributed in a variety of environments.
[0150] Fig.12 An example of an electronic device 1212 including one or more embodiments of the target detection apparatus of the present invention is shown. In one configuration, the electronic device 1212 includes at least one processing unit 1216 and a memory 1218. Depending on the exact configuration and type of the electronic device, the memory 1218 may be volatile (such as RAM), non-volatile (such as ROM, flash memory, etc.), or some combination of the two. Fig.12 This is illustrated by dashed line 1214.
[0151] In other embodiments, the electronic device 1212 may include additional features and / or functionality. For example, the device 1212 may also include additional storage devices (e.g., removable and / or non-removable), including but not limited to magnetic storage devices, optical storage devices, etc. Such additional storage devices may be stored in the form of a memory card or a memory card. Fig.12 12 is illustrated by storage device 1220. In one embodiment, computer readable instructions for implementing one or more embodiments provided herein may be in storage device 1220. Storage device 1220 may also store other computer readable instructions for implementing an operating system, application programs, etc. The computer readable instructions may be loaded into memory 1218 and executed by, for example, processing unit 1216.
[0152] The term "computer-readable media" as used herein includes computer storage media. Computer storage media include volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storing information such as computer-readable instructions or other data. Memory 1218 and storage device 1220 are examples of computer storage media. Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical storage device, cassette, magnetic tape, magnetic disk storage device or other magnetic storage device, or any other medium that can be used to store the desired information and can be accessed by the electronic device 1212. Any such computer storage media can be part of the electronic device 1212.
[0153] The electronic device 1212 may also include a communication connection 1226 that allows the electronic device 1212 to communicate with other devices. The communication connection 1226 may include, but is not limited to, a modem, a network interface card (NIC), an integrated network interface, a radio frequency transmitter / receiver, an infrared port, a USB connection, or other interfaces for connecting the electronic device 1212 to other electronic devices. The communication connection 1226 may include a wired connection or a wireless connection. The communication connection 1226 may transmit and / or receive communication media.
[0154] The term "computer-readable medium" may include communication media. Communication media typically embodies computer-readable instructions or other data in a "modulated data signal" such as a carrier wave or other transport mechanism, and includes any information delivery media. The term "modulated data signal" may include a signal that has one or more of its characteristics set or changed in such a manner as to encode information into the signal.
[0155] The electronic device 1212 may include an input device 1224, such as a keyboard, a mouse, a pen, a voice input device, a touch input device, an infrared camera, a video input device, and / or any other input device. The device 1212 may also include an output device 1222, such as one or more displays, speakers, a printer, and / or any other output device. The input device 1224 and the output device 1222 may be connected to the electronic device 1212 via a wired connection, a wireless connection, or any combination thereof. In one embodiment, an input device or an output device from another electronic device may be used as an input device 1224 or an output device 1222 of the electronic device 1212.
[0156] The components of the electronic device 1212 may be connected via various interconnections (such as buses). Such interconnections may include peripheral component interconnects (PCI) (such as PCI Express), universal serial bus (USB), FireWire (IEEE 1394), optical bus structures, etc. In another embodiment, the components of the electronic device 1212 may be interconnected via a network. For example, the memory 1218 may be composed of multiple physical memory units located in different physical locations and interconnected via a network.
[0157] Those skilled in the art will recognize that storage devices for storing computer-readable instructions can be distributed across a network. For example, an electronic device 1230 accessible via network 1228 can store computer-readable instructions for implementing one or more embodiments provided by the present invention. Electronic device 1212 can access electronic device 1230 and download a portion or all of the computer-readable instructions for execution. Alternatively, electronic device 1212 can download multiple computer-readable instructions as needed, or some instructions can be executed at electronic device 1212 and some instructions can be executed at electronic device 1230.
[0158] Various operations of the embodiments are provided herein. In one embodiment, the one or more operations described may constitute computer-readable instructions stored on one or more computer-readable media, which, when executed by an electronic device, will cause a computing device to perform the operations. The order in which some or all operations are described should not be interpreted as implying that these operations must be sequence-dependent. Those skilled in the art will appreciate alternative sequencing with the benefit of this specification. Moreover, it should be understood that not all operations must exist in each embodiment provided herein.
[0159] Moreover, although the present disclosure has been shown and described with respect to one or more implementations, those skilled in the art will think of equivalent variations and modifications based on the reading and understanding of this specification and the accompanying drawings. The present disclosure includes all such modifications and variations, and is limited only by the scope of the appended claims. In particular, with respect to the various functions performed by the above-mentioned components (such as elements, resources, etc.), the terms used to describe such components are intended to correspond to any component (unless otherwise indicated) that performs the specified function of the component (such as it is functionally equivalent), even if the structure is not equivalent to the disclosed structure of the function in the exemplary implementation of the present disclosure shown herein. In addition, although the specific features of the present disclosure have been disclosed with respect to only one of several implementations, such features can be combined with one or more other features of other implementations that may be desired and advantageous for a given or specific application. Moreover, insofar as the terms "including", "having", "containing" or their variations are used in specific embodiments or claims, such terms are intended to be included in a manner similar to the term "comprising".
[0160] The functional units in the embodiments of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc. The above-mentioned devices or systems may execute the methods in the corresponding method embodiments.
[0161] In summary, although the present invention has been disclosed as above by embodiments, the serial numbers before the embodiments are only used for convenience of description and do not limit the order of the embodiments of the present invention. Moreover, the above embodiments are not used to limit the present invention. A person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the scope defined by the claims.
Claims
1. A target detection method, characterized in that: include: Obtain a detection image, and use a preset feature extraction convolutional neural network to extract features from the detection image; Based on the similarity of the feature points of the detection image on at least one layer of the preset feature extraction convolutional neural network, an enhancement operation is performed on the feature points on the preset feature extraction convolutional neural network of the corresponding layer; Outputting a feature map of the detection image using a preset feature extraction convolutional neural network after the enhancement operation; as well as Using a preset detection classification convolutional neural network to perform classification detection on the feature map of the detection image to obtain the detection target in the detection image; The enhancing operation on the feature points of the preset feature extraction convolutional neural network at a corresponding layer based on the similarity of the feature points of the detection image on at least one layer of the preset feature extraction convolutional neural network includes: obtaining feature vectors of feature points at different positions of the detection image on the preset feature extraction convolutional neural network; A first preset linear mapping function is used to perform a first dimensionality reduction operation on the feature vectors of the feature points on the preset feature extraction convolutional neural network; a second preset linear mapping function is used to perform a second dimensionality reduction operation on the feature vectors of the feature points on the preset feature extraction convolutional neural network; a preset similarity function is used to calculate the similarity between the feature vectors of the feature points after the first dimensionality reduction operation on at least one layer of the preset feature extraction convolutional neural network and the feature vectors of the feature points at other positions on the corresponding layer of the preset feature extraction convolutional neural network after the second dimensionality reduction operation; and a preset weight matrix and the similarity of the feature vectors of the feature points are used to enhance and correct the feature vectors of the feature points on the preset feature extraction convolutional neural network of the corresponding layer.
2. The target detection method according to claim 1, characterized in that: The target detection method further includes: Performing a third dimensionality reduction operation on the feature vector of the feature point on the preset feature extraction convolutional neural network using a third preset linear mapping function; The similarity is corrected using the feature vector of the feature point after the third dimensionality reduction operation.
3. The target detection method according to claim 1, characterized in that: The step of enhancing and correcting the feature vectors of the feature points on the preset feature extraction convolutional neural network of the corresponding layer by using the preset weight matrix and the similarity of the feature vectors of the feature points comprises: Performing dimensionality restoration on the similarity of the feature vectors of the feature points using a preset weight matrix; Using the similarity after dimensionality restoration, the feature vectors of the feature points on the preset feature extraction convolutional neural network of the corresponding layer are corrected.
4. The target detection method according to claim 1, characterized in that: The step of performing an enhancement operation on the feature points of the preset feature extraction convolutional neural network of the corresponding layer based on the similarity of the feature points of the detection image on at least one layer of the preset feature extraction convolutional neural network also includes: The batch normalization layer is used to normalize the feature vectors of the feature points on the enhanced and modified preset feature extraction convolutional neural network.
5. A target detection device, characterized in that: include: A feature extraction module is used to obtain a detection image and use a preset feature extraction convolutional neural network to extract features from the detection image; A feature enhancement module, configured to enhance the feature points of the preset feature extraction convolutional neural network on a corresponding layer based on the similarity of the feature points of the detection image on at least one layer of the preset feature extraction convolutional neural network; A feature output module, used to output a feature map of the detection image using a preset feature extraction convolutional neural network after an enhancement operation; as well as A classification detection module, used to perform classification detection on the feature map of the detection image using a preset detection classification convolutional neural network to obtain a detection target in the detection image; The feature enhancement module includes: a feature vector acquisition unit, used to acquire feature vectors of feature points at different positions of the detection image on the preset feature extraction convolutional neural network; a similarity calculation unit, used to calculate the similarity between the feature vectors of feature points at different positions of at least one layer of the preset feature extraction convolutional neural network and the feature vectors of feature points at other positions on the preset feature extraction convolutional neural network of the corresponding layer using a preset similarity function; and a feature enhancement unit, used to enhance and correct the feature vectors of the feature points on the preset feature extraction convolutional neural network of the corresponding layer using a preset weight matrix and the similarity of the feature vectors of the feature points.
6. The target detection device according to claim 5, characterized in that: The similarity calculation unit comprises: A third dimension reduction subunit, configured to perform a third dimension reduction operation on the feature vector of the feature point on the preset feature extraction convolutional neural network using a third preset linear mapping function; The similarity correction subunit is used to correct the similarity using the feature vector of the feature point after the third dimensionality reduction operation.
7. The target detection device according to claim 5, characterized in that: The feature enhancement unit comprises: A dimension recovery subunit, used for performing dimension recovery on the similarity of the feature vectors of the feature points using a preset weight matrix; The feature correction subunit is used to correct the feature vector of the feature point on the preset feature extraction convolutional neural network of the corresponding layer using the similarity after dimensionality restoration.
8. The target detection device according to claim 5, characterized in that: The target detection device also includes: The normalization processing module is used to use a batch normalization layer to normalize the feature vectors of the feature points on the enhanced and corrected preset feature extraction convolutional neural network.
9. A computer-readable storage medium storing processor-executable instructions, wherein the instructions are loaded by one or more processors to execute the target detection method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Vegetable image classification identification method and system
CN108491765A
Traffic sign detection method based on improved convolutional neural network
CN108520212A
Face recognition method under complicated illumination conditions of underground coal mine
CN108875645A
Sea cucumber detection and binocular visual positioning method based on deep learning
CN108876855A
