Incremental target detection method, device, equipment and medium

The target detection model is trained through the model-independent meta-learning algorithm and MAML algorithm, and the original and new training samples are combined to solve the problem of insufficient detection accuracy of the traditional target detection model in the new categories and achieve accurate detection of the new categories. and feature extraction, improving the overall accuracy of the detection model.

CN114898154BActive Publication Date: 2024-09-06BEIJING YOUZHUJU NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210530908.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-16
Publication Date
2024-09-06
Estimated Expiration
2042-05-16

AI Technical Summary

Technical Problem

Traditional target detection algorithms based on deep learning cannot effectively detect and identify new categories, and existing incremental target detection methods still cannot meet expectations in terms of detection accuracy, especially in ultra-high-definition applications that require intra-class subdivision. In multi-category detection scenarios.

Method used

A model-independent meta-learning algorithm is used to train the target detection model. By obtaining a combined sample set of original and new training samples, the model avoids forgetting existing knowledge and improves the detection ability of new categories. Specific methods include using the MAML algorithm to train the detector and feature extractor to ensure that the model can both detect new target locations and extract its features when updating.

Benefits of technology

It realizes a target detection model that does not forget existing knowledge when facing new categories, improves the accuracy of the detection model and the detection ability of new categories, and ensures detection accuracy in multi-category scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114898154B
    Figure CN114898154B
Patent Text Reader

Abstract

The present application discloses an incremental target detection method, apparatus, equipment and medium. When training a detector and a feature extractor, the original training samples and the newly added training samples are sampled by utilizing a model-independent meta-learning algorithm, thereby avoiding the situation where the newly added training samples are not included in the obtained set of samples to be trained due to a small number of newly added training samples, and also avoiding the situation where the obtained set of samples to be trained includes only the original training samples due to a large number of original training samples. Thus, the samples used in subsequent training include both the original training samples and the newly added training samples, thereby ensuring that the trained target detection model will not forget the existing knowledge and can detect the newly added categories, thereby improving the accuracy of the target detection model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an incremental target detection method, device, equipment and medium. Background Art

[0002] Among the many technical fields of computer vision, object detection is a very basic task. Object detection, also known as object extraction, is a kind of image segmentation based on the geometric and statistical features of the object. It combines the segmentation and recognition of the object into one, and its accuracy and real-time performance are important capabilities of the entire system.

[0003] Traditional deep learning-based object detection algorithms mainly study the problem of closed datasets. Usually, the number and classification of closed datasets are limited, and the object detection model trained using closed datasets cannot meet the needs of newly added categories. How to detect newly added category data is a technical problem that needs to be solved urgently. Summary of the invention

[0004] In view of this, embodiments of the present application provide an incremental target detection method, apparatus, device and medium to detect and identify new targets.

[0005] To achieve the above objectives, the technical solutions provided by this application are as follows:

[0006] In a first aspect of the present application, an incremental target detection method is provided, the method being applied to a target detection model, the target detection model comprising a detector and a feature extractor, including:

[0007] Acquire a training sample set, wherein the training sample set includes original training samples and newly added training samples, and the newly added training samples include newly added targets;

[0008] The original training samples and the newly added training samples are sampled using a model-independent meta-learning algorithm to obtain a set of samples to be trained;

[0009] The detector and the feature extractor are trained using the set of samples to be trained to obtain a trained detector and a trained feature extractor, wherein the trained detector is used to detect the newly added target, and the trained feature extractor is used to extract features of the newly added target.

[0010] In a second aspect of the present application, an incremental target detection device is provided, the device is applied to a target detection model, the target detection model includes a detector and a feature extractor, including:

[0011] A first acquisition unit, configured to acquire a training sample set, wherein the training sample set includes original training samples and newly added training samples, and the newly added training samples include newly added targets;

[0012] A second acquisition unit is used to sample the original training samples and the newly added training samples by using a model-independent meta-learning algorithm to obtain a set of samples to be trained;

[0013] A training unit is used to train the detector and the feature extractor using the set of samples to be trained to obtain a trained detector and a trained feature extractor, wherein the trained detector is used to detect the newly added target, and the trained feature extractor is used to extract features of the newly added target.

[0014] In the third aspect of the present application, an electronic device is provided, comprising: a processor and a memory; the memory is used to store instructions or computer programs; the processor is used to execute the instructions or computer programs in the memory, so that the electronic device executes the method described in the first aspect.

[0015] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium. When the instructions are executed on a device, the device executes the method described in the first aspect.

