Target detection method and device, electronic equipment and storage medium

By employing a two-stage detection method, a first detection model is used for preliminary detection, and domain transformation is performed when the confidence level is low. A second detection model is then used to perform target detection on the domain-transformed image. This solves the problems of insufficient target detection accuracy and high annotation cost in existing technologies, and achieves high-precision target detection.

CN116721397BActive Publication Date: 2026-03-17Z-ONE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-28
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing technologies for object detection involve high costs associated with increasing dataset annotation in order to improve model generalization, but also result in insufficient object detection accuracy.

Method used

A two-stage detection method is adopted. First, a preliminary detection is performed using a first detection model. The detection effect is judged based on the confidence threshold. If it is not good, domain transformation is performed. Then, a second detection model is used to perform target detection on the domain-transformed sub-image to improve the detection accuracy.

Benefits of technology

By adopting a two-stage detection method, the accuracy of object detection is improved, the dependence on increasing dataset richness is reduced, and the annotation cost is decreased.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116721397B_ABST
    Figure CN116721397B_ABST
Patent Text Reader

Abstract

The application provides a target detection method and device, electronic equipment and a storage medium. The method comprises: performing target detection on a to-be-detected image by a first detection model to obtain a first detection result; if a confidence score corresponding to a first detection box included in the first detection result is greater than a first confidence threshold, outputting a detection result corresponding to the first detection box; if the confidence score corresponding to the first detection box is less than or equal to the first confidence threshold and greater than a second confidence threshold, performing domain conversion on a first sub-image located in the first detection box in the to-be-detected image to obtain a second sub-image; performing target detection on the second sub-image by a second detection model to obtain a second detection result and a corresponding confidence score; and if the confidence score corresponding to the second detection result is greater than the first confidence threshold, outputting the second detection result. The present scheme can improve the accuracy of the target detection result in a dim scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image recognition technology, and in particular to a target detection method, apparatus, electronic device, and storage medium. Background Technology

[0002] In recent years, autonomous driving technology has developed rapidly in the automotive industry. Object detection, as an application of autonomous driving technology, has a significant impact on the safety of autonomous driving. With the explosive growth of autonomous driving in new energy vehicles, improving the accuracy of object detection has become an increasingly urgent technology for every automobile manufacturer.

[0003] Currently, to address the aforementioned issues, a common model optimization method is to enhance the richness of the dataset by adding datasets from other domains or scenarios to the existing data and then training the model with them to increase its generalization ability.

[0004] However, increasing the richness of the dataset means incurring higher annotation costs. Summary of the Invention

[0005] In view of this, embodiments of this application provide a target detection method, apparatus, electronic device, and storage medium to at least solve some of the above-mentioned problems.

[0006] According to a first aspect of the embodiments of this application, a target detection method is provided, comprising: performing target detection on an image to be detected using a first detection model to obtain a first detection result, wherein the first detection result includes at least one first detection box and a corresponding confidence score. For each first detection box included in at least a portion of the first detection boxes in the first detection result, determining whether the confidence score corresponding to the first detection box is greater than a first confidence threshold. If the confidence score corresponding to the first detection box is greater than the first confidence threshold, then outputting the detection result corresponding to the first detection box. If the confidence score corresponding to the first detection box is less than or equal to the first confidence threshold and greater than a second confidence threshold, then performing a domain transformation on a first sub-image located within the first detection box in the image to be detected to obtain a second sub-image, wherein the second confidence threshold is less than the first confidence threshold. Performing target detection on the second sub-image using a second detection model to obtain a second detection result and a corresponding confidence score. If the confidence score corresponding to the second detection result is greater than the first confidence threshold, then outputting the second detection result.

