CN110443212B - Positive sample acquisition method, device, equipment and storage medium for target detection - Google Patents

Positive sample acquisition method, device, equipment and storage medium for target detection Download PDF

Info

Publication number
CN110443212B
CN110443212B CN201910738591.5A CN201910738591A CN110443212B CN 110443212 B CN110443212 B CN 110443212B CN 201910738591 A CN201910738591 A CN 201910738591A CN 110443212 B CN110443212 B CN 110443212B
Authority
CN
China
Prior art keywords
matching
frame
real
matching pair
anchor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910738591.5A
Other languages
Chinese (zh)
Other versions
CN110443212A (en
Inventor
董健
李帅
王铎皓
张军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
RUIMO INTELLIGENT TECHNOLOGY (SHENZHEN) Co.,Ltd.
Original Assignee
Ruimo Intelligent Technology Shenzhen Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ruimo Intelligent Technology Shenzhen Co ltd filed Critical Ruimo Intelligent Technology Shenzhen Co ltd
Priority to CN201910738591.5A priority Critical patent/CN110443212B/en
Publication of CN110443212A publication Critical patent/CN110443212A/en
Application granted granted Critical
Publication of CN110443212B publication Critical patent/CN110443212B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • G06V20/41Higher-level, semantic clustering, classification or understanding of video scenes, e.g. detection, labelling or Markovian modelling of sport events or news items
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/07Target detection

Abstract

The invention discloses a positive sample acquisition method, a device, equipment and a storage medium for target detection, and the positive sample acquisition method for target detection comprises the following steps: acquiring an image to be detected, wherein the image to be detected comprises at least one figure image; acquiring an anchor frame of the image to be detected and acquiring a real marking frame of the figure image; matching the anchor frame and the real marking frame according to a preset matching rule to obtain a first matching pair set; screening the first matching pair set according to a preset screening rule to obtain a second matching pair set; and taking the second matching pair set as a positive sample set for target detection. According to the positive sample obtaining method for target detection, the sample model with higher performance is obtained through the obtained positive sample for target detection, the problems of insufficient training samples and low quality in image recognition in the prior art are solved, and the quantity and diversity of the training samples are ensured.

Description

Positive sample acquisition method, device, equipment and storage medium for target detection
Technical Field
The embodiment of the invention relates to an image recognition technology, in particular to a positive sample acquisition method, a positive sample acquisition device, positive sample acquisition equipment and a storage medium for target detection.
Background
Target detection in image recognition is a basic task in the field of computer vision, and has direct application in the fields of human-computer interaction, unmanned driving, video monitoring and the like. When the positive sample is selected in the training stage, an anchor frame with the intersection ratio to the real object being greater than 0.5 is generally taken as the positive sample, and the intersection ratio of 0.5 makes the anchor frame contain a main object and possibly another object, which inevitably introduces noise into the positive sample; in the testing stage, when two objects are relatively close to each other, an anchor frame existing between the two objects has a large response, and the existence of the two objects prevents the model from automatically returning to one object, so that false detection between the two objects is generated.
The single-stage target detection algorithm cannot effectively inhibit false detection between two objects, one effective method is to directly set an anchor frame matching strategy with the intersection ratio of 0.7 or even higher, but the performance of the algorithm is reduced, and if a strict anchor frame matching strategy (such as the intersection ratio of 0.7 or even higher) is set, the quantity and diversity of positive samples in a training stage are greatly reduced, so that the detection performance is reduced.
Disclosure of Invention
The invention provides a positive sample acquisition method, a positive sample acquisition device, positive sample acquisition equipment and a storage medium for target detection, which ensure the quantity and diversity of training samples for target detection and can obtain a training model with higher performance.
In a first aspect, an embodiment of the present invention provides a positive sample acquiring method for target detection, where the positive sample acquiring method for target detection includes:
acquiring an image to be detected, wherein the image to be detected comprises at least one figure image;
acquiring an anchor frame of the image to be detected and acquiring a real marking frame of the figure image;
matching the anchor frame and the real marking frame according to a preset matching rule to obtain a first matching pair set;
screening the first matching pair set according to a preset screening rule to obtain a second matching pair set;
and taking the second matching pair set as a positive sample set for target detection.
In a second aspect, an embodiment of the present invention further provides a positive sample acquiring device for target detection, including:
the image acquisition module is used for acquiring an image to be detected, wherein the image to be detected comprises at least one figure image;
the anchor frame acquiring module is used for acquiring an anchor frame of the image to be detected;
the annotation acquisition module is used for acquiring a real annotation frame of the figure image;
the matching module is used for matching the anchor frame with the real marking frame according to a preset matching rule to obtain a first matching pair set;
the screening module is used for screening the first matching pair set according to a preset screening rule to obtain a second matching pair set;
and the sample acquisition module is used for taking the second matching pair set as a positive sample set for target detection.
In a third aspect, an embodiment of the present invention further provides a computer device, where the computer device includes:
one or more processors;
a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a positive sample acquisition method for target detection as described in any one of the above.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, the computer program comprising program instructions that, when executed by a processor, implement the positive sample acquisition method for target detection as described in any one of the above.
The invention provides a positive sample acquisition method for target detection, which comprises the steps of firstly analyzing an image to be detected to generate a corresponding anchor frame and a real marking frame, secondly matching the obtained anchor frame and the real marking frame according to a matching rule to obtain a matching pair set, screening the matching pair set according to a screening rule to delete redundant matching pairs, and using the screened matching pair set as a training sample to obtain a training model with higher performance, thereby solving the problems of insufficient training samples and low quality in the image recognition in the prior art and realizing the sufficient quantity and diversity of the training samples.
Drawings
FIG. 1 is a schematic flow chart of a positive sample acquisition method for target detection according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a positive sample acquisition method for target detection according to a second embodiment of the present invention;
FIG. 3 is a schematic flow chart of a positive sample acquisition method for target detection according to a third embodiment of the present invention;
FIG. 4 is a schematic view of a sub-flow chart of a positive sample acquiring method for target detection according to a third embodiment of the present invention;
FIG. 5 is a schematic view of another sub-flow of a positive sample acquisition method for target detection according to a third embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a positive sample acquiring device for target detection according to a fourth embodiment of the present invention;
fig. 7 is a schematic structural diagram of a positive sample acquiring apparatus for target detection in the fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. A process may be terminated when its operations are completed, but may have additional steps not included in the figure. A process may correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
Furthermore, the terms "first," "second," and the like may be used herein to describe various orientations, actions, steps, elements, or the like, but the orientations, actions, steps, or elements are not limited by these terms. These terms are only used to distinguish one direction, action, step or element from another direction, action, step or element. For example, the first speed difference may be referred to as a second speed difference, and similarly, the second speed difference may be referred to as a first speed difference, without departing from the scope of the present application. The first speed difference and the second speed difference are both speed differences, but they are not the same speed difference. The terms "first", "second", etc. are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Example one
Fig. 1 is a flowchart of a positive sample obtaining method for target detection according to an embodiment of the present invention, where the embodiment is applicable to a case where a sample is screened for a training model in image recognition, and specifically includes the following steps:
step 1000, obtaining an image to be detected, wherein the image to be detected comprises at least one figure image.
In this embodiment, the image to be detected is an image captured by an imaging device or the like and used for image recognition, and includes one person image or a plurality of person images. In alternative embodiments, the image to be detected may be an animal image, a vehicle image, or other image capturing material images besides a human image.
And 1100, acquiring an anchor frame of the image to be detected.
In this embodiment, the target detection algorithm usually samples a large number of regions in the input image, then determines whether the regions contain targets that are interested in, and adjusts the edges of the regions to predict the real-around bounding box (real-around bounding box) of the targets more accurately. The area sampling method used by different models may be different. A plurality of bounding boxes of different sizes and aspect ratios (aspect ratios) are generated centered around each pixel. These bounding boxes are called anchor boxes (anchor boxes), which are rectangular boxes.
Further, in an alternative embodiment, assume that the input image is h high and w wide. We generate anchor frames of different shapes, centered around each pixel of the image, respectively. Let the size s be e (0, 1)]And has an aspect ratio of r>0, then the width and height of the anchor frame will be respectively
Figure BDA0002163126830000051
And
Figure BDA0002163126830000052
given the center position, the anchor frame, which is known to be wide and high, is determined.
Step 1200, acquiring a real annotation frame of the person image.
The real labeling frame is obtained by manual labeling of a labeling person, so that the labeling frame just covers the person in the image during labeling, and the real labeling frame is a rectangular frame.
The real annotation frame is divided manually by the annotation personnel, but the person in the image must be just included, and the preferable mode is that the real annotation frame intersects with the boundary of the person image, so that the real annotation frame can cover the person in the image without greatly influencing the target detection.
Step S1100 and step S1200 have no logical sequence relationship, step S1200 may be executed first and then step S1100 may be executed, or step S1100 and step S1200 may be executed simultaneously.
Step 1300, matching the anchor frame and the real marking frame according to a preset matching rule to obtain a first matching pair set.
In this embodiment, the anchor frame and the real annotation frame are matched one-to-one according to a preset matching rule to form a matching pair, and under the preset matching rule, the same real annotation frame may be matched with different anchor frames. And forming a first matching pair set by matching all successfully matched anchor frames and the real marking frames. Illustratively, 1000 anchor frames are generated in an image to be detected, a labeling person marks out 10 real labeling frames, the anchor frames and the real labeling frames are matched under a preset rule to form 100 matching pairs of the anchor frames and the real labeling frames, and then the 100 matching pairs form a matching pair set.
And 1400, screening the first matching pair set according to a preset screening rule to obtain a second matching pair set.
In this embodiment, the screening rule is obtained by a large amount of experimental data by those skilled in the art, and through the screening rule, the matching pairs of the anchor frame and the real annotation frame in the first matching pair set can be determined one by one, and if a certain matching pair meets the screening rule, the matching pair is retained, and if not, the matching pair is deleted, so as to ensure that the training model does not generate false detection between similar characters. And when the matching pairs of all the anchor frames and the real marking frames are screened once, the reserved matching pairs form a second matching pair set.
And 1500, taking the second matching pair set as a positive sample set for target detection.
In this embodiment, the second matching pair filtered by the filtering rule in step 1400 is used as a sample for image recognition, and is input into the training model, and the parameters of the training model are continuously corrected according to the output result, so as to obtain a trained model, and the image recognition function can be realized by the trained model.
The positive sample obtaining method for target detection provided by this embodiment includes analyzing an image to be detected to generate a corresponding anchor frame and a real labeling frame, matching the obtained anchor frame and the real labeling frame according to a matching rule to obtain a matching pair set, screening the matching pair set according to a screening rule to delete redundant matching pairs, and using the screened matching pair set as a training sample.
Example two
Referring to fig. 2, fig. 2 is a flowchart of a positive sample obtaining method for target detection according to a second embodiment of the present invention. The embodiment is based on an embodiment scheme, optimized and improved, and particularly provides a specific scheme of a matching rule of an anchor frame and a real marking frame. As shown in fig. 2, the method includes:
step 2000, obtaining an image to be detected, wherein the image to be detected comprises at least one person image.
And step 2100, acquiring an anchor frame of the image to be detected.
And 2200, acquiring a real annotation frame of the person image.
Similarly, step S2100 and step S2200 may not have a logical sequence relationship, and step S2200 may be performed first and then step S2100 may be performed, or step S2100 and step S2200 may be performed simultaneously.
Step 2300, matching all the real labeling frames and the anchor frame having the maximum intersection ratio with all the real labeling frames to form a first matching subset.
In this embodiment, the Jaccard coefficient (Jaccard index) can measure the similarity between the two sets. Given sets AA and BB, their Jaccard coefficients, i.e. the size of the intersection of the two, divided by the size of the union of the two:
J(A,B)=|A∩B|/|A∪B|
in practice, we can consider the pixel area within the bounding box to be a collection of pixels. In this way, we can measure the similarity of two bounding boxes by the Jaccard coefficient of the pixel sets of the two bounding boxes. When measuring the similarity of two bounding boxes, we generally refer to the Jaccard coefficient as the intersection over area (IoU), i.e., the ratio of the intersection area to the phase area of the two bounding boxes. The intersection ratio ranges between 0 and 1, where 0 indicates no overlapping pixels in the two bounding boxes and 1 indicates that the two bounding boxes are equal.
And calculating and comparing each real labeling frame with all the anchor frames respectively, selecting the anchor frame with the maximum intersection and comparison (intersection of the two frames/union of the two frames) with the real labeling frame to form a matching pair, and using the matching pair as a first part matching pair set to ensure that each real labeling frame has the anchor frame and the corresponding anchor frame.
And 2400, matching all the anchor frames with the real mark frames which are intersected with all the anchor frames and exceed the preset threshold value to form a second matching subset.
In this embodiment, an intersection ratio is calculated between each real labeling frame and each anchor frame, and the real labeling frames and the anchor frames whose intersection ratio exceeds a preset threshold are selected to form a matching pair and serve as a second part matching pair set. In the training sample in the prior art, the anchor frame and the real marking frame are generally matched by selecting the intersection ratio of 0.5, and the similarity of the matching pair of the anchor frame and the real marking frame can be ensured by selecting the intersection ratio of 0.5, so that the accuracy of the sample is ensured. In some embodiments, the preset threshold is 0.5, and as an alternative embodiment, the preset threshold may be selected in the range of 0.4-0.6.
And 2500, taking the first matching subset and the second matching subset as a first matching pair set.
In this embodiment, the first matching subset and the second matching subset obtained in step 2400 are merged to serve as a first matching pair set, where the first matching pair set includes a matching pair of the real labeling frame and the anchor frame with the largest cross-over ratio and a matching pair of the real labeling frame and the anchor frame with the cross-over ratio exceeding a preset threshold.
And 2600, screening the first matching pair set according to a preset screening rule to obtain a second matching pair set.
And step 2700, taking the second matching pair set as a positive sample set for target detection.
According to the positive sample obtaining method for target detection provided by the embodiment, a more detailed scheme is provided for obtaining a first matching pair set by matching an anchor frame and a real marking frame according to a preset matching rule, firstly, all the real marking frames and the anchor frame having the maximum intersection and coincidence ratio with all the real marking frames are matched to form a first matching subset, and each real marking frame is ensured to have the anchor frame corresponding to the anchor frame; secondly, matching all the anchor frames and the real labeling frames which are intersected with all the anchor frames and exceed a preset threshold value to form a second matching subset, and finally taking the first matching subset and the second matching subset as a first matching pair set. The positive sample obtaining method for target detection provided by the embodiment solves the problems of insufficient training samples and low quality in image recognition in the prior art, and ensures the quantity and diversity of the training samples in the image recognition.
EXAMPLE III
Referring to fig. 3, fig. 3 is a flowchart of a positive sample obtaining method for target detection according to a third embodiment of the present invention. The embodiment is based on an embodiment scheme, and performs optimization and improvement, and particularly provides a specific scheme for obtaining a second matching pair set by screening a first matching pair set according to a preset screening rule. As shown in fig. 3, the method includes:
3000, acquiring an image to be detected, wherein the image to be detected comprises at least one figure image.
3100, obtaining an anchor frame of the image to be detected.
And 3200, acquiring a real annotation frame of the figure image.
Similarly, step S3100 and step S3200 do not have a logical sequence relationship, and step S3200 may be executed first and then step S3100 may be executed, or step S3100 and step S3200 may be executed simultaneously.
And 3300, matching the anchor frame and the real labeling frame according to a preset matching rule to obtain a first matching pair set.
And 3400, constructing a to-be-detected real marking frame set.
In this embodiment, the real labeling boxes that need to be checked are determined first, and these real labeling boxes are used as the real labeling box set to pair the first matching pair set.
Further, in an alternative embodiment, as shown in fig. 4, the constructing the to-be-detected real labeling box set in the step 3400 may include the following steps:
step 3410, when the same anchor frame in the first matching pair set comprises a plurality of matched real labeling frames, the plurality of matched real labeling frames are the real labeling frames to be detected.
In this embodiment, if an anchor frame is larger than a certain specified threshold a in a cross-over ratio with another real mark frame, in addition to the real mark frame matched with the anchor frame, the real mark frame is a real mark frame that needs to be additionally checked. As can be seen from a lot of experimental data by those skilled in the art, the threshold value a is preferably 0.25, that is, if there is an anchor box, in addition to the matching real label box, whose intersection ratio with another real label box is also greater than 0.25, the real label box is the real label box that needs to be checked additionally, in this embodiment, the same anchor box may correspond to multiple real label boxes, and their intersection ratios are all greater than 0.25, then all of these corresponding real label boxes need to be checked.
And 3420, constructing a to-be-detected real labeling box set consisting of all the to-be-detected real labeling boxes.
In this embodiment, all the real annotation frames to be checked obtained in step 3410 are combined into a set of real annotation frames to be checked, where the set includes all the real annotation frames to be checked, and is used to select the anchor frame to be checked and the set of real annotation frames in the first matching pair set.
And 3500, screening the first matching pair set based on the to-be-detected real labeling box set according to a preset screening rule to obtain a second matching pair set.
Further, in an optional embodiment, as shown in fig. 5, the step 3500 of screening the first matching pair set based on the to-be-detected real labeling box set according to the preset screening rule to obtain the second matching pair set may include the following steps:
step 3510, if any matching pair in the first matching pair set contains any one real labeling box in the to-be-detected real labeling box set, judging the matching pair.
In this embodiment, in the first matching pair set, if any matching pair includes any one of the real labeling boxes in the set of real labeling boxes to be detected, the matching pair belongs to a matching pair that needs to be determined, and the matching pair is defined as a matching pair to be determined.
Step 3520, if the undetermined matching pair meets the preset screening rule, the undetermined matching pair is reserved, otherwise, the undetermined matching pair is deleted, and a second matching pair set is obtained.
In this embodiment, if the undetermined matching pair obtained in step 3510 meets the preset screening rule, the undetermined matching pair is retained in the first matching pair set, and if the undetermined matching pair does not meet the preset screening rule, the undetermined matching pair is deleted in the first matching pair set. And after all the undetermined matching pairs are screened by the preset screening rule, the remaining matching pairs in the first matching pair set form a second matching pair set.
In an alternative embodiment, the preset screening rule is preferably:
true mark box _ x 1-anchor box _ x1< margin _ w
Anchor frame _ x 2-true mark frame _ x2< margin _ w
True mark box _ y 1-anchor box _ y1< margin _ h
Anchor frame _ y 2-true mark frame _ y2< margin _ h
The method comprises the steps of obtaining a mark _ w (b) (a real mark frame _ x 2-a real mark frame _ x1), obtaining a mark _ h (a real mark frame _ y 2-a real mark frame _ y1), obtaining an anchor frame _ x1, an anchor frame _ x2, an anchor frame _ y1, an anchor frame _ y2, a real mark frame _ x1, a real mark frame _ x2, a real mark frame _ y1 and a real mark frame _ y2, wherein the mark _ w (b) is a preset value and can be adjusted according to actual conditions.
The preset value b can be adjusted according to practical situations according to a lot of experimental data of those skilled in the art, and the preset value b in this implementation can range from 0.2 to 0.3, preferably 0.25.
In the embodiment, the matched pair of the anchor frame and the real marking frame is selected according to the intersection ratio of the anchor frame and the real marking frame and the boundary condition of the anchor frame relative to the real marking frame, the problem of false detection between similar objects is solved by introducing a screening mechanism of the matched pair of the anchor frame and the real marking frame, the diversity of samples is ensured, and thus a target detection model and an image recognition model with higher performance can be obtained.
And 3600, taking the second matching pair set as a positive sample set for target detection.
In the method for obtaining a positive sample for target detection provided in this embodiment, a more detailed scheme is provided for obtaining a second matching pair set by screening a first matching pair set according to a preset screening rule, where the scheme includes: firstly, a real labeling frame set to be detected is constructed, and then the first matching pair set is screened based on the real labeling frame set to be detected according to a preset screening rule to obtain a second matching pair set, so that redundant matching pairs in the initial matching pair set are optimized, and the sample diversification and accuracy are guaranteed. And constructing the real labeling box set to be detected further comprises: when the same anchor frame in the first matching pair set comprises a plurality of matched real marking frames, the plurality of matched real marking frames are the real marking frames to be detected; and taking all the real marking frames to be detected as a set of the real marking frames to be detected. The step of screening the first matching pair set based on the to-be-detected real labeling box set according to a preset screening rule to obtain a second matching pair set further comprises the following steps of: if any matching pair in the first matching pair set contains any one real labeling frame in the real labeling frame set to be detected, judging the matching pair and defining the matching pair as a matching pair to be determined; and if the undetermined matching pair meets the preset screening rule, reserving the undetermined matching pair, and otherwise, deleting the undetermined matching pair to obtain a second matching pair set. The positive sample obtaining method for target detection provided by the embodiment solves the problems of insufficient training samples and low quality in image recognition in the prior art, and realizes sufficient quantity and diversity of the training samples.
Example four
The positive sample acquisition device for target detection provided by the fourth embodiment of the present invention can execute the positive sample acquisition method for target detection provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. Fig. 6 is a schematic structural diagram of a positive sample acquiring device 4000 for target detection according to a fourth embodiment of the present invention. Referring to fig. 6, a positive sample acquiring device 4000 for target detection according to an embodiment of the present invention may specifically include:
an image obtaining module 4100, configured to obtain an image to be detected, where the image to be detected includes at least one person image;
an anchor frame acquiring module 4200, configured to acquire an anchor frame of the image to be detected;
the annotation acquisition module 4300 is configured to acquire a real annotation frame of the person image;
the matching module 4400 is configured to match the anchor frame with the real labeling frame according to a preset matching rule to obtain a first matching pair set;
a screening module 4500, configured to screen the first matching pair set according to a preset screening rule to obtain a second matching pair set;
a sample obtaining module 4600, configured to use the second set of matching pairs as a positive sample set for target detection.
Further, the matching module 4400 further includes:
the first matching submodule is used for matching all the real labeling frames with the anchor frame which has the maximum intersection ratio with all the real labeling frames to form a first matching subset;
the second matching submodule is used for matching all the anchor frames with the real marking frames which are intersected with all the anchor frames and exceed the preset threshold value to form a second matching subset;
and the third matching sub-module is used for taking the first matching subset and the second matching subset as the first matching pair set.
Further, the screening module 4500 further includes:
the to-be-detected set submodule is used for constructing a to-be-detected real labeling frame set;
and the matching pair screening submodule is used for screening the first matching pair set based on the to-be-detected real labeling frame set according to a preset screening rule to obtain a second matching pair set.
Further, the sub-module for the to-be-detected set further comprises:
the real marking frame unit to be detected is used for determining a plurality of matched real marking frames as the real marking frames to be detected when the same anchor frame in the first matching pair set comprises the plurality of matched real marking frames;
and the to-be-detected real labeling frame set unit is used for taking all the to-be-detected real labeling frames as the to-be-detected real labeling frame set.
Further, the matching pair screening submodule further includes:
a screening judgment unit, configured to judge a matching pair if any matching pair in the first matching pair set includes any one of the real labeling frames in the set of real labeling frames to be detected, and define the matching pair as a to-be-determined matching pair;
and the second matching pair set forming unit is used for reserving the undetermined matching pair if the undetermined matching pair meets the preset screening rule, and deleting the undetermined matching pair to obtain a second matching pair set if the undetermined matching pair does not meet the preset screening rule.
Further, the second matching pair set composing unit further includes:
a screening rule unit for determining the screening rule as:
true mark box _ x 1-anchor box _ x1< margin _ w
Anchor frame _ x 2-true mark frame _ x2< margin _ w
True mark box _ y 1-anchor box _ y1< margin _ h
Anchor frame _ y 2-true mark frame _ y2< margin _ h
The real labeling frame _ x2-b is the real labeling frame _ x1, the mark _ h is the real labeling frame _ y2-b is the real labeling frame _ y1, the anchor frame _ x1, the anchor frame _ x2, the anchor frame _ y1, the anchor frame _ y2, the real labeling frame _ x1, the real labeling frame _ x2, the real labeling frame _ y1 and the real labeling frame _ y2 are the coordinates of the anchor frame and the real labeling frame respectively, and b is a preset value and can be adjusted according to actual conditions.
In the embodiment, the matched pair of the anchor frame and the real marking frame is selected according to the intersection ratio of the anchor frame and the real marking frame and the boundary condition of the anchor frame relative to the real marking frame, the problem of false detection between similar objects is solved by introducing a screening mechanism of the matched pair of the anchor frame and the real marking frame, the diversity of samples is ensured, and thus a target detection model and an image recognition model with higher performance can be obtained.
In the positive sample obtaining apparatus for target detection in this embodiment, a corresponding anchor frame and a real labeling frame are generated by analyzing an image to be detected, a matching pair set is obtained by matching the obtained anchor frame and the real labeling frame according to a matching rule, the matching pair set is screened according to a screening rule to delete redundant matching pairs, and the screened matching pair set is used as a training sample, so that a sample model with higher performance can be obtained, the problems of insufficient training samples and low quality in image recognition in the prior art are solved, and the sufficient quantity and diversity of the training samples are realized.
EXAMPLE five
Fig. 7 is a schematic structural diagram of a computer device according to a fifth embodiment of the present invention, as shown in fig. 7, the computer device includes a memory 5100 and a processor 5200, the number of the processors 5200 in the computer device may be one or more, and fig. 7 illustrates one processor 5200 as an example; the memory 5100 and processor 5200 of the device may be connected by a bus or other means, such as by a bus in fig. 7.
The memory 5100 serves as a computer-readable storage medium and may be configured to store software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the power adapter testing method in the embodiments of the present invention (e.g., the image obtaining module 4100, the anchor frame obtaining module 4200, the annotation obtaining module 4300, the matching module 4400, the screening module 4500, and the sample obtaining module 4600 in the positive sample obtaining device for target detection). The processor 5200 executes various functional applications of the device/terminal/device and data processing, i.e., implements the positive sample acquisition method for object detection described above, by running software programs, instructions, and modules stored in the memory 5100.
The processor 5200 is configured to run a computer program stored in the memory 5100, and implement the following steps:
acquiring an image to be detected, wherein the image to be detected comprises at least one figure image;
acquiring an anchor frame according to an image to be detected and acquiring a real marking frame according to a figure image;
matching the anchor frame with the real marking frame according to a preset matching rule to obtain a first matching pair set;
screening the first matching pair set according to a preset screening rule to obtain a second matching pair set;
and taking the second matching pair set as a positive sample of target detection.
In one embodiment, the computer program of the computer device provided in the embodiments of the present invention is not limited to the above method operations, and may also perform related operations in the positive sample acquiring method for target detection provided in any embodiment of the present invention.
The memory 5100 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. In addition, the memory 5100 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 5100 may further include memory located remotely from the processor 5200, which may be connected to devices/terminals/devices through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
EXAMPLE six
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, where a computer program is stored on the storage medium, the computer program includes program instructions, and when the program instructions are executed by a processor, the positive sample acquisition method for target detection is implemented, and the positive sample acquisition method for target detection includes:
acquiring an image to be detected, wherein the image to be detected comprises at least one figure image;
acquiring an anchor frame of the image to be detected and acquiring a real marking frame of the figure image;
matching the anchor frame and the real marking frame according to a preset matching rule to obtain a first matching pair set;
screening the first matching pair set according to a preset screening rule to obtain a second matching pair set;
and taking the second matching pair set as a positive sample set for target detection.
Of course, the storage medium containing the computer-executable instructions provided by the embodiments of the present invention is not limited to the above method operations, and may also perform related operations in the positive sample acquiring method for target detection provided by any embodiments of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the above embodiment of the positive sample acquiring device for target detection, the included units and modules are merely divided according to the functional logic, but are not limited to the above division as long as the corresponding functions can be realized; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (9)