[0016] In a fifth aspect of the present application, a computer program product is provided, wherein the computer program product comprises a computer program / instructions, and when the computer program / instructions are executed by a processor, the method described in the first aspect is implemented.

[0017] It can be seen that this application has the following beneficial effects:

[0018] In the present application, when training the detector and feature extractor, the original training samples and the newly added training samples are trained by utilizing a model-independent meta-learning algorithm, thereby avoiding the situation where the newly added training samples are not included in the obtained set of samples to be trained due to a small number of newly added training samples, and also avoiding the situation where the obtained set of samples to be trained includes only the original training samples due to a large number of original training samples. As a result, the samples used in subsequent training include both the original training samples and the newly added training samples, thereby ensuring that the trained target detection model will not forget the existing knowledge and can detect the newly added categories, thereby improving the accuracy of the target detection model. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0020] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;

[0021] Figure 2 A flow chart of an incremental target detection method provided in an embodiment of the present application;

[0022] Figure 3 A schematic diagram of a training sample change provided in an embodiment of the present application;

[0023] Figure 4 A schematic diagram of an incremental target detection device provided in an embodiment of the present application;

[0024] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0026] With the development of technology, it is gradually found that the closed data set model cannot meet the detection of new categories when encountering new categories. The emergence of new categories means that the data must be re-labeled and the model must be trained. Currently, the following two methods are mainly used to detect new categories:

[0027] One is the incremental target detection algorithm, which learns a new model based on the existing model to detect the original categories and newly added categories. The difficulty of this method is that if no special design is performed and only new data is used to update the model, the performance of the model in the original categories will be poor. To solve this problem, it is proposed to "distill" the knowledge in the original model, and learn both the new categories and some of the distilled knowledge when updating the model, so as to ensure that the model does not forget the existing knowledge. However, the disadvantage of this method is that the incremental target detection still cannot meet the expectations in terms of detection accuracy, especially for scenarios that require intra-class segmentation and detection of many categories, such as trademark detection.

[0028] The other is a retrieval-based target detection algorithm, which mainly relies on detectors and feature extractors. The detector is responsible for extracting the area where the target is located, and the feature extractor is responsible for extracting the features of the corresponding area. After the feature is extracted, the feature is compared with the existing category features in the database to determine the classification of the target. The advantage of this method is that it is relatively robust to categories, and in principle there is no additional overhead for the addition of large-scale categories. The disadvantage is that the recall ability is very dependent on the position of the detector frame. When the detector has not detected a new category, even if the new category enters the database, the detector cannot detect the target.

[0029] Based on this, the present application provides an incremental target detection method, which retrains the detector and feature extractor through an incremental learning mechanism, so that the trained detector can detect the position of the newly added target in the image, and the trained feature extractor can extract the features of the newly added target, and then determine the category of the newly added target through a retrieval algorithm. Specifically, when training the detector and feature extractor, the original training samples and the newly added training samples are sampled by using a model-agnostic meta learning algorithm (Model-Agnostic Meta learning, MAML), so as to avoid the situation where the newly added training samples are not included in the obtained training sample set due to the small number of newly added training samples, and also avoid the situation where the obtained training sample set only includes the original training samples due to the large number of original training samples, so that the samples used in subsequent training include both the original training samples and the newly added training samples, ensuring that the trained target detection model will not forget the existing knowledge, but can also detect the newly added categories, thereby improving the accuracy of the target detection model.

[0030] For ease of understanding of the embodiments of this application, see Figure 1 The application scenario diagram shown in FIG. 1 combines the advantages of incremental target retrieval and retrieval target detection in the detection method shown in the application scenario diagram. Figure 1As shown in Figure 1, the target detection model includes two processes: reasoning process and incremental learning process. The solid line represents the reasoning process, and the dotted line represents the incremental learning process. Figure 1 Let’s take the detection of trademarks in images as an example.

[0031] The reasoning process means that when the target detection model is called, the image passes through the detector, which will extract all possible trademark areas in the image. That is, the detector will mark the detection boxes of all possible trademark areas in the image, and transmit the image corresponding to each detection box to the feature extractor, so that the feature extractor can convert the visual features into an embedding vector in a high-dimensional space. After obtaining the embedding vector, the retrieval engine will recall all trademarks similar to the embedding vector from the retrieval library based on the embedding vector, thereby determining the trademark classification framed by the detection box.

