WO2022011892A1 - Network training method and apparatus, target detection method and apparatus, and electronic device - Google Patents

Network training method and apparatus, target detection method and apparatus, and electronic device Download PDF

Info

Publication number
WO2022011892A1
WO2022011892A1 PCT/CN2020/125972 CN2020125972W WO2022011892A1 WO 2022011892 A1 WO2022011892 A1 WO 2022011892A1 CN 2020125972 W CN2020125972 W CN 2020125972W WO 2022011892 A1 WO2022011892 A1 WO 2022011892A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
sample image
category
sample
image
Prior art date
Application number
PCT/CN2020/125972
Other languages
French (fr)
Chinese (zh)
Inventor
窦浩轩
王意如
甘伟豪
路少卿
武伟
闫俊杰
Original Assignee
北京市商汤科技开发有限公司
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 北京市商汤科技开发有限公司 filed Critical 北京市商汤科技开发有限公司
Priority to KR1020217038227A priority Critical patent/KR20220009965A/en
Priority to JP2021569189A priority patent/JP2022544893A/en
Publication of WO2022011892A1 publication Critical patent/WO2022011892A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • 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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks

Definitions

  • the present disclosure relates to the field of computer technologies, and in particular, to a network training method and device, a target detection method and device, and electronic equipment.
  • Computer vision is an important direction of artificial intelligence technology. In computer vision processing, it is usually necessary to detect objects (such as pedestrians, objects, etc.) in images or videos.
  • Target detection of large-scale long-tail data has important applications in many fields, such as abnormal object detection in urban surveillance, abnormal behavior detection and emergency alarm.
  • abnormal object detection in urban surveillance abnormal behavior detection and emergency alarm.
  • the embodiments of the present disclosure propose a technical solution for network training and target detection.
  • a network training method including:
  • the sample image is taken as the marked second sample image and added to the training set, wherein the annotation information of the second sample image includes the image area of the first target and the category confidence corresponding to the first target.
  • the training set includes the labeled third sample image; for the second target whose category confidence in the target is less than the first threshold, according to the feature information of the third target in the third sample image, Feature correlation mining is performed on the second target, and through feature correlation mining, a fourth target and a first sample image where the fourth target is located are determined from the second target, and the fourth target is located.
  • the first sample image is taken as the fourth sample image and added to the training set; according to the annotation information of the fourth sample image, the second sample image, the third sample image and the fourth sample image in the training set images to train the object detection network.
  • the target detection network is trained according to the labeling information of the fourth sample image, the second sample image, the third sample image and the fourth sample image in the training set ,include:
  • the first number of samples sampled from the positive sample images of each category is determined respectively, and the positive sample images are the sample images including the target in the image; according to the positive samples of each category The first number of samples in the image, sampling positive sample images of each category to obtain a plurality of fifth sample images; sampling the negative sample images of the training set to obtain a plurality of sixth sample images, the negative samples
  • the image is a sample image that does not include a target; the target detection network is trained according to the fifth sample image and the sixth sample image.
  • the feature correlation mining is performed on the second target according to the feature information of the third target in the third sample image, and the feature correlation mining is performed from the second target.
  • Determining the fourth target and the first sample image where the fourth target is located includes: determining the information entropy of the second target according to the classification probability of the second target; according to the category confidence of the second target degree and information entropy, select the fifth target from the second target; according to the category of the third target in the third sample image and the total number of sample images to be mined, determine the samples to be mined for each category respectively The second number of images; according to the feature information of the third target in the third sample image, the feature information of the fifth target and the second number of sample images to be mined in each category, from the fifth target A fourth target and a first sample image where the fourth target is located are determined.
  • selecting a fifth target from the second target according to the category confidence and information entropy of the second target includes: according to the category confidence and information of the second target entropy, sort the second targets respectively, select the sixth target with the third quantity and the seventh target with the fourth quantity; combine the sixth target and the seventh target to obtain the fifth target Target.
  • the category of the third target in the third sample image and the total number of sample images to be mined respectively determining the second number of sample images to be mined for each category, including: according to The category of the third target in the third sample image determines the proportion of the third target of each category; according to the proportion of the third target of each category, the sampling proportion of each category is determined; according to the sampling proportion of each category, the proportion of each category is determined respectively The second number of sample images to be mined for each category.
  • Determining the fourth target and the first sample image where the fourth target is located from among the five targets includes: according to the distance between the characteristic information of the third target of the first category and the characteristic information of each fifth target, respectively determining Among the third targets of the first category, the third target with the smallest distance from each fifth target is used as the eighth target, and the first category is any one of the categories of the third targets; the eighth target is The target with the largest middle distance is determined as the fourth target.
  • the feature information of the third target in the third sample image the feature information of the fifth target and the second number of sample images to be mined in each category, from the third sample image Determining the fourth target and the first sample image where the fourth target is located among the five targets, further comprising: adding the determined fourth target to the third target of the first category, and adding the determined fourth target to the third target of the first category.
  • the outgoing fourth target is removed from the unlabeled fifth target.
  • the method further includes: inputting the third sample image into the target detection network for processing to obtain feature information of the third target in the third sample image.
  • the method before the step of inputting the unlabeled first sample image into the target detection network for processing to obtain the target detection result of the first sample image, the method further includes:
  • the target detection network is pre-trained by using the labeled third sample image.
  • the first sample image includes a long-tail image.
  • a target detection method includes: inputting an image to be processed into a target detection network for processing, and obtaining a target detection result of the to-be-processed image, where the target detection result includes all The position and category of the target in the image to be processed are obtained, and the target detection network is trained according to the above-mentioned network training method.
  • a network training apparatus including:
  • the target detection part is configured to input the unlabeled first sample image into the target detection network for processing, and obtain the target detection result of the first sample image, and the target detection result includes the target detection result in the first sample image.
  • a confidence determination part configured to determine the category confidence of the target according to the classification probability of the target
  • the labeling part is configured to take the first sample image where the first target is located as the labeled second sample image for the first target whose category confidence in the target is greater than or equal to the first threshold, and add training set, wherein the labeling information of the second sample image includes the image area of the first target and the category corresponding to the class confidence of the first target, and the training set includes the labelled third sample image;
  • the feature mining part is configured to, for the second target whose category confidence is less than the first threshold in the target, perform feature information on the second target according to the feature information of the third target in the third sample image Relevance mining, through feature correlation mining, the fourth target and the first sample image where the fourth target is located are determined from the second target, and the first sample image where the fourth target is located is used as the first sample image.
  • Four sample images are added to the training set;
  • the training part is configured to train the target detection network according to the label information of the fourth sample image, the second sample image, the third sample image and the fourth sample image in the training set.
  • the training part includes: a sampling quantity determination sub-part, configured to separately determine, according to the category of the target in the positive sample images of the training set, the number of samples sampled from the positive sample images of each category the first quantity, the positive sample images are sample images including the target in the image; the first sampling subsection is configured to sample the positive sample images of each category according to the first quantity sampled in the positive sample images of each category , to obtain a plurality of fifth sample images; the second sampling subsection is configured to sample the negative sample images of the training set to obtain a plurality of sixth sample images, and the negative sample images are images that do not include the target a sample image; a training subsection configured to train the object detection network according to the fifth sample image and the sixth sample image.
  • the feature mining part includes: an information entropy determination sub-section, configured to determine the information entropy of the second target according to the classification probability of the second target; a target selection sub-section, is configured to select a fifth target from the second target according to the category confidence and information entropy of the second target; the mining quantity determination subsection is configured to select a fifth target according to the third sample image in the third sample image
  • the category of the target and the total number of sample images to be mined respectively determine the second quantity of the sample images to be mined for each category;
  • the target and image determination sub-section is configured to be based on the third target in the third sample image.
  • the feature information, the feature information of the fifth target and the second number of sample images to be mined in each category, the fourth target and the first sample image where the fourth target is located are determined from the fifth target.
  • the target selection sub-section is configured to: according to the category confidence and information entropy of the second target, sort the second targets respectively, and select a third number of Six targets and a seventh target with a fourth quantity; the sixth target and the seventh target are combined to obtain the fifth target.
  • the mining quantity determination subsection is configured to: determine the proportion of the third objects of each category according to the category of the third object in the third sample image; The proportion of the three targets determines the sampling proportion of each category; according to the sampling proportion of each category, the second quantity of sample images to be mined in each category is determined respectively.
  • the target and image determination subsection is configured to: determine the third target according to the distance between the feature information of the third target of the first category and the feature information of each fifth target.
  • the third target with the smallest distance from each fifth target is used as the eighth target, and the first category is any one of the categories of the third targets; the distance among the eighth targets is the largest target, identified as the fourth target.
  • the target and image determination subsection is further configured to: add the determined fourth target to the third target of the first category, and add the determined fourth target to the third target of the first category. Four targets were removed from the unlabeled fifth target.
  • the apparatus further includes: a feature extraction part, configured to input the third sample image into the target detection network for processing to obtain a third target in the third sample image characteristic information.
  • the apparatus before the target detection part, further includes: a pre-training part configured to pre-train the target detection network by using the labeled third sample images.
  • the first sample image includes a long-tail image.
  • a target detection apparatus includes: a detection processing part configured to input an image to be processed into a target detection network for processing, and obtain a target detection result of the to-be-processed image , the target detection result includes the position and category of the target in the to-be-processed image, and the target detection network is trained according to the above-mentioned network training method.
  • the method before the step of respectively determining the first number of samples sampled from the positive sample images of each category according to the category of the target in the positive sample images of the training set, the method includes: The positive sample images and negative sample images are sampled to obtain the same or similar number of positive sample images and negative sample images.
  • the total number of sample images to be mined is 5% to 25% of the total number of the first sample images.
  • the combining the sixth target and the seventh target to obtain the fifth target includes: removing the sixth target that is the same as the seventh target target, obtain the remaining target that is different from the seventh target in the sixth target; take the remaining target and the seventh target as the fifth target.
  • the method further includes: when the number of the fourth sample images of the first category reaches a second number of sample images of the first category to be mined, ending the pairing process. Feature correlation mining of the first category.
  • the method further includes: after the number of the first sample images where the fourth target is located reaches the target of the first category to be mined. When the second number of sample images is reached, the determination of the eighth target is ended.
  • the method further includes: when the number of the first sample images where the fourth target is located does not reach the number of the first category to be mined When the second number of sample images is stored, and the set of storing the feature information of the fifth target is empty, the determination of the eighth target is ended.
  • the inputting the third sample image into the target detection network for processing to obtain the feature information of the third target in the third sample image includes: The sample image is input into the target detection network, and the feature vector output by the hidden layer of the target detection network is obtained; the feature vector is determined as the feature information of the third target.
  • an electronic device comprising: a processor; a memory configured to store instructions executable by the processor; wherein the processor is configured to invoke the instructions stored in the memory, to perform the above-mentioned network training method, or to perform the above-mentioned target detection method.
  • a computer-readable storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, implement the network training method, or implement the above-mentioned target detection method.
  • the target detection results of unlabeled sample images can be obtained through the target detection network; pseudo-labeling and feature correlation mining are respectively performed according to the target detection results, high-value sample images are marked and collected, and added to the training set;
  • the latter training set trains the target detection network, thereby expanding the number of positive sample data in the training set, alleviating the imbalance between positive and negative samples, and improving the training effect of the target detection network.
  • FIG. 1 shows a flowchart of a network training method according to an embodiment of the present disclosure.
  • FIG. 2 shows a schematic diagram of a processing procedure of a network training method according to an embodiment of the present disclosure.
  • FIG. 3 shows a block diagram of a network training apparatus according to an embodiment of the present disclosure.
  • FIG. 4 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
  • FIG. 5 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
  • FIG. 1 shows a flowchart of a network training method according to an embodiment of the present disclosure.
  • the network training method includes:
  • step S11 the unlabeled first sample image is input into a target detection network for processing to obtain a target detection result of the first sample image, where the target detection result includes the target detection result of the target in the first sample image Image area, feature information and classification probability;
  • step S12 the category confidence of the target is determined according to the classification probability of the target
  • step S13 for the first target whose category confidence is greater than or equal to the first threshold in the target, the first sample image where the first target is located is taken as the marked second sample image, and added to the training set , wherein the labeling information of the second sample image includes the image area of the first target and the category corresponding to the class confidence of the first target, and the training set includes the labelled third sample image;
  • step S14 for the second target whose category confidence is less than the first threshold in the target, perform feature correlation mining on the second target according to the feature information of the third target in the third sample image , through feature correlation mining, determine the fourth target and the first sample image where the fourth target is located from the second target, and use the first sample image where the fourth target is located as the fourth sample image, and add it to the training set;
  • step S15 the target detection network is trained according to the label information of the fourth sample image, the second sample image, the third sample image and the fourth sample image in the training set.
  • the method may be executed by an electronic device such as a terminal device or a server, and the terminal device may be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, For personal digital processing (Personal Digital Assistant, PDA), handheld devices, computing devices, vehicle-mounted devices, wearable devices, etc., the method can be implemented by the processor calling the computer-readable instructions stored in the memory. Alternatively, the method may be performed by a server.
  • UE User Equipment
  • PDA Personal Digital Assistant
  • the method may be implemented by the processor calling the computer-readable instructions stored in the memory.
  • the method may be performed by a server.
  • the first sample image may be an image acquired by an image acquisition device (eg, a camera).
  • the first sample image may include a large-scale long-tailed image, that is, most of the images are background images, and a small part of the images include detectable objects.
  • Detectable targets may include, for example, human bodies, faces, vehicles, objects, and the like.
  • images of a certain geographical area can be collected by cameras, and people may pass through the geographical area only a small part of the time, so most of the collected images are background images, and only a small part of the images include human faces and/or faces. or human body.
  • the collected images can form a long-tailed dataset.
  • the embodiment of the present disclosure does not limit the acquisition method of the first sample image and the category of the target in the first sample image.
  • a target detection network may be preset to detect the position (ie, detection frame) and category of the target in the image.
  • the target detection network may be, for example, a convolutional neural network, and the embodiment of the present disclosure does not limit the network structure of the target detection network.
  • the method further includes: pre-training the target detection network by using the labeled third sample image. That is to say, a training set may be preset, and the training set includes the labeled third sample images, and the labeling information of the third sample images may include the detection frame and category of the target in the image. According to the training set, the target detection network can be pre-trained by the method in the related art, so that the target detection network has a certain detection accuracy.
  • the pre-trained object detection network has poor detection effect on large-scale long-tail images. Therefore, the unlabeled first sample image can be used to further train the object detection network through active learning.
  • the unlabeled first sample image may be input into the target detection network for processing to obtain the target detection result of the first sample image.
  • the target detection result may include the image area, feature information and classification probability of the target in the first sample image.
  • the image area where the target is located can be the detection frame in the image;
  • the feature information of the target can be, for example, the feature vector output by the hidden layer (such as the convolution layer) of the target detection network;
  • the classification probability of the target can represent the classification of the target belonging to each category Posterior probability.
  • the target in the first sample image may also be referred to as an instance, and one or more targets may be detected in each first sample image.
  • the order of magnitude of detected objects may be several to dozens of times the order of magnitude of images.
  • step S12 according to the classification probability of the target, the maximum value of the classification probability may be obtained and determined as the classification confidence level of the target.
  • step S13 for a target whose category confidence is greater than or equal to the first threshold (which may be referred to as a first target), the first sample image where the first target is located may be used as a Annotated sample images (may be referred to as second sample images) are added to the training set.
  • the image area of the first target is taken as the marked image area, and the category corresponding to the category confidence of the first target is taken as the marked category of the first target.
  • the same second sample image may be labeled multiple times by multiple first objects in the second sample image.
  • the first threshold is, for example, 0.99, and the embodiment of the present disclosure does not limit the value of the first threshold.
  • step S13 may be called pseudo-labeling. That is, the image where the target with higher confidence is located is regarded as a high-value sample, and the target detection inference result is directly used as the target annotation result. In this way, the number of positive sample data in the training set can be expanded to solve the problem of difficult collection of positive samples.
  • step S14 for the target whose category confidence is less than the first threshold (which may be referred to as the second target), the target in the third sample image that has been marked in the training set (which may be referred to as The feature information of the third target), the feature correlation mining is performed on the second target, and the target that meets the requirements (may be referred to as the fourth target) is mined from the second target.
  • the distance or correlation between the feature information of the third target and the feature information of the second target can be calculated, a preset number of targets can be selected according to the distance or the correlation, and the selected preset number of targets can be used as the first target.
  • the first sample image where the mined fourth target is located may be taken as the fourth sample image and added to the training set, so as to complete the processing process of feature correlation mining. In this way, the number of sample data in the training set can be further expanded.
  • the annotation information of the fourth sample image may be obtained by manual annotation, for example, manually determining the detection frame and category of the target in the fourth sample image. This embodiment of the present disclosure does not limit this.
  • step S15 after obtaining the label information of the fourth sample image, the target detection network can be trained according to the second sample image, the third sample image and the fourth sample image in the training set.
  • the target detection results of unlabeled sample images can be obtained through the target detection network; pseudo-labeling and feature correlation mining are respectively performed according to the target detection results, high-value sample images are marked and collected, and added to the training set;
  • the latter training set trains the target detection network, thereby expanding the number of positive sample data in the training set, alleviating the imbalance between positive and negative samples, and improving the training effect of the target detection network.
  • step S11 the target detection result of each first sample image is obtained; through the processing of S12, the class confidence of the target in each of the first sample images is obtained.
  • step S13 the sample image of the first target whose class confidence is greater than or equal to the first threshold can be added to the training set, and the labeled second sample image can be obtained by pseudo-labeling; in step S14, the class confidence can be Mining is performed on second targets whose degree is less than the first threshold.
  • step S14 may include:
  • the classification probability of the second target determine the information entropy of the second target
  • the category of the third target in the third sample image and the total number of sample images to be mined respectively determine the second number of sample images to be mined in each category
  • the feature information of the third target in the third sample image According to the feature information of the third target in the third sample image, the feature information of the fifth target and the second number of sample images to be mined in each category, the fourth target and the The first sample image where the fourth target is located.
  • the information entropy of the second target can be calculated to indicate the degree of uncertainty of the second target, that is, the greater the information entropy of the second target, the higher the information entropy of the second target The greater the degree of uncertainty; on the contrary, the smaller the information entropy of the second target, the smaller the degree of uncertainty of the second target.
  • the embodiment of the present disclosure does not limit the calculation method of the information entropy.
  • a target (which may be referred to as a fifth target) that satisfies a certain condition may be selected from a plurality of second targets, for example, a category may be selected.
  • the step of selecting a fifth target from the second target according to the category confidence and information entropy of the second target may include:
  • the second targets are sorted respectively, and a third number of sixth targets and a fourth number of seventh targets are selected;
  • the sixth target and the seventh target are combined to obtain the fifth target.
  • the plurality of second targets are sorted; according to the sorting result, a preset fourth number of targets (which may be referred to as seventh targets) are selected from the plurality of second targets.
  • the third number and the fourth number may be 3K respectively
  • K represents the number of sample images to be mined
  • K is, for example, 10000.
  • the value of K may be 5% to 25% of the total number of unlabeled first sample images.
  • the embodiments of the present disclosure do not limit the value of K and the quantitative relationship between the third quantity and the fourth quantity and K.
  • the selected sixth target and the seventh target may be combined, and the combined multiple targets may be used as the fifth target, so as to remove possible duplicate targets therein.
  • the selected sixth target and the seventh target may be combined, and the combined multiple targets may be used as the fifth target, so as to remove possible duplicate targets therein.
  • about 6K fifth objects are available.
  • the above processing method can be called bootstrapping. In this way, a certain number of positive samples and negative samples with high probability can be selected from the second target at the same time, so as to carry out feature correlation mining in the future. Reduce the calculation amount of feature correlation mining and improve processing efficiency.
  • the step of respectively determining the second number of sample images to be mined in each category may be: include:
  • the second quantity of sample images to be mined in each category is determined respectively.
  • the proportion f c of the third object in each category can be determined; according to the proportion f c , each category can be calculated by the following formula sampling weight of
  • c represents R & lt class c sample values; t is the hyper-parameters, for example, a value of 0.1; C denotes the number of categories; R & lt classes C i represents the i-th sample value of the categories .
  • the sampling proportion corresponding to the category with a smaller proportion can be increased, and the sampling proportion corresponding to the category with a larger proportion can be reduced, thereby alleviating the quantity imbalance between samples of different categories in order to improve the training effect of the network.
  • the second number of sample images to be mined for each category can be determined. Further, feature correlation mining may be performed according to the second quantity.
  • the method further includes: inputting the third sample image into the target detection network for processing to obtain feature information of the third target in the third sample image.
  • the labeled third sample image in the training set can be input into the target detection network, and the feature information of the third sample image, such as a feature vector, is output from the hidden layer (eg, convolution layer) of the target detection network.
  • the hidden layer eg, convolution layer
  • the feature information of the third target in the third sample image the feature information of the fifth target and the second number of sample images to be mined in each category, from the third sample image Among the five targets, the fourth target and the first sample image where the fourth target is located are determined, including:
  • the first category is any one of the categories of the third target
  • the target with the largest distance among the eighth targets is determined as the fourth target.
  • a k-center method may be used to mine a corresponding number of sample images from the sample images where the fifth target is located.
  • the distance between the feature information of the third target of the first category and the feature information of each fifth target may be calculated, the distance It can be, for example, the Euclidean distance.
  • the third target with the smallest distance from the fifth target among the third targets in the first category can be determined, so that the third target with the smallest distance from each fifth target can be determined, which can be called the first target.
  • one target with the largest distance may be selected from each of the eighth targets, and determined as the fourth target obtained by this feature correlation mining. As shown in the following formula:
  • u represents the fourth target obtained by feature correlation mining; dist(f j , g l ) represents the feature information f j of the jth fifth target and the lth third target of the first category c the distance between the feature information g L; A set of feature information representing the fifth target; A set of feature information representing the third object of the first category c.
  • the first sample image where the fourth target is located can be determined, and the sample image is added to the training set as the fourth sample image, thereby completing the feature correlation mining process this time.
  • the feature information of the third target in the third sample image the feature information of the fifth target and the second number of sample images to be mined in each category, from the third sample image
  • the step of determining the fourth target and the first sample image where the fourth target is located among the five targets further includes:
  • the determined fourth object is added to the third object of the first category, and the determined fourth object is removed from the unlabeled fifth object.
  • the fourth target obtained by this feature correlation mining is regarded as the labeled target, and the fourth target is removed from the unlabeled target.
  • the feature information of the fourth object may be added to the set of feature information of the third object of the first category c , the set of feature information from the fifth target removed in.
  • the two updated sets can be mined by formula (3), and the above process can be repeated.
  • the number of the fourth sample images of the first category reaches the second number of the first category, or the second number is not reached and the fifth target is exhausted (the set When it is empty), the feature correlation mining of the first category can be completed.
  • human annotation may be performed on the mined fourth sample image to obtain annotation information of the fourth sample image. Since there may be both a positive sample image (that is, the fourth sample image including the target in the image) and a negative sample image (that is, the fourth sample image that does not include the target) in the fourth sample image, the fourth sample image
  • the annotation information can include the sample category information of whether the image is a positive sample image or a negative sample image, the image frame where the object is located in the positive sample image, and the category of the object.
  • the second sample image, the third sample image and the fourth sample image in the training set may be selected according to the annotation information of the fourth sample image in step S15. , train the target detection network.
  • step S15 may include: according to the categories of the targets in the positive sample images of the training set, respectively determining the first number of samples sampled from the positive sample images of each category, the positive sample images being the sample images including the target in the image ;
  • the object detection network is trained according to the fifth sample image and the sixth sample image.
  • the target detection network can be trained by resampling, and the sampling frequency of data with low frequency in the data can be increased by resampling to improve the performance of the network for these data, and further improve the positive and negative samples. imbalance between.
  • the positive sample images and the negative sample images in the training set may be sampled respectively, so that the sampled positive sample image
  • the number of negative samples is the same or similar.
  • the total number of samples of the positive sample image may be preset. According to the categories of the objects in the positive sample images in the training set, the first number of samples sampled from the positive sample images of each category is determined respectively.
  • the proportion of the target of each category can be determined; according to the proportion, the sampling proportion of each category can be calculated by the following formula:
  • R h represents the sampling proportion of the positive sample images of the h th category
  • q h represents the proportion of the objects of the h th category
  • t 1 is a hyperparameter, and the value is, for example, 0.1.
  • the sampling proportion corresponding to the category with a smaller proportion can be increased, and the sampling proportion corresponding to the category with a larger proportion can be reduced, so as to alleviate the imbalance in the number of positive sample images of different categories, so that Improve the training effect of the network.
  • the first number of positive sample images of each category may be determined according to the sampling proportion of positive sample images of each category and the total number of samples of positive sample images.
  • a first number of positive sample images may be randomly sampled from the positive sample images of the category according to the first number of the category, as the fifth sample image.
  • the positive sample images of each category are sampled respectively, and the fifth sample image with the total number of samples can be obtained.
  • the negative sample images in the training set can be directly randomly sampled according to the preset total number of samples to obtain the sixth sample image with the total number of samples.
  • the total number of samples of negative sample images may be the same as or different from the total number of samples of positive sample images, which is not limited in this embodiment of the present disclosure.
  • the target detection network can be trained according to the fifth sample image and the sixth sample image. That is, input the fifth and sixth sample images into the target detection network respectively to obtain the target detection results of the fifth and sixth sample images; determine the loss of the target detection network according to the target detection results and the label information; and adjust the loss in the reverse direction.
  • step S11 the step of pre-training the target detection network by using the marked third sample image can also be performed by the above-mentioned resampling training method, thereby improving the target detection network. pre-training effect.
  • steps S11-S15 can be repeated to achieve continuous incremental training. That is to say, when the unlabeled sample images are collected again, the target detection network after this training can be used as the initial target detection network, the expanded training set can be used as the initial training set, and the pseudo-labeling can be repeated.
  • Feature correlation mining The process of resampling training, so as to continuously improve the performance of the target detection network.
  • FIG. 2 shows a schematic diagram of a processing procedure of a network training method according to an embodiment of the present disclosure.
  • the data source includes a large number of unlabeled first sample images 20 , the first sample images 20 are input into the target detection network for prediction, and the target detection of each first sample image 20 is obtained.
  • the result 21 includes the image area (not shown), the feature vector and the classification probability of the object in the first sample image.
  • the target detection network may include a CNN backbone network 211, a feature map pyramid network (FPN) 212, and a fully connected network 213, such as a bbox head.
  • FPN feature map pyramid network
  • the target detection network After the first sample image 20 is input to the target detection network, it is processed by the CNN backbone network 211 and the FPN 212 to obtain a feature map 214 of the first sample image, and the feature map 214 is processed by the fully connected network 213 to obtain the target detection result 21.
  • the category confidence of the target can be determined according to the classification probability of the target; for the first targets whose category confidence is greater than or equal to the first threshold (for example, 0.99), the first objects in which the first targets are located are determined.
  • This image is used as the second sample image 22, and pseudo-labeling is performed on the second sample image 22, that is, the image area of the first target and the category corresponding to the category confidence of the first target are used as the labeling information of the second sample image 22.
  • the labeled second sample image 22 is added to the training set 25, thereby realizing the expansion of the positive samples in the training set.
  • a certain number of fifth targets are selected by the bootstrapping method, and the sample image 23 where the fifth target is located is obtained.
  • the feature vector (not shown) of the third target in the marked third sample image in the training set perform feature correlation mining on the fifth target, and determine the fourth target and the first sample image where the fourth target is located, As the fourth sample image 24 .
  • the fourth sample image 24 is manually labeled and added to the training set 25, so as to further expand the labeled images in the training set.
  • the training set 25 includes the labeled second sample image, the third sample image, and the fourth sample image. Resampling the training set 25, balancing the number of positive and negative samples, and the number of positive samples of different categories, to obtain a resampled training set 26; and then train the target detection network according to the resampled training set 26, thereby completing the entire process.
  • a target detection method comprising:
  • the target detection network trained by the above method can be deployed to realize the target detection of the image to be processed.
  • the image to be processed may be, for example, an image collected by an image collection device (eg, a camera), and the image may include a target to be detected, such as a human body, a face, a vehicle, an object, and the like. This embodiment of the present disclosure does not limit this.
  • the to-be-processed image may be input into a target detection network for processing to obtain a target detection result of the to-be-processed image.
  • the target detection result includes the position and category of the target in the image to be processed, such as the detection frame where the face in the image to be processed is located and the identity corresponding to the face.
  • the active learning mining method is used to mine potential unlabeled data
  • the semi-supervised learning method is used to label the auxiliary unlabeled data
  • the quantity of positive sample data is expanded, thereby solving large-scale problems.
  • large-scale long-tail detection the problem of large data size and difficulty in collecting positive samples, and to a certain extent, alleviates the problem of imbalance between positive and negative samples.
  • the model performance is effectively improved in the environment of limited annotation and computing resources.
  • the target detection network is trained by means of resampling, which can solve the negative impact of the imbalance of positive and negative samples on network training, and alleviate the negative impact of the imbalance between different categories of positive samples on network training. , so that the target detection network can effectively converge during training and improve the network performance.
  • the network training method by using the active learning method, potentially high-value samples that are helpful for model improvement can be mined in a huge amount of unlabeled data, and the model can be effectively improved in a limited labeling and computing resource environment. performance, saving a lot of manpower and computing costs required for the application of deep learning models in new businesses; using the resampling method, the target detection network can be effectively trained in the case of unbalanced samples, without too much manual parameter adjustment intervention, saving deep learning The labor cost required to apply the model to the new business.
  • the network training method according to the embodiment of the present disclosure can be applied to the fields of intelligent video analysis, security and other fields.
  • the method can be used to detect potential targets in intelligent video analysis or intelligent monitoring online. , and iteratively improve the detection network of the application, quickly meet the performance requirements required by the business with less labor and computing costs, and can continue to improve network performance in the future.
  • the network training method of the embodiments of the present disclosure can be applied to online intelligent video analysis or intelligent monitoring, so as to rapidly iterate online potential target detection applications in intelligent video analysis or intelligent monitoring under limited labor and computing resources It can quickly achieve the performance requirements required by the business with less labor and computing costs, and can continue to improve the performance of the model afterwards.
  • the embodiments of the present disclosure also provide a network training device, a target detection device, an electronic device, a computer-readable storage medium, and a program, all of which can be used to implement any network training method or target detection method provided by the embodiments of the present disclosure, Corresponding technical solutions and descriptions, and refer to the corresponding records in the method section, will not be repeated.
  • FIG. 3 shows a block diagram of a network training apparatus including a processor (not shown in FIG. 3 ) for executing a program stored in a memory (not shown in FIG. 3 ) according to an embodiment of the present disclosure part; as shown in Figure 3, the program part stored in the memory includes:
  • the target detection part 31 is configured to input the unlabeled first sample image into the target detection network for processing, and obtain the target detection result of the first sample image, and the target detection result includes the first sample image image area, feature information and classification probability of the target;
  • a confidence level determination part 32 configured to determine the category confidence level of the object according to the classification probability of the object
  • the labeling part 33 is configured to take the first sample image where the first target is located as the marked second sample image for the first target whose category confidence is greater than or equal to the first threshold in the target, and add In the training set, the annotation information of the second sample image includes the image area of the first target and the category corresponding to the category confidence of the first target, and the training set includes the labeled third sample image ;
  • the feature mining part 34 is configured to, for the second object in the object whose category confidence is less than the first threshold value, perform an analysis on the second object according to the feature information of the third object in the third sample image.
  • Feature correlation mining through feature correlation mining, determine the fourth target and the first sample image where the fourth target is located from the second target, and use the first sample image where the fourth target is located as the The fourth sample image is added to the training set;
  • the training part 35 is configured to train the target detection network according to the label information of the fourth sample image, the second sample image, the third sample image and the fourth sample image in the training set.
  • the training part includes: a sampling quantity determination sub-part, configured to separately determine, according to the category of the target in the positive sample images of the training set, the number of samples sampled from the positive sample images of each category the first quantity, the positive sample images are sample images including the target in the image; the first sampling subsection is configured to sample the positive sample images of each category according to the first quantity sampled in the positive sample images of each category , to obtain a plurality of fifth sample images; the second sampling subsection is configured to sample the negative sample images of the training set to obtain a plurality of sixth sample images, and the negative sample images are images that do not include the target a sample image; a training subsection configured to train the object detection network according to the fifth sample image and the sixth sample image.
  • the feature mining part includes: an information entropy determination sub-section, configured to determine the information entropy of the second target according to the classification probability of the second target; a target selection sub-section, is configured to select a fifth target from the second target according to the category confidence and information entropy of the second target; the mining quantity determination subsection is configured to select a fifth target according to the third sample image in the third sample image
  • the category of the target and the total number of sample images to be mined respectively determine the second quantity of the sample images to be mined for each category;
  • the target and image determination sub-section is configured to be based on the third target in the third sample image.
  • the feature information, the feature information of the fifth target and the second number of sample images to be mined in each category, the fourth target and the first sample image where the fourth target is located are determined from the fifth target.
  • the target selection sub-section is configured to: according to the category confidence and information entropy of the second target, sort the second targets respectively, and select a third number of Six targets and a seventh target with a fourth quantity; the sixth target and the seventh target are combined to obtain the fifth target.
  • the mining quantity determination subsection is configured to: determine the proportion of the third objects of each category according to the category of the third object in the third sample image; The proportion of the three targets determines the sampling proportion of each category; according to the sampling proportion of each category, the second quantity of sample images to be mined in each category is determined respectively.
  • the target and image determination subsection is configured to: determine the third target according to the distance between the feature information of the third target of the first category and the feature information of each fifth target.
  • the third target with the smallest distance from each fifth target is used as the eighth target, and the first category is any one of the categories of the third targets; the distance among the eighth targets is the largest target, identified as the fourth target.
  • the target and image determination subsection is further configured to: add the determined fourth target to the third target of the first category, and add the determined fourth target to the third target of the first category. Four targets were removed from the unlabeled fifth target.
  • the apparatus further includes: a feature extraction part, configured to input the third sample image into the target detection network for processing to obtain a third target in the third sample image characteristic information.
  • the apparatus further includes: a pre-training part configured to pre-train the target detection network by using the labeled third sample image.
  • the first sample image includes a long-tail image.
  • the sampling quantity determination sub-section is further configured to: in the category of the target according to the positive sample images of the training set, respectively determine the number of samples sampled from the positive sample images of each category. Before a certain number, the positive sample images and negative sample images in the training set are sampled to obtain the same or similar number of positive sample images and negative sample images.
  • the total number of sample images to be mined is 5% to 25% of the total number of the first sample images.
  • the target selection subsection is further configured to: remove the same target as the seventh target from the sixth target, and obtain the sixth target and the seventh target The remaining target with different targets; the remaining target and the seventh target are regarded as the fifth target.
  • the method further includes: according to the distance between the feature information of the third target of the first category and the feature information of each fifth target, respectively determining the first category of After the third target with the smallest distance from each fifth target among the third targets is used as the eighth target, after the number of the first sample images where the fourth target is located reaches the sample images of the first category to be mined When the second number of , ends the determination of the eighth target.
  • the target and image determination subsection is further configured to: the distance between the feature information of the third target according to the first category and the feature information of each fifth target, respectively After determining the third target with the smallest distance from each fifth target among the third targets of the first category and using it as the eighth target, the number of the first sample images where the fourth target is located does not reach the number of the first sample images.
  • the determination of the eighth target is ended.
  • the feature extraction part is further configured to: input the third sample image into the target detection network to obtain a feature vector output by the hidden layer of the target detection network;
  • the feature vector is determined as feature information of the third target.
  • a target detection apparatus includes: a detection processing part configured to input an image to be processed into a target detection network for processing, and obtain a target detection result of the to-be-processed image, where The target detection result includes the position and category of the target in the to-be-processed image, and the target detection network is trained according to the above-mentioned network training method.
  • the functions or included parts of the apparatus provided in the embodiments of the present disclosure may be configured to execute the methods described in the above method embodiments, and the specific implementation may refer to the above method embodiments. For brevity, I won't go into details here.
  • a "part” can also be a part of a circuit, a part of a processor, a part of a program or software, etc., of course, it can also be a unit, and it can also be a module or non-modular.
  • Embodiments of the present disclosure further provide a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the foregoing method is implemented.
  • the computer-readable storage medium may be a non-volatile computer-readable storage medium.
  • An embodiment of the present disclosure further provides an electronic device, including: a processor; a memory configured to store instructions executable by the processor; wherein the processor is configured to invoke the instructions stored in the memory to execute the above method.
  • Embodiments of the present disclosure also provide a computer program product, including computer-readable code, when the computer-readable code is run on a device, a processor in the device executes a network training method configured to implement the network training method provided in any of the above embodiments Or directives for object detection methods.
  • Embodiments of the present disclosure also provide another computer program product configured to store computer-readable instructions, which, when executed, cause the computer to perform the operations of the network training method or the target detection method provided by any of the foregoing embodiments.
  • the electronic device may be provided as a terminal, server or other form of device.
  • FIG. 4 shows a block diagram of an electronic device 800 according to an embodiment of the present disclosure.
  • electronic device 800 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, fitness device, personal digital assistant, etc. terminal.
  • the electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814 , and the communication component 816 .
  • the processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations.
  • the processing component 802 can include one or more processors 820 to execute instructions to perform all or some of the steps of the methods described above.
  • processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components.
  • processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
  • Memory 804 is configured to store various types of data to support operation at electronic device 800 . Examples of such data include instructions for any application or method operating on electronic device 800, contact data, phonebook data, messages, pictures, videos, and the like. Memory 804 may be implemented by any type of volatile or nonvolatile storage device or 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 or Optical Disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read only memory
  • EPROM erasable Programmable Read Only Memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Magnetic or Optical Disk Magnetic Disk
  • Power supply assembly 806 provides power to various components of electronic device 800 .
  • Power supply components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800 .
  • Multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user.
  • the touch panel includes one or more touch sensors to sense touch, swipe, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or swipe action, but also detect the duration and pressure associated with the touch or swipe action.
  • the multimedia component 808 includes a front-facing camera and/or a rear-facing camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each of the front and rear cameras can be a fixed optical lens system or have focal length and optical zoom capability.
  • Audio component 810 is configured to output and/or input audio signals.
  • audio component 810 includes a microphone (MIC) that is configured to receive external audio signals when electronic device 800 is in operating modes, such as calling mode, recording mode, and voice recognition mode.
  • the received audio signal may be further stored in memory 804 or transmitted via communication component 816 .
  • audio component 810 also includes a speaker for outputting audio signals.
  • the I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, or the like. These buttons may include, but are not limited to: home button, volume buttons, start button, and lock button.
  • Sensor assembly 814 includes one or more sensors for providing status assessment of various aspects of electronic device 800 .
  • the sensor assembly 814 can detect the on/off state of the electronic device 800, the relative positioning of the components, such as the display and the keypad of the electronic device 800, the sensor assembly 814 can also detect the electronic device 800 or one of the electronic device 800 Changes in the position of components, presence or absence of user contact with the electronic device 800 , orientation or acceleration/deceleration of the electronic device 800 and changes in the temperature of the electronic device 800 .
  • Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact.
  • Sensor assembly 814 may also include a light sensor, such as a complementary metal oxide semiconductor (CMOS) or charge coupled device (CCD) image sensor, for use in imaging applications.
  • CMOS complementary metal oxide semiconductor
  • CCD charge coupled device
  • the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
  • Communication component 816 is configured to facilitate wired or wireless communication between electronic device 800 and other devices.
  • the electronic device 800 may access a wireless network based on a communication standard, such as wireless network (WiFi), second generation mobile communication technology (2G) or third generation mobile communication technology (3G), or a combination thereof.
  • the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication.
  • the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID Radio Frequency Identification
  • IrDA Infrared Data Association
  • UWB Ultra Wide Band
  • Bluetooth Bluetooth
  • electronic device 800 may 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 A programmed gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation is used to perform the above method.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable A programmed gate array
  • controller microcontroller, microprocessor or other electronic component implementation is used to perform the above method.
  • a non-volatile computer-readable storage medium such as a memory 804 comprising computer program instructions executable by the processor 820 of the electronic device 800 to perform the above method is also provided.
  • FIG. 5 shows a block diagram of an electronic device 1900 according to an embodiment of the present disclosure.
  • the electronic device 1900 may be provided as a server.
  • electronic device 1900 includes processing component 1922, which further includes one or more processors, and a memory resource represented by memory 1932 configured to store instructions executable by processing component 1922, such as an application program.
  • An application program stored in memory 1932 may include one or more modules, each corresponding to a set of instructions.
  • the processing component 1922 is configured to execute instructions to perform the above-described methods.
  • the electronic device 1900 may also include a power supply assembly 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input output (I/O) interface 1958 .
  • the electronic device 1900 can operate based on an operating system stored in the memory 1932, such as a Microsoft server operating system (Windows Server TM ), a graphical user interface based operating system (Mac OS X TM ) introduced by Apple, a multi-user multi-process computer operating system (Unix TM ), Free and Open Source Unix-like Operating System (Linux TM ), Open Source Unix-like Operating System (FreeBSD TM ) or the like.
  • Microsoft server operating system Windows Server TM
  • Mac OS X TM graphical user interface based operating system
  • Uniix TM multi-user multi-process computer operating system
  • Free and Open Source Unix-like Operating System Linux TM
  • FreeBSD TM Open Source Unix-like Operating System
  • a non-volatile computer-readable storage medium such as memory 1932 comprising computer program instructions executable by processing component 1922 of electronic device 1900 to perform the above-described method.
  • Embodiments of the present disclosure may be systems, methods and/or computer program products.
  • the computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of the embodiments of the present disclosure.
  • a computer-readable storage medium may be a tangible device that can hold and store instructions for use by the instruction execution device.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • Non-exhaustive list of computer readable storage media include: portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM) or flash memory), static random access memory (SRAM), portable compact disk read only memory (CD-ROM), digital versatile disk (DVD), memory sticks, floppy disks, mechanically coded devices, such as printers with instructions stored thereon Hole cards or raised structures in grooves, and any suitable combination of the above.
  • RAM random access memory
  • ROM read only memory
  • EPROM erasable programmable read only memory
  • flash memory static random access memory
  • SRAM static random access memory
  • CD-ROM compact disk read only memory
  • DVD digital versatile disk
  • memory sticks floppy disks
  • mechanically coded devices such as printers with instructions stored thereon Hole cards or raised structures in grooves, and any suitable combination of the above.
  • Computer-readable storage media are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (eg, light pulses through fiber optic cables), or through electrical wires transmitted electrical signals.
  • the computer readable program instructions described herein may be downloaded to various computing/processing devices from a computer readable storage medium, or to an external computer or external storage device over a network such as the Internet, a local area network, a wide area network, and/or a wireless network.
  • the network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers.
  • a network adapter card or network interface in each computing/processing device receives computer-readable program instructions from a network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
  • Computer program instructions for carrying out operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or instructions in one or more programming languages.
  • Source or object code written in any combination, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as the "C" language or similar programming languages.
  • the computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server implement.
  • the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider through the Internet connect).
  • LAN local area network
  • WAN wide area network
  • custom electronic circuits such as programmable logic circuits, field programmable gate arrays (FPGAs), or programmable logic arrays (PLAs) can be personalized by utilizing state information of computer readable program instructions.
  • Computer readable program instructions are executed to implement various aspects of the present disclosure.
  • These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer or other programmable data processing apparatus to produce a machine that causes the instructions when executed by the processor of the computer or other programmable data processing apparatus , resulting in means for implementing the functions/acts specified in one or more blocks of the flowchart and/or block diagrams.
  • These computer readable program instructions can also be stored in a computer readable storage medium, these instructions cause a computer, programmable data processing apparatus and/or other equipment to operate in a specific manner, so that the computer readable medium on which the instructions are stored includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks of the flowchart and/or block diagrams.
  • Computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other equipment to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other equipment to produce a computer-implemented process , thereby causing instructions executing on a computer, other programmable data processing apparatus, or other device to implement the functions/acts specified in one or more blocks of the flowcharts and/or block diagrams.
  • each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more functions for implementing the specified logical function(s) executable instructions.
  • the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented in dedicated hardware-based systems that perform the specified functions or actions , or can be implemented in a combination of dedicated hardware and computer instructions.
  • the computer program product can be specifically implemented by hardware, software or a combination thereof.
  • the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), etc. Wait.
  • a software development kit Software Development Kit, SDK
  • the embodiments of the present disclosure relate to a network training method and apparatus, a target detection method and apparatus, and an electronic device.
  • the network training method includes: inputting unlabeled sample images into a target detection network for processing to obtain a target detection result, the result including the image area, feature information and classification probability of the target; and determining the category confidence of the target according to the classification probability of the target ; For the first target whose category confidence is greater than or equal to the threshold, the sample image where the first target is located is used as a marked image and is added to the training set; For the second target whose category confidence is less than the first threshold, the second target is characterized For related mining, the fourth target is determined from the second target, and the sample image where it is located is added to the training set; the target detection network is trained according to the sample image in the training set.
  • the embodiments of the present disclosure can improve the training effect of the target detection network.

