Target detection method and device, computing equipment

Through the two-stage detection method, the first detection model is used to perform preliminary detection and partial images are extracted, and the second detection model is used to perform secondary detection, which solves the problem of low detection accuracy of small and medium-sized targets in the prior art and achieves higher detection accuracy and accuracy.

CN113516144BActive Publication Date: 2025-02-07ALIBABA GROUP HOLDING LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202011399474.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-01
Publication Date
2025-02-07
Estimated Expiration
2040-12-01

AI Technical Summary

Technical Problem

In the prior art, the target detection model is not accurate enough for the detection results of small targets and has low detection accuracy.

Method used

Using a two-stage detection method, first performs preliminary detection of the image to be detected based on the first detection model, determines the first target area and the target category of the target object, and then extracts a local image and performs secondary detection based on the second detection model to improve detection. Accuracy.

Benefits of technology

By narrowing the detection range and adopting a more suitable small object detection model, accurate detection of small objects is achieved, and detection accuracy and accuracy are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113516144B_ABST
    Figure CN113516144B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a target detection method and device, and a computing device, the method comprising: determining an image to be detected; based on a first detection model, detecting a first target area where a target object is located in the image to be detected and a target category to which the target object belongs; extracting a partial image of the image to be detected in the first target area; based on a second detection model, detecting a second target area where the target object is located in the partial image; and determining a detection result of the target object in the image to be detected according to the second target area and in combination with the target category to which the target object belongs. The embodiment of the present application improves the accuracy and precision of target detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a target detection method and device, and a computing device. Background Art

[0002] Object detection is a hot research topic in the field of computer vision and can be widely used in many fields such as intelligent navigation, medical image processing, autonomous driving, intelligent monitoring, industrial defect detection, etc. The current object detection algorithm can identify and segment the target object area and the background area in the image. Object detection can include large object detection and small object detection. For small objects, the width of the detection box is less than 1 / 50 (pixel points) of the width of the original image, and the height of the detection box is less than 1 / 50 (pixel points) of the height of the original image; the size of the detection box is adapted to the size of the target object.

[0003] In the prior art, one target detection model is usually used to detect all targets in an image. However, for small targets in an image, a deep network and multiple scales are usually used to extract and classify image features, and a loss function that is more suitable for small targets is used to ensure that accurate small targets are obtained.

[0004] However, when using the target detection model to directly detect small targets, because the small targets are small enough, even if a more complex network, more scales and a loss function that is more suitable for small targets are used, the detection results obtained are still not accurate enough and the detection accuracy is low. Summary of the invention

[0005] In view of this, the embodiments of the present application provide a target detection method and apparatus, and a computing device to solve the technical problem in the prior art that the detection results of target detection models for small targets are not accurate enough.

[0006] In a first aspect, an embodiment of the present application provides a target detection method, comprising:

[0007] Determine an image to be detected;

[0008] Based on the first detection model, detecting a first target area where a target object in the image to be detected is located and a target category to which the target object belongs;

[0009] Extracting a local image of the image to be detected in the first target area;

[0010] Based on the second detection model, detecting a second target area where the target object is located in the partial image;

[0011] A detection result of the target object in the image to be detected is determined according to the second target area and in combination with the target category to which the target object belongs.

[0012] In a second aspect, an embodiment of the present application provides a target detection method, including:

[0013] In response to a detection request for invoking a target detection service, determining a target detection resource corresponding to the target detection service;

[0014] The target detection resource corresponding to the target detection service is used to perform the following steps:

[0015] Determine an image to be detected;

[0016] Based on the first detection model, detecting a first target area where a target object in the image to be detected is located and a target category to which the target object belongs;

[0017] Extracting a local image of the image to be detected in the first target area;

[0018] Based on the second detection model, detecting a second target area where the target object is located in the partial image;

[0019] A detection result of the target object in the image to be detected is determined according to the second target area and in combination with the target category to which the target object belongs.

[0020] In a third aspect, an embodiment of the present application provides a target detection method, including:

[0021] In response to a detection request initiated by a detection user, acquiring an image to be detected provided by the detection user;

[0022] Based on the first detection model, detecting a first target area where a target object in the image to be detected is located and a target category to which the target object belongs;

[0023] Extracting a local image of the image to be detected in the first target area;

[0024] Based on the second detection model, detecting a second target area where the target object is located in the partial image;

[0025] Determine, according to the second target area and in combination with the target category to which the target object belongs, a detection result of the target object in the image to be detected;

[0026] Output the detection result of the image to be detected to the detection user.

[0027] In a fourth aspect, an embodiment of the present application provides a target detection method, including:

[0028] Obtaining a detection request initiated by a detection user and an image to be detected provided by the detection user;

[0029] Sending the detection request and the image to be detected to a computing device that provides a target detection service, so that the computing device responds to the detection request for the target detection service and obtains a target detection resource corresponding to the target detection service;

[0030] The target detection resource is used to perform the following steps:

[0031] Determine the image to be detected; based on the first detection model, detect a first target area where the target object in the image to be detected is located and the target category to which the target object belongs; extract a local image of the image to be detected in the first target area; based on the second detection model, detect a second target area where the target object in the local image is located; determine a detection result of the target object in the image to be detected according to the second target area and in combination with the target category to which the target object belongs;

[0032] Obtain a detection result of the target object provided by the computing device.

[0033] In an embodiment of the present application, after determining the image to be detected, the first target area where the target object in the image to be detected is located, and the target category to which the target object belongs can be detected based on the first detection model. The first detection of the target object is achieved. Thereafter, a partial image of the image to be detected in the first target area is extracted, and based on the second detection model, the second target area where the target object in the partial image is located is detected to achieve a second detection of the target object. The detection area of ​​the partial image is smaller than the original image to be detected, so that accurate detection of the reduced detection range is achieved, accurate detection of the target object is achieved, and detection precision and accuracy are improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0035] Figure 1 A flowchart of an embodiment of a target detection method provided in an embodiment of the present application;

[0036] Figure 2 A flowchart of another embodiment of a target detection method provided in an embodiment of the present application;

[0037] Figure 3 A flowchart of another embodiment of a target detection method provided in an embodiment of the present application;

[0038] Figure 4 A flowchart of another embodiment of a target detection method provided in an embodiment of the present application;

[0039] Figure 5 A flowchart of another embodiment of a target detection method provided in an embodiment of the present application;

[0040] Figure 6 A flowchart of another embodiment of a target detection method provided in an embodiment of the present application;

[0041] Figure 7 A flowchart of another embodiment of a target detection method provided in an embodiment of the present application;

[0042] Figure 8 A flowchart of another embodiment of a target detection method provided in an embodiment of the present application;

[0043] Fig. 9 An example diagram of a target detection method provided in an embodiment of the present application;

[0044] Fig.10 A schematic diagram of the structure of an embodiment of a target detection device provided in an embodiment of the present application;

[0045] Fig.11 A schematic diagram of the structure of an embodiment of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0047] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms of "a", "said", and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings, and "multiple" generally includes at least two, but does not exclude the inclusion of at least one.

[0048] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0049] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to identifying", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is identified" may be interpreted as "when determining" or "in response to determining" or "when identifying (stated condition or event)" or "in response to identifying (stated condition or event)", depending on the context.

[0050] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a product or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such a product or system. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the product or system including the elements.

[0051] The technical solution of the embodiment of the present application can be applied to target detection scenarios. After using a large target detection model to perform preliminary detection on the target object in the image, a small target detection model is then used to detect local images where small target objects may exist, so as to improve the accuracy and precision of small target detection.

[0052] In the prior art, when detecting targets in images, detection models constructed by neural network algorithms are often used to detect targets in images. A small target is a target that is smaller than the size of the image. For example, the width of the detection box of a small target can usually be less than 1 / 50 (pixel points) of the width of the image, and the height of the detection box of a small target is usually less than 1 / 50 (pixel points) of the height of the image. In order to detect very small small target objects, developers can usually design deeper network structures and more scales to extract and classify image features, and use loss functions that are more suitable for small targets to ensure that accurate small targets are obtained. However, even with more complex networks, more scales, and loss functions that are more suitable for small targets, the detection results obtained are still not accurate enough and the detection accuracy is low.

[0053] In an embodiment of the present application, after determining the image to be detected, the first target area where the target object in the image to be detected and the target category to which the target object belongs can be detected based on the first detection model to achieve preliminary detection of the target object. Afterwards, a partial image of the image to be detected in the first target area can be extracted, and then the second detection model can be used to detect the second target area where the target object in the partial image is located, so as to determine the detection result of the target object in the image to be detected based on the second target area and the target category to which the target object belongs. By using the first detection model to perform preliminary detection on the image to be detected, and then using the second detection model to perform secondary detection on the image to be detected, the actual area of ​​the target object is reduced for detection, accurate detection of the target object is achieved, and detection precision and accuracy are improved.

[0054] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0055] like Figure 1 As shown, it is a flowchart of an embodiment of a target detection method provided in an embodiment of the present application, and the method may include the following steps:

[0056] 101: Determine an image to be detected.

[0057] The target method provided in the embodiment of the present application can be applied to a computing device, which can be a computer, an ordinary server, a cloud server, a super personal computer, a laptop computer, a tablet computer, etc. The embodiment of the present application does not impose too many restrictions on the specific type of the computing device.

[0058] When the technical solution provided by the present application is applied to electronic devices such as computers and laptops, the image to be detected can be collected by the electronic device or provided by the user. When the technical solution provided by the present application is applied to a server, the image to be detected can be sent from the user end to the server.