[0032] Among them, the incremental learning process is: the user uploads an image containing a newly added trademark, and uses the existing detector to detect the image containing the newly added trademark to mark the detection boxes of all possible trademark areas in the image. The detection results are displayed to the user, and the user determines the trademark area that needs to be stored in the database and marks the trademark name corresponding to the trademark area. The feature extractor reads the stored trademark area and the corresponding trademark name from the database, and converts the visual features corresponding to the trademark area into an embedded vector to add the embedded vector and the corresponding trademark name to the retrieval library. When the number of new trademark areas in the database or the number of new embedded vectors in the retrieval library reaches the preset number, it will trigger automatic iteration to update the detector and feature extractor.

[0033] If the image containing the newly added trademark is detected by using an existing detector and no possible trademark area is detected, a marking page can be displayed to the user, so that the user can manually mark the trademark area in the image on the marking page and add the trademark name corresponding to the trademark area. In response to the user completing the marking, the marked trademark area and the corresponding trademark name are added to the database.

[0034] Based on the above description, an incremental target detection method provided in an embodiment of the present application will be described below.

[0035] See also Figure 2, this figure is a flow chart of an incremental target detection method provided in an embodiment of the present application. The method can be executed by a target detection device, which can be a server, an electronic device, or other devices, without limitation. Among them, the server can be a cloud server or a server cluster and other devices with storage and computing functions. Electronic devices can include mobile phones, tablet computers, desktop computers, laptop computers, vehicle-mounted terminals, wearable electronic devices, all-in-one machines, smart home devices and other devices with communication functions, and can also be devices simulated by virtual machines or simulators. Figure 2 As shown, the method may include the following steps:

[0036] S201: Obtain a training sample set, where the training sample set includes original training samples and newly added training samples.

[0037] In this embodiment, when the number of newly added categories reaches a preset threshold, an automatic update mechanism can be triggered to update the detector and feature extractor in the target detection model. When performing the update operation, a training sample set can be obtained from the database, and the training sample set includes original training samples and newly added training samples. Among them, the original training sample refers to the base class data used when training basic detectors and feature extractors. Generally, the amount of data of this base class data is large. The newly added training sample refers to a small amount of data containing new labels, and the newly added training sample includes a newly added target. For example, the training sample is an image including a trademark, and the original training sample refers to multiple images including known trademarks 1-trademark 10, then the newly added training sample refers to one or more images including newly added trademarks 11-trademark 15.

[0038] The detector is used to detect the region where the target is located in the input image to extract the location of the region. The feature extractor is used to extract the feature vector of the region, so that the search engine can determine the classification of the target included in the region based on the feature vector.

[0039] Optionally, before obtaining the training sample set, the following may be included: obtaining a newly added training sample; using a detector to detect a newly added target in the newly added sample to obtain a detection result; in response to the detection result including the newly added target, displaying the detection result; in response to a confirmation operation triggered by a user, storing the detection result in a database. The database includes the detection results of the newly added training sample and the detection results corresponding to the original training sample.

[0040] That is, before triggering the automatic update, when the target detection model receives the newly added training samples input by the user, it uses the existing detector to detect the newly added targets in the newly added training samples to obtain the detection results. Among them, the detection result can be the area where the newly added target is detected, or the area where the newly added target is not detected. When the detection result is the area where the newly added target is detected, the detection result is displayed to the user, and the user confirms whether the result detected by the detector is accurate. If the detection result is accurate, the user can trigger a confirmation operation to store the detection result in the database. If the detection result is inaccurate, the user can manually correct the detection result through the display page, and then store the corrected detection result in the database. If the detection result is that the area where the newly added target is not detected, the detection result can be displayed to the user, and the user can manually mark the area where the newly added target is located through the display page, and then store the marked result in the database.

[0041] Optionally, in response to a confirmation operation triggered by the user, the detection result and the label corresponding to the newly added target are stored in the database. The label is used to indicate the category to which the newly added target belongs. For example, the area where the newly added trademark confirmed by the user is located and the trademark name of the trademark are stored in the database.

[0042] Among them, after adding the area where the new target is located and the label corresponding to the new target to the database, the feature extractor can extract features from the area where the new target is located, obtain the feature vector, and store the feature vector and the label corresponding to the new target in the retrieval library.

[0043] Optionally, in response to the number of detection results corresponding to the newly added training samples added to the database satisfying the fourth preset condition, or the number of feature vectors added to the search library satisfying the fourth preset condition, the detection results corresponding to the newly added training samples and the detection results corresponding to the original training samples are obtained from the database and combined into a training sample set. The fourth preset condition indicates a threshold value for the number of newly added samples, and the specific value can be set according to actual application conditions, which is not limited in this embodiment.