1. A positive sample acquisition method for target detection, comprising:
acquiring an image to be detected, wherein the image to be detected comprises at least one figure image;
acquiring an anchor frame of the image to be detected and acquiring a real marking frame of the figure image;
matching the anchor frame and the real marking frame according to a preset matching rule to obtain a first matching pair set;
screening the first matching pair set according to a preset screening rule to obtain a second matching pair set comprises the following steps:
constructing a to-be-detected real labeling frame set;
screening the first matching pair set based on the to-be-detected real labeling frame set according to a preset screening rule to obtain a second matching pair set;
and taking the second matching pair set as a positive sample set for target detection.
2. The method of claim 1, wherein the matching the anchor frame with the real label frame according to a preset matching rule to obtain a first set of matching pairs comprises:
matching all the real labeling frames with the anchor frame having the maximum intersection ratio with all the real labeling frames to form a first matching subset;
matching all the anchor frames with the real marking frames which are intersected with all the anchor frames and exceed a preset threshold value to form a second matching subset;
and combining the first matching subset and the second matching subset to obtain a first matching pair set.
3. The method of claim 1, wherein the constructing the set of true labeling boxes to be examined comprises:
when the same anchor frame in the first matching pair set comprises a plurality of matched real marking frames, the plurality of matched real marking frames are the real marking frames to be detected;
and constructing a to-be-detected real labeling frame set consisting of all the to-be-detected real labeling frames.
4. The method as claimed in claim 3, wherein the step of screening the first matching pair set based on the to-be-detected real labeling box set according to a preset screening rule to obtain a second matching pair set comprises:
if any matching pair in the first matching pair set contains any one real labeling frame in the to-be-detected real labeling frame set, judging the matching pair and defining the matching pair as a to-be-determined matching pair;
if the undetermined matching pair meets the preset screening rule, the undetermined matching pair is reserved, otherwise, the undetermined matching pair is deleted, and the second matching pair set is obtained.
5. The method for obtaining a positive sample for target detection according to claim 4, wherein the preset screening rule is:
true mark box _ x 1-anchor box _ x1< margin _ w
Anchor frame _ x 2-true mark frame _ x2< margin _ w
True mark box _ y 1-anchor box _ y1< margin _ h
Anchor frame _ y 2-true mark frame _ y2< margin _ h
The system comprises a mark _ w, a mark _ h, a mark _ y2-b, an anchor frame _ y1, an anchor frame _ x1, an anchor frame _ x2, an anchor frame _ y1 and an anchor frame _ y2, wherein the mark _ w, the mark _ b, the mark frame _ x2-b, the mark frame _ x1, the mark _ h, the mark frame _ y2-b, the mark frame _ y1, the anchor frame _ x1, the anchor frame _ x2, the anchor frame _ y1 and the anchor frame _ y2 are respectively the minimum abscissa, the maximum abscissa, the minimum ordinate and the maximum ordinate of the anchor frame; the real label box _ x1, the real label box _ x2, the real label box _ y1 and the real label box _ y2 are the minimum abscissa, the maximum abscissa, the minimum ordinate and the maximum ordinate of the real label box, respectively; b is a preset boundary threshold.
6. A positive sample acquisition device for target detection, comprising:
the image acquisition module is used for acquiring an image to be detected, wherein the image to be detected comprises at least one figure image;
the anchor frame acquiring module is used for acquiring an anchor frame of the image to be detected;
the annotation acquisition module is used for acquiring a real annotation frame of the figure image;
the matching module is used for matching the anchor frame with the real marking frame according to a preset matching rule to obtain a first matching pair set;
the screening module is used for screening the first matching pair set according to a preset screening rule to obtain a second matching pair set;
the screening module includes: the to-be-detected set submodule is used for constructing a to-be-detected real labeling frame set;
the matching pair screening submodule is used for screening the first matching pair set based on the to-be-detected real labeling frame set according to a preset screening rule to obtain a second matching pair set;
and the sample acquisition module is used for taking the second matching pair set as a positive sample set for target detection.
7. The positive sample acquisition device for target detection as recited in claim 6, wherein the matching module further comprises:
the first matching submodule is used for matching all the real labeling frames with the anchor frame which has the maximum intersection ratio with all the real labeling frames to form a first matching subset;
the second matching submodule is used for matching all the anchor frames with the real marking frames which are intersected with all the anchor frames and exceed the preset threshold value to form a second matching subset;
and the third matching sub-module is used for taking the first matching subset and the second matching subset as the first matching pair set.
8. A computer device, the device comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a positive sample acquisition method for target detection as recited in any of claims 1-5.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out a positive sample acquisition method for object detection as claimed in any one of claims 1 to 5.
CN201910738591.5A 2019-08-12 2019-08-12 Positive sample acquisition method, device, equipment and storage medium for target detection Active CN110443212B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910738591.5A CN110443212B (en) 2019-08-12 2019-08-12 Positive sample acquisition method, device, equipment and storage medium for target detection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910738591.5A CN110443212B (en) 2019-08-12 2019-08-12 Positive sample acquisition method, device, equipment and storage medium for target detection