Abstract

Embodiments of the present disclosure relate to a network training method and apparatus, a target detection method and apparatus, and an electronic device. The network training method comprises: inputting an unannotated sample image into a target detection network to obtain a target detection result, the result comprising an image area, feature information, and classification probability of a target; determining a category confidence of the target according to the classification probability of the target; for a first target having a category confidence greater than or equal to a threshold, using a sample image where the first target is located as an annotated image, and adding the annotated image into a training set; for a second target having a category confidence less than a first threshold, performing feature-related mining on the second target, determining a fourth target, and adding a sample image where the fourth target is located into the training set; and training the target detection network according to the training set.

Description

网络训练方法及装置、目标检测方法及装置和电子设备Network training method and device, target detection method and device, and electronic equipment
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请基于申请号为202010681178.2、申请日为2020年07月15日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。This application is based on the Chinese patent application with the application number of 202010681178.2 and the filing date of July 15, 2020, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is incorporated herein by reference.
技术领域technical field
本公开涉及计算机技术领域,尤其涉及一种网络训练方法及装置、目标检测方法及装置和电子设备。The present disclosure relates to the field of computer technologies, and in particular, to a network training method and device, a target detection method and device, and electronic equipment.
背景技术Background technique
计算机视觉是人工智能技术的重要方向,在计算机视觉处理中,通常需要对图像或视频中的目标(例如行人、物体等)进行检测。大规模长尾数据的目标检测在很多领域有重要应用,例如在城市监控中的异常物体检测,异常行为检测和突发事件报警等。然而,由于长尾数据的数据量巨大,以及严重的正负样本不均衡现象,即大部分数据图片为背景图,仅有小部分图片中含有可检测的目标,导致相关技术的目标检测方式对长尾数据的目标检测效果较差。Computer vision is an important direction of artificial intelligence technology. In computer vision processing, it is usually necessary to detect objects (such as pedestrians, objects, etc.) in images or videos. Target detection of large-scale long-tail data has important applications in many fields, such as abnormal object detection in urban surveillance, abnormal behavior detection and emergency alarm. However, due to the huge amount of long-tail data and the serious imbalance of positive and negative samples, that is, most of the data images are background images, and only a small part of the images contain detectable targets. The object detection effect of long-tailed data is poor.
发明内容SUMMARY OF THE INVENTION
本公开实施例提出了一种网络训练及目标检测技术方案。The embodiments of the present disclosure propose a technical solution for network training and target detection.
根据本公开实施例的一方面,提供了一种网络训练方法,包括:According to an aspect of the embodiments of the present disclosure, a network training method is provided, including:
将未标注的第一样本图像输入目标检测网络中处理,得到所述第一样本图像的目标检测结果,所述目标检测结果包括所述第一样本图像中目标的图像区域、特征信息及分类概率;根据所述目标的分类概率,确定所述目标的类别置信度;针对所述目标中类别置信度大于或等于第一阈值的第一目标,将所述第一目标所在的第一样本图像作为已标注的第二样本图像,并加入训练集中,其中,所述第二样本图像的标注信息包括所述第一目标的图像区域及与所述第一目标的类别置信度对应的类别,所述训练集中包括已标注的第三样本图像;针对所述目标中类别置信度小于所述第一阈值的第二目标,根据所述第三样本图像中的第三目标的特征信息,对所述第二目标进行特征相关挖掘,通过特征相关挖掘,从所述第二目标中确定出第四目标及所述第四目标所在的第一样本图像,并将所述第四目标所在的第一样本图像作为第四样本图像,并加入所述训练集中;根据所述第四样本图像的标注信息,所述训练集中的第二样本图像、第三样本图像及所述第四样本图像,训练所述目标检测网络。Input the unlabeled first sample image into the target detection network for processing, and obtain the target detection result of the first sample image, and the target detection result includes the image area and feature information of the target in the first sample image and classification probability; according to the classification probability of the target, determine the category confidence of the target; for the first target whose category confidence is greater than or equal to the first threshold in the target, the first target where the first target is located The sample image is taken as the marked second sample image and added to the training set, wherein the annotation information of the second sample image includes the image area of the first target and the category confidence corresponding to the first target. category, the training set includes the labeled third sample image; for the second target whose category confidence in the target is less than the first threshold, according to the feature information of the third target in the third sample image, Feature correlation mining is performed on the second target, and through feature correlation mining, a fourth target and a first sample image where the fourth target is located are determined from the second target, and the fourth target is located. The first sample image is taken as the fourth sample image and added to the training set; according to the annotation information of the fourth sample image, the second sample image, the third sample image and the fourth sample image in the training set images to train the object detection network.
在一种可能的实现方式中,所述根据所述第四样本图像的标注信息,所述训练集中的第二样本图像、第三样本图像及所述第四样本图像,训练所述目标检测网络,包括:In a possible implementation manner, the target detection network is trained according to the labeling information of the fourth sample image, the second sample image, the third sample image and the fourth sample image in the training set ,include:
根据所述训练集的正样本图像中目标的类别,分别确定从各个类别的正样本图像中采样的第一数量,所述正样本图像为图像中包括目标的样本图像;根据各个类别的正样本图像中采样的第一数量,对各个类别的正样本图像进行采样,得到多个第五样本图像;对所述训练集的负样本图像进行采样,得到多个第六样本图像,所述负样本图像为图像中不包括目标的样本图像;根据所述第五样本图像及所述第六样本图像,训练所述目标检测网络。According to the category of the target in the positive sample images of the training set, the first number of samples sampled from the positive sample images of each category is determined respectively, and the positive sample images are the sample images including the target in the image; according to the positive samples of each category The first number of samples in the image, sampling positive sample images of each category to obtain a plurality of fifth sample images; sampling the negative sample images of the training set to obtain a plurality of sixth sample images, the negative samples The image is a sample image that does not include a target; the target detection network is trained according to the fifth sample image and the sixth sample image.
在一种可能的实现方式中,所述根据所述第三样本图像中的第三目标的特征信息,对所述第二目标进行特征相关挖掘,通过特征相关挖掘,从所述第二目标中确定出第四目标及所述第四目标所在的第一样本图像,包括:根据所述第二目标的分类概率,确定所述第 二目标的信息熵;根据所述第二目标的类别置信度及信息熵,从所述第二目标中选择出第五目标;根据所述第三样本图像中的第三目标的类别以及待挖掘的样本图像的总数量,分别确定各个类别待挖掘的样本图像的第二数量;根据所述第三样本图像中的第三目标的特征信息,所述第五目标的特征信息以及各个类别待挖掘的样本图像的第二数量,从所述第五目标中确定出第四目标及所述第四目标所在的第一样本图像。In a possible implementation manner, the feature correlation mining is performed on the second target according to the feature information of the third target in the third sample image, and the feature correlation mining is performed from the second target. Determining the fourth target and the first sample image where the fourth target is located includes: determining the information entropy of the second target according to the classification probability of the second target; according to the category confidence of the second target degree and information entropy, select the fifth target from the second target; according to the category of the third target in the third sample image and the total number of sample images to be mined, determine the samples to be mined for each category respectively The second number of images; according to the feature information of the third target in the third sample image, the feature information of the fifth target and the second number of sample images to be mined in each category, from the fifth target A fourth target and a first sample image where the fourth target is located are determined.
在一种可能的实现方式中,根据所述第二目标的类别置信度及信息熵,从所述第二目标中选择出第五目标,包括:根据所述第二目标的类别置信度及信息熵,分别对所述第二目标进行排序,选择出第三数量的第六目标和第四数量的第七目标;对所述第六目标和所述第七目标进行合并,得到所述第五目标。In a possible implementation manner, selecting a fifth target from the second target according to the category confidence and information entropy of the second target includes: according to the category confidence and information of the second target entropy, sort the second targets respectively, select the sixth target with the third quantity and the seventh target with the fourth quantity; combine the sixth target and the seventh target to obtain the fifth target Target.
在一种可能的实现方式中,根据所述第三样本图像中的第三目标的类别以及待挖掘的样本图像的总数量,分别确定各个类别待挖掘的样本图像的第二数量,包括:根据所述第三样本图像中的第三目标的类别,确定各个类别的第三目标的比例;根据各个类别的第三目标的比例,确定各个类别的抽样比重;根据各个类别的抽样比重,分别确定各个类别待挖掘的样本图像的第二数量。In a possible implementation manner, according to the category of the third target in the third sample image and the total number of sample images to be mined, respectively determining the second number of sample images to be mined for each category, including: according to The category of the third target in the third sample image determines the proportion of the third target of each category; according to the proportion of the third target of each category, the sampling proportion of each category is determined; according to the sampling proportion of each category, the proportion of each category is determined respectively The second number of sample images to be mined for each category.
在一种可能的实现方式中,根据所述第三样本图像中的第三目标的特征信息,所述第五目标的特征信息以及各个类别待挖掘的样本图像的第二数量,从所述第五目标中确定出第四目标及所述第四目标所在的第一样本图像,包括:根据第一类别的第三目标的特征信息与各个第五目标的特征信息之间的距离,分别确定所述第一类别的第三目标中与各个第五目标距离最小的第三目标,并作为第八目标,所述第一类别为第三目标的类别中的任意一个;将所述第八目标中距离最大的目标,确定为第四目标。In a possible implementation manner, according to the feature information of the third target in the third sample image, the feature information of the fifth target and the second number of sample images to be mined in each category, from the third sample image Determining the fourth target and the first sample image where the fourth target is located from among the five targets includes: according to the distance between the characteristic information of the third target of the first category and the characteristic information of each fifth target, respectively determining Among the third targets of the first category, the third target with the smallest distance from each fifth target is used as the eighth target, and the first category is any one of the categories of the third targets; the eighth target is The target with the largest middle distance is determined as the fourth target.
在一种可能的实现方式中,根据所述第三样本图像中的第三目标的特征信息,所述第五目标的特征信息以及各个类别待挖掘的样本图像的第二数量,从所述第五目标中确定出第四目标及所述第四目标所在的第一样本图像,还包括:将确定出的第四目标添加到所述第一类别的第三目标中,并将所述确定出的第四目标从未标注的第五目标中移除。In a possible implementation manner, according to the feature information of the third target in the third sample image, the feature information of the fifth target and the second number of sample images to be mined in each category, from the third sample image Determining the fourth target and the first sample image where the fourth target is located among the five targets, further comprising: adding the determined fourth target to the third target of the first category, and adding the determined fourth target to the third target of the first category. The outgoing fourth target is removed from the unlabeled fifth target.
在一种可能的实现方式中,所述方法还包括:将所述第三样本图像输入所述目标检测网络中处理,得到所述第三样本图像中的第三目标的特征信息。In a possible implementation manner, the method further includes: inputting the third sample image into the target detection network for processing to obtain feature information of the third target in the third sample image.
在一种可能的实现方式中,在所述将未标注的第一样本图像输入目标检测网络中处理,得到所述第一样本图像的目标检测结果的步骤之前,所述方法还包括:In a possible implementation manner, before the step of inputting the unlabeled first sample image into the target detection network for processing to obtain the target detection result of the first sample image, the method further includes:
通过已标注的第三样本图像对所述目标检测网络进行预训练。The target detection network is pre-trained by using the labeled third sample image.
在一种可能的实现方式中,所述第一样本图像包括长尾图像。In a possible implementation manner, the first sample image includes a long-tail image.
根据本公开实施例的一方面,提供了一种目标检测方法,该方法包括:将待处理图像输入目标检测网络中处理,得到所述待处理图像的目标检测结果,所述目标检测结果包括所述待处理图像中目标的位置和类别,所述目标检测网络是根据上述的网络训练方法训练得到的。According to an aspect of the embodiments of the present disclosure, a target detection method is provided, the method includes: inputting an image to be processed into a target detection network for processing, and obtaining a target detection result of the to-be-processed image, where the target detection result includes all The position and category of the target in the image to be processed are obtained, and the target detection network is trained according to the above-mentioned network training method.
根据本公开实施例的一方面,提供了一种网络训练装置,包括:According to an aspect of the embodiments of the present disclosure, a network training apparatus is provided, including:
目标检测部分,被配置为将未标注的第一样本图像输入目标检测网络中处理,得到所述第一样本图像的目标检测结果,所述目标检测结果包括所述第一样本图像中目标的图像区域、特征信息及分类概率;The target detection part is configured to input the unlabeled first sample image into the target detection network for processing, and obtain the target detection result of the first sample image, and the target detection result includes the target detection result in the first sample image. The image area, feature information and classification probability of the target;
置信度确定部分,被配置为根据所述目标的分类概率,确定所述目标的类别置信度;a confidence determination part, configured to determine the category confidence of the target according to the classification probability of the target;
标注部分,被配置为针对所述目标中类别置信度大于或等于第一阈值的第一目标,将所述第一目标所在的第一样本图像作为已标注的第二样本图像,并加入训练集中,其中,所述第二样本图像的标注信息包括所述第一目标的图像区域及与所述第一目标的类别置信度对应的类别,所述训练集中包括已标注的第三样本图像;The labeling part is configured to take the first sample image where the first target is located as the labeled second sample image for the first target whose category confidence in the target is greater than or equal to the first threshold, and add training set, wherein the labeling information of the second sample image includes the image area of the first target and the category corresponding to the class confidence of the first target, and the training set includes the labelled third sample image;
特征挖掘部分,被配置为针对所述目标中类别置信度小于所述第一阈值的第二目标,根据所述第三样本图像中的第三目标的特征信息,对所述第二目标进行特征相关挖掘,通 过特征相关挖掘,从所述第二目标中确定出第四目标及所述第四目标所在的第一样本图像,并将所述第四目标所在的第一样本图像作为第四样本图像,并加入所述训练集中;The feature mining part is configured to, for the second target whose category confidence is less than the first threshold in the target, perform feature information on the second target according to the feature information of the third target in the third sample image Relevance mining, through feature correlation mining, the fourth target and the first sample image where the fourth target is located are determined from the second target, and the first sample image where the fourth target is located is used as the first sample image. Four sample images are added to the training set;
训练部分,被配置为根据所述第四样本图像的标注信息,所述训练集中的第二样本图像、第三样本图像及所述第四样本图像,训练所述目标检测网络。The training part is configured to train the target detection network according to the label information of the fourth sample image, the second sample image, the third sample image and the fourth sample image in the training set.
在一种可能的实现方式中,所述训练部分包括:采样数量确定子部分,被配置为根据所述训练集的正样本图像中目标的类别,分别确定从各个类别的正样本图像中采样的第一数量,所述正样本图像为图像中包括目标的样本图像;第一采样子部分,被配置为根据各个类别的正样本图像中采样的第一数量,对各个类别的正样本图像进行采样,得到多个第五样本图像;第二采样子部分,被配置为对所述训练集的负样本图像进行采样,得到多个第六样本图像,所述负样本图像为图像中不包括目标的样本图像;训练子部分,被配置为根据所述第五样本图像及所述第六样本图像,训练所述目标检测网络。In a possible implementation manner, the training part includes: a sampling quantity determination sub-part, configured to separately determine, according to the category of the target in the positive sample images of the training set, the number of samples sampled from the positive sample images of each category the first quantity, the positive sample images are sample images including the target in the image; the first sampling subsection is configured to sample the positive sample images of each category according to the first quantity sampled in the positive sample images of each category , to obtain a plurality of fifth sample images; the second sampling subsection is configured to sample the negative sample images of the training set to obtain a plurality of sixth sample images, and the negative sample images are images that do not include the target a sample image; a training subsection configured to train the object detection network according to the fifth sample image and the sixth sample image.
在一种可能的实现方式中,所述特征挖掘部分包括:信息熵确定子部分,被配置为根据所述第二目标的分类概率,确定所述第二目标的信息熵;目标选择子部分,被配置为根据所述第二目标的类别置信度及信息熵,从所述第二目标中选择出第五目标;挖掘数量确定子部分,被配置为根据所述第三样本图像中的第三目标的类别以及待挖掘的样本图像的总数量,分别确定各个类别待挖掘的样本图像的第二数量;目标及图像确定子部分,被配置为根据所述第三样本图像中的第三目标的特征信息,所述第五目标的特征信息以及各个类别待挖掘的样本图像的第二数量,从所述第五目标中确定出第四目标及所述第四目标所在的第一样本图像。In a possible implementation manner, the feature mining part includes: an information entropy determination sub-section, configured to determine the information entropy of the second target according to the classification probability of the second target; a target selection sub-section, is configured to select a fifth target from the second target according to the category confidence and information entropy of the second target; the mining quantity determination subsection is configured to select a fifth target according to the third sample image in the third sample image The category of the target and the total number of sample images to be mined respectively determine the second quantity of the sample images to be mined for each category; the target and image determination sub-section is configured to be based on the third target in the third sample image. The feature information, the feature information of the fifth target and the second number of sample images to be mined in each category, the fourth target and the first sample image where the fourth target is located are determined from the fifth target.
在一种可能的实现方式中,所述目标选择子部分被配置为:根据所述第二目标的类别置信度及信息熵,分别对所述第二目标进行排序,选择出第三数量的第六目标和第四数量的第七目标;对所述第六目标和所述第七目标进行合并,得到所述第五目标。In a possible implementation manner, the target selection sub-section is configured to: according to the category confidence and information entropy of the second target, sort the second targets respectively, and select a third number of Six targets and a seventh target with a fourth quantity; the sixth target and the seventh target are combined to obtain the fifth target.
在一种可能的实现方式中,所述挖掘数量确定子部分被配置为:根据所述第三样本图像中的第三目标的类别,确定各个类别的第三目标的比例;根据各个类别的第三目标的比例,确定各个类别的抽样比重;根据各个类别的抽样比重,分别确定各个类别待挖掘的样本图像的第二数量。In a possible implementation manner, the mining quantity determination subsection is configured to: determine the proportion of the third objects of each category according to the category of the third object in the third sample image; The proportion of the three targets determines the sampling proportion of each category; according to the sampling proportion of each category, the second quantity of sample images to be mined in each category is determined respectively.
在一种可能的实现方式中,所述目标及图像确定子部分被配置为:根据第一类别的第三目标的特征信息与各个第五目标的特征信息之间的距离,分别确定所述第一类别的第三目标中与各个第五目标距离最小的第三目标,并作为第八目标,所述第一类别为第三目标的类别中的任意一个;将所述第八目标中距离最大的目标,确定为第四目标。In a possible implementation manner, the target and image determination subsection is configured to: determine the third target according to the distance between the feature information of the third target of the first category and the feature information of each fifth target. Among the third targets of a category, the third target with the smallest distance from each fifth target is used as the eighth target, and the first category is any one of the categories of the third targets; the distance among the eighth targets is the largest target, identified as the fourth target.
在一种可能的实现方式中,所述目标及图像确定子部分还被配置为:将确定出的第四目标添加到所述第一类别的第三目标中,并将所述确定出的第四目标从未标注的第五目标中移除。In a possible implementation manner, the target and image determination subsection is further configured to: add the determined fourth target to the third target of the first category, and add the determined fourth target to the third target of the first category. Four targets were removed from the unlabeled fifth target.
在一种可能的实现方式中,所述装置还包括:特征提取部分,被配置为将所述第三样本图像输入所述目标检测网络中处理,得到所述第三样本图像中的第三目标的特征信息。In a possible implementation manner, the apparatus further includes: a feature extraction part, configured to input the third sample image into the target detection network for processing to obtain a third target in the third sample image characteristic information.
在一种可能的实现方式中,在所述目标检测部分之前,所述装置还包括:预训练部分,被配置为通过已标注的第三样本图像对所述目标检测网络进行预训练。In a possible implementation manner, before the target detection part, the apparatus further includes: a pre-training part configured to pre-train the target detection network by using the labeled third sample images.
在一种可能的实现方式中,所述第一样本图像包括长尾图像。In a possible implementation manner, the first sample image includes a long-tail image.
根据本公开实施例的一方面,提供了一种目标检测装置,所述装置包括:检测处理部分,被配置为将待处理图像输入目标检测网络中处理,得到所述待处理图像的目标检测结果,所述目标检测结果包括所述待处理图像中目标的位置和类别,所述目标检测网络是根据上述的网络训练方法训练得到的。According to an aspect of the embodiments of the present disclosure, a target detection apparatus is provided, the apparatus includes: a detection processing part configured to input an image to be processed into a target detection network for processing, and obtain a target detection result of the to-be-processed image , the target detection result includes the position and category of the target in the to-be-processed image, and the target detection network is trained according to the above-mentioned network training method.
在一种可能的实现方式中,在所述根据所述训练集的正样本图像中目标的类别,分别确定从各个类别的正样本图像中采样的第一数量的步骤之前,包括:对训练集中的正样本图像和负样本图像进行采样,得到数量相同或相近的正样本图像和负样本图像。In a possible implementation manner, before the step of respectively determining the first number of samples sampled from the positive sample images of each category according to the category of the target in the positive sample images of the training set, the method includes: The positive sample images and negative sample images are sampled to obtain the same or similar number of positive sample images and negative sample images.
在一种可能的实现方式中,所述待挖掘的样本图像的总数量为所述第一样本图像的总数量的5%~25%。In a possible implementation manner, the total number of sample images to be mined is 5% to 25% of the total number of the first sample images.
在一种可能的实现方式中,所述对所述第六目标和所述第七目标进行合并,得到所述第五目标,包括:去除所述第六目标中与所述第七目标相同的目标,得到所述第六目标中与所述第七目标不同的剩余目标;将所述剩余目标和所述第七目标作为所述第五目标。In a possible implementation manner, the combining the sixth target and the seventh target to obtain the fifth target includes: removing the sixth target that is the same as the seventh target target, obtain the remaining target that is different from the seventh target in the sixth target; take the remaining target and the seventh target as the fifth target.
在一种可能的实现方式中,所述方法还包括:在所述第一类别的所述第四样本图像的数量达到所述第一类别的待挖掘的样本图像的第二数量时,结束对所述第一类别的特征相关挖掘。In a possible implementation manner, the method further includes: when the number of the fourth sample images of the first category reaches a second number of sample images of the first category to be mined, ending the pairing process. Feature correlation mining of the first category.
在一种可能的实现方式中,在所述根据第一类别的第三目标的特征信息与各个第五目标的特征信息之间的距离,分别确定所述第一类别的第三目标中与各个第五目标距离最小的第三目标,并作为第八目标的步骤之后,所述方法还包括:在所述第四目标所在的第一样本图像的数量达到所述第一类别的待挖掘的样本图像的第二数量时,结束对所述第八目标的确定。In a possible implementation manner, according to the distance between the characteristic information of the third target of the first category and the characteristic information of each fifth target, determine the distance between the third target of the first category and each of the fifth targets respectively. After the step of using the third target with the smallest distance from the fifth target as the eighth target, the method further includes: after the number of the first sample images where the fourth target is located reaches the target of the first category to be mined. When the second number of sample images is reached, the determination of the eighth target is ended.
在一种可能的实现方式中,在所述根据第一类别的第三目标的特征信息与各个第五目标的特征信息之间的距离,分别确定所述第一类别的第三目标中与各个第五目标距离最小的第三目标,并作为第八目标的步骤之后,所述方法还包括:在所述第四目标所在的第一样本图像的数量未达到所述第一类别的待挖掘的样本图像的第二数量,且存储所述第五目标的特征信息的集合为空时,结束对所述第八目标的确定。In a possible implementation manner, according to the distance between the characteristic information of the third target of the first category and the characteristic information of each fifth target, determine the distance between the third target of the first category and each of the fifth targets respectively. After the step of using the third target with the smallest distance from the fifth target as the eighth target, the method further includes: when the number of the first sample images where the fourth target is located does not reach the number of the first category to be mined When the second number of sample images is stored, and the set of storing the feature information of the fifth target is empty, the determination of the eighth target is ended.
在一种可能的实现方式中,所述将所述第三样本图像输入所述目标检测网络中处理,得到所述第三样本图像中的第三目标的特征信息,包括:将所述第三样本图像,输入所述目标检测网络中,得到所述目标检测网络的隐藏层输出的特征向量;将所述特征向量确定为所述第三目标的特征信息。In a possible implementation manner, the inputting the third sample image into the target detection network for processing to obtain the feature information of the third target in the third sample image includes: The sample image is input into the target detection network, and the feature vector output by the hidden layer of the target detection network is obtained; the feature vector is determined as the feature information of the third target.
根据本公开实施例的一方面,提供了一种电子设备,包括:处理器;被配置为存储处理器可执行指令的存储器;其中,所述处理器被配置为调用所述存储器存储的指令,以执行上述网络训练方法,或执行上述目标检测方法。According to an aspect of the embodiments of the present disclosure, there is provided an electronic device, comprising: a processor; a memory configured to store instructions executable by the processor; wherein the processor is configured to invoke the instructions stored in the memory, to perform the above-mentioned network training method, or to perform the above-mentioned target detection method.
根据本公开实施例的一方面,提供了一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现网络训练方法,或实现上述目标检测方法。According to an aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, implement the network training method, or implement the above-mentioned target detection method.
根据本公开的实施例,能够通过目标检测网络获取未标注样本图像的目标检测结果;根据目标检测结果分别进行伪标注和特征相关挖掘,标注并收集高价值的样本图像,加入训练集;根据扩充后的训练集训练目标检测网络,从而扩充训练集中的正样本数据数量,缓解正负样本之间的不均衡问题,提高了目标检测网络的训练效果。According to the embodiments of the present disclosure, the target detection results of unlabeled sample images can be obtained through the target detection network; pseudo-labeling and feature correlation mining are respectively performed according to the target detection results, high-value sample images are marked and collected, and added to the training set; The latter training set trains the target detection network, thereby expanding the number of positive sample data in the training set, alleviating the imbalance between positive and negative samples, and improving the training effect of the target detection network.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开实施例。根据下面参考附图对示例性实施例的详细说明,本公开实施例的其它特征及方面将变得清楚。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not limiting of the disclosed embodiments. Other features and aspects of embodiments of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the accompanying drawings.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开实施例的技术方案。The accompanying drawings, which are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description, serve to explain the technical solutions of the embodiments of the present disclosure.
图1示出根据本公开实施例的网络训练方法的流程图。FIG. 1 shows a flowchart of a network training method according to an embodiment of the present disclosure.
图2示出根据本公开实施例的网络训练方法的处理过程的示意图。FIG. 2 shows a schematic diagram of a processing procedure of a network training method according to an embodiment of the present disclosure.
图3示出根据本公开实施例的网络训练装置的框图。FIG. 3 shows a block diagram of a network training apparatus according to an embodiment of the present disclosure.
图4示出根据本公开实施例的一种电子设备的框图。FIG. 4 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
图5示出根据本公开实施例的一种电子设备的框图。FIG. 5 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
具体实施方式detailed description
以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numbers in the figures denote elements that have the same or similar functions. While various aspects of the embodiments are shown in the drawings, the drawings are not necessarily drawn to scale unless otherwise indicated.
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration." Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。The term "and/or" in this article is only an association relationship to describe the associated objects, indicating that there can be three kinds of relationships, for example, A and/or B, it can mean that A exists alone, A and B exist at the same time, and A and B exist independently B these three cases. In addition, the term "at least one" herein refers to any combination of any one of the plurality or at least two of the plurality, for example, including at least one of A, B, and C, and may mean including from A, B, and C. Any one or more elements selected from the set of B and C.
另外,为了更好地说明本公开实施例,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本公开实施例同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本公开实施例的主旨。In addition, in order to better illustrate the embodiments of the present disclosure, numerous specific details are given in the following detailed description. It should be understood by those skilled in the art that the embodiments of the present disclosure may be practiced without certain specific details. In some instances, methods, means, components and circuits well known to those skilled in the art have not been described in detail so as not to obscure the subject matter of the embodiments of the present disclosure.
图1示出根据本公开实施例的网络训练方法的流程图,如图1所示,所述网络训练方法包括:FIG. 1 shows a flowchart of a network training method according to an embodiment of the present disclosure. As shown in FIG. 1 , the network training method includes:
在步骤S11中,将未标注的第一样本图像输入目标检测网络中处理,得到所述第一样本图像的目标检测结果,所述目标检测结果包括所述第一样本图像中目标的图像区域、特征信息及分类概率;In step S11, the unlabeled first sample image is input into a target detection network for processing to obtain a target detection result of the first sample image, where the target detection result includes the target detection result of the target in the first sample image Image area, feature information and classification probability;
在步骤S12中,根据所述目标的分类概率,确定所述目标的类别置信度;In step S12, the category confidence of the target is determined according to the classification probability of the target;
在步骤S13中,针对所述目标中类别置信度大于或等于第一阈值的第一目标,将所述第一目标所在的第一样本图像作为已标注的第二样本图像,并加入训练集中,其中,所述第二样本图像的标注信息包括所述第一目标的图像区域及与所述第一目标的类别置信度对应的类别,所述训练集中包括已标注的第三样本图像;In step S13, for the first target whose category confidence is greater than or equal to the first threshold in the target, the first sample image where the first target is located is taken as the marked second sample image, and added to the training set , wherein the labeling information of the second sample image includes the image area of the first target and the category corresponding to the class confidence of the first target, and the training set includes the labelled third sample image;
在步骤S14中,针对所述目标中类别置信度小于所述第一阈值的第二目标,根据所述第三样本图像中的第三目标的特征信息,对所述第二目标进行特征相关挖掘,通过特征相关挖掘,从所述第二目标中确定出第四目标及所述第四目标所在的第一样本图像,并将所述第四目标所在的第一样本图像作为第四样本图像,并加入所述训练集中;In step S14, for the second target whose category confidence is less than the first threshold in the target, perform feature correlation mining on the second target according to the feature information of the third target in the third sample image , through feature correlation mining, determine the fourth target and the first sample image where the fourth target is located from the second target, and use the first sample image where the fourth target is located as the fourth sample image, and add it to the training set;
在步骤S15中,根据所述第四样本图像的标注信息,所述训练集中的第二样本图像、第三样本图像及所述第四样本图像,训练所述目标检测网络。In step S15, the target detection network is trained according to the label information of the fourth sample image, the second sample image, the third sample image and the fourth sample image in the training set.
在一种可能的实现方式中,所述方法可以由终端设备或服务器等电子设备执行,终端设备可以为用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字处理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等,所述方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。或者,可通过服务器执行所述方法。In a possible implementation manner, the method may be executed by an electronic device such as a terminal device or a server, and the terminal device may be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, For personal digital processing (Personal Digital Assistant, PDA), handheld devices, computing devices, vehicle-mounted devices, wearable devices, etc., the method can be implemented by the processor calling the computer-readable instructions stored in the memory. Alternatively, the method may be performed by a server.
举例来说,第一样本图像可以是通过图像采集设备(例如摄像头)采集的图像。第一样本图像可包括大规模的长尾(Long-tailed)图像,也即大部分图像为背景图像,小部分图像中包括可检测的目标。可检测的目标可例如包括人体、人脸、车辆、物体等。例如在安防领域中,可通过摄像头采集某一地理区域的图像,可能仅有小部分时间有人经过该地理区域,从而采集到的图像大部分为背景图像,仅小部分图像中包括人脸和/或人体。在该情况下,采集到的多个图像即可组成长尾数据集。本公开实施例对第一样本图像的获取方式及第一样本图像中目标的类别不作限制。For example, the first sample image may be an image acquired by an image acquisition device (eg, a camera). The first sample image may include a large-scale long-tailed image, that is, most of the images are background images, and a small part of the images include detectable objects. Detectable targets may include, for example, human bodies, faces, vehicles, objects, and the like. For example, in the field of security and protection, images of a certain geographical area can be collected by cameras, and people may pass through the geographical area only a small part of the time, so most of the collected images are background images, and only a small part of the images include human faces and/or faces. or human body. In this case, the collected images can form a long-tailed dataset. The embodiment of the present disclosure does not limit the acquisition method of the first sample image and the category of the target in the first sample image.
在一种可能的实现方式中,可预先设置有目标检测网络,用于检测图像中目标的位置(也即检测框)和类别。该目标检测网络可例如为卷积神经网络,本公开实施例对目标检 测网络的网络结构不作限制。In a possible implementation manner, a target detection network may be preset to detect the position (ie, detection frame) and category of the target in the image. The target detection network may be, for example, a convolutional neural network, and the embodiment of the present disclosure does not limit the network structure of the target detection network.
在一种可能的实现方式中,在步骤S11之前,该方法还包括:通过已标注的第三样本图像对所述目标检测网络进行预训练。也就是说,可预设有训练集,该训练集中包括已标注的第三样本图像,第三样本图像的标注信息可包括图像中目标的检测框和类别。根据该训练集,可采用相关技术中的方式对目标检测网络进行预训练,以使该目标检测网络具有一定的检测精度。In a possible implementation manner, before step S11, the method further includes: pre-training the target detection network by using the labeled third sample image. That is to say, a training set may be preset, and the training set includes the labeled third sample images, and the labeling information of the third sample images may include the detection frame and category of the target in the image. According to the training set, the target detection network can be pre-trained by the method in the related art, so that the target detection network has a certain detection accuracy.
然而,预训练后的目标检测网络对大规模长尾图像的检测效果较差,因此,可通过主动学习的方式,采用未标注的第一样本图像进一步训练目标检测网络。However, the pre-trained object detection network has poor detection effect on large-scale long-tail images. Therefore, the unlabeled first sample image can be used to further train the object detection network through active learning.
在一种可能的实现方式中,在步骤S11中,可将未标注的第一样本图像输入目标检测网络中处理,得到第一样本图像的目标检测结果。该目标检测结果可包括第一样本图像中目标的图像区域、特征信息及分类概率。目标所在的图像区域可为图像中的检测框;目标的特征信息可例如为目标检测网络的隐藏层(例如卷积层)输出的特征向量;目标的分类概率可表示该目标属于各个类别的分类后验概率。In a possible implementation manner, in step S11, the unlabeled first sample image may be input into the target detection network for processing to obtain the target detection result of the first sample image. The target detection result may include the image area, feature information and classification probability of the target in the first sample image. The image area where the target is located can be the detection frame in the image; the feature information of the target can be, for example, the feature vector output by the hidden layer (such as the convolution layer) of the target detection network; the classification probability of the target can represent the classification of the target belonging to each category Posterior probability.
在一种可能的实现方式中,第一样本图像中的目标也可称为实例,每个第一样本图像中可能检测出一个或多个目标。在实际处理中,检测到的目标的数量量级可能是图像数量量级的几倍到几十倍。In a possible implementation manner, the target in the first sample image may also be referred to as an instance, and one or more targets may be detected in each first sample image. In practical processing, the order of magnitude of detected objects may be several to dozens of times the order of magnitude of images.
在一种可能的实现方式中,在步骤S12中,根据目标的分类概率,可求取分类概率的最大值,确定为该目标的类别置信度。In a possible implementation manner, in step S12, according to the classification probability of the target, the maximum value of the classification probability may be obtained and determined as the classification confidence level of the target.
在一种可能的实现方式中,在步骤S13中,针对类别置信度大于或等于第一阈值的目标(可称为第一目标),可将该第一目标所在的第一样本图像作为已标注的样本图像(可称为第二样本图像),并加入训练集中。将第一目标的图像区域作为标注的图像区域,将与该第一目标的类别置信度对应的类别作为该第一目标的标注类别。同一个第二样本图像可能被该第二样本图像中的多个第一目标标注多次。其中,第一阈值例如为0.99,本公开实施例对第一阈值的取值不作限制。In a possible implementation manner, in step S13, for a target whose category confidence is greater than or equal to the first threshold (which may be referred to as a first target), the first sample image where the first target is located may be used as a Annotated sample images (may be referred to as second sample images) are added to the training set. The image area of the first target is taken as the marked image area, and the category corresponding to the category confidence of the first target is taken as the marked category of the first target. The same second sample image may be labeled multiple times by multiple first objects in the second sample image. The first threshold is, for example, 0.99, and the embodiment of the present disclosure does not limit the value of the first threshold.
在一种可能的实现方式中,步骤S13的处理过程可称为伪标注(pseudo-labeling)。也即,将置信度较高的目标所在的图像作为高价值的样本,将目标检测推理结果直接作为目标的标注结果。通过这种方式,可以扩充训练集中正样本数据的数量,以解决正样本收集困难的问题。In a possible implementation manner, the process of step S13 may be called pseudo-labeling. That is, the image where the target with higher confidence is located is regarded as a high-value sample, and the target detection inference result is directly used as the target annotation result. In this way, the number of positive sample data in the training set can be expanded to solve the problem of difficult collection of positive samples.
在一种可能的实现方式中,在步骤S14中,针对类别置信度小于第一阈值的目标(可称为第二目标),可根据训练集中已标注的第三样本图像中目标(可称为第三目标)的特征信息,对第二目标进行特征相关挖掘,从第二目标中挖掘出满足要求的目标(可称为第四目标)。例如,可计算第三目标的特征信息与第二目标的特征信息之间的距离或相关度,根据距离或相关度选择出预设数量的目标,并将选择出的预设数量的目标作为第四目标。In a possible implementation manner, in step S14, for the target whose category confidence is less than the first threshold (which may be referred to as the second target), the target in the third sample image that has been marked in the training set (which may be referred to as The feature information of the third target), the feature correlation mining is performed on the second target, and the target that meets the requirements (may be referred to as the fourth target) is mined from the second target. For example, the distance or correlation between the feature information of the third target and the feature information of the second target can be calculated, a preset number of targets can be selected according to the distance or the correlation, and the selected preset number of targets can be used as the first target. Four goals.
在一种可能的实现方式中,可将挖掘到的第四目标所在的第一样本图像作为第四样本图像,并加入所述训练集中,从而完成特征相关挖掘的处理过程。通过这种方式,能够进一步扩充训练集中样本数据的数量。In a possible implementation manner, the first sample image where the mined fourth target is located may be taken as the fourth sample image and added to the training set, so as to complete the processing process of feature correlation mining. In this way, the number of sample data in the training set can be further expanded.
在一种可能的实现方式中,可通过人工标注的方式获取第四样本图像的标注信息,例如人工确定第四样本图像中目标的检测框和类别。本公开实施例对此不作限制。In a possible implementation manner, the annotation information of the fourth sample image may be obtained by manual annotation, for example, manually determining the detection frame and category of the target in the fourth sample image. This embodiment of the present disclosure does not limit this.
在一种可能的实现方式中,在步骤S15中,在得到第四样本图像的标注信息后,可根据训练集中的第二样本图像、第三样本图像及第四样本图像,训练目标检测网络。In a possible implementation manner, in step S15, after obtaining the label information of the fourth sample image, the target detection network can be trained according to the second sample image, the third sample image and the fourth sample image in the training set.
根据本公开的实施例,能够通过目标检测网络获取未标注样本图像的目标检测结果;根据目标检测结果分别进行伪标注和特征相关挖掘,标注并收集高价值的样本图像,加入训练集;根据扩充后的训练集训练目标检测网络,从而扩充训练集中的正样本数据数量,缓解正负样本之间的不均衡问题,提高了目标检测网络的训练效果。According to the embodiments of the present disclosure, the target detection results of unlabeled sample images can be obtained through the target detection network; pseudo-labeling and feature correlation mining are respectively performed according to the target detection results, high-value sample images are marked and collected, and added to the training set; The latter training set trains the target detection network, thereby expanding the number of positive sample data in the training set, alleviating the imbalance between positive and negative samples, and improving the training effect of the target detection network.
在一种可能的实现方式中,经过步骤S11处理,得到各个第一样本图像的目标检测结 果;经过S12处理,得到各个第一样本图像中目标的类别置信度。在步骤S13中,可将类别置信度大于或等于第一阈值的第一目标所在的样本图像加入训练集,通过伪标注方式得到已标注的第二样本图像;在步骤S14中,可对类别置信度小于第一阈值的第二目标进行挖掘。In a possible implementation manner, through the processing of step S11, the target detection result of each first sample image is obtained; through the processing of S12, the class confidence of the target in each of the first sample images is obtained. In step S13, the sample image of the first target whose class confidence is greater than or equal to the first threshold can be added to the training set, and the labeled second sample image can be obtained by pseudo-labeling; in step S14, the class confidence can be Mining is performed on second targets whose degree is less than the first threshold.
在一种可能的实现方式中,步骤S14可包括:In a possible implementation manner, step S14 may include:
根据所述第二目标的分类概率,确定所述第二目标的信息熵;According to the classification probability of the second target, determine the information entropy of the second target;
根据所述第二目标的类别置信度及信息熵,从所述第二目标中选择出第五目标;selecting a fifth target from the second target according to the category confidence and information entropy of the second target;
根据所述第三样本图像中的第三目标的类别以及待挖掘的样本图像的总数量,分别确定各个类别待挖掘的样本图像的第二数量;According to the category of the third target in the third sample image and the total number of sample images to be mined, respectively determine the second number of sample images to be mined in each category;
根据所述第三样本图像中的第三目标的特征信息,所述第五目标的特征信息以及各个类别待挖掘的样本图像的第二数量,从所述第五目标中确定出第四目标及所述第四目标所在的第一样本图像。According to the feature information of the third target in the third sample image, the feature information of the fifth target and the second number of sample images to be mined in each category, the fourth target and the The first sample image where the fourth target is located.
举例来说,根据第二目标的分类概率,可计算得到第二目标的信息熵,用于表示第二目标的不确定程度,也即,第二目标的信息熵越大,则第二目标的不确定程度越大;反之,第二目标的信息熵越小,则第二目标的不确定程度越小。本公开实施例对信息熵的计算方式不作限制。For example, according to the classification probability of the second target, the information entropy of the second target can be calculated to indicate the degree of uncertainty of the second target, that is, the greater the information entropy of the second target, the higher the information entropy of the second target The greater the degree of uncertainty; on the contrary, the smaller the information entropy of the second target, the smaller the degree of uncertainty of the second target. The embodiment of the present disclosure does not limit the calculation method of the information entropy.
在一种可能的实现方式中,根据第二目标的类别置信度及信息熵,可分别从多个第二目标中选择出满足一定条件的目标(可称为第五目标),例如选择出类别置信度较大的目标、信息熵较大的目标等。In a possible implementation manner, according to the category confidence and information entropy of the second target, a target (which may be referred to as a fifth target) that satisfies a certain condition may be selected from a plurality of second targets, for example, a category may be selected. Targets with higher confidence, targets with higher information entropy, etc.
在一种可能的实现方式中,根据所述第二目标的类别置信度及信息熵,从所述第二目标中选择出第五目标的步骤,可包括:In a possible implementation manner, the step of selecting a fifth target from the second target according to the category confidence and information entropy of the second target may include:
根据所述第二目标的类别置信度及信息熵,分别对所述第二目标进行排序,选择出第三数量的第六目标和第四数量的第七目标;According to the category confidence and information entropy of the second target, the second targets are sorted respectively, and a third number of sixth targets and a fourth number of seventh targets are selected;
对所述第六目标和所述第七目标进行合并,得到所述第五目标。The sixth target and the seventh target are combined to obtain the fifth target.
也就是说,根据第二目标的类别置信度,对多个第二目标进行排序;根据排序结果,从多个第二目标中选择出预设的第三数量的目标(可称为第六目标)。类似地,根据第二目标的信息熵,对多个第二目标进行排序;根据排序结果,从多个第二目标中选择出预设的第四数量的目标(可称为第七目标)。其中,第三数量和第四数量可分别为3K,K表示待挖掘的样本图像的数量,K例如取值为10000。在实际处理中,K的取值可能为未标注的第一样本图像的总数量的5%~25%。本公开实施例对K的取值,以及第三数量和第四数量与K之间的数量关系均不作限制。That is, according to the category confidence of the second targets, sort the plurality of second targets; according to the sorting result, select a preset third number of targets (which may be referred to as sixth targets) from the plurality of second targets ). Similarly, according to the information entropy of the second targets, the plurality of second targets are sorted; according to the sorting result, a preset fourth number of targets (which may be referred to as seventh targets) are selected from the plurality of second targets. Wherein, the third number and the fourth number may be 3K respectively, K represents the number of sample images to be mined, and K is, for example, 10000. In actual processing, the value of K may be 5% to 25% of the total number of unlabeled first sample images. The embodiments of the present disclosure do not limit the value of K and the quantitative relationship between the third quantity and the fourth quantity and K.
应当理解,本领域技术人员可根据实际情况设置待挖掘的样本图像的数量K、第三数量及第四数量的取值,且第三数量和第四数量可以不同,本公开实施例对此不作限制。It should be understood that those skilled in the art can set the values of the number K, the third number and the fourth number of sample images to be excavated according to the actual situation, and the third number and the fourth number may be different, which is not made in this embodiment of the present disclosure. limit.
在一种可能的实现方式中,可将选取的第六目标和第七目标合并,将合并后的多个目标作为第五目标,以便去除其中可能存在的重复目标。在实际处理中,可得到大约6K个第五目标。In a possible implementation manner, the selected sixth target and the seventh target may be combined, and the combined multiple targets may be used as the fifth target, so as to remove possible duplicate targets therein. In actual processing, about 6K fifth objects are available.
上述的处理方式可称为自举法(bootstrapping),通过这种方式,可从第二目标中同时选取一定数量的、可能性较高的正样本和负样本,以便后续进行特征相关挖掘,从而降低特征相关挖掘的计算量,提高处理效率。The above processing method can be called bootstrapping. In this way, a certain number of positive samples and negative samples with high probability can be selected from the second target at the same time, so as to carry out feature correlation mining in the future. Reduce the calculation amount of feature correlation mining and improve processing efficiency.
在一种可能的实现方式中,根据所述第三样本图像中的第三目标的类别以及待挖掘的样本图像的总数量,分别确定各个类别待挖掘的样本图像的第二数量的步骤,可包括:In a possible implementation manner, according to the category of the third target in the third sample image and the total number of sample images to be mined, the step of respectively determining the second number of sample images to be mined in each category may be: include:
根据所述第三样本图像中的第三目标的类别,确定各个类别的第三目标的比例;According to the category of the third object in the third sample image, determine the proportion of the third object of each category;
根据各个类别的第三目标的比例,确定各个类别的抽样比重;According to the proportion of the third target of each category, determine the sampling proportion of each category;
根据各个类别的抽样比重,分别确定各个类别待挖掘的样本图像的第二数量。According to the sampling proportion of each category, the second quantity of sample images to be mined in each category is determined respectively.
举例来说,根据训练集中已有标注的第三样本图像中的第三目标的类别, 可确定各个类别的第三目标的比例f c;根据该比例f c,可通过如下公式计算出各个类别的抽样比重
Figure PCTCN2020125972-appb-000001
For example, according to the category of the third object in the third sample image that has been marked in the training set, the proportion f c of the third object in each category can be determined; according to the proportion f c , each category can be calculated by the following formula sampling weight of
Figure PCTCN2020125972-appb-000001
r c=max(f c,t·exp(f c/t-1))      (1) r c =max(f c ,t·exp(f c /t-1)) (1)
Figure PCTCN2020125972-appb-000002
Figure PCTCN2020125972-appb-000002
在公式(1)和(2)中,r c表示类别c的抽样值;t为超参数,取值例如为0.1;C表示类别数量;r i表示C个类别中第i个类别的抽样值。 In the formula (1) and (2), c represents R & lt class c sample values; t is the hyper-parameters, for example, a value of 0.1; C denotes the number of categories; R & lt classes C i represents the i-th sample value of the categories .
通过公式(1)和(2)的处理,可提高比例较小的类别所对应的抽样比重,并降低比例较大的类别所对应的抽样比重,从而缓解不同类别的样本之间的数量不平衡的问题,以便提高网络的训练效果。Through the processing of formulas (1) and (2), the sampling proportion corresponding to the category with a smaller proportion can be increased, and the sampling proportion corresponding to the category with a larger proportion can be reduced, thereby alleviating the quantity imbalance between samples of different categories in order to improve the training effect of the network.
在一种可能的实现方式中,根据各个类别的抽样比重
Figure PCTCN2020125972-appb-000003
以及待挖掘的样本图像的总数量(K个),可确定出各个类别待挖掘的样本图像的第二数量。进而可根据第二数量进行特征相关挖掘。
In one possible implementation, according to the sampling weight of each category
Figure PCTCN2020125972-appb-000003
and the total number (K) of sample images to be mined, the second number of sample images to be mined for each category can be determined. Further, feature correlation mining may be performed according to the second quantity.
在一种可能的实现方式中,所述方法还包括:将所述第三样本图像输入所述目标检测网络中处理,得到所述第三样本图像中的第三目标的特征信息。In a possible implementation manner, the method further includes: inputting the third sample image into the target detection network for processing to obtain feature information of the third target in the third sample image.
也就是说,可将训练集中已标注的第三样本图像,输入到目标检测网络中,由目标检测网络的隐藏层(例如卷积层)输出该第三样本图像的特征信息,例如特征向量。通过这种方式,可得到第三样本图像的特征,以便于后续的特征相关挖掘。That is, the labeled third sample image in the training set can be input into the target detection network, and the feature information of the third sample image, such as a feature vector, is output from the hidden layer (eg, convolution layer) of the target detection network. In this way, the features of the third sample image can be obtained to facilitate subsequent feature correlation mining.
在一种可能的实现方式中,根据所述第三样本图像中的第三目标的特征信息,所述第五目标的特征信息以及各个类别待挖掘的样本图像的第二数量,从所述第五目标中确定出第四目标及所述第四目标所在的第一样本图像,包括:In a possible implementation manner, according to the feature information of the third target in the third sample image, the feature information of the fifth target and the second number of sample images to be mined in each category, from the third sample image Among the five targets, the fourth target and the first sample image where the fourth target is located are determined, including:
根据第一类别的第三目标的特征信息与各个第五目标的特征信息之间的距离,分别确定所述第一类别的第三目标中与各个第五目标距离最小的第三目标,并作为第八目标,所述第一类别为第三目标的类别中的任意一个;According to the distance between the feature information of the third target of the first category and the feature information of each fifth target, determine the third target with the smallest distance from each fifth target among the third targets of the first category, and use it as The eighth target, the first category is any one of the categories of the third target;
将所述第八目标中距离最大的目标,确定为第四目标。The target with the largest distance among the eighth targets is determined as the fourth target.
举例来说,在确定各个类别待挖掘的样本图像的第二数量后,可采用k中心(k-center)方式,从第五目标所在的样本图像中挖掘对应数量的样本图像。针对第三目标的多个类别中的任一类别(可称为第一类别),可计算该第一类别的第三目标的特征信息与各个第五目标的特征信息之间的距离,该距离可例如为欧氏距离。对于任意一个第五目标,可确定第一类别中的第三目标中与该第五目标距离最小的第三目标,从而可分别确定与各个第五目标距离最小的第三目标,可称为第八目标。For example, after the second number of sample images to be mined in each category is determined, a k-center method may be used to mine a corresponding number of sample images from the sample images where the fifth target is located. For any one of the multiple categories of the third target (which may be referred to as the first category), the distance between the feature information of the third target of the first category and the feature information of each fifth target may be calculated, the distance It can be, for example, the Euclidean distance. For any fifth target, the third target with the smallest distance from the fifth target among the third targets in the first category can be determined, so that the third target with the smallest distance from each fifth target can be determined, which can be called the first target. Eight goals.
在一种可能的实现方式中,可从各个第八目标中,选择出距离最大的一个目标,确定为本次的特征相关挖掘得到的第四目标。如下公式所示:In a possible implementation manner, one target with the largest distance may be selected from each of the eighth targets, and determined as the fourth target obtained by this feature correlation mining. As shown in the following formula:
Figure PCTCN2020125972-appb-000004
Figure PCTCN2020125972-appb-000004
在公式(3)中,u表示特征相关挖掘得到的第四目标;dist(f j,g l)表示第j个第五目标的特征信息f j与第一类别c的第l个第三目标的特征信息g l之间的距离;
Figure PCTCN2020125972-appb-000005
表示第五目标的特征信息的集合;
Figure PCTCN2020125972-appb-000006
表示第一类别c的第三目标的特征信息的集合。
In formula (3), u represents the fourth target obtained by feature correlation mining; dist(f j , g l ) represents the feature information f j of the jth fifth target and the lth third target of the first category c the distance between the feature information g L;
Figure PCTCN2020125972-appb-000005
A set of feature information representing the fifth target;
Figure PCTCN2020125972-appb-000006
A set of feature information representing the third object of the first category c.
在一种可能的实现方式中,可确定该第四目标所在的第一样本图像,并将该样本图像加入训练集中,作为第四样本图像,从而完成本次的特征相关挖掘过程。In a possible implementation manner, the first sample image where the fourth target is located can be determined, and the sample image is added to the training set as the fourth sample image, thereby completing the feature correlation mining process this time.
在一种可能的实现方式中,根据所述第三样本图像中的第三目标的特征信息,所述第五目标的特征信息以及各个类别待挖掘的样本图像的第二数量,从所述第五目标中确定出第四目标及所述第四目标所在的第一样本图像的步骤,还包括:In a possible implementation manner, according to the feature information of the third target in the third sample image, the feature information of the fifth target and the second number of sample images to be mined in each category, from the third sample image The step of determining the fourth target and the first sample image where the fourth target is located among the five targets further includes:
将确定出的第四目标添加到所述第一类别的第三目标中,并将所述确定出的第四目标从未标注的第五目标中移除。The determined fourth object is added to the third object of the first category, and the determined fourth object is removed from the unlabeled fifth object.
也就是说,将该次特征相关挖掘得到的第四目标作为已标注目标,并将该第四目标从未标注目标中移除。在该情况下,可将该第四目标的特征信息加入到第一类别c的第三目标的特征信息的集合
Figure PCTCN2020125972-appb-000007
中,从第五目标的特征信息的集合
Figure PCTCN2020125972-appb-000008
中移除。这样,在下次的特征相关挖掘中,可以通过公式(3)对更新后的两个集合进行挖掘,重复上述过程。
That is to say, the fourth target obtained by this feature correlation mining is regarded as the labeled target, and the fourth target is removed from the unlabeled target. In this case, the feature information of the fourth object may be added to the set of feature information of the third object of the first category c
Figure PCTCN2020125972-appb-000007
, the set of feature information from the fifth target
Figure PCTCN2020125972-appb-000008
removed in. In this way, in the next feature correlation mining, the two updated sets can be mined by formula (3), and the above process can be repeated.
在一种可能的实现方式中,在第一类别的第四样本图像的数量达到第一类别的第二数量,或未达到第二数量且第五目标耗尽(集合
Figure PCTCN2020125972-appb-000009
为空)时,可完成该第一类别的特征相关挖掘。
In a possible implementation, the number of the fourth sample images of the first category reaches the second number of the first category, or the second number is not reached and the fifth target is exhausted (the set
Figure PCTCN2020125972-appb-000009
When it is empty), the feature correlation mining of the first category can be completed.
通过这种方式,可分别对各个类别进行特征相关挖掘,最终得到足够数量的第四样本图像(通常为K个样本图像),从而进一步扩充训练集中的样本图像的数量,并缓解正负样本之间的不均衡。In this way, feature correlation mining can be performed on each category separately, and finally a sufficient number of fourth sample images (usually K sample images) can be obtained, so as to further expand the number of sample images in the training set and alleviate the difference between positive and negative samples. imbalance between.
在一种可能的实现方式中,可对挖掘到的第四样本图像进行人工标注(human annotation),得到第四样本图像的标注信息。由于第四样本图像中可能同时存在正样本图像(也即图像中包括目标的第四样本图像)和负样本图像(也即图像中不包括目标的第四样本图像),因此,第四样本图像的标注信息可包括图像是正样本图像或负样本图像的样本类别信息,正样本图像中目标所在的图像框及目标的类别。In a possible implementation manner, human annotation (human annotation) may be performed on the mined fourth sample image to obtain annotation information of the fourth sample image. Since there may be both a positive sample image (that is, the fourth sample image including the target in the image) and a negative sample image (that is, the fourth sample image that does not include the target) in the fourth sample image, the fourth sample image The annotation information can include the sample category information of whether the image is a positive sample image or a negative sample image, the image frame where the object is located in the positive sample image, and the category of the object.
在一种可能的实现方式中,在完成人工标注后,可在步骤S15中根据所述第四样本图像的标注信息,所述训练集中的第二样本图像、第三样本图像及第四样本图像,训练目标检测网络。In a possible implementation manner, after the manual annotation is completed, the second sample image, the third sample image and the fourth sample image in the training set may be selected according to the annotation information of the fourth sample image in step S15. , train the target detection network.
其中,步骤S15可包括:根据所述训练集的正样本图像中目标的类别,分别确定从各个类别的正样本图像中采样的第一数量,所述正样本图像为图像中包括目标的样本图像;Wherein, step S15 may include: according to the categories of the targets in the positive sample images of the training set, respectively determining the first number of samples sampled from the positive sample images of each category, the positive sample images being the sample images including the target in the image ;
根据各个类别的正样本图像中采样的第一数量,对各个类别的正样本图像进行采样,得到多个第五样本图像;Sampling the positive sample images of each category according to the first quantity sampled in the positive sample images of each category to obtain a plurality of fifth sample images;
对所述训练集的负样本图像进行采样,得到多个第六样本图像,所述负样本图像为图像中不包括目标的样本图像;Sampling the negative sample images of the training set to obtain a plurality of sixth sample images, where the negative sample images are sample images that do not include the target in the image;
根据所述第五样本图像及所述第六样本图像,训练所述目标检测网络。The object detection network is trained according to the fifth sample image and the sixth sample image.
举例来说,可通过重采样(resampling)的方式来训练目标检测网络,通过重采样来增加数据中出现频次较低的数据的采样频率,来改善网络对于这些数据的性能,进一步改善正负样本之间的不均衡。For example, the target detection network can be trained by resampling, and the sampling frequency of data with low frequency in the data can be increased by resampling to improve the performance of the network for these data, and further improve the positive and negative samples. imbalance between.
在一种可能的实现方式中,可分别对训练集(包括第二样本图像、第三样本图像及第四样本图像)中的正样本图像和负样本图像进行采样,以使采样后正样本图像和负样本图像的数量相同或相近。In a possible implementation manner, the positive sample images and the negative sample images in the training set (including the second sample image, the third sample image and the fourth sample image) may be sampled respectively, so that the sampled positive sample image The number of negative samples is the same or similar.
在一种可能的实现方式中,对于正样本图像,可预设有正样本图像的采样总数量。根据训练集中的正样本图像中目标的类别,分别确定从各个类别的正样本图像中采样的第一数量。In a possible implementation manner, for the positive sample image, the total number of samples of the positive sample image may be preset. According to the categories of the objects in the positive sample images in the training set, the first number of samples sampled from the positive sample images of each category is determined respectively.
与前面的处理过程类似,根据正样本图像中目标的类别,可确定各个类别的目标的比例;根据该比例,可通过如下公式计算出各个类别的抽样比重:Similar to the previous processing process, according to the category of the target in the positive sample image, the proportion of the target of each category can be determined; according to the proportion, the sampling proportion of each category can be calculated by the following formula:
Figure PCTCN2020125972-appb-000010
Figure PCTCN2020125972-appb-000010
公式(4)中,R h表示第h个类别的正样本图像的抽样比重;q h表示第h个类别的目标的比例;t 1为超参数,取值例如为0.1。 In formula (4), R h represents the sampling proportion of the positive sample images of the h th category; q h represents the proportion of the objects of the h th category; t 1 is a hyperparameter, and the value is, for example, 0.1.
通过公式(4)的处理,可提高比例较小的类别所对应的抽样比重,并降低比例较大 的类别所对应的抽样比重,从而缓解不同类别的正样本图像之间的数量不平衡,以便提高网络的训练效果。Through the processing of formula (4), the sampling proportion corresponding to the category with a smaller proportion can be increased, and the sampling proportion corresponding to the category with a larger proportion can be reduced, so as to alleviate the imbalance in the number of positive sample images of different categories, so that Improve the training effect of the network.
在一种可能的实现方式中,根据各个类别的正样本图像的抽样比重以及正样本图像的采样总数量,可确定各个类别的正样本图像的第一数量。In a possible implementation manner, the first number of positive sample images of each category may be determined according to the sampling proportion of positive sample images of each category and the total number of samples of positive sample images.
在一种可能的实现方式中,对于任意一个类别,可根据该类别的第一数量,在该类别的正样本图像中随机采样出第一数量的正样本图像,作为第五样本图像。对各个类别的正样本图像分别进行采样,可得到采样总数量的第五样本图像。In a possible implementation manner, for any category, a first number of positive sample images may be randomly sampled from the positive sample images of the category according to the first number of the category, as the fifth sample image. The positive sample images of each category are sampled respectively, and the fifth sample image with the total number of samples can be obtained.
在一种可能的实现方式中,对于负样本图像,可根据预设的采样总数量对训练集中负样本图像直接进行随机采样,得到采样总数量的第六样本图像。负样本图像的该采样总数量可与正样本图像的采样总数量相同或不同,本公开实施例对此不作限制。In a possible implementation manner, for the negative sample images, the negative sample images in the training set can be directly randomly sampled according to the preset total number of samples to obtain the sixth sample image with the total number of samples. The total number of samples of negative sample images may be the same as or different from the total number of samples of positive sample images, which is not limited in this embodiment of the present disclosure.
在一种可能的实现方式中,可根据第五样本图像及第六样本图像,训练目标检测网络。也即,将第五及第六样本图像分别输入目标检测网络,得到第五及第六样本图像的目标检测结果;根据目标检测结果及标注信息,确定目标检测网络的损失;根据损失反向调整目标检测网络的参数;经过多轮迭代,在满足预设条件(例如网络收敛)时,得到训练后的目标检测网络。In a possible implementation manner, the target detection network can be trained according to the fifth sample image and the sixth sample image. That is, input the fifth and sixth sample images into the target detection network respectively to obtain the target detection results of the fifth and sixth sample images; determine the loss of the target detection network according to the target detection results and the label information; and adjust the loss in the reverse direction. The parameters of the target detection network; after multiple rounds of iterations, the trained target detection network is obtained when a preset condition (such as network convergence) is satisfied.
通过这种方式,可显著提高训练后的目标检测网络对于长尾图像的检测效果。In this way, the detection effect of the trained object detection network for long-tailed images can be significantly improved.
在一种可能的实现方式中,在步骤S11之前,通过已标注的第三样本图像对所述目标检测网络进行预训练的步骤,也可以采用上述的重采样训练方式进行,从而提高目标检测网络的预训练效果。In a possible implementation manner, before step S11, the step of pre-training the target detection network by using the marked third sample image can also be performed by the above-mentioned resampling training method, thereby improving the target detection network. pre-training effect.
在实际应用中,可重复步骤S11-S15的整个处理过程,实现持续的增量训练。也就是说,当再次采集到未标注的样本图像时,可将本次训练后的目标检测网络作为初始的目标检测网络,将本次扩展后的训练集作为初始的训练集,重复进行伪标注-特征相关挖掘-重采样训练的处理过程,从而持续提升目标检测网络的性能。In practical applications, the entire process of steps S11-S15 can be repeated to achieve continuous incremental training. That is to say, when the unlabeled sample images are collected again, the target detection network after this training can be used as the initial target detection network, the expanded training set can be used as the initial training set, and the pseudo-labeling can be repeated. - Feature correlation mining - The process of resampling training, so as to continuously improve the performance of the target detection network.
图2示出根据本公开实施例的网络训练方法的处理过程的示意图。如图2所示,数据源中包括大量未标注的第一样本图像20,将第一样本图像20输入目标检测网络中进行预测(predict),得到各个第一样本图像20的目标检测结果21,包括第一样本图像中目标的图像区域(未示出)、特征向量及分类概率。FIG. 2 shows a schematic diagram of a processing procedure of a network training method according to an embodiment of the present disclosure. As shown in FIG. 2 , the data source includes a large number of unlabeled first sample images 20 , the first sample images 20 are input into the target detection network for prediction, and the target detection of each first sample image 20 is obtained. The result 21 includes the image area (not shown), the feature vector and the classification probability of the object in the first sample image.
如图2所示,在该示例中,目标检测网络可包括CNN主干网络211、特征图金字塔网络(FPN)212以及全连接网络213,全连接网络213例如为bbox head。第一样本图像20输入到目标检测网络后,经由CNN主干网络211及FPN 212处理,得到第一样本图像的特征图214,特征图214经由全连接网络213处理,得到目标检测结果21。As shown in FIG. 2, in this example, the target detection network may include a CNN backbone network 211, a feature map pyramid network (FPN) 212, and a fully connected network 213, such as a bbox head. After the first sample image 20 is input to the target detection network, it is processed by the CNN backbone network 211 and the FPN 212 to obtain a feature map 214 of the first sample image, and the feature map 214 is processed by the fully connected network 213 to obtain the target detection result 21.
在该示例中,可根据目标的分类概率,确定目标的类别置信度;对于类别置信度大于或等于第一阈值(例如为0.99)的第一目标,确定出这些第一目标所在的第一样本图像,作为第二样本图像22,并对第二样本图像22进行伪标注,也即将第一目标的图像区域及与第一目标的类别置信度对应的类别作为第二样本图像22的标注信息。将已标注的第二样本图像22加入到训练集25中,从而实现对训练集中正样本的扩充。In this example, the category confidence of the target can be determined according to the classification probability of the target; for the first targets whose category confidence is greater than or equal to the first threshold (for example, 0.99), the first objects in which the first targets are located are determined. This image is used as the second sample image 22, and pseudo-labeling is performed on the second sample image 22, that is, the image area of the first target and the category corresponding to the category confidence of the first target are used as the labeling information of the second sample image 22. . The labeled second sample image 22 is added to the training set 25, thereby realizing the expansion of the positive samples in the training set.
在该示例中,对于类别置信度小于第一阈值的第二目标,通过自举法选择出一定数量的第五目标,得到第五目标所在的样本图像23。根据训练集中已标注的第三样本图像中的第三目标的特征向量(未示出),对第五目标进行特征相关挖掘,确定出第四目标以及第四目标所在的第一样本图像,作为第四样本图像24。对第四样本图像24进行人工标注,加入训练集25中,从而实现对训练集中已标注图像的进一步扩充。In this example, for the second target whose category confidence is less than the first threshold, a certain number of fifth targets are selected by the bootstrapping method, and the sample image 23 where the fifth target is located is obtained. According to the feature vector (not shown) of the third target in the marked third sample image in the training set, perform feature correlation mining on the fifth target, and determine the fourth target and the first sample image where the fourth target is located, As the fourth sample image 24 . The fourth sample image 24 is manually labeled and added to the training set 25, so as to further expand the labeled images in the training set.
在该示例中,经两次扩充后,训练集25中包括已标注的第二样本图像、第三样本图像及第四样本图像。对训练集25进行重采样,平衡正负样本的数量,以及不同类别的正样本的数量,得到重采样后的训练集26;进而根据重采样后的训练集26,训练目标检测网络,从而完成整个处理过程。In this example, after two expansions, the training set 25 includes the labeled second sample image, the third sample image, and the fourth sample image. Resampling the training set 25, balancing the number of positive and negative samples, and the number of positive samples of different categories, to obtain a resampled training set 26; and then train the target detection network according to the resampled training set 26, thereby completing the entire process.
根据本公开的实施例,还提供了一种目标检测方法,该方法包括:According to an embodiment of the present disclosure, a target detection method is also provided, the method comprising:
将待处理图像输入目标检测网络中处理,得到所述待处理图像的目标检测结果,所述目标检测结果包括所述待处理图像中目标的位置和类别,所述目标检测网络是根据上述的网络训练方法训练得到的。Input the image to be processed into the target detection network for processing, and obtain the target detection result of the image to be processed, and the target detection result includes the position and category of the target in the image to be processed, and the target detection network is based on the above-mentioned network. training method.
也就是说,可将上述方法训练得到的目标检测网络进行部署,实现待处理图像的目标检测。待处理图像可例如为图像采集设备(例如摄像头)采集的图像,图像中可能包括待检测的目标,例如,人体、人脸、车辆、物体等。本公开实施例对此不作限制。That is to say, the target detection network trained by the above method can be deployed to realize the target detection of the image to be processed. The image to be processed may be, for example, an image collected by an image collection device (eg, a camera), and the image may include a target to be detected, such as a human body, a face, a vehicle, an object, and the like. This embodiment of the present disclosure does not limit this.
在一种可能的实现方式中,可将待处理图像输入目标检测网络中处理,得到所述待处理图像的目标检测结果。该目标检测结果包括待处理图像中目标的位置和类别,例如待处理图像中人脸所在的检测框和人脸对应的身份。In a possible implementation manner, the to-be-processed image may be input into a target detection network for processing to obtain a target detection result of the to-be-processed image. The target detection result includes the position and category of the target in the image to be processed, such as the detection frame where the face in the image to be processed is located and the identity corresponding to the face.
通过这种方式,可提高目标检测的检测精度,实现大规模长尾图像数据的目标检测。In this way, the detection accuracy of target detection can be improved, and target detection of large-scale long-tail image data can be realized.
根据本公开实施例的网络训练方法,利用主动学习挖掘方法来对潜在的无标注数据进行挖掘,利用半监督学习方法来对辅助对无标注数据进行标注,扩充正样本数据的数量,从而解决大规模长尾检测中数据规模大且正样本收集困难的问题,并且,在一定程度上缓解了正负样本之间的不均衡的问题。在有限的标注与计算资源环境下有效提升了模型性能。According to the network training method of the embodiment of the present disclosure, the active learning mining method is used to mine potential unlabeled data, the semi-supervised learning method is used to label the auxiliary unlabeled data, and the quantity of positive sample data is expanded, thereby solving large-scale problems. In large-scale long-tail detection, the problem of large data size and difficulty in collecting positive samples, and to a certain extent, alleviates the problem of imbalance between positive and negative samples. The model performance is effectively improved in the environment of limited annotation and computing resources.
根据本公开实施例的网络训练方法,采用重采样的方式训练目标检测网络,能够解决正负样本不均衡对网络训练的负面影响,并缓解正样本不同类别之间不均衡对网络训练的负面影响,使得目标检测网络在训练时能够有效收敛并提高网络性能。According to the network training method of the embodiment of the present disclosure, the target detection network is trained by means of resampling, which can solve the negative impact of the imbalance of positive and negative samples on network training, and alleviate the negative impact of the imbalance between different categories of positive samples on network training. , so that the target detection network can effectively converge during training and improve the network performance.
根据本公开实施例的网络训练方法,利用主动学习方法,可在巨量的未标注数据中,挖掘对于模型提升有帮助的潜在高价值样本,能够在有限的标注与计算资源环境下有效提升模型性能,大量节省深度学习模型应用在新的业务上所需的人力以及计算成本;利用重采样方法,能够有效在样本不均衡情况下训练目标检测网络,无需过多人工调参干预,节省深度学习模型应用在新的业务上所需的人力成本。According to the network training method according to the embodiment of the present disclosure, by using the active learning method, potentially high-value samples that are helpful for model improvement can be mined in a huge amount of unlabeled data, and the model can be effectively improved in a limited labeling and computing resource environment. performance, saving a lot of manpower and computing costs required for the application of deep learning models in new businesses; using the resampling method, the target detection network can be effectively trained in the case of unbalanced samples, without too much manual parameter adjustment intervention, saving deep learning The labor cost required to apply the model to the new business.
根据本公开实施例的网络训练方法,能够应用于智能视频分析,安防等领域中,在有限的人工以及计算资源下,可以使用本方法在线上对智能视频分析或智能监控中潜在的目标进行检测,并对应用的检测网络进行快速迭代提升,用较小的人力和计算成本快速达到业务所需的性能要求,并能够在之后持续提升网络性能。The network training method according to the embodiment of the present disclosure can be applied to the fields of intelligent video analysis, security and other fields. With limited labor and computing resources, the method can be used to detect potential targets in intelligent video analysis or intelligent monitoring online. , and iteratively improve the detection network of the application, quickly meet the performance requirements required by the business with less labor and computing costs, and can continue to improve network performance in the future.
本公开实施例的网络训练方法,可以应用于线上智能视屏分析或智能监控中,以在有限的人工以及计算资源下,在线上对于智能视频分析或者智能监控中潜在的目标检测应用进行快速迭代提升,从而用较小的人力和计算成本快速达到业务所需的性能要求,并能在之后继续持续提升模型性能。The network training method of the embodiments of the present disclosure can be applied to online intelligent video analysis or intelligent monitoring, so as to rapidly iterate online potential target detection applications in intelligent video analysis or intelligent monitoring under limited labor and computing resources It can quickly achieve the performance requirements required by the business with less labor and computing costs, and can continue to improve the performance of the model afterwards.
可以理解,本公开实施例提及的上述各个方法实施例,在不违背原理逻辑的情况下,均可以彼此相互结合形成结合后的实施例,限于篇幅,本公开实施例不再赘述。本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。It can be understood that the above method embodiments mentioned in the embodiments of the present disclosure can be combined with each other to form a combined embodiment without violating the principle and logic. Those skilled in the art can understand that, in the above method of the specific embodiment, the specific execution order of each step should be determined by its function and possible internal logic.
此外,本公开实施例还提供了网络训练装置、目标检测装置、电子设备、计算机可读存储介质、程序,上述均可用来实现本公开实施例提供的任一种网络训练方法或目标检测方法,相应技术方案和描述和参见方法部分的相应记载,不再赘述。In addition, the embodiments of the present disclosure also provide a network training device, a target detection device, an electronic device, a computer-readable storage medium, and a program, all of which can be used to implement any network training method or target detection method provided by the embodiments of the present disclosure, Corresponding technical solutions and descriptions, and refer to the corresponding records in the method section, will not be repeated.
图3示出根据本公开实施例的网络训练装置的框图,所述装置包括处理器(图3中未示出),所述处理器用于执行存储器(图3中未示出)中存储的程序部分;如图3所示,存储器中存储的程序部分包括:3 shows a block diagram of a network training apparatus including a processor (not shown in FIG. 3 ) for executing a program stored in a memory (not shown in FIG. 3 ) according to an embodiment of the present disclosure part; as shown in Figure 3, the program part stored in the memory includes:
目标检测部分31,被配置为将未标注的第一样本图像输入目标检测网络中处理,得到所述第一样本图像的目标检测结果,所述目标检测结果包括所述第一样本图像中目标的图像区域、特征信息及分类概率;The target detection part 31 is configured to input the unlabeled first sample image into the target detection network for processing, and obtain the target detection result of the first sample image, and the target detection result includes the first sample image image area, feature information and classification probability of the target;
置信度确定部分32,被配置为根据所述目标的分类概率,确定所述目标的类别置信度;a confidence level determination part 32, configured to determine the category confidence level of the object according to the classification probability of the object;
标注部分33,被配置为针对所述目标中类别置信度大于或等于第一阈值的第一目标,将所述第一目标所在的第一样本图像作为已标注的第二样本图像,并加入训练集中,其中,所述第二样本图像的标注信息包括所述第一目标的图像区域及与所述第一目标的类别置信度对应的类别,所述训练集中包括已标注的第三样本图像;The labeling part 33 is configured to take the first sample image where the first target is located as the marked second sample image for the first target whose category confidence is greater than or equal to the first threshold in the target, and add In the training set, the annotation information of the second sample image includes the image area of the first target and the category corresponding to the category confidence of the first target, and the training set includes the labeled third sample image ;
特征挖掘部分34,被配置为针对所述目标中类别置信度小于所述第一阈值的第二目标,根据所述第三样本图像中的第三目标的特征信息,对所述第二目标进行特征相关挖掘,通过特征相关挖掘,从所述第二目标中确定出第四目标及所述第四目标所在的第一样本图像,并将所述第四目标所在的第一样本图像作为第四样本图像,并加入所述训练集中;The feature mining part 34 is configured to, for the second object in the object whose category confidence is less than the first threshold value, perform an analysis on the second object according to the feature information of the third object in the third sample image. Feature correlation mining, through feature correlation mining, determine the fourth target and the first sample image where the fourth target is located from the second target, and use the first sample image where the fourth target is located as the The fourth sample image is added to the training set;
训练部分35,被配置为根据所述第四样本图像的标注信息,所述训练集中的第二样本图像、第三样本图像及所述第四样本图像,训练所述目标检测网络。The training part 35 is configured to train the target detection network according to the label information of the fourth sample image, the second sample image, the third sample image and the fourth sample image in the training set.
在一种可能的实现方式中,所述训练部分包括:采样数量确定子部分,被配置为根据所述训练集的正样本图像中目标的类别,分别确定从各个类别的正样本图像中采样的第一数量,所述正样本图像为图像中包括目标的样本图像;第一采样子部分,被配置为根据各个类别的正样本图像中采样的第一数量,对各个类别的正样本图像进行采样,得到多个第五样本图像;第二采样子部分,被配置为对所述训练集的负样本图像进行采样,得到多个第六样本图像,所述负样本图像为图像中不包括目标的样本图像;训练子部分,被配置为根据所述第五样本图像及所述第六样本图像,训练所述目标检测网络。In a possible implementation manner, the training part includes: a sampling quantity determination sub-part, configured to separately determine, according to the category of the target in the positive sample images of the training set, the number of samples sampled from the positive sample images of each category the first quantity, the positive sample images are sample images including the target in the image; the first sampling subsection is configured to sample the positive sample images of each category according to the first quantity sampled in the positive sample images of each category , to obtain a plurality of fifth sample images; the second sampling subsection is configured to sample the negative sample images of the training set to obtain a plurality of sixth sample images, and the negative sample images are images that do not include the target a sample image; a training subsection configured to train the object detection network according to the fifth sample image and the sixth sample image.
在一种可能的实现方式中,所述特征挖掘部分包括:信息熵确定子部分,被配置为根据所述第二目标的分类概率,确定所述第二目标的信息熵;目标选择子部分,被配置为根据所述第二目标的类别置信度及信息熵,从所述第二目标中选择出第五目标;挖掘数量确定子部分,被配置为根据所述第三样本图像中的第三目标的类别以及待挖掘的样本图像的总数量,分别确定各个类别待挖掘的样本图像的第二数量;目标及图像确定子部分,被配置为根据所述第三样本图像中的第三目标的特征信息,所述第五目标的特征信息以及各个类别待挖掘的样本图像的第二数量,从所述第五目标中确定出第四目标及所述第四目标所在的第一样本图像。In a possible implementation manner, the feature mining part includes: an information entropy determination sub-section, configured to determine the information entropy of the second target according to the classification probability of the second target; a target selection sub-section, is configured to select a fifth target from the second target according to the category confidence and information entropy of the second target; the mining quantity determination subsection is configured to select a fifth target according to the third sample image in the third sample image The category of the target and the total number of sample images to be mined respectively determine the second quantity of the sample images to be mined for each category; the target and image determination sub-section is configured to be based on the third target in the third sample image. The feature information, the feature information of the fifth target and the second number of sample images to be mined in each category, the fourth target and the first sample image where the fourth target is located are determined from the fifth target.
在一种可能的实现方式中,所述目标选择子部分被配置为:根据所述第二目标的类别置信度及信息熵,分别对所述第二目标进行排序,选择出第三数量的第六目标和第四数量的第七目标;对所述第六目标和所述第七目标进行合并,得到所述第五目标。In a possible implementation manner, the target selection sub-section is configured to: according to the category confidence and information entropy of the second target, sort the second targets respectively, and select a third number of Six targets and a seventh target with a fourth quantity; the sixth target and the seventh target are combined to obtain the fifth target.
在一种可能的实现方式中,所述挖掘数量确定子部分被配置为:根据所述第三样本图像中的第三目标的类别,确定各个类别的第三目标的比例;根据各个类别的第三目标的比例,确定各个类别的抽样比重;根据各个类别的抽样比重,分别确定各个类别待挖掘的样本图像的第二数量。In a possible implementation manner, the mining quantity determination subsection is configured to: determine the proportion of the third objects of each category according to the category of the third object in the third sample image; The proportion of the three targets determines the sampling proportion of each category; according to the sampling proportion of each category, the second quantity of sample images to be mined in each category is determined respectively.
在一种可能的实现方式中,所述目标及图像确定子部分被配置为:根据第一类别的第三目标的特征信息与各个第五目标的特征信息之间的距离,分别确定所述第一类别的第三目标中与各个第五目标距离最小的第三目标,并作为第八目标,所述第一类别为第三目标的类别中的任意一个;将所述第八目标中距离最大的目标,确定为第四目标。In a possible implementation manner, the target and image determination subsection is configured to: determine the third target according to the distance between the feature information of the third target of the first category and the feature information of each fifth target. Among the third targets of a category, the third target with the smallest distance from each fifth target is used as the eighth target, and the first category is any one of the categories of the third targets; the distance among the eighth targets is the largest target, identified as the fourth target.
在一种可能的实现方式中,所述目标及图像确定子部分还被配置为:将确定出的第四目标添加到所述第一类别的第三目标中,并将所述确定出的第四目标从未标注的第五目标中移除。In a possible implementation manner, the target and image determination subsection is further configured to: add the determined fourth target to the third target of the first category, and add the determined fourth target to the third target of the first category. Four targets were removed from the unlabeled fifth target.
在一种可能的实现方式中,所述装置还包括:特征提取部分,被配置为将所述第三样本图像输入所述目标检测网络中处理,得到所述第三样本图像中的第三目标的特征信息。In a possible implementation manner, the apparatus further includes: a feature extraction part, configured to input the third sample image into the target detection network for processing to obtain a third target in the third sample image characteristic information.
在一种可能的实现方式中,所述装置还包括:预训练部分,被配置为通过已标注的第三样本图像对所述目标检测网络进行预训练。In a possible implementation manner, the apparatus further includes: a pre-training part configured to pre-train the target detection network by using the labeled third sample image.
在一种可能的实现方式中,所述第一样本图像包括长尾图像。In a possible implementation manner, the first sample image includes a long-tail image.
在一种可能的实现方式中,采样数量确定子部分,还被配置为:在所述根据所述训练 集的正样本图像中目标的类别,分别确定从各个类别的正样本图像中采样的第一数量之前,对训练集中的正样本图像和负样本图像进行采样,得到数量相同或相近的正样本图像和负样本图像。In a possible implementation manner, the sampling quantity determination sub-section is further configured to: in the category of the target according to the positive sample images of the training set, respectively determine the number of samples sampled from the positive sample images of each category. Before a certain number, the positive sample images and negative sample images in the training set are sampled to obtain the same or similar number of positive sample images and negative sample images.
在一种可能的实现方式中,所述待挖掘的样本图像的总数量为所述第一样本图像的总数量的5%~25%。In a possible implementation manner, the total number of sample images to be mined is 5% to 25% of the total number of the first sample images.
在一种可能的实现方式中,所述目标选择子部分,还被配置为:去除所述第六目标中与所述第七目标相同的目标,得到所述第六目标中与所述第七目标不同的剩余目标;将所述剩余目标和所述第七目标作为所述第五目标。In a possible implementation manner, the target selection subsection is further configured to: remove the same target as the seventh target from the sixth target, and obtain the sixth target and the seventh target The remaining target with different targets; the remaining target and the seventh target are regarded as the fifth target.
在一种可能的实现方式中,所述方法还包括:在所述根据第一类别的第三目标的特征信息与各个第五目标的特征信息之间的距离,分别确定所述第一类别的第三目标中与各个第五目标距离最小的第三目标,并作为第八目标之后,在所述第四目标所在的第一样本图像的数量达到所述第一类别的待挖掘的样本图像的第二数量时,结束对所述第八目标的确定。In a possible implementation manner, the method further includes: according to the distance between the feature information of the third target of the first category and the feature information of each fifth target, respectively determining the first category of After the third target with the smallest distance from each fifth target among the third targets is used as the eighth target, after the number of the first sample images where the fourth target is located reaches the sample images of the first category to be mined When the second number of , ends the determination of the eighth target.
在一种可能的实现方式中,所述目标及图像确定子部分还被配置为:在所述根据第一类别的第三目标的特征信息与各个第五目标的特征信息之间的距离,分别确定所述第一类别的第三目标中与各个第五目标距离最小的第三目标,并作为第八目标之后,在所述第四目标所在的第一样本图像的数量未达到所述第一类别的待挖掘的样本图像的第二数量,且存储所述第五目标的特征信息的集合为空时,结束对所述第八目标的确定。In a possible implementation manner, the target and image determination subsection is further configured to: the distance between the feature information of the third target according to the first category and the feature information of each fifth target, respectively After determining the third target with the smallest distance from each fifth target among the third targets of the first category and using it as the eighth target, the number of the first sample images where the fourth target is located does not reach the number of the first sample images. When the second quantity of sample images of one category to be mined is empty, and the set storing the feature information of the fifth target is empty, the determination of the eighth target is ended.
在一种可能的实现方式中,所述特征提取部分,还被配置为:将所述第三样本图像,输入所述目标检测网络中,得到所述目标检测网络的隐藏层输出的特征向量;将所述特征向量确定为所述第三目标的特征信息。In a possible implementation manner, the feature extraction part is further configured to: input the third sample image into the target detection network to obtain a feature vector output by the hidden layer of the target detection network; The feature vector is determined as feature information of the third target.
根据本公开的一方面,提供了一种目标检测装置,所述装置包括:检测处理部分,被配置为将待处理图像输入目标检测网络中处理,得到所述待处理图像的目标检测结果,所述目标检测结果包括所述待处理图像中目标的位置和类别,所述目标检测网络是根据上述的网络训练方法训练得到的。According to an aspect of the present disclosure, there is provided a target detection apparatus, the apparatus includes: a detection processing part configured to input an image to be processed into a target detection network for processing, and obtain a target detection result of the to-be-processed image, where The target detection result includes the position and category of the target in the to-be-processed image, and the target detection network is trained according to the above-mentioned network training method.
在一些实施例中,本公开实施例提供的装置具有的功能或包含的部分可以被配置为执行上文方法实施例描述的方法,其具体实现可以参照上文方法实施例的描述,为了简洁,这里不再赘述。In some embodiments, the functions or included parts of the apparatus provided in the embodiments of the present disclosure may be configured to execute the methods described in the above method embodiments, and the specific implementation may refer to the above method embodiments. For brevity, I won't go into details here.
在一些实施例中,“部分”还可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是单元,还可以是模块也可以是非模块化的。In some embodiments, a "part" can also be a part of a circuit, a part of a processor, a part of a program or software, etc., of course, it can also be a unit, and it can also be a module or non-modular.
本公开实施例还提出一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。计算机可读存储介质可以是非易失性计算机可读存储介质。Embodiments of the present disclosure further provide a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the foregoing method is implemented. The computer-readable storage medium may be a non-volatile computer-readable storage medium.
本公开实施例还提出一种电子设备,包括:处理器;被配置为存储处理器可执行指令的存储器;其中,所述处理器被配置为调用所述存储器存储的指令,以执行上述方法。An embodiment of the present disclosure further provides an electronic device, including: a processor; a memory configured to store instructions executable by the processor; wherein the processor is configured to invoke the instructions stored in the memory to execute the above method.
本公开实施例还提供了一种计算机程序产品,包括计算机可读代码,当计算机可读代码在设备上运行时,设备中的处理器执行被配置为实现如上任一实施例提供的网络训练方法或目标检测方法的指令。Embodiments of the present disclosure also provide a computer program product, including computer-readable code, when the computer-readable code is run on a device, a processor in the device executes a network training method configured to implement the network training method provided in any of the above embodiments Or directives for object detection methods.
本公开实施例还提供了另一种计算机程序产品,被配置为存储计算机可读指令,指令被执行时使得计算机执行上述任一实施例提供的网络训练方法或目标检测方法的操作。Embodiments of the present disclosure also provide another computer program product configured to store computer-readable instructions, which, when executed, cause the computer to perform the operations of the network training method or the target detection method provided by any of the foregoing embodiments.
电子设备可以被提供为终端、服务器或其它形态的设备。The electronic device may be provided as a terminal, server or other form of device.
图4示出根据本公开实施例的一种电子设备800的框图。例如,电子设备800可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等终端。FIG. 4 shows a block diagram of an electronic device 800 according to an embodiment of the present disclosure. For example, electronic device 800 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, fitness device, personal digital assistant, etc. terminal.
参照图4,电子设备800可以包括以下一个或多个组件:处理组件802,存储器804,电 源组件806,多媒体组件808,音频组件810,输入/输出(I/O)的接口812,传感器组件814,以及通信组件816。4, the electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814 , and the communication component 816 .
处理组件802通常控制电子设备800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 can include one or more processors 820 to execute instructions to perform all or some of the steps of the methods described above. Additionally, processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
存储器804被配置为存储各种类型的数据以支持在电子设备800的操作。这些数据的示例包括用于在电子设备800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。 Memory 804 is configured to store various types of data to support operation at electronic device 800 . Examples of such data include instructions for any application or method operating on electronic device 800, contact data, phonebook data, messages, pictures, videos, and the like. Memory 804 may be implemented by any type of volatile or nonvolatile storage device or 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 or Optical Disk.
电源组件806为电子设备800的各种组件提供电力。电源组件806可以包括电源管理系统,一个或多个电源,及其他与为电子设备800生成、管理和分配电力相关联的组件。 Power supply assembly 806 provides power to various components of electronic device 800 . Power supply components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800 .
多媒体组件808包括在所述电子设备800和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当电子设备800处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。 Multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, swipe, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or swipe action, but also detect the duration and pressure associated with the touch or swipe action. In some embodiments, the multimedia component 808 includes a front-facing camera and/or a rear-facing camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each of the front and rear cameras can be a fixed optical lens system or have focal length and optical zoom capability.
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),当电子设备800处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。 Audio component 810 is configured to output and/or input audio signals. For example, audio component 810 includes a microphone (MIC) that is configured to receive external audio signals when electronic device 800 is in operating modes, such as calling mode, recording mode, and voice recognition mode. The received audio signal may be further stored in memory 804 or transmitted via communication component 816 . In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, or the like. These buttons may include, but are not limited to: home button, volume buttons, start button, and lock button.
传感器组件814包括一个或多个传感器,用于为电子设备800提供各个方面的状态评估。例如,传感器组件814可以检测到电子设备800的打开/关闭状态,组件的相对定位,例如所述组件为电子设备800的显示器和小键盘,传感器组件814还可以检测电子设备800或电子设备800一个组件的位置改变,用户与电子设备800接触的存在或不存在,电子设备800方位或加速/减速和电子设备800的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还可以包括光传感器,如互补金属氧化物半导体(CMOS)或电荷耦合装置(CCD)图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。 Sensor assembly 814 includes one or more sensors for providing status assessment of various aspects of electronic device 800 . For example, the sensor assembly 814 can detect the on/off state of the electronic device 800, the relative positioning of the components, such as the display and the keypad of the electronic device 800, the sensor assembly 814 can also detect the electronic device 800 or one of the electronic device 800 Changes in the position of components, presence or absence of user contact with the electronic device 800 , orientation or acceleration/deceleration of the electronic device 800 and changes in the temperature of the electronic device 800 . Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. Sensor assembly 814 may also include a light sensor, such as a complementary metal oxide semiconductor (CMOS) or charge coupled device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
通信组件816被配置为便于电子设备800和其他设备之间有线或无线方式的通信。电子设备800可以接入基于通信标准的无线网络,如无线网络(WiFi),第二代移动通信技术(2G)或第三代移动通信技术(3G),或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件816还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT) 技术和其他技术来实现。 Communication component 816 is configured to facilitate wired or wireless communication between electronic device 800 and other devices. The electronic device 800 may access a wireless network based on a communication standard, such as wireless network (WiFi), second generation mobile communication technology (2G) or third generation mobile communication technology (3G), or a combination thereof. In one exemplary embodiment, the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology and other technologies.
在示例性实施例中,电子设备800可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In an exemplary embodiment, electronic device 800 may 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 A programmed gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation is used to perform the above method.
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器804,上述计算机程序指令可由电子设备800的处理器820执行以完成上述方法。In an exemplary embodiment, a non-volatile computer-readable storage medium, such as a memory 804 comprising computer program instructions executable by the processor 820 of the electronic device 800 to perform the above method is also provided.
图5示出根据本公开实施例的一种电子设备1900的框图。例如,电子设备1900可以被提供为一服务器。参照图5,电子设备1900包括处理组件1922,其进一步包括一个或多个处理器,以及由存储器1932所代表的存储器资源,被配置为存储可由处理组件1922的执行的指令,例如应用程序。存储器1932中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件1922被配置为执行指令,以执行上述方法。FIG. 5 shows a block diagram of an electronic device 1900 according to an embodiment of the present disclosure. For example, the electronic device 1900 may be provided as a server. 5, electronic device 1900 includes processing component 1922, which further includes one or more processors, and a memory resource represented by memory 1932 configured to store instructions executable by processing component 1922, such as an application program. An application program stored in memory 1932 may include one or more modules, each corresponding to a set of instructions. Additionally, the processing component 1922 is configured to execute instructions to perform the above-described methods.
电子设备1900还可以包括一个电源组件1926被配置为执行电子设备1900的电源管理,一个有线或无线网络接口1950被配置为将电子设备1900连接到网络,和一个输入输出(I/O)接口1958。电子设备1900可以操作基于存储在存储器1932的操作系统,例如微软服务器操作系统(Windows Server TM),苹果公司推出的基于图形用户界面操作系统(Mac OS X TM),多用户多进程的计算机操作系统(Unix TM),自由和开放原代码的类Unix操作系统(Linux TM),开放原代码的类Unix操作系统(FreeBSD TM)或类似。 The electronic device 1900 may also include a power supply assembly 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input output (I/O) interface 1958 . The electronic device 1900 can operate based on an operating system stored in the memory 1932, such as a Microsoft server operating system (Windows Server ), a graphical user interface based operating system (Mac OS X ) introduced by Apple, a multi-user multi-process computer operating system (Unix ), Free and Open Source Unix-like Operating System (Linux ), Open Source Unix-like Operating System (FreeBSD ) or the like.
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器1932,上述计算机程序指令可由电子设备1900的处理组件1922执行以完成上述方法。In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as memory 1932 comprising computer program instructions executable by processing component 1922 of electronic device 1900 to perform the above-described method.
本公开实施例可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本公开实施例的各个方面的计算机可读程序指令。Embodiments of the present disclosure may be systems, methods and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of the embodiments of the present disclosure.
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是――但不限于――电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。A computer-readable storage medium may be a tangible device that can hold and store instructions for use by the instruction execution device. The computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (non-exhaustive list) of computer readable storage media include: portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM) or flash memory), static random access memory (SRAM), portable compact disk read only memory (CD-ROM), digital versatile disk (DVD), memory sticks, floppy disks, mechanically coded devices, such as printers with instructions stored thereon Hole cards or raised structures in grooves, and any suitable combination of the above. Computer-readable storage media, as used herein, are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (eg, light pulses through fiber optic cables), or through electrical wires transmitted electrical signals.
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。The computer readable program instructions described herein may be downloaded to various computing/processing devices from a computer readable storage medium, or to an external computer or external storage device over a network such as the Internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer-readable program instructions from a network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
用于执行本公开操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独 立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开的各个方面。Computer program instructions for carrying out operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or instructions in one or more programming languages. Source or object code, written in any combination, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as the "C" language or similar programming languages. The computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server implement. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider through the Internet connect). In some embodiments, custom electronic circuits, such as programmable logic circuits, field programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), can be personalized by utilizing state information of computer readable program instructions. Computer readable program instructions are executed to implement various aspects of the present disclosure.
这里参照根据本公开实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。Aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions.
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer or other programmable data processing apparatus to produce a machine that causes the instructions when executed by the processor of the computer or other programmable data processing apparatus , resulting in means for implementing the functions/acts specified in one or more blocks of the flowchart and/or block diagrams. These computer readable program instructions can also be stored in a computer readable storage medium, these instructions cause a computer, programmable data processing apparatus and/or other equipment to operate in a specific manner, so that the computer readable medium on which the instructions are stored includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks of the flowchart and/or block diagrams.
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。Computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other equipment to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other equipment to produce a computer-implemented process , thereby causing instructions executing on a computer, other programmable data processing apparatus, or other device to implement the functions/acts specified in one or more blocks of the flowcharts and/or block diagrams.
附图中的流程图和框图显示了根据本公开的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more functions for implementing the specified logical function(s) executable instructions. In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented in dedicated hardware-based systems that perform the specified functions or actions , or can be implemented in a combination of dedicated hardware and computer instructions.
该计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。The computer program product can be specifically implemented by hardware, software or a combination thereof. In an optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), etc. Wait.
以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。Various embodiments of the present disclosure have been described above, and the foregoing descriptions are exemplary, not exhaustive, and not limiting of the disclosed embodiments. Numerous modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein was chosen to best explain the principles of the various embodiments, the practical application or improvement over the technology in the marketplace, or to enable others of ordinary skill in the art to understand the various embodiments disclosed herein.
工业实用性Industrial Applicability
本公开实施例涉及一种网络训练方法及装置、目标检测方法及装置和电子设备。该网络训练方法包括:将未标注的样本图像输入目标检测网络中处理,得到目标检测结果,该结果包括目标的图像区域、特征信息及分类概率;根据目标的分类概率,确定目标的类别置信度;针对类别置信度大于或等于阈值的第一目标,将第一目标所在的样本图像作为已标注图像并加入训练集;针对类别置信度小于第一阈值的第二目标,对第二目标进行特征相关挖掘,从第二目标中确定出第四目标,将其所在的样本图像并加入训练集;根据训练 集中的样本图像训练目标检测网络。本公开实施例可提高目标检测网络的训练效果。The embodiments of the present disclosure relate to a network training method and apparatus, a target detection method and apparatus, and an electronic device. The network training method includes: inputting unlabeled sample images into a target detection network for processing to obtain a target detection result, the result including the image area, feature information and classification probability of the target; and determining the category confidence of the target according to the classification probability of the target ; For the first target whose category confidence is greater than or equal to the threshold, the sample image where the first target is located is used as a marked image and is added to the training set; For the second target whose category confidence is less than the first threshold, the second target is characterized For related mining, the fourth target is determined from the second target, and the sample image where it is located is added to the training set; the target detection network is trained according to the sample image in the training set. The embodiments of the present disclosure can improve the training effect of the target detection network.