[0044] S202: Sample the original training samples and the newly added training samples using a model-independent meta-learning algorithm to obtain a set of samples to be trained.

[0045] After obtaining the training sample set, in order to ensure that the trained target detection model can accurately detect the original data, the MAML algorithm is used to sample the original training samples and the newly added training samples to obtain the training sample set. The sampled training samples will be used as tasks, and the learning goal of each task is to distinguish the foreground from the background. The foreground refers to the area including the target, and the background refers to the area not including the target.

[0046] Among them, the MAML algorithm is a deep learning parameter optimization method that is independent of the model structure. Among them, being independent of the model structure means not paying attention to the specific model structure used. It can be applied to convolutional neural networks, recurrent neural networks, and the latest Transformer and other model structures. When updating parameters, MAML can adopt a two-step gradient descent paradigm. The first gradient descent is executed for each task to calculate a gradient range. The second gradient descent takes the average of the above gradient range to reduce the problem of too fast deviation on new data.

[0047] S203: Train the detector and the feature extractor using the sample set to be trained to obtain a trained detector and a trained feature extractor.

[0048] After obtaining the set of samples to be trained, the detector and the feature extractor are trained using the set of samples to be trained to obtain a trained detector and a trained feature extractor. The trained detector can accurately detect the position of the newly added target in the image, and the trained feature extractor can accurately extract features of the newly added target.

[0049] In this embodiment, the original training samples and the newly added training samples are sampled alternately, and the sampled training samples are used as tasks to update the detector and feature extractor, which not only ensures that the newly stored training samples can be sampled, but also updates the model parameters through two gradient calculations through the MAML method, suppressing the model parameter offset too fast, thereby avoiding the updated parameters from over-emphasizing the newly stored training samples and causing the model to fall into a local optimum. At the same time, the training samples used in the training of this embodiment are not batches obtained by random sampling, but the network parameters are optimized by grouping the newly stored data batches and the existing old data batches into tasks at a certain sampling ratio. In this way, when the existing old data is much larger than the newly stored data, it can be ensured that the newly stored data can be quickly learned by the neural network.

[0050] Optionally, the detector is trained using a set of samples to be trained to obtain a trained detector, including: for any sample to be trained in the set of samples to be trained, obtaining a feature map corresponding to the sample to be trained; for any pixel point in the feature map, determining the probability that the pixel point is the target center point of the detection frame according to the feature map; determining the position vector of the detection frame according to the feature map; constructing a loss function based on the probability and the first label, the position vector and the second label; in response to the value corresponding to the loss function satisfying the first preset condition, obtaining a trained detector. That is, this embodiment updates the detector using an anchor-free technology. Among them, the first label is used to indicate whether the pixel point is the target center point, and the second label is the position vector of the detection frame corresponding to the pixel point.

[0051] That is, this embodiment determines the classification loss function by probability and the first label, determines the frame regression loss function by the position vector and the second label, and constructs the loss function of the detector according to the classification loss function and the frame regression loss function. The parameters of the detector are adjusted with the goal of minimizing the loss function of the detector, thereby obtaining a trained detector.

[0052] For example, the input image is The image I can be feature extracted through a simple convolutional neural network to obtain a feature map that is downsampled n times. Where h and w represent the height and width of the image, respectively, and c represents the depth of the feature map. Based on the extracted feature map m, the detector learns to predict two targets:

[0053] 1. Continue to perform high-dimensional mapping on the feature map to predict the probability of each pixel becoming the target center point of the detection box.

[0054] 2. Predict the position vector of the possible detection box in the feature map.

[0055] Specifically, the gradient descent algorithm in the classic deep learning algorithm can be used to optimize these two objectives respectively, and the loss function is defined as:

[0056]

[0057] Among them, L cls represents the classification loss function, P x,y represents the probability of predicting the pixel point (x, y) as the target center point, c * x,y Represents the true annotation of the pixel point (x, y). reg represents the box regression loss function, t x,y Represents the position vector of the detection box corresponding to the predicted pixel point (x, y), t * x,y Represents the true position vector of the detection box corresponding to the pixel point. N is Npos, which represents the number of positive sample boxes detected, and λ is a hyperparameter, which represents the ratio between the classification loss function and the box regression loss function.

[0058] Among them, c * x,y >0 means binarization is performed and only the position vector of the detection box whose prediction result is the foreground part is calculated.

[0059] Among them, the classification loss function L cls It can be a cross entropy binary loss function, which is specifically expressed as follows:

[0060]

[0061] Here, k represents the number of predicted categories. Since this embodiment only distinguishes between foreground and background, k=2.