[0059] The image to be detected may be an image that needs to be subjected to target detection. Corresponding to different usage scenarios, the types of images to be detected may be different. When a user uses the target detection method provided by the present application, the image to be detected may be provided by the user. In a test scenario, the image to be detected may be a test image. In a training scenario, the image to be detected may be a training image. The test image and the training image may be obtained by dividing the annotated image. For example, the annotated image is divided into a training image and a test image according to a certain ratio, and the training image is used in the training process, and the test image is used in the testing process.

[0060] 102: Based on the first detection model, detect a first target region where a target object is located in the image to be detected and a target category to which the target object belongs.

[0061] The first detection model can detect a target object in the image to be detected, and the target object may include multiple ones. Any target object corresponds to a first target area and a target category to which the target object belongs.

[0062] In an optional embodiment, the target area can be in various shapes such as rectangle, circle, square, etc. The size of the target area is adapted to the size of the corresponding target object, and the target area can completely surround the target object to achieve accurate prompting of the position of the target object.

[0063] The target category to which the target object belongs can be obtained by category selection or category matching based on multiple classification categories provided in the first detection model. In an optional manner, the classification probabilities of the target object in multiple classification categories can be determined separately, and the classification probabilities can be sorted in order from large to small, so that the classification category corresponding to the maximum classification probability is the target category of the target object.

[0064] 103: Extract a local image of the image to be detected in the first target area.

[0065] The local image may be a partial image of the image to be detected in the first target area. When acquiring the local image, the coordinate points of the first target area in the image to be detected may be determined, and the image to be detected may be cropped to obtain the local image according to the coordinate points of the first target area in the image to be detected. Taking the first target area as a rectangle as an example, the four coordinate points of the first target area in the upper left, lower left, upper right, and lower right in the image to be detected may be determined, and the local image corresponding to the first target area may be acquired using the four coordinate points in the image to be detected.

[0066] 104: Detect a second target area where the target object is located in the partial image based on the second detection model.

[0067] The second target area can be detected and obtained based on the second detection model, and the second target area where the target object is located can be obtained by inputting the local image into the second detection model.

[0068] The second target area is smaller than the first target area, and the second target area is a partial area of ​​the first target area.

[0069] The first detection model may be a "large target" detection model, and the second detection model may be a "small target" detection model. The large target may be a target having a first category attribute, and the small target may be a target having a second category attribute.

[0070] 105: Determine a detection result of the target object in the image to be detected according to the second target area and in combination with the target category to which the target object belongs.

[0071] The detection result of the image to be detected may be composed of the second target area where the target object is located and the target category to which the target object belongs.

[0072] In an embodiment of the present application, after determining the image to be detected, the first target area where the target object in the image to be detected is located, and the target category to which the target object belongs can be detected based on the first detection model. The first detection of the target object is achieved. Thereafter, a partial image of the image to be detected in the first target area is extracted, and based on the second detection model, the second target area where the target object in the partial image is located is detected to achieve a second detection of the target object. The detection area of ​​the partial image is smaller than the original image to be detected, so that accurate detection of the reduced detection range is achieved, accurate detection of the target object is achieved, and detection precision and accuracy are improved.

[0073] In practical applications, the classifier of the detection model can include multiple classification categories. For example, if an RCNN model is designed to classify whether the detection object in the image belongs to a car, a pedestrian, or a building, then the RCNN model can include three classification categories such as cars, pedestrians, and buildings. The detection model can correspond to multiple classification categories and determine the classification category corresponding to the target object obtained by the detection.

[0074] However, in an embodiment of the present application, based on the detection problem of large targets and small targets, the classification categories of the detection model are divided, and the classification categories belonging to large targets and the classification categories belonging to small targets are distinguished, so as to facilitate accurate division of the classifiable categories corresponding to the first detection model and the second detection model.

[0075] In the present application, the classification category belonging to the large target is regarded as at least one first classification category having a first category attribute, and the classification category belonging to the small target is regarded as at least one second classification category having a second category attribute.

[0076] The first category attribute may be that a ratio of a width of a detection frame of the target object to a width of a detection image is greater than a first ratio, and a ratio of a height of the detection frame to a height of the detection image is greater than a second ratio. The first ratio is relatively large to the second ratio, for example, the first ratio and the second ratio may be 0.1.

[0077] The second category attribute may be that the ratio of the width of the detection frame of the target object to the width of the detection image is less than the third ratio, and the ratio of the height of the detection frame to the height of the detection image is greater than the fourth ratio. The third ratio is relatively small to the fourth ratio, for example, the third ratio to the fourth ratio may be 0.02.

[0078] In order to solve the problem of detecting small targets, the first detection model can distinguish all classification categories, and the second detection model can classify the classification categories belonging to the second category attributes as the classification basis.

[0079] Optionally, the first detection model may include at least one first classification category in the first category set and at least one second classification category in the second category set.

[0080] The second detection model may include at least one second classification category from the second set of categories.

[0081] That is, when the first detection model classifies the target object, it can perform category detection on the target object, including multiple classification categories including at least one first classification category and at least one second classification category, and perform category judgment to obtain the final target category of the target object. The target category may belong to the first classification category or the second classification category. When the second detection model classifies the target object, the final target category of the target object has only one result, which is the second classification category.

[0082] As an embodiment, based on the first detection model, detecting the first target area where the target object is located in the image to be detected and the target category to which the target object belongs may include:

[0083] Based on the first detection model, detecting a first target area where a target object is located in the image to be detected;

[0084] According to the image features corresponding to the first target area, the target category to which the target object belongs is determined from at least one first classification category and at least one second classification category corresponding to the first detection model.

[0085] Since the second detection model only has at least one second classification category of the second category attribute and the first detection model has divided the category to which the target object belongs, the second detection model may not classify the target object again to reduce the processing process and improve processing efficiency.

[0086] like Figure 2 FIG. 1 is a flow chart of an embodiment of a target detection method provided in an embodiment of the present application. The method may include the following steps:

[0087] 201: Determine an image to be detected.

[0088] Some steps in the embodiments of this application are Figure 1 Some steps of the illustrated embodiments are the same and will not be described again for the sake of brevity.

[0089] 202: Determine a first detection model corresponding to at least one first classification category in the first category set and at least one second classification category in the second category set.

[0090] The first detection model may include a classifier composed of at least one first classification category and at least one second classification category. The classification result of the target object by the first detection model, that is, the target category may be one of the at least one first classification category or one of the at least one second classification category.

[0091] 203: Determine a second detection model corresponding to at least one second classification category in the second category set.

[0092] 204: Detect a first target area where the target object is located in the image to be detected based on the first detection model.

[0093] 205: Determine, according to the object features corresponding to the target object in the first target area, the target category to which the target object belongs from at least one first classification category and at least one second classification category corresponding to the first detection model.

[0094] 206: Extract a local image of the image to be detected in the first target area.

[0095] 207: Detect a second target area where the target object is located in the partial image according to the second detection model.

[0096] 208: Determine a detection result of the target object in the image to be detected according to the second target area and in combination with the target category to which the target object belongs.

[0097] In an embodiment of the present application, after determining the image to be detected, a first detection model including at least one first classification category in the first category set and at least one second classification category in the second category set, and a second detection model corresponding to at least one second classification category in the second category set are first determined. The first detection model can detect the image to be detected, and determine the first target area where the target is located and the target category to which it belongs. The target category of the target object may belong to the first category set or may belong to the second category set. By adopting two detection models with different classification benchmarks to classify and distinguish the target objects in the image to be detected, accurate classification of the image to be detected is achieved. On the basis of accurate classification, after the first detection model is used to detect large targets, the second detection model is used to perform detailed detection on the local image corresponding to the first target area detected in the previous time, which can improve the efficiency and accuracy of target object detection.

[0098] As an embodiment, after detecting the first target area where the target object is located and the target category to which the target object belongs in the image to be detected based on the first detection model, the method may further include:

[0099] A first set of categories and a second set of categories are determined.

[0100] The first category set includes at least one first classification category having a first category attribute; and the second category set includes at least one second classification category having a second category attribute.

[0101] By obtaining the first category set and the second category set, the classification categories with different category attributes are divided, and the detection models of the two category sets are trained separately to obtain a detection model that is more suitable for the second category set, thereby realizing targeted training of the model to solve the problem of low accuracy and precision in small target detection caused by using a single detection model for object detection.

[0102] The first detection model is used to perform the initial detection on the target object in the image to be detected. After obtaining the first detection area where the target object is located and the target category, the target category of the target object can be determined. If the target category is a category in the first category set, it means that the target object is a large target, and the detection result of the target object can be directly determined. If the target category is a category in the second category set, it means that the target object is a small target, and a secondary detection is required to improve the detection accuracy.

[0103] like Figure 3 FIG. 1 is a flowchart of another embodiment of a target detection method provided in an embodiment of the present application. The method may include the following steps:

[0104] 301: Determine an image to be detected.

[0105] It should be noted that some steps in the embodiments of the present application are the same as some steps in the aforementioned embodiments, and for the sake of brevity of description, they will not be repeated here.

[0106] 302: Based on the first detection model, detect a first target region where a target object is located in the image to be detected and a target category to which the target object belongs.

[0107] 303: Determine a first category set and a second category set.

[0108] The first category set includes at least one first classification category having a first category attribute; and the second category set includes at least one second classification category having a second category attribute.

[0109] 304: If the target category belongs to the first category set, determine a detection result of the target object in the to-be-detected image according to the first target region and the target category to which the target object belongs.