Claims (20)

  1. 一种网络训练方法,包括:A network training method comprising:
    将未标注的第一样本图像输入目标检测网络中处理,得到所述第一样本图像的目标检测结果,所述目标检测结果包括所述第一样本图像中目标的图像区域、特征信息及分类概率;Input the unlabeled first sample image into the target detection network for processing, and obtain the target detection result of the first sample image, and the target detection result includes the image area and feature information of the target in the first sample image and classification probability;
    根据所述目标的分类概率,确定所述目标的类别置信度;According to the classification probability of the target, determine the category confidence of the target;
    针对所述目标中类别置信度大于或等于第一阈值的第一目标,将所述第一目标所在的第一样本图像作为已标注的第二样本图像,并加入训练集中,其中,所述第二样本图像的标注信息包括所述第一目标的图像区域及与所述第一目标的类别置信度对应的类别,所述训练集中包括已标注的第三样本图像;For the first target whose category confidence is greater than or equal to the first threshold in the target, the first sample image where the first target is located is taken as the marked second sample image, and added to the training set, wherein the The labeling information of the second sample image includes the image area of the first target and the class corresponding to the class confidence of the first target, and the training set includes the labelled third sample image;
    针对所述目标中类别置信度小于所述第一阈值的第二目标,根据所述第三样本图像中的第三目标的特征信息,对所述第二目标进行特征相关挖掘,通过特征相关挖掘,从所述第二目标中确定出第四目标及所述第四目标所在的第一样本图像,并将所述第四目标所在的第一样本图像作为第四样本图像,并加入所述训练集中;For the second target in the target whose category confidence is less than the first threshold, according to the feature information of the third target in the third sample image, feature correlation mining is performed on the second target, and feature correlation mining is performed on the second target. , determine the fourth target and the first sample image where the fourth target is located from the second target, take the first sample image where the fourth target is located as the fourth sample image, and add all the the training set described above;
    根据所述第四样本图像的标注信息,所述训练集中的第二样本图像、第三样本图像及所述第四样本图像,训练所述目标检测网络。The target detection network is trained according to the label information of the fourth sample image, the second sample image, the third sample image and the fourth sample image in the training set.
  2. 根据权利要求1所述的方法,其中,所述根据所述第四样本图像的标注信息,所述训练集中的第二样本图像、第三样本图像及所述第四样本图像,训练所述目标检测网络,包括:The method according to claim 1, wherein the target is trained according to the label information of the fourth sample image, the second sample image, the third sample image and the fourth sample image in the training set Detection network, including:
    根据所述训练集的正样本图像中目标的类别,分别确定从各个类别的正样本图像中采样的第一数量,所述正样本图像为图像中包括目标的样本图像;According to the category of the target in the positive sample images of the training set, respectively determine the first number of samples sampled from the positive sample images of each category, and the positive sample images are sample images including the target in the image;
    根据各个类别的正样本图像中采样的第一数量,对各个类别的正样本图像进行采样,得到多个第五样本图像;Sampling the positive sample images of each category according to the first quantity sampled in the positive sample images of each category to obtain a plurality of fifth sample images;
    对所述训练集的负样本图像进行采样,得到多个第六样本图像,所述负样本图像为图像中不包括目标的样本图像;Sampling the negative sample images of the training set to obtain a plurality of sixth sample images, where the negative sample images are sample images that do not include the target in the image;
    根据所述第五样本图像及所述第六样本图像,训练所述目标检测网络。The object detection network is trained according to the fifth sample image and the sixth sample image.
  3. 根据权利要求1或2所述的方法,其中,所述根据所述第三样本图像中的第三目标的特征信息,对所述第二目标进行特征相关挖掘,通过特征相关挖掘,从所述第二目标中确定出第四目标及所述第四目标所在的第一样本图像,包括:The method according to claim 1 or 2, wherein the feature correlation mining is performed on the second target according to the feature information of the third target in the third sample image, and the feature correlation mining is performed from the The fourth target and the first sample image where the fourth target is located are determined from the second target, including:
    根据所述第二目标的分类概率,确定所述第二目标的信息熵;According to the classification probability of the second target, determine the information entropy of the second target;
    根据所述第二目标的类别置信度及信息熵,从所述第二目标中选择出第五目标;selecting a fifth target from the second target according to the category confidence and information entropy of the second target;
    根据所述第三样本图像中的第三目标的类别以及待挖掘的样本图像的总数量,分别确定各个类别待挖掘的样本图像的第二数量;According to the category of the third target in the third sample image and the total number of sample images to be mined, respectively determine the second number of sample images to be mined in each category;
    根据所述第三样本图像中的第三目标的特征信息,所述第五目标的特征信息以及各个类别待挖掘的样本图像的第二数量,从所述第五目标中确定出第四目标及所述第四目标所在的第一样本图像。According to the feature information of the third target in the third sample image, the feature information of the fifth target and the second number of sample images to be mined in each category, the fourth target and the The first sample image where the fourth target is located.
  4. 根据权利要求3所述的方法,其中,根据所述第二目标的类别置信度及信息熵,从所述第二目标中选择出第五目标,包括:The method according to claim 3, wherein, selecting a fifth target from the second target according to the category confidence and information entropy of the second target, comprising:
    根据所述第二目标的类别置信度及信息熵,分别对所述第二目标进行排序,选择出第三数量的第六目标和第四数量的第七目标;According to the category confidence and information entropy of the second target, the second targets are sorted respectively, and a third number of sixth targets and a fourth number of seventh targets are selected;
    对所述第六目标和所述第七目标进行合并,得到所述第五目标。The sixth target and the seventh target are combined to obtain the fifth target.
  5. 根据权利要求3或4所述的方法,其中,根据所述第三样本图像中的第三目标的类别以及待挖掘的样本图像的总数量,分别确定各个类别待挖掘的样本图像的第二数量,包括:The method according to claim 3 or 4, wherein the second number of sample images to be mined for each category is determined according to the category of the third target in the third sample image and the total number of sample images to be mined ,include:
    根据所述第三样本图像中的第三目标的类别,确定各个类别的第三目标的比例;According to the category of the third object in the third sample image, determine the proportion of the third object of each category;
    根据各个类别的第三目标的比例,确定各个类别的抽样比重;According to the proportion of the third target of each category, determine the sampling proportion of each category;
    根据各个类别的抽样比重,分别确定各个类别待挖掘的样本图像的第二数量。According to the sampling proportion of each category, the second quantity of sample images to be mined in each category is determined respectively.
  6. 根据权利要求3-5中任意一项所述的方法,其中,根据所述第三样本图像中的第三目标的特征信息,所述第五目标的特征信息以及各个类别待挖掘的样本图像的第二数量,从所述第五目标中确定出第四目标及所述第四目标所在的第一样本图像,包括:The method according to any one of claims 3-5, wherein according to the feature information of the third target in the third sample image, the feature information of the fifth target and the sample images of each category to be mined The second quantity is determined from the fifth target to determine the fourth target and the first sample image where the fourth target is located, including:
    根据第一类别的第三目标的特征信息与各个第五目标的特征信息之间的距离,分别确定所述第一类别的第三目标中与各个第五目标距离最小的第三目标,并作为第八目标,所述第一类别为第三目标的类别中的任意一个;According to the distance between the feature information of the third target of the first category and the feature information of each fifth target, determine the third target with the smallest distance from each fifth target among the third targets of the first category, and use it as The eighth target, the first category is any one of the categories of the third target;
    将所述第八目标中距离最大的目标,确定为第四目标。The target with the largest distance among the eighth targets is determined as the fourth target.
  7. 根据权利要求6所述的方法,其中,根据所述第三样本图像中的第三目标的特征信息,所述第五目标的特征信息以及各个类别待挖掘的样本图像的第二数量,从所述第五目标中确定出第四目标及所述第四目标所在的第一样本图像,还包括:The method according to claim 6, wherein, according to the feature information of the third target in the third sample image, the feature information of the fifth target and the second number of sample images to be mined in each category, from the Determine the fourth target and the first sample image where the fourth target is located in the fifth target, and further include:
    将确定出的第四目标添加到所述第一类别的第三目标中,并将所述确定出的第四目标从未标注的第五目标中移除。The determined fourth object is added to the third object of the first category, and the determined fourth object is removed from the unlabeled fifth object.
  8. 根据权利要求1-7中任意一项所述的方法,其中,所述方法还包括:The method according to any one of claims 1-7, wherein the method further comprises:
    将所述第三样本图像输入所述目标检测网络中处理,得到所述第三样本图像中的第三目标的特征信息。The third sample image is input into the target detection network for processing to obtain feature information of the third target in the third sample image.
  9. 根据权利要求1-8中任意一项所述的方法,其中,在所述将未标注的第一样本图像输入目标检测网络中处理,得到所述第一样本图像的目标检测结果的步骤之前,所述方法还包括:The method according to any one of claims 1-8, wherein the step of inputting the unlabeled first sample image into a target detection network for processing to obtain a target detection result of the first sample image Before, the method further includes:
    通过已标注的第三样本图像对所述目标检测网络进行预训练。The target detection network is pre-trained by using the labeled third sample images.
  10. 根据权利要求1-9中任意一项所述的方法,其中,所述第一样本图像包括长尾图像。The method of any one of claims 1-9, wherein the first sample image comprises a long-tail image.
  11. 根据权利要求2所述的方法,其中,在所述根据所述训练集的正样本图像中目标的类别,分别确定从各个类别的正样本图像中采样的第一数量的步骤之前,所述方法包括:The method according to claim 2, wherein, before the step of respectively determining the first number of samples sampled from the positive sample images of each category according to the categories of the objects in the positive sample images of the training set, the method include:
    对训练集中的正样本图像和负样本图像进行采样,得到数量相同或相近的正样本图像和负样本图像。Sampling the positive sample images and negative sample images in the training set to obtain the same or similar number of positive sample images and negative sample images.
  12. 根据权利要求3所述的方法,其中,所述待挖掘的样本图像的总数量为所述第一样本图像的总数量的5%~25%。The method according to claim 3, wherein the total number of the sample images to be mined is 5%˜25% of the total number of the first sample images.
  13. 根据权利要求4所述的方法,其中,所述对所述第六目标和所述第七目标进行合并,得到所述第五目标,包括:The method according to claim 4, wherein the combining the sixth target and the seventh target to obtain the fifth target comprises:
    去除所述第六目标中与所述第七目标相同的目标,得到所述第六目标中与所述第七目标不同的剩余目标;Remove the same target as the seventh target in the sixth target, and obtain the remaining target that is different from the seventh target in the sixth target;
    将所述剩余目标和所述第七目标作为所述第五目标。The remaining target and the seventh target are taken as the fifth target.
  14. 根据权利要求6所述的方法,其中,在所述根据第一类别的第三目标的特征信息与各个第五目标的特征信息之间的距离,分别确定所述第一类别的第三目标中与各个第五目标距离最小的第三目标,并作为第八目标的步骤之后,所述方法还包括:The method according to claim 6, wherein, according to the distance between the characteristic information of the third target of the first category and the characteristic information of each fifth target, respectively determining the third target of the first category After the third target with the smallest distance from each fifth target and serving as the eighth target, the method further includes:
    在所述第四目标所在的第一样本图像的数量达到所述第一类别的待挖掘的样本图像的第二数量时,结束对所述第八目标的确定。When the number of the first sample images where the fourth target is located reaches the second number of the sample images to be mined of the first category, the determination of the eighth target is ended.
  15. 根据权利要求7所述的方法,其中,在所述根据第一类别的第三目标的特征信息与各个第五目标的特征信息之间的距离,分别确定所述第一类别的第三目标中与各个第五目标距离最小的第三目标,并作为第八目标的步骤之后,所述方法还包括:The method according to claim 7, wherein, according to the distance between the characteristic information of the third target of the first category and the characteristic information of each fifth target, respectively determining the third target of the first category After the third target with the smallest distance from each fifth target and serving as the eighth target, the method further includes:
    在所述第四目标所在的第一样本图像的数量未达到所述第一类别的待挖掘的样本图像的第二数量,且存储所述第五目标的特征信息的集合为空时,结束对所述第八目标的确定。When the number of the first sample images where the fourth target is located has not reached the second number of the sample images of the first category to be mined, and the set of storing the feature information of the fifth target is empty, the process ends. Determination of the eighth target.
  16. 根据权利要求8所述的方法,其中,所述将所述第三样本图像输入所述目标检测网络中处理,得到所述第三样本图像中的第三目标的特征信息,包括:The method according to claim 8, wherein the inputting the third sample image into the target detection network for processing to obtain the feature information of the third target in the third sample image comprises:
    将所述第三样本图像,输入所述目标检测网络中,得到所述目标检测网络的隐藏层输出的特征向量;Inputting the third sample image into the target detection network to obtain the feature vector output by the hidden layer of the target detection network;
    将所述特征向量确定为所述第三目标的特征信息。The feature vector is determined as feature information of the third target.
  17. 一种目标检测方法,所述方法包括:A target detection method, the method comprising:
    将待处理图像输入目标检测网络中处理,得到所述待处理图像的目标检测结果,所述目标检测结果包括所述待处理图像中目标的位置和类别,Input the to-be-processed image into a target detection network for processing to obtain a target detection result of the to-be-processed image, where the target detection result includes the position and category of the target in the to-be-processed image,
    所述目标检测网络是根据权利要求1-10中任意一项的网络训练方法训练得到的。The target detection network is obtained by training according to the network training method of any one of claims 1-10.
  18. 一种网络训练装置,包括:A network training device, comprising:
    目标检测部分,被配置为将未标注的第一样本图像输入目标检测网络中处理,得到所述第一样本图像的目标检测结果,所述目标检测结果包括所述第一样本图像中目标的图像区域、特征信息及分类概率;The target detection part is configured to input the unlabeled first sample image into the target detection network for processing, and obtain the target detection result of the first sample image, and the target detection result includes the target detection result in the first sample image. The image area, feature information and classification probability of the target;
    置信度确定部分,被配置为根据所述目标的分类概率,确定所述目标的类别置信度;a confidence determination part, configured to determine the category confidence of the target according to the classification probability of the target;
    标注部分,被配置为针对所述目标中类别置信度大于或等于第一阈值的第一目标,将所述第一目标所在的第一样本图像作为已标注的第二样本图像,并加入训练集中,其中,所述第二样本图像的标注信息包括所述第一目标的图像区域及与所述第一目标的类别置信度对应的类别,所述训练集中包括已标注的第三样本图像;The labeling part is configured to take the first sample image where the first target is located as the labeled second sample image for the first target whose category confidence is greater than or equal to the first threshold in the target, and join the training set, wherein the labeling information of the second sample image includes the image area of the first target and the class corresponding to the class confidence of the first target, and the training set includes the labelled third sample image;
    特征挖掘部分,被配置为针对所述目标中类别置信度小于所述第一阈值的第二目标,根据所述第三样本图像中的第三目标的特征信息,对所述第二目标进行特征相关挖掘,通过特征相关挖掘,从所述第二目标中确定出第四目标及所述第四目标所在的第一样本图像,并将所述第四目标所在的第一样本图像作为第四样本图像,并加入所述训练集中;The feature mining part is configured to, for the second target in the target whose category confidence is less than the first threshold, perform feature information on the second target according to the feature information of the third target in the third sample image Relevance mining, through feature correlation mining, determine the fourth target and the first sample image where the fourth target is located from the second target, and use the first sample image where the fourth target is located as the first sample image. Four sample images are added to the training set;
    训练部分,被配置为根据所述第四样本图像的标注信息,所述训练集中的第二样本图像、第三样本图像及所述第四样本图像,训练所述目标检测网络。The training part is configured to train the target detection network according to the label information of the fourth sample image, the second sample image, the third sample image and the fourth sample image in the training set.
  19. 一种电子设备,包括:An electronic device comprising:
    处理器;processor;
    被配置为存储处理器可执行指令的存储器;a memory configured to store processor-executable instructions;
    其中,所述处理器被配置为调用所述存储器存储的指令,以执行权利要求1至16中任意一项所述的网络训练方法,或执行权利要求17所述的目标检测方法。Wherein, the processor is configured to invoke the instructions stored in the memory to execute the network training method as claimed in any one of claims 1 to 16, or to execute the target detection method as claimed in claim 17.
  20. 一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现权利要求1至16中任意一项所述的方法网络训练方法,或实现权利要求17所述的目标检测方法。A computer-readable storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the network training method according to any one of claims 1 to 16 is realized, or the method described in claim 17 is realized. The target detection method described above.