[0062] Among them, the specific expression of the box regression loss function is as follows:

[0063]

[0064] Among them, prediction represents the position vector of the predicted detection box, groundtruth represents the position vector of the real detection box. Intersection represents the intersection of two boxes, and union represents the union of two boxes.

[0065] Optionally, in order to realize that the feature extractor maps the visual features into a high-dimensional vector and ensure that the features extracted from similar trademarks have a high degree of similarity, this embodiment adopts a triplet sampling method and a loss function calculation method of triplet loss. For example, the sampled triplet consists of three samples:<a,p,n> , where a indicates the anchor positive sample (anchor), p indicates the comparison sample (positive), p and a are samples of the same category, and n indicates the negative sample (negative), n and a are not samples of the same category. The loss function corresponding to this triplet is calculated as:

[0066] L=max(d(a,p)-d(a,n)+margin,0) (4)

[0067] Among them, margin represents a fixed constant distance, and d() represents a distance calculation function, such as a cosine similarity calculation function.

[0068] Among them, the distance calculation function d is expressed as follows:

[0069]

[0070] Where N represents the number of sample groups, θ yi and θ j represents the vector of x and the vector of y in d(x,y). For example, θ in d(a,p) yi The vector that identifies sample a, θ j The vector that identifies the sample P. s() represents the activation function, and its specific form can be determined according to the actual application.

[0071] In this embodiment, the optimization goal is to shorten the distance between a and p and increase the distance between a and n, so as to achieve greater differentiation during retrieval and recall.

[0072] Based on the above considerations, this embodiment provides a feature extractor training method, which is specifically implemented as follows:

[0073] 1) Determine at least three training samples from a set of samples to be trained, where the at least three training samples include a first training sample, a second training sample, and a third training sample.

[0074] The second training sample has the same category as the first training sample, and the third training sample has a different category from the first training sample. For example, the first training sample is an anchor point positive sample, the second training sample is a comparison positive sample, and the third training sample is a negative sample.

[0075] 2) Perform enhancement processing on at least three training samples respectively to obtain an enhanced training sample set, where the enhanced training sample set includes a first enhanced training sample, a second enhanced training sample, and a third enhanced training sample.

[0076] To ensure that the feature extractor can extract features from different images, such as rotated images, images containing the same object but different colors, etc., before training the feature extractor, the acquired training samples are enhanced to improve the robustness of the feature extractor. The enhancement processing operation may include one or more of rotation, color change, perspective distortion, smearing, and clarity change.

[0077] For example Figure 3 As shown, the first training sample (anchor) is enhanced to obtain the first enhanced training sample (hard anchor); the second training sample (positive) is enhanced to obtain the second enhanced training sample (hard positive); and the third training sample (negative) is enhanced to obtain the third enhanced training sample (hard negative).

[0078] 3) Randomly select three training samples from at least three training samples and enhanced training sample sets as a training sample group.

[0079] For example, three training samples are randomly selected from the six training samples to form a training sample group.

[0080] 4) For the target training sample group, use the feature extractor to extract features from the target training sample group to obtain a feature set.

[0081] The target training sample group may be any training sample group in the above step 3), or may be a preset training sample group.

[0082] Optionally, the target training sample group includes at least one of a first training sample group, a second training sample group, a third training sample group and a fourth training sample group. The first training sample group includes a first training sample, a second training sample and a third training sample, the second training sample group includes a first enhanced training sample, a second enhanced training sample and a third enhanced training sample, the third training sample group includes a second training sample, a second enhanced training sample and a third training sample, and the fourth training sample group includes a first enhanced sample, a first enhanced training sample and a third training sample.

[0083] For example, the first training sample group triplets 1: anchor, positive, negative; the second training sample group triplets 2: hard anchor, hard positive, hard negative; the third training sample group triplets 3: positive, hard positive, negative; the fourth training sample group triplets 4: anchor, hard anchor, negative.

[0084] For the training samples included in the target training sample group, the feature extractor is used to extract features from the training samples, thereby obtaining features corresponding to each training sample in the target training sample group. Specifically, since the feature extractor extracts features from the area detected by the detector, the training samples included in the target training sample group are first input into the detector to obtain the detection area, and the detection area is input into the feature extractor to extract features corresponding to the detection area.

[0085] 5) Determine the loss function corresponding to the target training group based on the feature set.

[0086] Specifically, for each target training group, the loss function of the target training group can be determined using formula (4).

[0087] 6) Determine the loss function of the feature extractor based on the loss function corresponding to each target training group.