[0110] When the target category belongs to the first category set, the detection result of the target object in the image to be detected can be determined by the first target area and the target category to which the target object belongs.

[0111] The first category set may include at least one first classification category. The target category belonging to the first category set may include: the target category is any one of the at least one first classification category. Determining whether the target category belongs to the first category set may be specifically determined by determining whether the target category is any one of the at least one first classification category.

[0112] 305: If the target category belongs to the second category set, extract a local image of the image to be detected in the first target area.

[0113] When the target category belongs to the second category set, it means that the target object has the second category attribute. At this time, a secondary detection can be performed on the local image of the first target area to improve the accuracy and precision of the detected target object area.

[0114] The second category set may include at least one second classification category. The target category belonging to the second category set may include: the target category is any one of the at least one second classification category. Determining whether the target category belongs to the second category set may be specifically determined by determining whether the target category is any one of the at least one second classification category.

[0115] 306: Detect a second target area where the target object is located in the partial image based on the second detection model.

[0116] 307: Determine a detection result of the target object in the image to be detected according to the second target area and in combination with the target category to which the target object belongs.

[0117] In the embodiment of the present application, a judgment is made as to whether the target category belongs to the first category set or the second category set to confirm whether the target object is a large target or a small target, thereby accurately obtaining the detection result for the target object and improving the detection accuracy of the target object.

[0118] In practical applications, the detection results of the target object actually need to be combined with a double-layer detection of a first detection model having a first category set and a second category set and a second detection model corresponding to the second category set, and based on the first target area and target category of the target object obtained through detection, accurate detection of the target object is achieved to improve detection precision and accuracy.

[0119] like Figure 4 FIG. 1 is a flowchart of another embodiment of a target object detection method provided in an embodiment of the present application. The method may include the following steps:

[0120] 401: Determine the image to be detected.

[0121] It should be noted that some steps in the embodiments of the present application are the same as some steps in the aforementioned embodiments, and for the sake of brevity of description, they will not be repeated here.

[0122] 402: Determine a first detection model corresponding to at least one first classification category in the first category set and at least one second classification category in the second category set.

[0123] 403: Determine a second detection model corresponding to at least one second classification category in the second category set.

[0124] 404: Detect a first target area where the target object is located in the image to be detected based on the first detection model.

[0125] 405: Determine, according to the object feature corresponding to the first target area, the target category to which the target object belongs from at least one first classification category and at least one second classification category corresponding to the first detection model.

[0126] 406: Determine a first category set and a second category set.

[0127] The first category set includes at least one first classification category having a first category attribute; and the second category set includes at least one second classification category having a second category attribute.

[0128] 407: If the target category belongs to the first category set, determine a detection result of the target object in the to-be-detected image according to the first target region and the target category to which the target object belongs.

[0129] 408: If the target category belongs to the second category set, extract a local image of the image to be detected in the first target area.

[0130] 409: Detect a second target area where the target object is located in the partial image according to the second detection model.

[0131] 410: Determine a detection result of the target object in the image to be detected according to the second target area and in combination with the target category to which the target object belongs.

[0132] In the embodiment of the present application, after determining the image to be detected, the first detection model and the second detection model can be determined, and the first detection model is used to perform preliminary target detection and category prediction on the image to be detected to obtain the first target area and target category where the target object is located. From the perspective of improving efficiency, if the target category of the target object belongs to the first category set, it means that this target object can be detected more accurately through the first detection model; if the target category of the target object belongs to the second category set, it means that this target object needs to be detected using the second detection model for secondary detection to improve the detection accuracy. At this time, the local image of the image to be detected in the first target area can be extracted first, and according to the second detection model, the second target area where the target object is located in the local image is detected. The second target area belongs to a partial area of ​​the first target area, and the positioning of the area where the target object is located is more accurate relative to the first target area. Thus, according to the second target area and the target category to which the target object belongs, the detection result of the image to be detected is determined to be more accurate.

[0133] In the field of object detection, the object detection model is mainly used to detect the object in the image, and the detected object is marked and highlighted by a detection box. The size of the detection box is usually adapted to the size of the target object. The detected object is a positive class, for example, a car or a pedestrian in the image can be a positive class, and the background of the image, for example, the sky or the road can be a negative class.

[0134] In the actual detection process, there are four possible detection results: 1. Predicting the positive class as the positive class (TP), 2. Predicting the negative class as the positive class (FP), 3. Predicting the negative class as the negative class (TN), 4. Predicting the original positive class as the negative class (FN). The main measurement indicators of the image-based object detection algorithm are the recall and precision of the detected target. The precision rate indicates the proportion of samples predicted as positive classes that are truly positive, that is, precision = TP / (TP+FP). The recall rate indicates the proportion of positive classes that are correctly detected, that is, recall = TP / (TP+FN).

[0135] From the calculation method of the above precision and recall rate, it can be seen that there is a constraint phenomenon between precision and recall rate, and the two cannot be improved at the same time. However, in practical applications, for some detection scenarios, ensuring that the recall rate and precision rate reach their respective indicators at the same time is a technical problem that needs to be solved urgently. In particular, the accuracy and recall rate of the detection cannot be guaranteed at the same time. Therefore, in the embodiment of the present application, the confidence constraint precision and recall rate are adopted so that both the precision rate and the recall rate can reach a certain height, thereby improving the detection precision and accuracy.

[0136] Confidence can be expressed as the probability that the difference between the measured result and the actual true result is less than a predetermined value. It is a probability statistical value that can reflect the robustness of the model. Confidence and precision are mutually constrained. The higher the confidence, the lower the precision. Conversely, the higher the precision, the lower the confidence.

[0137] As an embodiment, if the target category belongs to the second category set, extracting a local image of the image to be detected in the first target area may include:

[0138] If the target category belongs to the second category set, determining a first target area of ​​the target object detected by the first detection model and a first confidence level corresponding to the target category;

[0139] If the first confidence level is greater than the first threshold, a detection result of the target object in the image to be detected is determined according to the first target area and in combination with the target category to which the target object belongs.

[0140] If the first confidence level is greater than the second threshold and less than the first threshold, a local image of the image to be detected in the first target area is extracted.

[0141] The first threshold is greater than the second threshold.

[0142] Optionally, the first target area of ​​the target object detected by the first detection model and the first confidence corresponding to the target category can be calculated by the first detection model, that is, the first detection model can simultaneously output the first target area, target category and first confidence of the target object. For target objects whose target categories belong to the first category set, the corresponding detection results are accurate enough, and the first confidence obtained by the detection does not need to participate in the secondary detection judgment, so as to reduce the computational complexity and improve the computational efficiency.

[0143] When the target category belongs to the second category set, two thresholds are set, namely a first threshold b and a second threshold a, wherein the first threshold b is greater than the second threshold a.

[0144] When the confidence of the first target area is greater than the first threshold b, it means that the confidence of the detected area is high enough, and the detected result can be considered to be relatively accurate, and no secondary detection is required. When the confidence of the first target area is greater than the second threshold a and less than the first threshold b, the confidence is low, the recall rate is high, but the precision rate is low, and the possibility of false detection is high. At this time, the second detection model needs to be used for secondary detection to ensure that the detection precision rate and recall rate are higher than a certain standard.

[0145] In an embodiment of the present application, a first threshold and a second threshold are used to perform a range judgment on the first confidence level of the detection area belonging to the second category set to accurately determine whether a secondary detection is required, thereby avoiding invalid or unnecessary secondary detection and improving detection efficiency.

[0146] As a possible implementation manner, the first category set and the second category set may be determined and obtained in the following manner:

[0147] Identify multiple labeled images.

[0148] Among them, any annotated image corresponds to an annotated area where the annotated object is located and an annotated category.

[0149] The labeled images with the same label category are divided into the same category image set to obtain category image sets corresponding to multiple label categories.

[0150] Among them, any category image set includes at least one annotated image with the same annotated category.

[0151] According to at least one annotated image in the category image set corresponding to any annotated category, a target category attribute corresponding to the annotated category is determined from the first category attribute and the second category attribute to obtain target category attributes corresponding to multiple annotated categories respectively.

[0152] The labeled categories whose target category attributes are the first category attributes are classified into a first category set, and the labeled categories whose target category attributes are the second category attributes are classified into a second category set.

[0153] Since the annotated area where the annotated object is located in the annotated image is known, for a certain annotated area, when the annotated area is larger than the annotated image, it can be determined that the object annotated in the annotated area is a large target; when the annotated area is smaller than the annotated image, it can be determined that the object annotated in the annotated area is a small target. Therefore, when the annotated area where the annotated object of any annotated image is located is determined, the category attribute of the annotated object can be determined by the size of the annotated area. The category attributes in the embodiments of the present application can mainly include a first category attribute and a second category attribute. The first category attribute has relevant attributes of large targets, and the second category attribute has relevant attributes of small targets. The category attribute of the annotated image can be directly determined through the annotated area.

[0154] Optionally, the annotated area is larger than the annotated image in that the ratio of the width of the annotated area to the width of the corresponding annotated image is greater than a first ratio, and the ratio of the height of the annotated area to the height of the corresponding annotated image is greater than a second ratio. The first ratio is relatively large to the second ratio, for example, the first ratio and the second ratio can both be 0.1. The annotated area is smaller than the annotated image in that the ratio of the width of the annotated area to the width of the corresponding annotated image is less than a third ratio, and the ratio of the height of the annotated area to the height of the corresponding annotated image is greater than a fourth ratio. The third ratio is relatively small to the fourth ratio, for example, the third ratio and the fourth ratio can both be 0.02. Of course, the first ratio and the second ratio can be different but the difference is less than a certain threshold, and the third ratio and the fourth ratio can also be different but the difference is also less than the threshold.