PCT/CN2020/125972 2020-07-15 2020-11-02 Network training method and apparatus, target detection method and apparatus, and electronic device WO2022011892A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
KR1020217038227A KR20220009965A (en) 2020-07-15 2020-11-02 Network training method and apparatus, target detection method and apparatus, and electronic device
JP2021569189A JP2022544893A (en) 2020-07-15 2020-11-02 Network training method and apparatus, target detection method and apparatus, and electronic equipment

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010681178.2 2020-07-15
CN202010681178.2A CN111881956B (en) 2020-07-15 2020-07-15 Network training method and device, target detection method and device and electronic equipment

Publications (1)

Publication Number Publication Date
WO2022011892A1 true WO2022011892A1 (en) 2022-01-20

Family

ID=73154466

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/125972 WO2022011892A1 (en) 2020-07-15 2020-11-02 Network training method and apparatus, target detection method and apparatus, and electronic device

Country Status (5)

Country Link
JP (1) JP2022544893A (en)
KR (1) KR20220009965A (en)
CN (1) CN111881956B (en)
TW (1) TWI780751B (en)
WO (1) WO2022011892A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115100419A (en) * 2022-07-20 2022-09-23 中国科学院自动化研究所 Target detection method and device, electronic equipment and storage medium
CN115470910A (en) * 2022-10-20 2022-12-13 晞德软件(北京)有限公司 Automatic parameter adjusting method based on Bayesian optimization and K-center sampling
CN115601749A (en) * 2022-12-07 2023-01-13 赛维森(广州)医疗科技服务有限公司(Cn) Pathological image classification method and image classification device based on characteristic peak map

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112446335A (en) * 2020-12-02 2021-03-05 电子科技大学中山学院 Terahertz contraband detection method based on deep learning
CN112541928A (en) * 2020-12-18 2021-03-23 上海商汤智能科技有限公司 Network training method and device, image segmentation method and device and electronic equipment
CN112581472B (en) * 2021-01-26 2022-09-02 中国人民解放军国防科技大学 Target surface defect detection method facing human-computer interaction
CN113052244B (en) * 2021-03-30 2023-05-26 歌尔股份有限公司 Classification model training method and classification model training device
CN113159209A (en) * 2021-04-29 2021-07-23 深圳市商汤科技有限公司 Target detection method, device, equipment and computer readable storage medium
CN113344086B (en) * 2021-06-16 2022-07-01 深圳市商汤科技有限公司 Man-machine loop method, device, system, electronic equipment and storage medium
AU2021240261A1 (en) * 2021-06-28 2023-01-19 Sensetime International Pte. Ltd. Methods, apparatuses, devices and storage media for training object detection network and for detecting object
CN113486957A (en) * 2021-07-07 2021-10-08 西安商汤智能科技有限公司 Neural network training and image processing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104156438A (en) * 2014-08-12 2014-11-19 德州学院 Unlabeled sample selection method based on confidence coefficients and clustering
CN104318242A (en) * 2014-10-08 2015-01-28 中国人民解放军空军工程大学 High-efficiency SVM active half-supervision learning algorithm
CN108985334A (en) * 2018-06-15 2018-12-11 广州深域信息科技有限公司 The generic object detection system and method for Active Learning are improved based on self-supervisory process
US20190073447A1 (en) * 2017-09-06 2019-03-07 International Business Machines Corporation Iterative semi-automatic annotation for workload reduction in medical image labeling
US20190378044A1 (en) * 2013-12-23 2019-12-12 Groupon, Inc. Processing dynamic data within an adaptive oracle-trained learning system using curated training data for incremental re-training of a predictive model

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107341434A (en) * 2016-08-19 2017-11-10 北京市商汤科技开发有限公司 Processing method, device and the terminal device of video image
CN107665353A (en) * 2017-09-15 2018-02-06 平安科技(深圳)有限公司 Model recognizing method, device, equipment and computer-readable recording medium based on convolutional neural networks
CN108764281A (en) * 2018-04-18 2018-11-06 华南理工大学 A kind of image classification method learning across task depth network based on semi-supervised step certainly
US10810460B2 (en) * 2018-06-13 2020-10-20 Cosmo Artificial Intelligence—AI Limited Systems and methods for training generative adversarial networks and use of trained generative adversarial networks
CN109034190B (en) * 2018-06-15 2022-04-12 拓元(广州)智慧科技有限公司 Object detection system and method for active sample mining by dynamically selecting strategy
JP6678709B2 (en) * 2018-08-24 2020-04-08 株式会社東芝 Information processing apparatus, information processing method and program
CN109766991A (en) * 2019-01-14 2019-05-17 电子科技大学 A kind of artificial intelligence optimization's system and method using antagonistic training

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190378044A1 (en) * 2013-12-23 2019-12-12 Groupon, Inc. Processing dynamic data within an adaptive oracle-trained learning system using curated training data for incremental re-training of a predictive model
CN104156438A (en) * 2014-08-12 2014-11-19 德州学院 Unlabeled sample selection method based on confidence coefficients and clustering
CN104318242A (en) * 2014-10-08 2015-01-28 中国人民解放军空军工程大学 High-efficiency SVM active half-supervision learning algorithm
US20190073447A1 (en) * 2017-09-06 2019-03-07 International Business Machines Corporation Iterative semi-automatic annotation for workload reduction in medical image labeling
CN108985334A (en) * 2018-06-15 2018-12-11 广州深域信息科技有限公司 The generic object detection system and method for Active Learning are improved based on self-supervisory process

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115100419A (en) * 2022-07-20 2022-09-23 中国科学院自动化研究所 Target detection method and device, electronic equipment and storage medium
CN115470910A (en) * 2022-10-20 2022-12-13 晞德软件(北京)有限公司 Automatic parameter adjusting method based on Bayesian optimization and K-center sampling
CN115601749A (en) * 2022-12-07 2023-01-13 赛维森(广州)医疗科技服务有限公司(Cn) Pathological image classification method and image classification device based on characteristic peak map