[0088] Optionally, the loss function of the feature extractor is obtained by weighted summing the loss functions corresponding to each target training group.

[0089] For example, in the target training sample group, the loss function corresponding to triplets1 is L1, the loss function corresponding to triplets2 is L2, the loss function corresponding to triplets3 is L3, and the loss function corresponding to triplets4 is L4. Then the loss function of the feature extractor is: L = 1 / 4*(a1*L1+a2*L2+a3*L3+a4*L4).

[0090] 7) Optimize the loss function until the second preset condition is met to obtain a trained feature extractor.

[0091] After determining the loss function of the feature extractor, a gradient descent algorithm may be used to optimize the loss function until the value of the loss function satisfies a second preset condition, thereby obtaining a trained feature extractor.

[0092] Optionally, after completing the training of the detector and the feature extractor, data to be detected is received, which includes a target to be detected; the trained detector is used to detect the area where the target to be detected is located; the area is input into the trained feature extractor to obtain features corresponding to the area; the similarity between the feature and the target feature stored in the retrieval library is calculated; and the classification result corresponding to the target feature whose similarity meets a third preset condition is determined as the classification result of the target to be detected.

[0093] In this embodiment, after the detector and feature extractor are trained and generated, the detector and feature extractor can be used to detect the target. The detector is used to detect the area in the image where the target may exist, and transmit the area to the feature extractor so that the feature extractor can extract the feature vector of the area, and then the retrieval engine calculates the similarity between the feature vector and the feature vector stored in the retrieval library, and the classification result corresponding to the stored feature vector whose similarity meets the third preset condition is used to determine the classification result of the target. The third preset condition refers to the similarity threshold, for example, 80%, and the specific value can be determined according to the actual application situation, and this embodiment will not be determined here.

[0094] Based on the above method embodiment, the embodiment of the present application also provides an incremental target detection device, which will be described below in conjunction with the accompanying drawings.

[0095] See also Figure 4 , which is a structural diagram of an incremental target detection device provided in an embodiment of the present application, such as Figure 4 As shown, the device may include: a first acquisition unit 401, a second acquisition unit 402 and a training unit 403.

[0096] The first acquisition unit is used to acquire a training sample set, wherein the training sample set includes original training samples and newly added training samples, and the newly added training samples include newly added targets;

[0097] A second acquisition unit is used to sample the original training samples and the newly added training samples by using a model-independent meta-learning algorithm to obtain a set of samples to be trained;

[0098] A training unit is used to train the detector and the feature extractor using the set of samples to be trained to obtain a trained detector and a trained feature extractor, wherein the trained detector is used to detect the newly added target, and the trained feature extractor is used to extract features of the newly added target.

[0099] In a specific implementation, the training unit 403 is specifically used to obtain a feature map corresponding to any sample to be trained in the set of samples to be trained; for any pixel point in the feature map, determine the probability of the pixel point being the target center point of the detection frame according to the feature map; determine the position vector of the detection frame according to the feature map; construct a loss function based on the probability and the first label, the position vector and the second label, the first label is used to indicate whether the pixel point is the target center point, and the second label is the position vector of the detection frame corresponding to the pixel point; in response to the value corresponding to the loss function satisfying the first preset condition, obtain a trained detector.

[0100] In a specific implementation, the training unit 403 is specifically used to determine at least three training samples from the set of samples to be trained, the at least three training samples include a first training sample, a second training sample and a third training sample, the second training sample is of the same category as the first training sample, and the third training sample is of a different category from the first training sample; the at least three training samples are enhanced respectively to obtain an enhanced training sample set, the enhanced training sample set includes a first enhanced training sample, a second enhanced training sample and a third enhanced training sample; three training samples are randomly selected from the at least three training samples and the enhanced training sample set as a group of training sample groups; for a target training sample group, the feature extractor is used to extract features from the target training sample group to obtain a feature set; a loss function corresponding to the target training group is determined according to the feature set; a loss function of the feature extractor is determined based on the loss function corresponding to each target training sample group; the loss function is optimized until a second preset condition is met to obtain a trained feature extractor.

[0101] In a specific implementation, the target training sample group includes at least one of a first training sample group, a second training sample group, a third training sample group and a fourth training sample group, the first training sample group includes a first training sample, a second training sample and a third training sample, the second training sample group includes a first enhanced training sample, a second enhanced training sample and a third enhanced training sample, the third training sample group includes a second training sample, a second enhanced training sample and a third training sample, and the fourth training sample group includes a first enhanced sample, a first enhanced training sample and a third training sample.