[0155] In some embodiments, the annotated area may directly correspond to the first category attribute or the second category attribute. The steps in the aforementioned embodiment: according to at least one annotated image in the category image set corresponding to any annotated category, determining the target category attribute corresponding to the annotated category from the first category attribute and the second category attribute to obtain the target category attributes corresponding to the plurality of annotated categories may include:

[0156] For at least one annotated image in the set of images corresponding to any annotated category, determine a first annotated image in which an annotated area in the at least one annotated image corresponds to a first category attribute, and a second annotated image in which an annotated area corresponds to a second category attribute;

[0157] Counting the number of first annotated images to obtain the number of first images and the number of second annotated images to obtain the number of second images;

[0158] Determining whether a ratio of the number of first images to the number of second images is greater than a first ratio threshold;

[0159] If so, determining that the annotated category corresponds to the first category attribute;

[0160] If not, it is determined that the annotation category corresponds to the second category attribute.

[0161] When the number of first annotated images belonging to the first category attribute in at least one annotated image of a category image set is far greater than the number of second annotated images belonging to the second category attribute, it means that there are far more large objects than small objects in this category image set. From the perspective of detection efficiency, the overall annotated category of this category image set can be defined as the first category attribute.

[0162] When the first annotated image belonging to the first category attribute in at least one annotated image of a category image set is much smaller than the second annotated image belonging to the second category attribute, it means that the large targets in this category image set are much smaller than the small targets. Considering the detection accuracy and effectiveness, the overall annotated category of the category image set can be defined as the second category attribute.

[0163] In some embodiments, in order to further determine whether multiple annotation categories in the first category set can satisfy the corresponding detection results, each annotation category in the first category set can be tested to ensure that each annotation category can meet certain usage conditions. After the steps performed in the aforementioned embodiment: classifying the annotation categories whose target category attributes are the first category attributes into the first category set and classifying the annotation categories whose target category attributes are the second category attributes into the second category set, the method may further include:

[0164] For any annotated category in the first category set, if the test result of the annotated category does not meet the test condition, the annotated category is marked as a second category attribute and classified into the second category set.

[0165] Further, optionally, in order to accurately obtain the test results of each labeled category in the first category set, the test result of any labeled category in the first category set can be determined by:

[0166] Determine a plurality of first test images belonging to the annotation category; wherein the plurality of first test images correspond to an annotation area where the annotated object is located;

[0167] Inputting a plurality of first test images into a first detection model respectively, and obtaining a test area and a test category where a target object is located by respectively detecting the plurality of first test images;

[0168] Test results corresponding to the plurality of first test images are determined according to the respective annotated areas and test areas of the plurality of first test images, and the respective annotated categories and test categories of the plurality of first test images.

[0169] In a possible design, determining the test results corresponding to the plurality of first test images according to the respective annotated areas and test areas of the plurality of first test images, and the respective annotated categories and test categories of the plurality of first test images may include:

[0170] According to the respective labeled areas and test areas of the plurality of first test images, and the respective labeled categories and test categories of the plurality of first test images, the precision and recall rates corresponding to the plurality of first test images are determined.

[0171] In some embodiments, in order to accurately determine whether a test result of a certain annotation category satisfies a test condition, for any annotation category in the first category set, if the test result of the annotation category does not satisfy the test condition, updating the category attribute of the annotation category from the first category attribute to the second category attribute, and classifying the annotation category into the second category set may include:

[0172] For any labeled category in the first category set, determine the precision and recall rate corresponding to the labeled category;

[0173] If the accuracy of the labeled category is less than the preset accuracy threshold and the recall of the labeled category is less than the recall threshold, it is determined that the test result of the labeled category does not meet the test condition;

[0174] The category attribute of the labeled category is updated from the first category attribute to the second category attribute, and the labeled category is divided into a second category set.

[0175] In the embodiment of the present application, a judgment method of testing the conditions of the first classification category is adopted to confirm whether a certain classification category needs to be added to the second category set, thereby achieving accurate division of the first category set and the second category set, and improving the accuracy and effectiveness of the division.

[0176] In practical applications, the first detection model and the second detection model can be obtained by training. The first detection model and the second detection model can use any existing target detection algorithm, and the two can use the same target detection algorithm or different target detection algorithms.

[0177] The difference between the first detection model and the second detection model lies in the difference in classifiers. The classifier of the first detection model may include at least one first classification category in the first classification set and at least one second classification category in the second classification set. The classifier of the second detection model may include at least one second classification category in the second classification set. The training of the first detection model and the training of the second model may be performed separately.

[0178] As an embodiment, the first detection model can be trained in the following manner:

[0179] Determine a plurality of first training data; wherein the plurality of first training data respectively correspond to a marked area where the marked object is located and a marked category; the marked area corresponds to a first category attribute or a second category attribute;

[0180] constructing a first detection model based on at least one first classification category in the first category set and at least one second classification category in the second category set;

[0181] According to a preset first training target, a plurality of first training data are used to train and obtain first model parameters of a first detection model.

[0182] The plurality of first training data may be selected from the plurality of annotated data, that is, the plurality of first training data may be partial data of the plurality of annotated data. The plurality of first training data need to include annotated images of the first category attribute and annotated images of the second category attribute.

[0183] Optionally, the first training goal may be that the training error is less than a first error threshold. According to the preset first training goal, the part of obtaining the first model parameters of the first detection model by training with multiple first training data is the same as the specific training method of the target detection model in the prior art, which is not repeated here.

[0184] As another embodiment, the second detection model can be obtained by training in the following manner:

[0185] Determine a plurality of second training data; wherein the plurality of second training data respectively correspond to a marked area where the marked object is located and a marked category; the marked area corresponds to a second category attribute;

[0186] constructing a second detection model based on at least one second classification category in the second category set;

[0187] According to a preset second training target, a plurality of second training data are used to train and obtain second model parameters of a second detection model.

[0188] The plurality of second training data may be selected from the plurality of annotated data, that is, the plurality of second training data may be part of the plurality of annotated data. The plurality of second training data need to include annotated images of the second category attributes.

[0189] Optionally, the second training target can be that the training error is less than a second error threshold. According to the preset first training target, the part of obtaining the second model parameters of the second detection model by training with multiple second training data is the same as the training method of the target detection model in the prior art, which is not repeated here.

[0190] Optionally, the first detection model and the second detection model used in the embodiments of the present application can be pre-trained using the training method described in the aforementioned embodiments, and the first detection model and the first model parameters and the second detection model and the second model parameters are stored in a model storage file, and when necessary, the model storage file is read to parse and obtain the first detection model and the second detection model.

[0191] In practical applications, in order to verify the scheme of combining the first detection model and the second detection model in the embodiment of the present application with the detection target, a test method can be used to test and verify the technical scheme of the embodiment of the present application. In a possible design, when applied to a test scene, the image to be detected may include multiple second test images. Any of the second test images corresponds to the annotated area and the annotated category where the annotated object is located.

[0192] refer to Figure 5 , is a flowchart of another embodiment of a target detection method provided in an embodiment of the present application, and the method may include the following steps:

[0193] 501: Determine a plurality of second test images.

[0194] Any second test image corresponds to a marked area where the marked object is located and a marked category.

[0195] 502: Based on the first detection model, respectively detect the first target area where the target object is located and the target category to which the target object belongs in the plurality of second test images;

[0196] 503: Extracting local images corresponding to the first target areas of the plurality of second test images respectively.

[0197] 504: Detect a second target area where the target object is located in the plurality of local images based on the second detection model.

[0198] 505: Determine a detection result of the target object in the second test image according to the second target area corresponding to any second test image and in combination with the target category to which the target object in the second test image belongs, so as to obtain detection results corresponding to the plurality of second test images respectively.

[0199] 506: Obtain target areas and target categories in the detection results corresponding to the plurality of second test images respectively.

[0200] 507: Based on the target areas and target categories respectively corresponding to the plurality of second test images, combined with the annotated areas and annotated categories respectively corresponding to the plurality of second test images, calculate and obtain test results corresponding to the plurality of second test images.

[0201] In some embodiments, the plurality of second test images may be the same as the plurality of first test images. In order to distinguish different test effects, the plurality of second test images may also be different from the plurality of first test images.

[0202] The plurality of second test images and the plurality of first test images may be partial images of the plurality of annotated images, and may be annotated images of the plurality of annotated images that are not set as training images. That is, partial images of the plurality of annotated images may be used as test images, and the remaining images may be used as training images.

[0203] Further, optionally, the test results corresponding to the plurality of second test images may include: accuracy and recall rate.

[0204] The use of accuracy and recall can accurately display the test results, improve the measurement value of the test results for this application, and achieve accurate and effective testing.

[0205] In some embodiments, after obtaining the test results corresponding to the plurality of second test images, the method may further include:

[0206] Generate test result prompt information according to the test results corresponding to the plurality of second test images;

[0207] Output test result prompt information to the test user.

[0208] By using the test result prompt information, the test results can be promptly and effectively prompted to the test user, thereby achieving effective interaction with the user.

[0209] As an embodiment, before executing the first detection model to detect the first target area where the target object is located and the target category to which the target object belongs in the image to be detected, the method may further include:

[0210] Providing a plurality of candidate categories for a detection user, so that the detection user can select a detection category from the plurality of candidate categories;

[0211] Based on the first detection model, detecting a first target area where a target object is located in the image to be detected and a target category to which the target object belongs includes:

[0212] Based on the first detection model, a first target area where the target object is located in the image to be detected is detected, and a target category to which the target object belongs is detected from the detection categories.

[0213] Optionally, the plurality of candidate categories may include at least one first classification category in the first category set and at least one second classification category in the second category set. The detection category may include the first classification category and the second classification category.

[0214] In the embodiment of the present application, multiple candidate categories are displayed to the detection user for the detection user to select the detection category that needs to be detected, so as to narrow the scope of category judgment and improve the detection efficiency.

[0215] As another embodiment, the first detection model and the second detection model may be specified by a user. The method may further include:

[0216] Providing a plurality of candidate detection models to a detection user, so that the detection user can select a first detection model and a second detection model from the plurality of candidate detection models;

[0217] A first detection model and a second detection model are determined.

[0218] In an embodiment of the present application, by providing multiple candidate detection models to the user, the user can select the required first detection model and second detection model from the multiple candidate detection models, thereby achieving targeted detection of the model and achieving effective detection of the model.

[0219] In addition, in a possible design, the first detection model and the second detection model can also be directly provided by the detection user, and the embodiments of the present application do not impose too many restrictions on the acquisition process of the first detection model and the second detection model.

[0220] In order to enable the user to know the intermediate detection results so as to better control the detection results. In some embodiments, extracting a local image of the image to be detected in the first target area may include:

[0221] Displaying the image to be detected corresponding to the first target area where the target object is located to the detection user;

[0222] Determining whether a confirmation operation performed by the detected user on the first target area is obtained;

[0223] If yes, determining that the confirmation operation performed by the detection user on the first target area, and extracting a partial image of the image to be detected in the first target area;

[0224] If not, the adjustment operation of the detecting user on the first target area is obtained, and the first target area adjusted by the detecting user is determined to extract a partial image of the image to be detected corresponding to the first target area adjusted by the detecting user.

[0225] In an embodiment of the present application, an image to be detected having a first target area can be displayed to a user, so that the detecting user can obtain intermediate detection results of the image to be detected, thereby improving the detecting user's control over the intermediate results, achieving effective detection and improving detection efficiency.

[0226] In a possible design, the technical solution provided in the embodiment of the present application can be configured in a server or a cloud server to form a service that can be provided to the outside. Figure 6 , is a flowchart of another embodiment of a target detection method provided in an embodiment of the present application, and the method may include the following steps:

[0227] 601: In response to a detection request for invoking a target detection service, determine a target detection resource corresponding to the target detection service.

[0228] Use the target detection resources corresponding to the target detection service to perform the following steps:

[0229] 602: Determine an image to be detected.

[0230] 603: Based on the first detection model, detect a first target area where the target object in the image to be detected is located and a target category to which the target object belongs.

[0231] 604: Extract a local image of the image to be detected in the first target area.

[0232] 605: Detect a second target area where the target object is located in the partial image based on the second detection model.

[0233] 606: Determine a detection result of the target object in the image to be detected according to the second target area and in combination with the target category to which the target object belongs.

[0234] Some steps in the embodiments of the present application are the same as those in the aforementioned embodiments, and for the sake of brevity of description, they will not be repeated here.

[0235] In an embodiment of the present application, the target detection function is provided to users in the form of a service, so that users can implement the target detection function on the image to be detected by calling the target detection service, providing users with fast and accurate target detection services and improving service efficiency.

[0236] Figure 7 A flowchart of another embodiment of a target detection method provided in an embodiment of the present application, the method may include the following steps:

[0237] 701: In response to a detection request initiated by a detection user, an image to be detected provided by the detection user is obtained.

[0238] 702: Based on the first detection model, detect a first target area where a target object is located in the image to be detected and a target category to which the target object belongs.

[0239] 703: Extract a local image of the image to be detected in the first target area.

[0240] 704: Detect a second target area where the target object is located in the partial image based on the second detection model.

[0241] 705: Determine a detection result of the target object in the image to be detected according to the second target area and in combination with the target category to which the target object belongs.

[0242] 706: Output the detection result of the image to be detected to the detection user.

[0243] Some steps in the embodiments of the present application are the same as those in the aforementioned embodiments, and for the sake of brevity of description, they will not be repeated here.

[0244] In an embodiment of the present application, a detection request initiated by a detection user can be directly responded to, and an image to be detected provided by the detection user can be obtained. Thus, the first detection model is used to perform a first detection on the image to be detected, and the first target area where the target object is located and the target category to which it belongs are obtained. By extracting a partial image of the image to be detected in the first target area, and performing a secondary detection on the partial image based on the second detection model, the second target area where the target object is located is obtained, and accurate detection of the area where the target object is located is achieved, the accuracy of the detection area of ​​the target object is improved, so that the size of the detected second target area is more matched with the target object, and the detection accuracy and effectiveness are improved.

[0245] In actual applications, the target user can initiate a detection request to the computing device that provides the target detection service. Figure 8 FIG. 1 is a flow chart of an embodiment of a target detection method provided in an embodiment of the present application. The method may include the following steps:

[0246] 801: Obtain a detection request initiated by a detection user and an image to be detected provided by the detection user.

[0247] 802: Send a detection request and an image to be detected to a computing device that provides a target detection service, so that the computing device responds to the detection request for the target detection service and obtains target detection resources corresponding to the target detection service.

[0248] Among them, the target detection resource is used to perform the following steps:

[0249] Determine an image to be detected; based on a first detection model, detect a first target area where a target object in the image to be detected is located and a target category to which the target object belongs; extract a local image of the image to be detected in the first target area; based on a second detection model, detect a second target area where the target object in the local image is located; determine a detection result of the target object in the image to be detected based on the second target area and in combination with the target category to which the target object belongs.

[0250] 803: Obtain the detection result of the target object provided by the computing device.

[0251] Some steps in the embodiments of the present application are the same as some steps in the aforementioned embodiments, and will not be repeated here.

[0252] In an embodiment of the present application, a user terminal can initiate a detection request to a computing device that provides a target detection service, and provide an image that needs to be detected, so that the computing device that provides the target detection service can use the target detection resource corresponding to the target detection service to determine the image to be detected, based on the first detection model, detect the first target area where the target object in the image to be detected is located and the target category to which the target object belongs, and extract the local image of the image to be detected in the first target area, and based on the second detection model, detect the second target area where the target object in the local image is located. According to the second target area, combined with the target category to which the target object belongs, determine the detection result of the target object in the image to be detected. The computing device can send the detection result of the target object to the user terminal. The user terminal can obtain the detection result of the target object provided by the computing device. The detection user can use the target detection service provided by the computing device through the user terminal to obtain the target detection result of the corresponding target object, realize multiple operation modes of the detection service in the embodiment of the present application, and improve the service scope.

[0253] In practical applications, the image classification problem can be applied to various technical fields, and in some fields, many categories can be provided for the target object to be classified. However, in practical applications, users may not need many categories. For example, in the field of trademark image detection, trademarks can contain many primary categories, and primary categories can include many secondary categories. When applying for trademark images, similarity detection can actually be performed only on a certain primary category or secondary category that needs to be applied for. If all trademarks in the primary category are still detected under the original category, the detection efficiency of the trademark image will be very low. However, if the user makes a preliminary selection of the detected category to narrow the detection range, the detection efficiency can be greatly improved. Therefore, in the embodiment of the present application, multiple candidate categories provided by the target detection service can be displayed to the user, and the user's selection results of the candidate categories can be obtained to achieve targeted detection according to the category range selected by the user, thereby improving detection efficiency and accuracy.

[0254] Therefore, after sending the detection request and the image to be detected to the computing device providing the target detection service in step 802, the method may further include:

[0255] Obtain multiple candidate categories provided by a computing device;

[0256] Displaying multiple candidate categories to the detection user to determine that the detection user selects the detection category from the multiple candidate categories;

[0257] The detection category is provided to the computing device, so that the computing device uses the target detection resource to detect the target category to which the target object belongs from the detection category based on the first detection model.

[0258] In an embodiment of the present application, multiple candidate categories provided by the computing device are displayed to the user end of the detection user, so that the user end can display multiple candidate categories for the detection user, thereby determining the detection category selected by the detection user from the multiple candidate categories, and providing the detection category to the computing device, so that the computing device can detect the target category to which the target object belongs from the detection category based on the first detection model, thereby achieving more efficient category classification.

[0259] The detection model involved in the embodiment of the present application can be a neural network model, and there are many types of neural network models. The computing device can provide multiple models for users to choose from. Therefore, after sending the detection request and the image to be detected to the computing device providing the target detection service in step 802, the method can also include:

[0260] Acquire multiple candidate detection models provided by a computing device;

[0261] Displaying a plurality of candidate detection models to a detection user to determine a first detection model and a second detection model selected by the detection user from the plurality of candidate detection models;

[0262] The first detection model and the second detection model are provided to the computing device so that the target detection resource in the computing device can determine the first detection model and the second detection model.

[0263] In an embodiment of the present application, after obtaining multiple candidate detection models, multiple candidate detection models can be displayed to the detection user to determine the first detection model and the second detection model selected by the detection user from the multiple candidate detection models, so as to realize the user's selection of the detection model, and then after the user terminal provides the first detection model and the second detection model to the computing device, the target detection resource in the computing device determines the first detection model and the second detection model. By providing the user with a model selection function, a more convenient model selection interaction function is provided to the user, thereby improving detection efficiency and accuracy.

[0264] In addition, in order to further improve the user's control over the detection process, in some cases, it can also include:

[0265] Acquire an image to be detected provided by a computing device and having a first target area where a target object is located;