Publications (2)

Publication Number Publication Date
CN110443212A CN110443212A (en) 2019-11-12
CN110443212B true CN110443212B (en) 2022-03-11

Family

ID=68434546

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910738591.5A Active CN110443212B (en) 2019-08-12 2019-08-12 Positive sample acquisition method, device, equipment and storage medium for target detection

Country Status (1)

Country Link
CN (1) CN110443212B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110969200B (en) * 2019-11-27 2023-05-12 中国科学院自动化研究所 Image target detection model training method and device based on consistency negative sample
CN111444945A (en) * 2020-03-20 2020-07-24 北京每日优鲜电子商务有限公司 Sample information filtering method and device, computer equipment and storage medium
CN113808186B (en) * 2021-03-04 2024-01-16 京东鲲鹏(江苏)科技有限公司 Training data generation method and device and electronic equipment
CN113378864B (en) * 2021-08-16 2021-11-12 浙江啄云智能科技有限公司 Method, device and equipment for determining anchor frame parameters and readable storage medium
CN114092739B (en) * 2021-11-02 2023-06-30 北京百度网讯科技有限公司 Image processing method, apparatus, device, storage medium, and program product
CN114359676B (en) * 2022-03-08 2022-07-19 人民中科(济南)智能技术有限公司 Method, device and storage medium for training target detection model and constructing sample set
CN116912603B (en) * 2023-09-12 2023-12-15 浙江大华技术股份有限公司 Pre-labeling screening method, related device, equipment and medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107403141A (en) * 2017-07-05 2017-11-28 中国科学院自动化研究所 Method for detecting human face and device, computer-readable recording medium, equipment
CN108764164A (en) * 2018-05-30 2018-11-06 华中科技大学 A kind of method for detecting human face and system based on deformable convolutional network
CN108875577A (en) * 2018-05-11 2018-11-23 深圳市易成自动驾驶技术有限公司 Object detection method, device and computer readable storage medium
CN109409252A (en) * 2018-10-09 2019-03-01 杭州电子科技大学 A kind of traffic multi-target detection method based on modified SSD network
CN110020664A (en) * 2019-01-31 2019-07-16 浙江工业大学 A kind of positive negative sample balance method of deep learning target detection
CN110060508A (en) * 2019-04-08 2019-07-26 武汉理工大学 A kind of ship automatic testing method for inland river bridge zone

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107403141A (en) * 2017-07-05 2017-11-28 中国科学院自动化研究所 Method for detecting human face and device, computer-readable recording medium, equipment
CN108875577A (en) * 2018-05-11 2018-11-23 深圳市易成自动驾驶技术有限公司 Object detection method, device and computer readable storage medium
CN108764164A (en) * 2018-05-30 2018-11-06 华中科技大学 A kind of method for detecting human face and system based on deformable convolutional network
CN109409252A (en) * 2018-10-09 2019-03-01 杭州电子科技大学 A kind of traffic multi-target detection method based on modified SSD network
CN110020664A (en) * 2019-01-31 2019-07-16 浙江工业大学 A kind of positive negative sample balance method of deep learning target detection
CN110060508A (en) * 2019-04-08 2019-07-26 武汉理工大学 A kind of ship automatic testing method for inland river bridge zone