[0007] According to a second aspect of the embodiments of this application, a target detection apparatus is provided, comprising: a first detection module, configured to perform target detection on an image to be detected using a first detection model to obtain a first detection result, wherein the first detection result includes at least one first detection box and a corresponding confidence score; a judgment module, configured to determine, for each of the first detection boxes included in at least a portion of the first detection boxes in the first detection result, whether the confidence score corresponding to the first detection box is greater than a first confidence threshold; a first output module, configured to output the detection result corresponding to the first detection box when the confidence score corresponding to the first detection box is greater than the first confidence threshold; a domain transformation module, configured to perform domain transformation on a first sub-image located within the first detection box in the image to be detected to obtain a second sub-image when the confidence score corresponding to the first detection box is less than or equal to the first confidence threshold and greater than a second confidence threshold, wherein the second confidence threshold is less than the first confidence threshold; and a second detection module, configured to perform target detection on the second sub-image using a second detection model to obtain a second detection result and a corresponding confidence score. The second output module is used to output the second detection result when the confidence score corresponding to the second detection result is greater than the first confidence threshold.

[0008] According to a third aspect of the embodiments of this application, an electronic device is provided, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus. The memory is used to store at least one executable instruction, which causes the processor to perform an operation corresponding to the target detection method described in the first aspect above.

[0009] According to a fourth aspect of the embodiments of this application, a computer storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the target detection method as described in the first aspect above.

[0010] The above technical solution uses a first detection model to perform target detection on the image to be detected, obtaining a first detection result. When the confidence score of the corresponding detection box in the first detection result is less than or equal to a set first confidence threshold and greater than a second confidence threshold, the corresponding image region within the detection box is cropped and input into a domain transformation model for domain transformation. The transformed image is then subjected to target detection using a second detection model to obtain a second detection result. If the confidence score corresponding to the second detection result is greater than the first confidence threshold, the detection result is output. By using two detection models in the target detection process, the accuracy of the target detection result is improved. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 This is a flowchart of target detection provided in one embodiment of this application;

[0013] Figure 2 This is a flowchart of target detection provided in another embodiment of this application;

[0014] Figure 3 This is a schematic diagram of a target detection device provided in one embodiment of this application;

[0015] Figure 4 This is a schematic diagram of an electronic device provided in one embodiment of this application. Detailed Implementation

[0016] The present application is described below based on embodiments, but it is not limited to these embodiments. In the detailed description of the present application below, certain specific details are described in detail. Those skilled in the art can fully understand the present application without these details. To avoid obscuring the essence of the present application, well-known methods, processes, and procedures are not described in detail. Furthermore, the accompanying drawings are not necessarily drawn to scale.

[0017] Target detection methods

[0018] This application provides a target detection method, which will be described in detail below through multiple embodiments.

[0019] Figure 1 This is a flowchart of an embodiment of the target detection method of this application. Figure 1 As shown, the target detection method includes the following steps:

[0020] Step S102: Perform target detection on the image to be detected using the first detection model to obtain the first detection result.

[0021] The first detection result includes at least one first detection box and a corresponding confidence score.

[0022] The first detection model can use YOLOv7 or YOLOv7 models, which are capable of detecting targets in autonomous driving scenarios. Such 2D detection models typically perform better in daytime scenarios than in twilight (nighttime) scenarios. The first detection model can also use other 2D detection models that can achieve similar results, and this application does not limit this.

[0023] The image to be detected can be a 2D image or an image extracted from a video. This application does not limit the method of obtaining the image.

[0024] The first detection result includes at least one first detection box and the corresponding confidence score, and may also include information such as image name, coordinates, image width and height.

[0025] Step S104: Determine whether the confidence score corresponding to the first detection box is greater than the first confidence threshold. If yes, proceed to step S106; otherwise, proceed to step S108.

[0026] The first detection box refers to at least a portion of the detection boxes included in the first detection result. Step S104 must be executed for each first detection box.

[0027] The first confidence threshold represents a high score, with a default value of 0.6, but it can also be flexibly configured from 0 to 1 as needed.

[0028] Step S106: Output the detection result corresponding to the first detection box and end the current process.

[0029] If the confidence score of the first detection box is greater than the first confidence threshold, it indicates that the detection effect is good, and the detection result corresponding to the first detection box is output.

[0030] Step S108: Determine whether the confidence score corresponding to the first detection box is greater than the second confidence threshold. If yes, proceed to step S112; otherwise, proceed to step S110.

[0031] Step S110: Discard the first detection frame and end the current process.

[0032] When the confidence score corresponding to the first detection box is less than or equal to the second confidence threshold, it indicates that the detection effect is not good. Therefore, the first detection box is discarded and the current process ends.