[0266] Determine whether the detected user performs a confirmation operation on the first target area;

[0267] If yes, providing a confirmation operation triggered by the detection user on the first target area to the computing device, so that the target detection resource in the computing device can extract a partial image of the image to be detected in the first target area;

[0268] If not, then detect the adjustment operation of the detection user on the first target area, and determine the first target area after the detection user adjusts it; the first target area after the detection user adjusts it is sent to the computing device, so that the target detection resource of the computing device can extract the local image of the image to be detected corresponding to the first target area after the detection user adjusts it.

[0269] After obtaining the image to be detected of the first target area where the target object is located provided by the computing device, the image to be detected with the first target area can be displayed to the detection user. In the specific display process, the first target area can be suspended above the image to be detected, for example, the position of the first target area in the image to be detected can be indicated in the form of a rectangular frame.

[0270] Optionally, in an embodiment of the present application, when displaying candidate categories, candidate detection models, or images to be detected containing the first target area to the detection user, they can be displayed in a variety of message display methods such as web pages, dialog boxes, instant messaging messages, etc. In the embodiment of the present application, there are no excessive restrictions on the display methods of candidate categories, candidate detection models, and images to be detected containing the first target area.

[0271] For ease of understanding, refer to Fig. 9 Taking the target detection method provided in the embodiment of the present application configured in the cloud server M1 as an example, the specific usage scenario of the embodiment of the present application is described in detail.

[0272] Fig. 9 A mobile user terminal M2 is set in. The first detection model and the second detection model used in the embodiment of the present application are trained detection models. The specific training method is described in detail in the above embodiment and will not be repeated here.

[0273] The detection user U can provide 901 the image to be detected to the cloud server M1 through the mobile phone user terminal M2.

[0274] After the cloud server M1 obtains the image to be detected, it can detect 902 the first target area where the target object in the image to be detected is located and the target category to which the target object belongs based on the first detection model. The first detection of the target object is achieved. When the target object needs a second detection, a partial image of the image to be detected in the first target area can be extracted 903. Then, the second detection model is used to detect 904 the second target area where the target object is located in the partial image. Thus, according to the second target area, combined with the target category to which the target object belongs, the detection result of the target object in the image to be detected is determined 905.

[0275] Afterwards, the cloud server M1 may send 906 the detection result of the target object of the image to be detected to the mobile user terminal M2, and the mobile user terminal M2 displays the detection result (not shown in the figure) to the detection user U. The mobile user terminal M2 may display the detection result in a variety of display modes, such as in the form of a short message, a web page, or an instant messaging message.

[0276] Fig. 9 It shows that the user interacts with the cloud server by operating the user terminal to solve the target detection problem of the image. By adopting a double-layer detection method of a first detection model and a second detection model, it can ensure that the target area and target category of the target object detected are more accurate.

[0277] Fig. 9 The target detection device can perform Figure 1 The implementation principle and technical effect of the target detection method in the above embodiments are not described in detail. The specific mode of operation performed by each module, unit, and sub-unit of the target detection device in the above embodiments has been described in detail in the embodiment of the method, and will not be described in detail here.

[0278] like Fig.10 FIG. 1 is a schematic diagram of a structure of an embodiment of a target detection device provided in an embodiment of the present application, and the device may include:

[0279] Image determination module 1001: used to determine the image to be detected.

[0280] The first detection module 1002 is used to detect a first target area where a target object is located and a target category to which the target object belongs in the image to be detected based on a first detection model.

[0281] Local extraction module 1003: used to extract a local image of the image to be detected in the first target area.

[0282] The second detection module 1004 is used to detect a second target area where the target object is located in the local image based on a second detection model.

[0283] The result determination module 1005 is used to determine the detection result of the target object in the image to be detected according to the second target area and the target category to which the target object belongs.

[0284] In an embodiment of the present application, after determining the image to be detected, the first target area where the target object in the image to be detected is located, and the target category to which the target object belongs can be detected based on the first detection model. The first detection of the target object is achieved. Thereafter, a partial image of the image to be detected in the first target area is extracted, and based on the second detection model, the second target area where the target object in the partial image is located is detected to achieve a second detection of the target object. The detection area of ​​the partial image is smaller than the original image to be detected, so that accurate detection of the reduced detection range is achieved, accurate detection of the target object is achieved, and detection precision and accuracy are improved.

[0285] As an embodiment, the device may further include:

[0286] The first determination module is used to determine a first detection model corresponding to at least one first classification category in the first category set and at least one second classification category in the second category set.

[0287] The second determination module is used to determine a second detection model corresponding to at least one second classification category in the second category set.

[0288] As a possible implementation manner, the first detection module may include:

[0289] The area detection unit is used to detect a first target area where a target object is located in the image to be detected based on a first detection model.

[0290] The category classification unit is used to determine the target category to which the target object belongs from at least one first classification category and at least one second classification category corresponding to the first detection model according to the object features corresponding to the first target area.

[0291] As yet another embodiment, the device may further include:

[0292] A set determination module, configured to determine a first category set and a second category set; wherein the first category set includes at least one first classification category having a first category attribute; and the second category set includes at least one second classification category having a second category attribute;

[0293] The third determination module is used to determine the detection result of the target object in the image to be detected according to the first target area and in combination with the target category to which the target object belongs if the target category belongs to the first category set.

[0294] In some embodiments, the local extraction module may include:

[0295] The first extraction unit is configured to extract a local image of the to-be-detected image in a first target area if the target category belongs to a second category set.

[0296] In some embodiments, the first extraction unit may include:

[0297] A first calculation subunit is used to determine a first target area of ​​the target object detected by the first detection model and a first confidence level corresponding to the target category if the target category belongs to the second category set;

[0298] A first judgment subunit is used to determine a detection result of the target object in the image to be detected based on the first target area and in combination with the target category to which the target object belongs if the first confidence level is greater than a first threshold;

[0299] The second judgment subunit is configured to extract a local image of the image to be detected in the first target area if the first confidence level is greater than the second threshold and less than the first threshold.

[0300] In some embodiments, the set determination module may include:

[0301] The annotation determination unit is used to determine a plurality of annotated images; wherein any annotated image corresponds to an annotated area where an annotated object is located and an annotated category.

[0302] A labeling division unit, used to divide the labeled images with the same labeling category into the same category image set, so as to obtain category image sets corresponding to a plurality of labeling categories; wherein any category image set includes at least one labeled image with the same labeling category;

[0303] an attribute determination unit, configured to determine, according to at least one annotated image in the category image set corresponding to any annotated category, a target category attribute corresponding to the annotated category from the first category attribute and the second category attribute, so as to obtain target category attributes corresponding to the plurality of annotated categories respectively;

[0304] The set division unit is used to divide the labeled categories whose target category attributes are the first category attributes into the first category set and divide the labeled categories whose target category attributes are the second category attributes into the second category set.

[0305] In some embodiments, the marked area corresponds to the first category attribute or the second category attribute.

[0306] The attribute determination unit may include:

[0307] The image division subunit is used to determine, for at least one annotated image in the category image set corresponding to any annotated category, a first annotated image whose annotated area in the at least one annotated image corresponds to a first category attribute, and a second annotated image whose annotated area corresponds to a second category attribute.

[0308] A quantity counting subunit, used for counting the number of first annotated images to obtain the number of first images and the number of second annotated images to obtain the number of second images;

[0309] A threshold determination subunit, used to determine whether a ratio of the number of first images to the number of second images is greater than a first ratio threshold;

[0310] The first result subunit is used to determine if the marked category corresponds to the first category attribute.

[0311] The second result subunit is used to determine if no, then to correspond to the second category attribute of the marked category.

[0312] As a possible implementation, the device may further include:

[0313] The category adjustment module is used for marking any marked category in the first category set as a second category attribute and classifying the marked category into the second category set if the test result of the marked category does not meet the test condition.

[0314] In some embodiments, the category adjustment module may include:

[0315] The test determination unit is used to determine a plurality of first test images belonging to the annotation category; wherein the plurality of first test images correspond to an annotation area where the annotation object is located.

[0316] A first testing unit, used to input a plurality of first test images into a first detection model respectively, and obtain a test area and a test category where a target object is located by respectively detecting the plurality of first test images;

[0317] The test result unit is used to determine the test results corresponding to the plurality of first test images according to the respective annotated areas and test areas of the plurality of first test images, and the respective annotated categories and test categories of the plurality of first test images.

[0318] In one possible design, the test result unit may include:

[0319] A test result subunit, used to determine the accuracy and recall rates corresponding to the plurality of first test images according to the respective annotated areas and test areas of the plurality of first test images, and the respective annotated categories and test categories of the first plurality of test images;

[0320] The category adjustment module can be used specifically for:

[0321] For any labeled category in the first category set, determine the accuracy and recall rate corresponding to the labeled category; if the accuracy of the labeled category is less than a preset accuracy threshold and the recall rate of the labeled category is less than the recall rate threshold, determine that the test result of the labeled category does not meet the test conditions; update the category attribute of the labeled category from the first category attribute to the second category attribute, and divide the labeled category into the second category set.

[0322] As an embodiment, the first detection model is trained in the following manner:

[0323] A plurality of first training data are determined, wherein the plurality of first training data respectively correspond to a marked area where the marked object is located and a marked category, and the marked area corresponds to a first category attribute or a second category attribute.

[0324] constructing a first detection model based on at least one first classification category in the first category set and at least one second classification category in the second category set;

[0325] According to a preset first training target, a plurality of first training data are used to train and obtain first model parameters of a first detection model.