[0102] In a specific implementation, the training unit 403 is specifically used to perform weighted summation on the loss functions corresponding to each target training group to obtain the loss function of the feature extractor.

[0103] In a possible implementation, the enhancement processing includes one or more of rotation, color change, perspective distortion, smearing, and clarity change.

[0104] In a possible implementation manner, the device further includes:

[0105] A receiving unit, used for receiving data to be detected, wherein the data to be detected includes a target to be detected;

[0106] A detection unit, used to detect the area where the target to be detected is located using the trained detector;

[0107] A third acquisition unit, used for inputting the region into the trained feature extractor to obtain features corresponding to the region;

[0108] A calculation unit, used to calculate the similarity between the feature and the target feature stored in the search library, wherein the detection library stores a plurality of features and a classification result corresponding to each of the plurality of features;

[0109] The determination unit is used to determine the classification result corresponding to the target feature whose similarity meets the third preset condition as the classification result of the target to be detected.

[0110] In a possible implementation, the device includes:

[0111] A fourth acquisition unit, configured to acquire a newly added training sample before acquiring the training sample set;

[0112] A detection unit, configured to detect the newly added target in the newly added training sample using the detector to obtain a detection result;

[0113] a display unit, configured to display the detection result in response to the detection result including the newly added target;

[0114] A storage unit is used to store the detection result in a database in response to a confirmation operation triggered by a user, wherein the database includes the detection result and the detection result corresponding to the original training sample.

[0115] In a possible implementation, the storage unit is specifically configured to store the detection result and the label corresponding to the newly added target in a database in response to a confirmation operation triggered by a user.

[0116] In a possible implementation, the first acquisition unit 401 is specifically used to obtain the detection results corresponding to the newly added training samples and the detection results corresponding to the original training samples from the database in response to the number of detection results corresponding to the newly added training samples added to the database satisfying a fourth preset condition.

[0117] In a possible implementation manner, the training samples in the training sample set are images including trademarks.

[0118] It should be noted that the implementation of each unit in this embodiment can refer to the relevant description in the above method embodiment, and this embodiment will not be repeated here.

[0119] See also Figure 5 , which shows a schematic diagram of the structure of an electronic device 500 suitable for implementing the embodiment of the present application. The terminal device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (portable android devices), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs (televisions), desktop computers, etc. Figure 5 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0120] like Figure 5 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0121] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0122] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present application are executed.

[0123] The electronic device provided in the embodiment of the present application and the method provided in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0124] An embodiment of the present application provides a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any of the above embodiments is implemented.

[0125] It should be noted that the computer-readable medium mentioned above in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0126] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (Hyper Text Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0127] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0128] The computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device executes the method.

[0129] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0130] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0131] The units involved in the embodiments described in this application may be implemented by software or hardware. The name of a unit / module does not limit the unit itself in some cases. For example, a voice data acquisition module may also be described as a "data acquisition module".

[0132] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0133] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0134] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system or device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0135] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0136] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0137] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0138] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An incremental target detection method, characterized in that: The method is applied to a target detection model, the target detection model comprising a detector and a feature extractor, including: Acquire a training sample set, wherein the training sample set includes original training samples and newly added training samples, and the newly added training samples include newly added targets; The original training samples and the newly added training samples are sampled using a model-independent meta-learning algorithm to obtain a set of samples to be trained; The detector and the feature extractor are trained using the sample set to be trained to obtain a trained detector and a trained feature extractor, wherein the trained detector is used to detect the newly added target, and the trained feature extractor is used to extract features of the newly added target; The step of training the feature extractor using the sample set to be trained to obtain the trained feature extractor includes: Determine at least three training samples from the set of samples to be trained, the at least three training samples include a first training sample, a second training sample and a third training sample, the second training sample is of the same category as the first training sample, and the third training sample is of a different category from the first training sample; Performing enhancement processing on the at least three training samples respectively to obtain an enhanced training sample set, wherein the enhanced training sample set includes a first enhanced training sample, a second enhanced training sample, and a third enhanced training sample; Randomly extracting three training samples from the at least three training samples and the enhanced training sample set as a training sample group; For a target training sample group, using the feature extractor to extract features from the target training sample group to obtain a feature set; Determine a loss function corresponding to the target training group according to the feature set; Determining the loss function of the feature extractor based on the loss function corresponding to each target training sample group; The loss function is optimized until a second preset condition is met to obtain a trained feature extractor.