Also Published As

Publication number Publication date
CN111881956A (en) 2020-11-03
JP2022544893A (en) 2022-10-24
CN111881956B (en) 2023-05-12
TWI780751B (en) 2022-10-11
TW202205151A (en) 2022-02-01
KR20220009965A (en) 2022-01-25

Similar Documents

Publication Publication Date Title
WO2022011892A1 (en) Network training method and apparatus, target detection method and apparatus, and electronic device
CN107491541B (en) Text classification method and device
US11120078B2 (en) Method and device for video processing, electronic device, and storage medium
TWI766286B (en) Image processing method and image processing device, electronic device and computer-readable storage medium
US20210248718A1 (en) Image processing method and apparatus, electronic device and storage medium
WO2022166069A1 (en) Deep learning network determination method and apparatus, and electronic device and storage medium
WO2021036382A9 (en) Image processing method and apparatus, electronic device and storage medium
WO2021027343A1 (en) Human face image recognition method and apparatus, electronic device, and storage medium
CN111931844B (en) Image processing method and device, electronic equipment and storage medium
CN113326768B (en) Training method, image feature extraction method, image recognition method and device
CN111539410B (en) Character recognition method and device, electronic equipment and storage medium
WO2022247103A1 (en) Image processing method and apparatus, electronic device, and computer-readable storage medium
CN113792207A (en) Cross-modal retrieval method based on multi-level feature representation alignment
WO2022021901A1 (en) Target detection method and apparatus, electronic device, and storage medium
CN110532956B (en) Image processing method and device, electronic equipment and storage medium
CN109685041B (en) Image analysis method and device, electronic equipment and storage medium
WO2022099989A1 (en) Liveness identification and access control device control methods, apparatus, electronic device, storage medium, and computer program
WO2022247128A1 (en) Image processing method and apparatus, electronic device, and storage medium
CN111242303A (en) Network training method and device, and image processing method and device
CN111259967A (en) Image classification and neural network training method, device, equipment and storage medium
WO2020220807A1 (en) Image generation method and apparatus, electronic device, and storage medium
WO2022247091A1 (en) Crowd positioning method and apparatus, electronic device, and storage medium
WO2022141969A1 (en) Image segmentation method and apparatus, electronic device, storage medium, and program
CN113781518A (en) Neural network structure searching method and device, electronic device and storage medium
CN111523599B (en) Target detection method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2021569189

Country of ref document: JP

Kind code of ref document: A

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20945441

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20945441

Country of ref document: EP

Kind code of ref document: A1