[0326] As another embodiment, the second detection model is trained in the following manner:

[0327] Determine a plurality of second training data; wherein the plurality of second training data respectively correspond to a marked area where the marked object is located and a marked category; the marked area corresponds to a second category attribute;

[0328] constructing a second detection model based on at least one second classification category in the second category set;

[0329] According to a preset second training target, a plurality of second training data are used to train and obtain second model parameters of a second detection model.

[0330] As an embodiment, the image to be detected includes a plurality of second test images; any second test image corresponds to a marked area where the marked object is located and a marked category. The device also includes:

[0331] A test acquisition module, used to acquire target areas and target categories in the detection results corresponding to the plurality of second test images respectively;

[0332] The result acquisition module is used to calculate and obtain the test results corresponding to the multiple second test images based on the target areas and target categories respectively corresponding to the multiple second test images and the annotated areas and annotated categories respectively corresponding to the multiple second test images.

[0333] Further, optionally, the test results corresponding to the plurality of second test images include: accuracy and recall rate.

[0334] In some embodiments, the apparatus may further include:

[0335] The prompt generating module is used to generate the test result prompt information according to the test results corresponding to the plurality of second test images.

[0336] The information output module is used to output test result prompt information to the test user.

[0337] As yet another embodiment, the image determination module may further include:

[0338] The request response module is used to respond to the detection request initiated by the detection user and obtain the image to be detected provided by the detection user.

[0339] The result output module is used to output the detection result of the image to be detected to the detection user.

[0340] Fig.10 The target detection device can perform Figure 1 The implementation principle and technical effect of the target detection method of the illustrated embodiment will not be described in detail. The specific implementation methods of the various modules, units and sub-units executed by the processing component in the above embodiment have been described in detail in the embodiment of the method, and will not be elaborated here.

[0341] In practical applications, Fig.10 The apparatus shown may be configured as a computing device, referring to Fig.11 , is a structural diagram of a computing device provided in an embodiment of the present application, and the computing device may include: a storage component 1101 and a processing component 1102; the storage component 1101 is used to store one or more computer instructions; the one or more computer instructions are called by the processing component 1102 to execute any one of the target detection methods in the aforementioned embodiments.

[0342] The processing component 1102 may include one or more processors to execute computer instructions to complete all or part of the steps in the above method. Of course, the processing component can also be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to execute the image annotation method provided in the above embodiment.

[0343] The storage component 1101 is configured to store various types of data to support operations at the terminal. The storage component can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0344] Of course, the computing device may also include other components, such as input / output interfaces, communication components, etc. The input / output interface provides an interface between the processing component and the peripheral interface module, which may be an output device, an input device, etc. The communication component is configured to facilitate wired or wireless communication between the computing device and other devices.

[0345] In addition, an embodiment of the present application also provides a computer-readable storage medium, which can store one or more computer instructions, and when the one or more computer instructions are executed, they are used to implement any target detection method in the embodiment of the present application.

[0346] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.

[0347] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by combining hardware and software. Based on such an understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a computer product, and the present application can be in 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.

[0348] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A target detection method, characterized in that: include: Determine an image to be detected; Based on the first detection model, a first target area where the target object in the image to be detected is located and a target category to which the target object belongs are detected; wherein the classification categories corresponding to the first detection model include: at least one first classification category in the first category set and at least one second classification category in the second category set; the first classification category is a classification category belonging to a large target; and the second classification category is a classification category belonging to a small target; If the target category belongs to the second category set, extracting a local image of the image to be detected in the first target area; Based on a second detection model, detecting a second target area where the target object is located in the partial image; the classification category corresponding to the second detection model includes: at least one second classification category in the second category set; Determine, according to the second target area and in combination with the target category to which the target object belongs, a detection result of the target object in the image to be detected; The first category set and the second category set are determined in the following manner: Acquire a set of category images corresponding to a plurality of annotation categories, wherein any one of the category image sets includes at least one annotated image having the same annotation category, and any one of the annotated images corresponds to an annotation region where an annotation object is located and an annotation category, and the annotation region corresponds to a first category attribute or a second category attribute; For at least one annotated image in the category image set corresponding to any annotated category, determine whether the ratio of the number of first annotated images whose annotated areas in the at least one annotated image correspond to a first category attribute to the number of second annotated images whose annotated areas in the at least one annotated image correspond to a second category attribute is greater than a first ratio threshold; if yes, determine that the annotated category corresponds to the first category attribute; if not, determine that the annotated category corresponds to the second category attribute; classify the annotated categories whose target category attributes are the first category attributes into the first category set and classify the annotated categories whose target category attributes are the second category attributes into the second category set.

2. The method according to claim 1, characterized in that The detecting, based on the first detection model, a first target area where the target object in the image to be detected is located and a target category to which the target object belongs comprises: Based on the first detection model, detecting a first target area where the target object is located in the image to be detected; According to the object features corresponding to the first target area, the target category to which the target object belongs is determined from at least one first classification category and at least one second classification category corresponding to the first detection model.

3. The method according to any one of claims 1 to 2, characterized in that: After detecting the first target area where the target object in the image to be detected is located and the target category to which the target object belongs based on the first detection model, the method further includes: Determine the first category set and the second category set; wherein the first category set includes the at least one first classification category having a first category attribute; and the second category set includes the at least one second classification category having a second category attribute; If the target category belongs to a first category set, a detection result of the target object in the to-be-detected image is determined according to the first target area in combination with the target category to which the target object belongs.

4. The method according to claim 1, characterized in that: If the target category belongs to the second category set, extracting a local image of the image to be detected in the first target area includes: If the target category belongs to the second category set, determining a first target area of ​​the target object detected by the first detection model and a first confidence level corresponding to the target category; If the first confidence level is greater than a first threshold, determining a detection result of the target object in the image to be detected according to the first target area and in combination with the target category to which the target object belongs; If the first confidence level is greater than the second threshold and less than the first threshold, a local image of the image to be detected in the first target area is extracted.

5. The method according to claim 1, characterized in that After the labeling categories whose target category attributes are the first category attributes are divided into the first category set and the labeling categories whose target category attributes are the second category attributes are divided into the second category set, the method further includes: For any annotated category in the first category set, if the test result of the annotated category does not meet the test condition, the annotated category is marked as a second category attribute and classified into the second category set.

6. The method according to claim 5, characterized in that The test result of any labeled category in the first category set is determined in the following manner: Determine a plurality of first test images belonging to the annotation category; wherein the plurality of first test images correspond to an annotation area where the annotated object is located; Inputting the plurality of first test images into the first detection model respectively, and obtaining the test areas and test categories where the target objects are located, respectively detected by the plurality of first test images; Test results corresponding to the plurality of first test images are determined according to the annotated areas and the test areas of the plurality of first test images, and the annotated categories and the test categories of the plurality of first test images.

7. The method according to claim 6, characterized in that The determining, according to the respective annotated areas and test areas of the plurality of first test images, and the respective annotated categories and test categories of the plurality of first test images, the test results corresponding to the plurality of first test images comprises: Determine the precision and recall rates corresponding to the plurality of first test images according to the respective annotated areas and test areas of the plurality of first test images, and the respective annotated categories and test categories of the plurality of first test images; For any annotation category in the first category set, if the test result of the annotation category does not meet the test condition, updating the category attribute of the annotation category from the first category attribute to the second category attribute, and classifying the annotation category into the second category set includes: For any labeled category in the first category set, determine the accuracy and recall rate corresponding to the labeled category; If the accuracy of the labeled category is less than a preset accuracy threshold and the recall of the labeled category is less than a recall threshold, determining that the test result of the labeled category does not meet the test condition; The category attribute of the marked category is updated from the first category attribute to the second category attribute, and the marked category is divided into the second category set.

8. The method according to claim 1, characterized in that The first detection model is trained by the following method: Determine a plurality of first training data; wherein the plurality of first training data respectively correspond to a marked area where the marked object is located and a marked category; the marked area corresponds to a first category attribute or a second category attribute; constructing the first detection model based on at least one first classification category in the first category set and at least one second classification category in the second category set; According to a preset first training target, the first model parameters of the first detection model are obtained by training using the plurality of first training data.

9. The method according to claim 1, characterized in that: The second detection model is trained by the following method: Determine a plurality of second training data; wherein the plurality of second training data respectively correspond to a marked area where the marked object is located and a marked category; the marked area corresponds to a second category attribute; constructing the second detection model based on at least one second classification category in the second category set; According to a preset second training target, the second model parameters of the second detection model are obtained by training using the plurality of second training data.

10. The method according to claim 1, characterized in that The image to be detected includes a plurality of second test images; any of the second test images corresponds to a marked area where a marked object is located and a marked category; and further includes: Obtaining target areas and target categories in the detection results corresponding to the plurality of second test images respectively; Based on the target areas and target categories respectively corresponding to the plurality of second test images, and in combination with the annotated areas and annotated categories respectively corresponding to the plurality of second test images, the test results corresponding to the plurality of second test images are obtained by calculation.

11. The method according to claim 10, characterized in that The test results corresponding to the plurality of second test images include: accuracy and recall rate.

12. The method according to claim 11, characterized in that Also includes: Generate test result prompt information according to the test results corresponding to the plurality of second test images; Output the test result prompt information to the test user.

13. The method according to claim 1, characterized in that Also includes: Providing a plurality of candidate categories for a detection user, so that the detection user can select a detection category from the plurality of candidate categories; The detecting, based on the first detection model, a first target area where the target object in the image to be detected is located and a target category to which the target object belongs comprises: Based on the first detection model, a first target area where a target object is located in the image to be detected is detected, and a target category to which the target object belongs is detected from the detection categories.