2. The method according to claim 1, characterized in that The step of training the detector using the sample set to be trained to obtain a trained detector includes: For any to-be-trained sample in the to-be-trained sample set, obtaining a feature map corresponding to the to-be-trained sample; For any pixel point in the feature map, determining, according to the feature map, a probability that the pixel point is a target center point of a detection frame; Determine a position vector of the detection frame according to the feature map; Constructing a loss function based on the probability and the first label, the position vector and the second label, wherein the first label is used to indicate whether the pixel point is the target center point, and the second label is the position vector of the detection box corresponding to the pixel point; In response to a value corresponding to the loss function satisfying a first preset condition, a trained detector is obtained.

3. The method according to claim 1, characterized in that The target training sample group includes at least one of a first training sample group, a second training sample group, a third training sample group and a fourth training sample group, the first training sample group includes a first training sample, a second training sample and a third training sample, the second training sample group includes a first enhanced training sample, a second enhanced training sample and a third enhanced training sample, the third training sample group includes a second training sample, a second enhanced training sample and a third training sample, and the fourth training sample group includes a first training sample, a first enhanced training sample and a third training sample.

4. The method according to claim 1, characterized in that: The determining the loss function of the feature extractor based on the loss function corresponding to each target training sample group includes: The loss function of the feature extractor is obtained by weighted summing the loss functions corresponding to each target training group.

5. The method according to claim 1, characterized in that The enhancement processing includes one or more of rotation, color change, perspective distortion, smearing, and clarity change.

6. The method according to claim 1, characterized in that The method further comprises: Receiving data to be detected, wherein the data to be detected includes a target to be detected; Using the trained detector to detect the area where the target to be detected is located; Inputting the region into the trained feature extractor to obtain features corresponding to the region; Calculating the similarity between the feature and the target feature stored in a search library, wherein the detection library stores a plurality of features and a classification result corresponding to each of the plurality of features; The classification result corresponding to the target feature whose similarity meets the third preset condition is determined as the classification result of the target to be detected.

7. The method according to claim 1, characterized in that Before acquiring the training sample set, the method includes: Get new training samples; Using the detector to detect the newly added target in the newly added training sample to obtain a detection result; In response to the detection result including the newly added target, displaying the detection result; In response to a confirmation operation triggered by the user, the detection result is stored in a database, where the database includes the detection result and the detection result corresponding to the original training sample.

8. The method according to claim 7, characterized in that The step of storing the detection result in a database in response to a confirmation operation triggered by a user comprises: In response to a confirmation operation triggered by the user, the detection result and the label corresponding to the newly added target are stored in a database.

9. The method according to claim 7 or 8, characterized in that: The step of obtaining a training sample set includes: In response to the number of detection results corresponding to the newly added training samples added to the database satisfying a fourth preset condition, the detection results corresponding to the newly added training samples and the detection results corresponding to the original training samples are acquired from the database.

10. The method according to claim 1, characterized in that The training samples in the training sample set are images including trademarks.

11. An incremental target detection device, characterized in that: The device is applied to a target detection model, which includes a detector and a feature extractor, including: A first acquisition unit, configured to acquire a training sample set, wherein the training sample set includes original training samples and newly added training samples, and the newly added training samples include newly added targets; A second acquisition unit is used to sample the original training samples and the newly added training samples by using a model-independent meta-learning algorithm to obtain a set of samples to be trained; A training unit, used to train the detector and the feature extractor using the set of samples to be trained to obtain a trained detector and a trained feature extractor, wherein the trained detector is used to detect the newly added target, and the trained feature extractor is used to extract features of the newly added target; The training unit is specifically used to determine at least three training samples from the set of samples to be trained, the at least three training samples include a first training sample, a second training sample and a third training sample, the second training sample is of the same category as the first training sample, and the third training sample is of a different category from the first training sample; respectively enhance the at least three training samples to obtain an enhanced training sample set, the enhanced training sample set includes a first enhanced training sample, a second enhanced training sample and a third enhanced training sample; randomly extract three training samples from the at least three training samples and the enhanced training sample set as a group of training sample groups; for a target training sample group, use the feature extractor to extract features from the target training sample group to obtain a feature set; determine a loss function corresponding to the target training group according to the feature set; determine the loss function of the feature extractor based on the loss function corresponding to each target training sample group; optimize the loss function until a second preset condition is met to obtain a trained feature extractor.

12. An electronic device, characterized in that: The device comprises: a processor and a memory; The memory is used to store instructions or computer programs; The processor is used to execute the instructions or computer programs in the memory so that the electronic device executes the method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a device, the device executes the method according to any one of claims 1 to 10.