[0033] Step S112: Perform domain transformation on the first sub-image located within the first detection box in the image to be detected to obtain the second sub-image.

[0034] The second confidence threshold represents a low score. The second confidence threshold is less than the first confidence threshold. Its default value is 0.1, but it can also be flexibly configured from 0 to 1 as needed.

[0035] When the confidence score corresponding to the first detection box is less than or equal to the first confidence threshold and greater than the second confidence threshold, it indicates that the detection effect is average. In this case, the first sub-image located within the first detection box is cropped out and fed into the domain transformation model to obtain the second sub-image. For example, if the first sub-image belongs to the twilight domain, feeding it into the twilight domain to daytime domain transformation model will generate a second sub-image in the daytime domain.

[0036] Step S114: Perform target detection on the second sub-image using the second detection model to obtain the second detection result and the corresponding confidence score.

[0037] The second detection model can use YOLOv7 or other 2D detection models that can achieve similar results; this application does not impose any restrictions on this.

[0038] Step S116: Determine whether the confidence score corresponding to the second detection result is greater than the first confidence threshold. If yes, proceed to step S118; otherwise, proceed to step S120.

[0039] Step S118: Output the second detection result and end the current process.

[0040] The confidence score of the second detection result being greater than the first confidence threshold indicates that the target area in the first detection box that did not perform well in detection has reached the target threshold after being re-detected after domain transformation. Therefore, the second detection result obtained is output.

[0041] Step S120: Discard the second test result.

[0042] If the confidence score corresponding to the second detection result is less than or equal to the first confidence threshold, it indicates that the detection effect is not good. Therefore, the second detection result is discarded and the current process ends.

[0043] In this embodiment, a first detection result is obtained by performing target detection on the image to be detected using a first detection model. When the confidence score of the corresponding detection box in the first detection result is less than or equal to a set first confidence threshold and greater than a second confidence threshold, the corresponding image region within the detection box is cropped and input into a domain transformation model for domain transformation. The transformed image is then subjected to target detection using a second detection model to obtain a second detection result. If the confidence score corresponding to the second detection result is greater than the first confidence threshold, the detection result is output. By using two detection models to perform target detection during the target detection process, the accuracy of the target detection result is improved.

[0044] In one possible implementation, the step of determining whether the confidence score corresponding to each first detection box in at least a portion of the first detection boxes included in the first detection result is greater than a first confidence threshold specifically includes: performing non-maximum suppression processing on at least one first detection box whose corresponding confidence score is greater than a second confidence threshold to obtain at least one target detection box; and determining whether the confidence score corresponding to each target detection box is greater than the first confidence threshold.

[0045] Non-maximum suppression processing of the detection box can be performed before or after determining whether the confidence score corresponding to the first detection box is greater than the first confidence threshold, and this application does not restrict this.

[0046] In this embodiment, the first detection box is subjected to a judgment on whether the confidence score corresponding to the first detection box is greater than the first confidence threshold and non-maximum suppression processing, which filters out redundant detection boxes and improves the efficiency of target detection.

[0047] In one possible implementation, the specific steps for performing domain transformation on a first sub-image located within a first detection box in the image to be detected to obtain a second sub-image include: inputting the first sub-image located within the first detection box into a domain transformation model to obtain an intermediate image output by the domain transformation model; detecting whether the intermediate image belongs to a second domain using a discriminator model; if the intermediate image belongs to the second domain, then determining the intermediate image as the second sub-image; if the intermediate image does not belong to the second domain, then inputting the intermediate image as the first sub-image into the domain transformation model and repeating the above steps until the second sub-image corresponding to the first sub-image is obtained.

[0048] At the same time, a threshold can be set. When the number of times the above steps are repeated reaches the set threshold, the next process will proceed even if the intermediate image is not determined to belong to the second domain.

[0049] Domain transformation models are used to transform an image from a first domain to a second domain. The purpose is to transform a poorly performing image domain into a better one, such as transforming a twilight domain into a daytime domain, a nighttime domain into a daytime domain, or a rainy day domain into a sunny day domain.

