Target detection method, device, electronic device and storage medium
By combining the backbone network and bias-balanced RPN with the composite ROI detection network, the problem of large-sample performance degradation in small-sample target detection is solved, high-accuracy target detection is achieved, and the computational complexity is reduced.
Patent Information
- Application Number
- CN202110120871.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-28
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-01-28
AI Technical Summary
Existing small-sample target detection technology usually sacrifices large-sample category performance when implementing small-sample category target detection, resulting in low accuracy of target detection, and the meta-learning method has high computational complexity and a forgetting effect.
Extract image features through the backbone network, use the bias balanced RPN to generate target detection proposal frames, and determine the preliminary target detection results through the composite ROI detection network, and finally generate the final target detection results, avoiding the loss of large sample performance and improving the accuracy of target detection. accuracy and reduced computational complexity.
When detecting targets in small sample categories, the stability of large sample category performance is maintained, the accuracy of target detection is improved, and the computational complexity of meta-learning methods is reduced.
Smart Images

Figure CN113052165B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a target detection method, device, electronic equipment and storage medium. Background Art
[0002] Object detection refers to the classification and location of objects belonging to the category of interest contained in an image, which is one of the basic technologies for computer vision-related businesses. Few-Shot Object Detection refers to object detection performed when the number of samples of some categories is small (usually less than 30 objects / classes). Since there are other categories with sufficient samples, the information of these categories can be used to help learning under the condition of small samples.
[0003] At present, there are few technical solutions for small sample target detection, which are usually divided into two categories: meta-learning and transfer learning. However, both methods sacrifice some of the performance of large sample categories when realizing small sample category target detection, resulting in a drop in large sample performance, namely the forgetting effect, and low target detection accuracy. In addition, meta-learning methods often have higher computational complexity. Summary of the invention
[0004] In view of the above problems, embodiments of the present invention are proposed to provide a target detection method, device, electronic device and storage medium that overcome the above problems or at least partially solve the above problems.
[0005] According to a first aspect of an embodiment of the present invention, a target detection method is provided, comprising:
[0006] Extract image features of the image to be detected through the backbone network;
[0007] The image features are processed by a bias-equalized region generation network RPN to obtain a target detection proposal frame;
[0008] Determining multiple preliminary target detection results through a composite ROI detection network according to the image features and the target detection proposal box;
[0009] A final target detection result is determined based on the multiple preliminary target detection results.
[0010] According to a second aspect of an embodiment of the present invention, there is provided a target detection device, comprising:
[0011] A feature extraction module is used to extract image features of the image to be detected through the backbone network;
[0012] The proposal box generation module is used to process image features through bias-equalized RPN generation to obtain the target detection proposal box;
[0013] A preliminary result determination module, used to determine a plurality of preliminary target detection results through a composite ROI detection network according to the image features and the target detection proposal box;
[0014] The detection result determination module is used to determine the final target detection result based on the multiple preliminary target detection results.
[0015] According to a third aspect of an embodiment of the present invention, an electronic device is provided, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the target detection method as described in the first aspect is implemented.
[0016] According to a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the target detection method as described in the first aspect is implemented.
[0017] The target detection method, device, electronic device and storage medium provided by the embodiments of the present invention extract image features of the image to be detected through a backbone network, process the image features through a deviation-equalized RPN to obtain a target detection proposal frame, determine multiple preliminary target detection results through a composite ROI detection network based on the image features and the target detection proposal frame, and determine the final target detection result based on the multiple preliminary target detection results. Since the target detection proposal frame is generated through the deviation-equalized RPN and the multiple preliminary target detection results are determined through the composite ROI detection network, the performance of the large sample category is not sacrificed when realizing the target detection of the small sample category, and the large sample performance will not be dropped, that is, there is no forgetting effect, which improves the accuracy of target detection. Moreover, this is a transfer learning method, which reduces the computational complexity compared to the meta-learning method.
[0018] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the following detailed description of the preferred embodiment.The drawings are only for the purpose of illustrating the preferred embodiments and are not to be construed as limiting the invention.
[0020] Figure 1is a flowchart of a target detection method provided by an embodiment of the present invention;
[0021] Figure 2 is a schematic diagram of the structure of a Faster R-CNN detector without forgetting effect in an embodiment of the present invention;
[0022] Figure 3 It is a structural block diagram of a target detection device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0023] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0024] Figure 1 is a flowchart of a target detection method provided by an embodiment of the present invention. The method can be applied to small sample target detection, such as Figure 1 As shown, the method may include:
[0025] Step 101: extract image features of the image to be detected through a backbone network.
[0026] The image features of the image to be detected are extracted through a backbone network based on a convolutional network.
[0027] Step 102: Process the image features through the deviation equalization RPN to obtain a target detection proposal box.
[0028] The image features are input into the deviation-balanced RPN (Region Proposal Networks), and the image features are processed by the deviation-balanced RPN to generate a target detection proposal frame. The deviation-balanced RPN may include a basic target classifier and a basic RPN. The image features are input into the basic target classifier and the basic RPN respectively. The basic target classifier uses Softmax to distinguish whether each predefined frame (anchor) in the image features is a foreground or a background, and obtains the probability that each predefined frame is a foreground; the basic RPN calculates the frame offset of the target region, i.e., each predefined frame, and obtains the positioning deviation of each predefined frame; the proposal layer synthesizes the probability and positioning deviation of each predefined frame to obtain an initial proposal frame, and removes proposal frames that are too small and exceed the boundary from the initial proposal frame to obtain a final proposal frame.
[0029] In one embodiment of the present invention, the deviation balanced RPN includes a basic target classifier, a fine-tuning target classifier and a basic RPN, wherein the basic target classifier is trained based on a large sample data set, and the fine-tuning target classifier is obtained by fine-tuning the basic target classifier on a balanced data set.
[0030] Among them, the large sample data set is a data set including basic target detection results, that is, a large sample category data set, and the balanced data set is a data set including basic target detection results and new target detection results, and the new target detection results are the detection results of the small sample category.
[0031] The basic target classifier and the fine-tuned target classifier classify the image features into foreground and background respectively, and obtain the probability that each predefined bounding box belongs to the foreground, that is, the foreground area. The output of the basic target classifier and the output of the fine-tuned target classifier are combined to obtain the target area, and the target area is corrected according to the positioning deviation output by the basic RPN to obtain the proposal box. By adding a fine-tuned target classifier to detect small sample category targets, the accuracy of small sample category target detection can be further improved.
[0032] In one embodiment of the present invention, the image features are processed by the deviation equalization RPN to obtain a target detection proposal frame, including: generating a first target score map corresponding to the image features by the basic target classifier, and generating a second target score map corresponding to the image features by fine-tuning the target classifier; determining the positioning deviation corresponding to the image features by the basic RPN; and generating a target detection proposal frame according to the first target score map, the second target score map and the positioning deviation.
[0033] The image features are input into the basic target classifier, the fine-tuned target classifier and the basic RPN respectively. The basic target classifier determines the probability that each pixel in the image feature is the foreground within the predefined bounding box, and obtains the first target score map corresponding to the image feature. Since the basic target classifier is pre-trained based on a large sample data set, the first target score map is the target score map for the large sample category; the fine-tuned target classifier determines the probability that each pixel in the image feature is the foreground within the predefined bounding box, and obtains the second target score map corresponding to the image feature. Since the fine-tuned target trainer is fine-tuned based on the basic target classifier and the balanced data set, the second target score map is the target score map for the large sample category and the small sample category; the positioning deviation corresponding to the image feature is calculated by the basic RPN; the target detection proposal box is obtained by combining the first target score map, the second target score map and the positioning deviation. Since the fine-tuned target classifier is fine-tuned based on the basic target classifier and the balanced data set, the balanced data set includes large sample categories and small sample categories, so the use of the basic target classifier and the fine-tuned target classifier can improve the accuracy of small sample detection without causing a drop in the performance of the large sample category.
[0034] In an optional embodiment, generating a target detection proposal frame based on the first target score map, the second target score map and the positioning deviation includes: taking the maximum value of corresponding pixels in the first target score map and the second target score map to obtain a fused target score map corresponding to the image feature; generating the target detection proposal frame based on the positioning deviation and the fused target score map.
[0035] After obtaining the first target score map and the second target score map, the pixel values of the same pixel point in the first target score map and the second target score map can be compared, and the maximum pixel value can be used as the pixel value of the same pixel point in the fused target score map to obtain a fused target score map including large sample categories and small sample categories, so that the foreground target is more prominent. Then, the target detection proposal box is generated based on the positioning deviation and the fused target score map.
[0036] Step 103: Determine multiple preliminary object detection results through a composite ROI detection network according to the image features and the object detection proposal box.
[0037] Wherein, the composite ROI detection network includes multiple ROI detection networks in parallel. The composite ROI detection network optionally includes a basic ROI detection network and a new ROI detection network, wherein the basic ROI detection network is trained based on a large sample data set, and the new ROI detection network is fine-tuned and trained based on a balanced data set. Since the basic ROI detection network is trained based on a large sample data set, the basic ROI detection network can determine the basic target detection results of the large sample category; since the new ROI detection network is trained based on a balanced data set, the new ROI detection network can determine the basic target detection results of the large sample category and the new target detection results of the small sample category.
[0038] After obtaining the target detection proposal box, the image features and the target detection proposal box are input into the composite ROI (Region Of Interest) detection network. The composite ROI detection network detects the preliminary target detection results corresponding to each proposal box to obtain multiple preliminary target detection results.
[0039] In one embodiment of the present invention, the preliminary target detection result includes a basic target detection result and a new target detection result;
[0040] According to the image features and the target detection proposal box, the multiple preliminary target detection results are determined through a composite ROI detection network, including: according to the image features and the target detection proposal box, a basic target detection result is determined through a basic ROI detection network in the composite ROI detection network, and a basic target detection result and a new target detection result are determined through a new ROI detection network in the composite ROI detection network.
[0041] The basic target detection result is a detection result of a large sample category, and the new target category is a detection result of a small sample category.
[0042] After obtaining the target detection proposal box, the image features and the target detection proposal box are respectively input into the basic ROI detection network and the new ROI detection network. The basic ROI detection network is used to determine the large sample category to which the image features in the proposal box belong, and the basic target detection result is obtained; the new ROI detection network is used to determine the large sample category and small sample category to which the image features in the proposal box belong, and the basic target detection result and the new target detection result are obtained.
[0043] Since the basic ROI detection network is trained based on a large sample data set, and the new ROI detection network is fine-tuned based on a balanced data set, the network weights of the basic ROI detection network are kept unchanged during the fine-tuning training process, so that the performance of the large sample category is not sacrificed when realizing the target detection of the small sample category, and the large sample performance will not be dropped, that is, there is no forgetting effect. Moreover, this is a transfer learning method, which reduces the computational complexity compared to the meta-learning method.
[0044] The new ROI detection network includes a classifier, which takes the form of a cosine classifier, that is, the classifier performs L2 normalization on the input features and classifier weights respectively, and then performs tensor operations, so as to avoid the difference in norms between large sample categories and small sample categories.
[0045] Step 104: Determine a final target detection result based on the multiple preliminary target detection results.
[0046] After obtaining multiple preliminary target detection results, the multiple preliminary target detection results are merged to obtain the final target detection result, that is, the proposal box surrounding the target and the target category to which the image features in the proposal box belong. The target in each proposal box may be part of a large target. For example, when a large target is a car, the target in each proposal box may include the front of the car, the lights, etc. At this time, the target category corresponding to each proposal box can be merged to obtain the final target detection result.
[0047] In one embodiment of the present invention, determining the final target detection result based on the multiple preliminary target detection results includes: performing non-maximum suppression processing on the multiple preliminary target detection results to obtain the final target detection result.
[0048] The multiple preliminary target detection results are processed by non-maximum suppression (NMS), that is, the basic target detection results output by the basic ROI detection network and the basic target detection results output by the new ROI detection network and the new target detection results are processed by non-maximum suppression to remove redundant proposal boxes and obtain more appropriate proposal boxes and corresponding target categories as the final target detection results. By merging the target categories corresponding to the proposal boxes through non-maximum suppression processing, more accurate target detection results can be obtained.
[0049] Figure 2 : is a schematic diagram of the structure of the Faster R-CNN detector without forgetting effect in an embodiment of the present invention, such as Figure 2As shown, the Faster R-CNN detector without forgetting effect includes a backbone network, a bias-balanced RPN and a composite ROI detection network, wherein the bias-balanced RPN includes a basic target classifier, a fine-tuned target classifier and a basic RPN, and the composite detection network includes a basic ROI detection network and a new ROI detection network. First, the image features of the image to be detected are extracted through the backbone network, and the image features are input into the basic target classifier, the fine-tuned target classifier and the basic RPN. The basic target classifier outputs a first target score map, and the fine-tuned target classifier outputs a second target score map. The maximum value of the corresponding pixels in the first target score map and the second target score map is taken to obtain the fused target score map. The basic RPN outputs the positioning deviation corresponding to the image features, and the target detection proposal frame is obtained according to the positioning deviation and the fused target score map; the target detection proposal frame and image features are input into the basic ROI detection network and the new ROI detection network, the basic ROI detection network determines the basic target detection results of the image features in the proposal frame, and the new ROI detection network determines the basic target detection results and / or new target detection results of the image features in the proposal frame; non-maximum suppression processing is performed on the basic target detection results and new target detection results corresponding to all target detection proposal frames to obtain the final target detection result. The network including the backbone network, the basic target classifier, the basic RPN and the basic ROI detection network is obtained by pre-training based on a large sample data set. In the process of fine-tuning the network including the backbone network, the basic target classifier, the basic RPN, the fine-tuning target classifier, the basic ROI detection network and the new ROI detection network, the network weights of the backbone network, the basic target classifier, the basic RPN and the basic ROI detection network are kept unchanged, thereby avoiding the forgetting effect and achieving small sample target detection without causing a decrease in large sample performance.
[0050] The target detection method provided in this embodiment extracts image features of the image to be detected through a backbone network, processes the image features through a deviation-equalized RPN to obtain a target detection proposal frame, determines multiple preliminary target detection results through a composite ROI detection network based on the image features and the target detection proposal frame, and determines the final target detection result based on the multiple preliminary target detection results. Since the target detection proposal frame is generated through the deviation-equalized RPN and the multiple preliminary target detection results are determined through the composite ROI detection network, the performance of the large sample category is not sacrificed when realizing the target detection of the small sample category, and the large sample performance will not be dropped, that is, there is no forgetting effect, which improves the accuracy of target detection. Moreover, this is a transfer learning method, which reduces the computational complexity compared to the meta-learning method.
[0051] On the basis of the above technical solution, the training process of the bias-balanced RPN and the composite ROI detection network includes: based on the large sample data set, pre-training the network including the backbone network, the basic target classifier and the basic RPN in the bias-balanced RPN, and the basic ROI detection network in the composite ROI detection network; based on the balanced data set, fine-tuning the network including the backbone network, the basic target classifier, the basic RPN and the fine-tuning target classifier in the bias-balanced RPN, and the basic ROI detection network and the new ROI detection network in the composite ROI detection network, and keeping the network weights of the backbone network, the basic target classifier, the basic RPN and the basic ROI detection network fixed.
[0052] The network including the backbone network, the basic target classifier, the basic RPN and the basic ROI detection network is a traditional Faster R-CNN detector. When training the network, the traditional Faster R-CNN detector is first pre-trained based on a large sample data set. After the pre-training is completed, the Faster R-CNN detector without forgetting effect composed of the network including the backbone network, the basic target classifier, the fine-tuning target classifier, the basic RPN, the basic ROI detection network and the new ROI detection network is fine-tuned based on a balanced data set. During the fine-tuning training process, the network weights of the backbone network, the basic target classifier, the basic RPN and the basic ROI detection network are kept fixed, and only the network weights of the fine-tuning target classifier and the new ROI detection network are adjusted to avoid the decline of large sample performance, thereby realizing target detection without forgetting effect.
[0053] On the basis of the above technical solution, before fine-tuning the network including the backbone network, the basic target classifier in the deviation balanced RPN, the basic RPN and the fine-tuning target classifier, and the basic ROI detection network and the new ROI detection network in the composite ROI detection network based on the balanced data set, it also includes: initializing the network weights of the fine-tuning target classifier to the network weights of the basic target classifier, and randomly initializing the network weights of the new ROI detection network.
[0054] After the network pre-training including the backbone network, basic target classifier, basic RPN and basic ROI detection network is completed, the network weights of the fine-tuning target classifier are initialized to the network weights of the basic target classifier, and the network weights of the new ROI detection network are randomly initialized. On this basis, fine-tuning training is performed based on the balanced data set. Since the fine-tuning target classifier can predict the target score of the small sample category based on the prediction of the target score of the large sample category relative to the basic target classifier, the network weights of the fine-tuning target classifier can be initialized to the network weights of the basic target classifier, which can increase the speed of fine-tuning training. The new ROI detection network can detect more categories than the basic ROI detection network, including large sample categories and small sample categories, which is different from the number of categories that can be detected by the basic ROI detection network, and the network weights can be randomly initialized.
[0055] Based on the above technical solution, the method further includes: fine-tuning the new ROI detection network through the consistency loss of the basic target detection result output by the basic ROI detection network and the basic target detection result output by the new ROI detection network.
[0056] The basic target detection result is the detection result of the large sample category, while the new target detection result is the detection result of the small sample category. For an object detection proposal box, the basic target detection result detected by the new ROI detection network should be consistent with the basic target detection result detected by the basic ROI detection network. Therefore, the fine-tuning training of the new ROI detection network can be constrained by the consistency loss of the basic target detection result output by the basic ROI detection network and the basic target detection result output by the new ROI detection network. The consistency loss can be expressed as follows:
[0057]
[0058] Among them, L con is the consistency loss, and The new ROI detection network and the basic ROI detection network are respectively b Normalized marginal probability distribution for class c.
[0059] The consistency loss is not limited to the above forms, and other consistency losses such as negative cosine similarity and L1 deviation can also be used. By fine-tuning the new ROI detection network using the consistency loss, the accuracy of the trained network in object detection can be further improved.
[0060] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0061] Figure 3 is a structural block diagram of a target detection device provided by an embodiment of the present invention, such as Figure 3 As shown, the target detection device may include:
[0062] A feature extraction module 301 is used to extract image features of the image to be detected through a backbone network;
[0063] A proposal box generation module 302 is used to process the image features through a bias-equalized RPN to obtain a target detection proposal box;
[0064] A preliminary result determination module 303 is used to determine a plurality of preliminary object detection results through a composite ROI detection network according to the image features and the object detection proposal box;
[0065] The detection result determination module 304 is used to determine a final target detection result based on the multiple preliminary target detection results.
[0066] Optionally, the composite ROI detection network includes a basic ROI detection network and a new ROI detection network, wherein the basic ROI detection network is trained based on a large sample data set, and the new ROI detection network is trained based on fine-tuning of a balanced data set.
[0067] Optionally, the preliminary target detection result includes a basic target detection result and a new target detection result;
[0068] The target category determination module is specifically used for:
[0069] According to the image features and the object detection proposal box, a basic object detection result is determined by a basic ROI detection network in the composite ROI detection network, and a basic object detection result and a new object detection result are determined by a new ROI detection network in the composite ROI detection network.
[0070] Optionally, the deviation balanced RPN includes a basic target classifier, a fine-tuning target classifier and a basic RPN, wherein the basic target classifier is trained based on a large sample data set, and the fine-tuning target classifier is obtained by fine-tuning the basic target classifier on the balanced data set.
[0071] Optionally, the proposal frame generation module includes:
[0072] A target score map generating unit, configured to generate a first target score map corresponding to the image feature by using the basic target classifier, and to generate a second target score map corresponding to the image feature by fine-tuning the target classifier;
[0073] A positioning deviation determining unit, used to determine the positioning deviation corresponding to the image feature through a basic RPN;
[0074] A proposal box generation unit is used to generate a target detection proposal box according to the first target score map, the second target score map and the positioning deviation.
[0075] Optionally, the proposal frame generating unit includes:
[0076] A target score map fusion subunit, used to take the maximum value of corresponding pixels in the first target score map and the second target score map to generate a fused target score map corresponding to the image feature;
[0077] The proposal box generation subunit is used to generate the target detection proposal box according to the positioning deviation and the fused target score map.
[0078] Optionally, the device further comprises:
[0079] A pre-training module, used for pre-training a network including the backbone network, a basic target classifier and a basic RPN in the bias-equalized RPN, and a basic ROI detection network in the composite ROI detection network based on the large sample data set;
[0080] A fine-tuning training module is used to perform fine-tuning training on a network including the backbone network, the basic target classifier in the deviation balanced RPN, the basic RPN and the fine-tuning target classifier, and the basic ROI detection network and the new ROI detection network in the composite ROI detection network based on the balanced data set, and keep the network weights of the backbone network, the basic target classifier, the basic RPN and the basic ROI detection network fixed.
[0081] Optionally, the device further comprises:
[0082] The weight initialization module is used to initialize the network weights of the fine-tuned target classifier to the network weights of the basic target classifier, and randomly initialize the network weights of the new ROI detection network.
[0083] Optionally, the device further comprises:
[0084] The fine-tuning training constraint module is used to perform fine-tuning training on the new ROI detection network through the consistency loss between the basic target detection result output by the basic ROI detection network and the basic target detection result output by the new ROI detection network.
[0085] Optionally, the detection result determination module is specifically used to:
[0086] Non-maximum suppression processing is performed on the multiple preliminary target detection results to obtain a final target detection result.
[0087] The target detection device provided by the present embodiment extracts image features of the image to be detected through a backbone network, processes the image features through a deviation-equalized RPN to obtain a target detection proposal frame, determines multiple preliminary target detection results through a composite ROI detection network based on the image features and the target detection proposal frame, and determines the final target detection result based on the multiple preliminary target detection results. Since the target detection proposal frame is generated through the deviation-equalized RPN and the multiple preliminary target detection results are determined through the composite ROI detection network, the performance of the large sample category is not sacrificed when realizing the target detection of the small sample category, and the large sample performance will not be dropped, that is, there is no forgetting effect, which improves the accuracy of target detection. Moreover, this is a transfer learning method, which reduces the computational complexity compared to the meta-learning method.
[0088] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0089] Furthermore, according to an embodiment of the present invention, an electronic device is provided, which may be a computer, a mobile terminal or a server, etc. The electronic device includes: a processor, a memory and a computer program stored in the memory and executable on the processor, and the computer program implements the target detection method of the aforementioned embodiment when executed by the processor.
[0090] According to one embodiment of the present invention, a computer-readable storage medium is also provided, and the computer-readable storage medium includes but is not limited to a disk storage, a CD-ROM, an optical storage, etc., and a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the target detection method of the aforementioned embodiment is implemented.
[0091] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0092] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0093] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0094] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0095] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0096] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0097] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0098] The target detection method, device, electronic device and storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A target detection method, characterized in that: include: Extract image features of the image to be detected through the backbone network; The image features are processed by the deviation equalization RPN to obtain a target detection proposal frame; The deviation balanced RPN includes a basic target classifier, a fine-tuning target classifier and a basic RPN, wherein the basic target classifier is trained based on a large sample data set, and the fine-tuning target classifier is obtained by fine-tuning the basic target classifier on a balanced data set; the balanced data set includes a large sample category and a small sample category; According to the image features and the object detection proposal box, a plurality of preliminary object detection results are determined by a composite ROI detection network; the composite ROI detection network includes a basic ROI detection network and a new ROI detection network, wherein the basic ROI detection network is trained based on a large sample data set, and the new ROI detection network is trained based on fine-tuning of a balanced data set; A final target detection result is determined based on the multiple preliminary target detection results.
2. The method according to claim 1, characterized in that The preliminary target detection result includes a basic target detection result and a new target detection result; According to the image features and the object detection proposal box, a plurality of preliminary object detection results are determined through a composite ROI detection network, including: According to the image features and the object detection proposal box, a basic object detection result is determined by a basic ROI detection network in the composite ROI detection network, and a basic object detection result and a new object detection result are determined by a new ROI detection network in the composite ROI detection network.
3. The method according to claim 2, characterized in that The image features are processed by the deviation equalization RPN to obtain a target detection proposal frame, including: Generating a first target score map corresponding to the image feature by using the basic target classifier, and generating a second target score map corresponding to the image feature by fine-tuning the target classifier; Determine the positioning deviation corresponding to the image feature through the basic RPN; Generate a target detection proposal box according to the first target score map, the second target score map and the positioning deviation.
4. The method according to claim 3, characterized in that The generating a target detection proposal frame according to the first target score map, the second target score map and the positioning deviation includes: Taking the maximum value of corresponding pixels in the first target score map and the second target score map to obtain a fused target score map corresponding to the image feature; The target detection proposal box is generated according to the positioning deviation and the fused target score map.
5. The method according to claim 1, characterized in that The training process of the bias equalization RPN and the composite ROI detection network includes: Based on the large sample data set, pre-training a network including the backbone network, the basic target classifier and the basic RPN in the deviation equalization RPN, and the basic ROI detection network in the composite ROI detection network; Based on the balanced data set, fine-tuning training is performed on the network including the backbone network, the basic target classifier in the deviation balanced RPN, the basic RPN and the fine-tuning target classifier, and the basic ROI detection network and the new ROI detection network in the composite ROI detection network, and the network weights of the backbone network, the basic target classifier, the basic RPN and the basic ROI detection network are kept fixed.
6. The method according to claim 5, characterized in that Before fine-tuning the network including the backbone network, the basic target classifier in the deviation-equalized RPN, the basic RPN and the fine-tuned target classifier, and the basic ROI detection network and the new ROI detection network in the composite ROI detection network based on the balanced data set, the method further includes: The network weights of the fine-tuned target classifier are initialized as the network weights of the basic target classifier, and the network weights of the new ROI detection network are randomly initialized.
7. The method according to claim 5, characterized in that The method further comprises: The new ROI detection network is fine-tuned and trained by using the consistency loss between the basic target detection result output by the basic ROI detection network and the basic target detection result output by the new ROI detection network.
8. The method according to claim 1, characterized in that Determining a final target detection result according to the multiple preliminary target detection results includes: Non-maximum suppression processing is performed on the multiple preliminary target detection results to obtain a final target detection result.
9. A target detection device, characterized in that: include: A feature extraction module is used to extract image features of the image to be detected through the backbone network; A proposal box generation module is used to process the image features through a bias-equalized RPN to obtain a target detection proposal box; The deviation balanced RPN includes a basic target classifier, a fine-tuning target classifier and a basic RPN, wherein the basic target classifier is trained based on a large sample data set, and the fine-tuning target classifier is obtained by fine-tuning the basic target classifier on a balanced data set; the balanced data set includes a large sample category and a small sample category; A preliminary result determination module is used to determine a plurality of preliminary target detection results through a composite ROI detection network according to the image features and the target detection proposal box; the composite ROI detection network includes a basic ROI detection network and a new ROI detection network, wherein the basic ROI detection network is trained based on a large sample data set, and the new ROI detection network is fine-tuned and trained based on a balanced data set; The detection result determination module is used to determine the final target detection result based on the multiple preliminary target detection results.
10. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the target detection method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the target detection method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Student behavior detection method based on target detection
CN110414380A
User interface component identification method and device, electronic equipment and storage medium
CN111652266A