14. The method according to claim 1, characterized in that Also includes: Providing a plurality of candidate detection models for a detection user, so that the detection user can select the first detection model and the second detection model from the plurality of candidate detection models; The first detection model and the second detection model are determined.

15. The method according to claim 1, characterized in that The extracting of a local image of the image to be detected in the first target area comprises: Displaying the image to be detected corresponding to the first target area where the target object is located to the detection user; Determining whether a confirmation operation performed by the detected user on the first target area is obtained; If yes, determining the confirmation operation performed by the detection user on the first target area, and extracting a partial image of the image to be detected in the first target area; If not, the adjustment operation of the detecting user on the first target area is obtained, and the first target area adjusted by the detecting user is determined to extract a partial image of the image to be detected corresponding to the first target area adjusted by the detecting user.

16. A target detection method, characterized in that: include: In response to a detection request for invoking a target detection service, determining a target detection resource corresponding to the target detection service; The target detection resource corresponding to the target detection service is used to perform the following steps: Determine an image to be detected; Based on the first detection model, detecting a first target area where a target object in the image to be detected is located and a target category to which the target object belongs; If the target category belongs to the second category set, extracting a local image of the image to be detected in the first target area; Based on the second detection model, detecting a second target area where the target object is located in the partial image; Determine, according to the second target area and in combination with the target category to which the target object belongs, a detection result of the target object in the image to be detected; The classification categories corresponding to the first detection model include: at least one first classification category in the first category set and at least one second classification category in the second category set; the classification categories corresponding to the second detection model include: at least one second classification category in the second category set; the first classification category is a classification category belonging to a large target; the second classification category is a classification category belonging to a small target; The first category set and the second category set are determined in the following manner: Acquire a set of category images corresponding to a plurality of annotation categories, wherein any one of the category image sets includes at least one annotated image having the same annotation category, and any one of the annotated images corresponds to an annotation region where an annotation object is located and an annotation category, and the annotation region corresponds to a first category attribute or a second category attribute; For at least one annotated image in the category image set corresponding to any annotated category, determine whether the ratio of the number of first annotated images whose annotated areas in the at least one annotated image correspond to a first category attribute to the number of second annotated images whose annotated areas in the at least one annotated image correspond to a second category attribute is greater than a first ratio threshold; if yes, determine that the annotated category corresponds to the first category attribute; if not, determine that the annotated category corresponds to the second category attribute; classify the annotated categories whose target category attributes are the first category attributes into the first category set and classify the annotated categories whose target category attributes are the second category attributes into the second category set.

17. A target detection method, characterized in that: include: In response to a detection request initiated by a detection user, acquiring an image to be detected provided by the detection user; Based on the first detection model, detecting a first target area where a target object in the image to be detected is located and a target category to which the target object belongs; If the target category belongs to the second category set, extracting a local image of the image to be detected in the first target area; Based on the second detection model, detecting a second target area where the target object is located in the partial image; Determine, according to the second target area and in combination with the target category to which the target object belongs, a detection result of the target object in the image to be detected; Outputting the detection result of the image to be detected to the detection user; The classification categories corresponding to the first detection model include: at least one first classification category in the first category set and at least one second classification category in the second category set; the classification categories corresponding to the second detection model include: at least one second classification category in the second category set; the first classification category is a classification category belonging to a large target; the second classification category is a classification category belonging to a small target; The first category set and the second category set are determined in the following manner: Acquire a set of category images corresponding to a plurality of annotation categories, wherein any one of the category image sets includes at least one annotated image having the same annotation category, and any one of the annotated images corresponds to an annotation region where an annotation object is located and an annotation category, and the annotation region corresponds to a first category attribute or a second category attribute; For at least one annotated image in the category image set corresponding to any annotated category, determine whether the ratio of the number of first annotated images whose annotated areas in the at least one annotated image correspond to a first category attribute to the number of second annotated images whose annotated areas in the at least one annotated image correspond to a second category attribute is greater than a first ratio threshold; if yes, determine that the annotated category corresponds to the first category attribute; if not, determine that the annotated category corresponds to the second category attribute; classify the annotated categories whose target category attributes are the first category attributes into the first category set and classify the annotated categories whose target category attributes are the second category attributes into the second category set.

18. A target detection method, characterized in that: include: Obtaining a detection request initiated by a detection user and an image to be detected provided by the detection user; Sending the detection request and the image to be detected to a computing device that provides a target detection service, so that the computing device responds to the detection request for the target detection service and obtains a target detection resource corresponding to the target detection service; The target detection resource is used to perform the following steps: Determine the image to be detected; based on the first detection model, detect a first target area where the target object in the image to be detected is located and a target category to which the target object belongs; if the target category belongs to a second category set, extract a local image of the image to be detected in the first target area; based on the second detection model, detect a second target area where the target object in the local image is located; determine a detection result of the target object in the image to be detected according to the second target area and in combination with the target category to which the target object belongs; Acquire a detection result of the target object provided by the computing device; The classification categories corresponding to the first detection model include: at least one first classification category in the first category set and at least one second classification category in the second category set; the classification categories corresponding to the second detection model include: at least one second classification category in the second category set; the first classification category is a classification category belonging to a large target; the second classification category is a classification category belonging to a small target; The first category set and the second category set are determined in the following manner: Acquire a set of category images corresponding to a plurality of annotation categories, wherein any one of the category image sets includes at least one annotated image having the same annotation category, and any one of the annotated images corresponds to an annotation region where an annotation object is located and an annotation category, and the annotation region corresponds to a first category attribute or a second category attribute; For at least one annotated image in the category image set corresponding to any annotated category, determine whether the ratio of the number of first annotated images whose annotated areas in the at least one annotated image correspond to a first category attribute to the number of second annotated images whose annotated areas in the at least one annotated image correspond to a second category attribute is greater than a first ratio threshold; if yes, determine that the annotated category corresponds to the first category attribute; if not, determine that the annotated category corresponds to the second category attribute; classify the annotated categories whose target category attributes are the first category attributes into the first category set and classify the annotated categories whose target category attributes are the second category attributes into the second category set.

19. The method according to claim 18, characterized in that The method further comprises: Acquire a plurality of candidate categories provided by the computing device; Displaying the plurality of candidate categories to the detection user to determine that the detection user selects a detection category from the plurality of candidate categories; The detection category is provided to the computing device, so that the computing device uses the target detection resource to detect the target category to which the target object belongs from the detection categories based on a first detection model.

20. The method according to claim 18, characterized in that The method further comprises: Acquire multiple candidate detection models provided by the computing device; Displaying the multiple candidate detection models to the detection user to determine a first detection model and a second detection model selected by the detection user from the multiple candidate detection models; The first detection model and the second detection model are provided to the computing device so that a target detection resource in the computing device can determine the first detection model and the second detection model.

21. The method according to claim 18, characterized in that The method further comprises: Acquire an image to be detected provided by the computing device and having a first target area where the target object is located; determining whether the detected user performs a confirmation operation on the first target area; If yes, providing the confirmation operation triggered by the detection user for the first target area to the computing device, so that the target detection resource in the computing device can extract a local image of the image to be detected in the first target area; If not, then detecting the adjustment operation of the detection user on the first target area, and determining the first target area after the detection user's adjustment; and sending the first target area after the detection user's adjustment to the computing device, so that the target detection resource of the computing device can extract the local image of the image to be detected corresponding to the first target area after the detection user's adjustment.

22. A target detection device, characterized in that: include: An image determination module, used to determine an image to be detected; A first detection module, configured to detect a first target area where a target object is located and a target category to which the target object belongs in the image to be detected based on a first detection model; A local extraction module, configured to extract a local image of the image to be detected in the first target area if the target category belongs to a second category set; A second detection module, configured to detect a second target area where the target object is located in the partial image based on a second detection model; A result determination module, configured to determine a detection result of the target object in the image to be detected according to the second target area and in combination with the target category to which the target object belongs; The classification categories corresponding to the first detection model include: at least one first classification category in the first category set and at least one second classification category in the second category set; the classification categories corresponding to the second detection model include: at least one second classification category in the second category set; the first classification category is a classification category belonging to a large target; the second classification category is a classification category belonging to a small target; The first category set and the second category set are determined in the following manner: Acquire a set of category images corresponding to a plurality of annotation categories, wherein any one of the category image sets includes at least one annotated image having the same annotation category, and any one of the annotated images corresponds to an annotation region where an annotation object is located and an annotation category, and the annotation region corresponds to a first category attribute or a second category attribute; For at least one annotated image in the category image set corresponding to any annotated category, determine whether the ratio of the number of first annotated images whose annotated areas in the at least one annotated image correspond to a first category attribute to the number of second annotated images whose annotated areas in the at least one annotated image correspond to a second category attribute is greater than a first ratio threshold; if yes, determine that the annotated category corresponds to the first category attribute; if not, determine that the annotated category corresponds to the second category attribute; classify the annotated categories whose target category attributes are the first category attributes into the first category set and classify the annotated categories whose target category attributes are the second category attributes into the second category set.

23. A computing device, characterized in that It comprises: a storage component and a processing component; the storage component is used to store one or more computer instructions; the one or more computer instructions are called by the processing component to execute the method described in any one of claims 1 to 21.

Citation Information

Patent Citations

  • Cell labeling system and method

    CN111325103A

  • Target detection method, detection model training method and electronic equipment

    CN111507958A

  • Image detection method and device

    CN111723723A