[0050] In this embodiment, the first sub-image in the image to be detected is transformed into an intermediate image by domain transformation. The discriminator model is used to identify whether the intermediate image belongs to the second domain to determine the second sub-image. The domain transformation model optimizes the image effect and improves the accuracy of target detection.

[0051] In one possible implementation, a first detection model is trained by taking the entire sample image included in the first training set as input.

[0052] The first training set consists of multiple sample images, which must contain scenes from both the first and second domains. For example, the sample images may contain scenes from both the daytime and twilight domains.

[0053] In this embodiment of the application, the first detection model is trained by using the entire sample image included in the first training set as input. The first detection model is used to perform target detection on the entire image.

[0054] In one possible implementation, a second detection model is trained by taking a sub-image from the sample images in the first training set as input.

[0055] At least a portion of the sample images in the first training set include at least one sub-image, and at least a portion of the sub-image includes an image of the target to be identified. For example, if the target to be detected is a car, then at least a portion of the sample images in the first training set include at least one sub-image containing a car.

[0056] In this embodiment, the sample images in the first training set contain images of the target to be identified, ensuring that the second detection model obtained by training the model using the first training set can detect the target image.

[0057] In one possible implementation, such as Figure 2 As shown, the target detection method also includes the following steps:

[0058] Step S202: Perform target detection on the sample images in the first training set using the first detection model to obtain the third detection result.

[0059] The third detection result includes at least one second detection box and its corresponding confidence score.

[0060] Step S204: Determine whether the confidence score corresponding to the second detection box is greater than the second confidence threshold. If yes, proceed to step S208; otherwise, proceed to step S206.

[0061] The second detection box refers to at least a portion of the detection boxes included in the third detection result. Step S204 is performed for each second detection box.

[0062] The second confidence threshold represents a low score, with a default value of 0.1, but it can also be flexibly configured from 0 to 1 as needed.

[0063] Step S206: Discard the second detection frame and end the current process.

[0064] When the confidence score corresponding to the second detection box is less than or equal to the second confidence threshold, it indicates that the detection effect is not good. Therefore, the second detection box is discarded and the current process ends.

[0065] Step S208: If the confidence score corresponding to the second detection box is greater than the second confidence threshold, then the image in the sample image located within the second detection box is determined as the third sub-image.

[0066] When the confidence score corresponding to the second detection box is greater than the second confidence threshold, it indicates that the detection effect is within the acceptable range. Then, the image in the sample image that is located within the second detection box is determined as the third sub-image.

[0067] Step S210: Generate a second training set that includes at least a portion of the third sub-images.

[0068] The obtained third sub-image should contain all categories corresponding to the detection model.

[0069] Step S212: Train the domain transformation model and discriminator model using the second training set, and end the current process.

[0070] The second training set includes samples from the first and second domains. These sample images are input into the CycleGAN domain transfer model to train a model that transforms the first domain to the second domain, as well as a discriminator model for the second domain. The domain transfer model includes, but is not limited to, CycleGAN, and also includes other variants of CycleGAN.

[0071] In this embodiment, the sample images in the second training set are partial regions of the sample images in the first training set rather than the entire images. Using the second training set to train the model can eliminate redundant information in regions that are not of interest, thereby improving the efficiency of model training.

[0072] In one possible implementation, generating a second training set comprising at least some third sub-images includes: extracting a first number of third sub-images from each third sub-image whose corresponding confidence scores are greater than a first confidence threshold, as a first sub-training set; extracting a second number of third sub-images from each third sub-image whose corresponding confidence scores are greater than a second confidence threshold and less than or equal to the first confidence threshold, as a second sub-training set; and merging the first and second sub-training sets to obtain a second training set.

[0073] The number of third sub-images corresponding to the first domain in the first sub-training set is equal to the number of third sub-images corresponding to the second domain. For example, 1000 images of the daytime domain and 1000 images of the twilight domain are selected from the first sub-training set.

[0074] The second number is greater than the first number. The number of third sub-images corresponding to the first domain in the second sub-training set is equal to the number of third sub-images corresponding to the second domain. For example, 2000 images of the daytime domain and 2000 images of the twilight domain are selected from the second sub-training set.