Also Published As

Publication number Publication date
CN110443212A (en) 2019-11-12

Similar Documents

Publication Publication Date Title
CN110443212B (en) Positive sample acquisition method, device, equipment and storage medium for target detection
EP3806064B1 (en) Method and apparatus for detecting parking space usage condition, electronic device, and storage medium
KR101854554B1 (en) Method, device and storage medium for calculating building height
CN107273832B (en) License plate recognition method and system based on integral channel characteristics and convolutional neural network
CN105868708A (en) Image object identifying method and apparatus
CN110399842B (en) Video processing method and device, electronic equipment and computer readable storage medium
CN109741325B (en) Intelligent detection method for wiring verticality
CN112052782B (en) Method, device, equipment and storage medium for recognizing parking space based on looking around
CN110910445B (en) Object size detection method, device, detection equipment and storage medium
CN112307853A (en) Detection method of aerial image, storage medium and electronic device
CN111008961A (en) Transmission line equipment defect detection method and system, equipment and medium thereof
US20220405145A1 (en) Method, Apparatus, System and Electronic Device for Selecting Intelligent Analysis Algorithm
CN105405130A (en) Cluster-based license image highlight detection method and device
CN111738036A (en) Image processing method, device, equipment and storage medium
CN113222970A (en) Vehicle loading rate detection method and device, computer equipment and storage medium
CN111523558A (en) Ship shielding detection method and device based on electronic purse net and electronic equipment
CN111695373B (en) Zebra stripes positioning method, system, medium and equipment
CN112802027A (en) Target object analysis method, storage medium and electronic device
CN110458202B (en) Picture processing method, device and equipment and computer readable storage medium
CN106682611A (en) Image processing method and apparatus
CN113362227B (en) Image processing method, device, electronic equipment and storage medium
CN104809438A (en) Method and device for detecting electronic eyes
CN111523583B (en) Method for automatically identifying and classifying equipment nameplate photos by using unmanned aerial vehicle
CN113902740A (en) Construction method of image blurring degree evaluation model
CN114511862A (en) Form identification method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20211103

Address after: 518027 220, building 6, Qianhai Shenzhen Hong Kong youth dream workshop, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen City, Guangdong Province

Applicant after: RUIMO INTELLIGENT TECHNOLOGY (SHENZHEN) Co.,Ltd.

Address before: 518027 220, building 6, Qianhai Shenzhen Hong Kong youth dream workshop, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen City, Guangdong Province

Applicant before: RUIMO INTELLIGENT TECHNOLOGY (SHENZHEN) Co.,Ltd.

Applicant before: DONGGUAN SONGSHAN LAKE TECHXINSTITUTE Co.,Ltd.

GR01 Patent grant
GR01 Patent grant