[0075] In this embodiment, the first sub-training set corresponds to sample images with confidence scores greater than a first confidence threshold, and the second sub-training set corresponds to sample images with confidence scores between the first and second confidence thresholds. The first confidence threshold is greater than the second confidence threshold, and the number of sample images in the second sub-training set is greater than the number of sample images in the first sub-training set. This allows the domain transfer model and the discriminator model to learn as many domain transfer features as possible corresponding to the lower-scoring sample images, thereby improving the conversion effect of the domain transfer model.

[0076] Target detection device

[0077] Figure 3 This is a schematic diagram of a target detection device provided in one embodiment of this application, as shown below. Figure 3 As shown, the target detection device 300 may include: a first detection module 302, a judgment module 304, a first output module 306, a domain conversion module 308, a second detection module 310, and a second output module 312.

[0078] The first detection module 302 is used to perform target detection on the image to be detected using a first detection model to obtain a first detection result, wherein the first detection result includes at least one first detection box and a corresponding confidence score.

[0079] The first detection model can use YOLOv7 or YOLOv7 models, which are capable of detecting targets in autonomous driving scenarios. Such 2D detection models typically perform better in daytime scenarios than in twilight (nighttime) scenarios. The first detection model can also use other 2D detection models that can achieve similar results, and this application does not limit this.

[0080] The image to be detected can be a 2D image or an image extracted from a video. This application does not limit the method of obtaining the image.

[0081] The first detection result includes at least one first detection box and the corresponding confidence score, and may also include information such as image name, coordinates, image width and height.

[0082] The judgment module 304 is used to determine whether the confidence score corresponding to each first detection box in at least a portion of the first detection boxes included in the first detection result is greater than a first confidence threshold.

[0083] The first confidence threshold represents a high score, with a default value of 0.6, but it can also be flexibly configured from 0 to 1 as needed.

[0084] The first output module 306 is used to output the detection result corresponding to the first detection box when the confidence score corresponding to the first detection box is greater than the first confidence threshold.

[0085] If the confidence score of the first detection box is greater than the first confidence threshold, it indicates that the detection effect is good, and the corresponding detection result will be output.

[0086] The domain transformation module 308 is used to perform domain transformation on the first sub-image located within the first detection box in the image to be detected when the confidence score corresponding to the first detection box is less than or equal to the first confidence threshold and greater than the second confidence threshold, so as to obtain the second sub-image, wherein the second confidence threshold is less than the first confidence threshold.

[0087] The second confidence threshold represents a low score. The second confidence threshold is less than the first confidence threshold. Its default value is 0.1, but it can also be flexibly configured from 0 to 1 as needed.

[0088] When the confidence score corresponding to the first detection box is less than or equal to the second confidence threshold, it indicates that the detection effect is not good, and the first detection box is discarded.

[0089] When the confidence score corresponding to the first detection box is less than or equal to the first confidence threshold and greater than the second confidence threshold, it indicates that the detection effect is average. In this case, the first sub-image located within the first detection box is cropped out and fed into the domain transformation model to obtain the second sub-image. For example, if the first sub-image belongs to the twilight domain, feeding it into the twilight domain to daytime domain transformation model will generate a second sub-image in the daytime domain.

[0090] The second detection module 310 is used to perform target detection on the second sub-image through the second detection model, and obtain the second detection result and the corresponding confidence score.

[0091] The second detection model can use YOLOv7 or other 2D detection models that can achieve similar results; this application does not impose any restrictions on this.

[0092] The second output module 312 is used to output the second detection result when the confidence score corresponding to the second detection result is greater than the first confidence threshold.

[0093] The confidence score of the second detection result being greater than the first confidence threshold indicates that the confidence score of the target area with poor detection performance in the first detection box, after domain transformation and re-detection, has reached the target threshold. Therefore, the second detection result obtained is output.

[0094] In this embodiment, a first detection result is obtained by performing target detection on the image to be detected using a first detection model. When the confidence score of the corresponding detection box in the first detection result is less than or equal to a set first confidence threshold and greater than a second confidence threshold, the corresponding image region within the detection box is cropped and input into a domain transformation model for domain transformation. The transformed image is then subjected to target detection using a second detection model to obtain a second detection result. If the confidence score corresponding to the second detection result is greater than the first confidence threshold, the detection result is output. By using two detection models to perform target detection during the target detection process, the accuracy of the target detection result is improved.

[0095] electronic devices

[0096] Figure 4 This is a schematic block diagram of an electronic device provided in an embodiment of this application. Specific embodiments of this application do not limit the specific implementation of the electronic device. Figure 4 As shown, the electronic device 400 may include: a processor 402, a communications interface 404, a memory 406, and a communications bus 408. Wherein:

[0097] The processor 402, communication interface 404, and memory 406 communicate with each other via communication bus 408.

[0098] Communication interface 404 is used to communicate with other electronic devices or servers.

[0099] The processor 402 is used to execute program 410, which can specifically execute the relevant steps in any of the aforementioned target detection method embodiments.

[0100] Specifically, program 410 may include program code that includes computer operation instructions.

[0101] Processor 402 may be a CPU, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application. The smart device includes one or more processors, which may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0102] Memory 406 is used to store program 410. Memory 406 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0103] Specifically, program 410 can be used to cause processor 402 to execute the target detection method in any of the foregoing embodiments.

[0104] The specific implementation of each step in procedure 410 can be found in the corresponding steps and units described in any of the foregoing examples of the target detection method, and will not be repeated here. Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the devices and modules described above can be referred to the corresponding process descriptions in the foregoing method examples, and will not be repeated here.

[0105] The electronic device of this application embodiment performs target detection on the image to be detected using a first detection model to obtain a first detection result. When the confidence score of the corresponding detection box in the first detection result is less than a set first confidence threshold, the corresponding image region within the detection box is cropped and input into a domain transformation model for domain transformation. The transformed image is then subjected to target detection using a second detection model to obtain a second detection result. If the confidence score corresponding to the second detection result is greater than the first confidence threshold, the detection result is output. By using two detection models to perform target detection during the target detection process, the accuracy of the target detection result is improved.

[0106] storage media

[0107] In this embodiment, a computer-readable storage medium is provided, storing instructions for causing a machine to perform the target detection method as described herein. Specifically, a system or apparatus equipped with a storage medium may be provided, on which software program code implementing the functions of any of the embodiments described above is stored, and the computer (or CPU or MPU) of the system or apparatus may read and execute the program code stored in the storage medium.

[0108] In this case, the program code read from the storage medium can itself implement the function of any of the above embodiments, and therefore the program code and the storage medium storing the program code constitute part of this application.

[0109] Examples of storage media used to provide program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer via a communication network.

[0110] It should be noted that in the description of this application, the terms "first" and "second" are used only for convenience in describing different components or names, and should not be construed as indicating or implying a sequential relationship, relative importance, or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features.

[0111] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.

[0112] It should be noted that although specific embodiments of this application have been described in detail with reference to the accompanying drawings, this should not be construed as limiting the scope of protection of this application. Various modifications and variations that can be made by those skilled in the art without inventive effort within the scope described in the claims still fall within the scope of protection of this application.

[0113] The examples of the embodiments in this application are intended to concisely illustrate the technical features of the embodiments in this application, so that those skilled in the art can intuitively understand the technical features of the embodiments in this application, and are not intended to be improper limitations on the embodiments in this application.

[0114] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A target detection method characterized by, The method comprises: performing target detection on the to-be-detected image by a first detection model to obtain a first detection result, wherein the first detection result comprises at least one first detection box and a corresponding confidence score; for each of at least some of the first detection boxes included in the first detection result, determining whether the confidence score corresponding to the first detection box is greater than a first confidence threshold; if the confidence score corresponding to the first detection box is greater than the first confidence threshold, outputting the detection result corresponding to the first detection box; if the confidence score corresponding to the first detection box is less than or equal to the first confidence threshold and greater than a second confidence threshold, performing domain conversion on a first sub-image located in the first detection box in the to-be-detected image to obtain a second sub-image, wherein the second confidence threshold is less than the first confidence threshold; performing target detection on the second sub-image by a second detection model to obtain a second detection result and a corresponding confidence score; if the confidence score corresponding to the second detection result is greater than the first confidence threshold, outputting the second detection result.

2. The method of claim 1, wherein, The method further comprises: performing non-maximum suppression processing on the first detection boxes in the at least one first detection box whose corresponding confidence score is greater than the second confidence threshold to obtain at least one target detection box; respectively determining whether the confidence score corresponding to each of the target detection boxes is greater than the first confidence threshold.

3. The method of claim 1, wherein, The method further comprises: inputting the first sub-image located in the first detection box in the to-be-detected image into a domain conversion model to obtain an intermediate image output by the domain conversion model, wherein the domain conversion model is used to convert an image from a first domain to a second domain; determining whether the intermediate image belongs to the second domain by a discriminator model; if the intermediate image belongs to the second domain, determining the intermediate image as the second sub-image; if the intermediate image does not belong to the second domain, inputting the intermediate image as the first sub-image into the domain conversion model to repeat the above steps until the second sub-image corresponding to the first sub-image is obtained.

4. The method of claim 3, wherein, The method further comprises: training the first detection model by taking an entire sample image included in a first training set as input, wherein the first training set comprises a plurality of sample images.

5. The method of claim 4, wherein, The method further comprises: training the second detection model by taking a sub-image included in a sample image in the first training set as input, wherein at least some of the sample images in the first training set comprise at least one sub-image, and at least some of the sub-images comprise an image of a to-be-recognized target.

6. The method of claim 4, wherein, The method further comprises: obtaining a third detection result by performing target detection on the sample image in the first training set through the first detection model, wherein the third detection result at least includes a second detection box and a corresponding confidence score; judging, for each of at least part of the second detection boxes included in the third detection result, whether the confidence score corresponding to the second detection box is greater than the second confidence threshold; if the confidence score corresponding to the second detection box is greater than the second confidence threshold, determining an image located in the second detection box in the sample image as a third sub-image; generating a second training set including at least part of the third sub-image; obtaining the domain conversion model and the discriminator model through training of the second training set.

7. The method of claim 6, wherein, The generating of the second training set including at least part of the third sub-image comprises: extracting a first number of third sub-images corresponding to confidence scores greater than the first confidence threshold from each of the third sub-images as a first sub-training set, wherein the number of third sub-images corresponding to the first domain in the first sub-training set is equal to the number of third sub-images corresponding to the second domain; extracting a second number of third sub-images corresponding to confidence scores greater than the second confidence threshold and less than or equal to the first confidence threshold from each of the third sub-images as a second sub-training set, wherein the second number is greater than the first number, and the number of third sub-images corresponding to the first domain in the second sub-training set is equal to the number of third sub-images corresponding to the second domain; merging the first sub-training set and the second sub-training set to obtain the second training set.

8. A target detection apparatus characterized by comprising: The device comprises: a first detection module configured to perform target detection on a to-be-detected image through a first detection model to obtain a first detection result, wherein the first detection result includes at least one first detection box and a corresponding confidence score; a judgment module configured to judge, for each of at least part of the first detection boxes included in the first detection result, whether the confidence score corresponding to the first detection box is greater than a first confidence threshold; a first output module configured to output the detection result corresponding to the first detection box when the confidence score corresponding to the first detection box is greater than the first confidence threshold; a domain conversion module configured to perform domain conversion on a first sub-image located in the first detection box in the to-be-detected image to obtain a second sub-image when the confidence score corresponding to the first detection box is less than or equal to the first confidence threshold and greater than a second confidence threshold, wherein the second confidence threshold is less than the first confidence threshold; a second detection module configured to perform target detection on the second sub-image through a second detection model to obtain a second detection result and a corresponding confidence score; a second output module configured to output the second detection result when the confidence score corresponding to the second detection result is greater than the first confidence threshold.

9. An electronic device, comprising: ​ The processor, the communication interface, the memory and the communication bus complete communication with each other through the communication bus; The memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute operations corresponding to the target detection method in any one of claims 1-7.

10. A computer storage medium, which stores a computer program, and the program is executed by a processor to implement the target detection method in any one of claims 1-7.

Citation Information

Patent Citations

  • Target detection method, device and equipment

    CN114626477A

  • Image processor, image processing method, computer program and computer readable storage medium

    JP2004128975A