Target tracking method, device, electronic device and storage medium

By combining classification probability and feature vector methods to detect whether a video frame contains a target, the problem of high false detection rate in gesture detection in the existing technology is solved, and the accuracy and robustness of gesture tracking are improved.

CN114255257BActive Publication Date: 2024-10-25BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010946949.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-10
Publication Date
2024-10-25
Estimated Expiration
2040-09-10

AI Technical Summary

Technical Problem

The existing technology has a high false detection rate in gesture detection and tracking, resulting in frequent false tracking or missed tracking, which affects the accuracy of the classification algorithm.

Method used

Video frames are detected using a method that combines classification probability and feature vectors. The classification probability is obtained through the first neural network, and when the classification probability is less than the threshold, the second neural network is used to obtain the feature vector to determine whether the video frame contains the target, and then determine Tracking strategy.

Benefits of technology

It improves the classification accuracy during target tracking, reduces false tracking and missed tracking, and improves robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114255257B_ABST
    Figure CN114255257B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a target tracking method, device, electronic device and storage medium, and belongs to the field of computer vision technology. The method includes: inputting the current video frame to be processed into a first neural network to obtain the classification probability of the current video frame; wherein the classification probability is the probability that the target is contained in the current video frame; in response to the classification probability being less than or equal to a first threshold, inputting the current video frame into a second neural network to obtain a feature vector of the current video frame; the distance between the feature vectors of different video frames is used to characterize the similarity between different video frames; in response to the distance between the feature vector of the current video frame and the designated vector being less than a second threshold, determining that the current video frame includes the target, and continuing to track the target in the next video frame; wherein the designated vector is the average of the feature vectors of multiple foreground images. The present disclosure can improve the accuracy of classification in the target tracking process, thereby avoiding the occurrence of mistracking or missed tracking.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer vision technology, and in particular to a target tracking method, device, electronic device and storage medium. Background Art

[0002] In the field of human-computer interaction, gestures have received widespread attention as a natural and intuitive way of human-computer interaction. For example, Hand Gesture Detection and Tracking (HGDT) has gradually developed into an important topic in the field of computer vision technology. Among them, the main task of HGDT is to detect and classify gesture information appearing in videos or images through deep learning algorithms.

[0003] For HGDT tasks, a basic task is to detect whether a video or image contains a hand, and continue to track it if it does. Among them, the false detection rate of hands is an important indicator to measure the quality of a classification algorithm. Once the false detection rate is high, non-hand parts in the video or image will be misclassified as hands, or real hands will be misclassified as non-hand parts, which will lead to false tracking or missed tracking.

[0004] Based on this, how to improve the accuracy of classification during target (such as hand) tracking and thus avoid mis-tracking or missed tracking has become a problem that needs to be solved urgently by those skilled in the art. Summary of the invention

[0005] The present disclosure provides a target tracking method, device, electronic device and storage medium, which can improve the accuracy of classification during target (such as hand) tracking, thereby avoiding the occurrence of mistracking or missed tracking. The technical solution of the present disclosure is as follows:

[0006] According to a first aspect of an embodiment of the present disclosure, a target tracking method is provided, including:

[0007] Inputting the current video frame to be processed into the first neural network to obtain the classification probability of the current video frame; wherein the classification probability is the probability that the target is contained in the current video frame;

[0008] In response to the classification probability being less than or equal to the first threshold, the current video frame is input into a second neural network to obtain a feature vector of the current video frame; wherein the feature vector is a mathematical vector obtained after the second neural network performs feature mapping on the video frame; and the distance between the feature vectors of different video frames is used to characterize the similarity between different video frames;

[0009] In response to a distance between a feature vector of the current video frame and a specified vector being less than a second threshold, determining that the current video frame includes the target, and continuing to track the target in a next video frame;

[0010] The next video frame is adjacent to the current video frame in time sequence and is located after the current video frame; the designated vector is an average value of feature vectors of multiple foreground images, and the foreground image is an image with the target as a foreground object.

[0011] In a possible implementation, the method further includes:

[0012] In response to the distance between the feature vector of the current video frame and the designated vector being greater than or equal to the second threshold, tracking the target according to the distance between the feature vector of the current video frame and the feature vector of a previous video frame;

[0013] The previous video frame is adjacent to the current video frame in time sequence and is located before the current video frame.

[0014] In a possible implementation manner, tracking the target according to the distance between the feature vector of the current video frame and the feature vector of the previous video frame includes:

[0015] In response to a distance between the feature vector of the current video frame and the feature vector of the previous video frame being greater than or equal to a third threshold, it is determined that the current video frame does not include the target.

[0016] In a possible implementation manner, tracking the target according to the distance between the feature vector of the current video frame and the feature vector of the previous video frame includes:

[0017] In response to a distance between the feature vector of the current video frame and the feature vector of the previous video frame being less than a third threshold, tracking the target according to classification probabilities of N consecutive video frames;

[0018] The value of N is a positive integer, and N≥2; the N consecutive video frames include: the current video frame, and N-1 video frames that are located before the current video frame and adjacent to the current video frame in time sequence.

[0019] In a possible implementation, tracking the target according to the classification probability of N consecutive video frames includes:

[0020] In response to the N consecutive video frames not satisfying the target condition, determining that the current video frame includes the target, and continuing to track the target in the next video frame;

[0021] In response to the N consecutive video frames satisfying the target condition, stopping tracking the target;

[0022] The target condition is that the classification probability of the N consecutive video frames is less than or equal to the first threshold.

[0023] In a possible implementation, the specified vector is obtained by the following method:

[0024] Acquire a training sample set, wherein the training sample set includes a plurality of the foreground images;

[0025] Inputting the plurality of foreground images into the second neural network to obtain feature vectors of the plurality of foreground images;

[0026] The designated vector is obtained by obtaining an average value of the feature vectors of the plurality of foreground images.

[0027] In a possible implementation, the training process of the second neural network includes:

[0028] Acquire a training sample set, wherein the training sample set includes a plurality of the foreground images and a plurality of background images, wherein the background image is an image that does not contain the target or an image that uses the target as a background object;

[0029] Determine a designated sample image in the training sample set, and obtain a positive sample and a negative sample of the designated sample image; wherein the similarity between the positive sample and the designated sample image is greater than the similarity between the negative sample and the designated sample image; and the designated sample image is the foreground image or the background image;

[0030] Input the constructed sample triples into the initial neural network to obtain feature vectors of each sample triple; wherein each sample triple includes a specified sample image, a positive sample of the specified sample image, and a negative sample; wherein the specified sample image and the positive sample belong to the same category, and the specified sample image and the negative sample belong to different categories;

[0031] Constructing a triplet loss function according to the first distance and the second distance corresponding to each sample triplet; adjusting the network parameters of the initial neural network according to the triplet loss function to obtain the second neural network;

[0032] Among them, the convergence condition of the triplet loss function is: the first distance is less than the second distance; the first distance refers to the distance between the feature vector of the specified sample image and the feature vector of the positive sample in the same sample triplet, and the second distance refers to the distance between the feature vector of the specified sample image and the feature vector of the negative sample.

[0033] According to a second aspect of an embodiment of the present disclosure, there is provided a target tracking device, comprising:

[0034] A first acquisition module is configured to input the current video frame to be processed into a first neural network to obtain a classification probability of the current video frame; wherein the classification probability is a probability that the target is contained in the current video frame;

[0035] A second acquisition module is configured to input the current video frame into a second neural network in response to the classification probability being less than or equal to a first threshold value, to obtain a feature vector of the current video frame; wherein the feature vector is a mathematical vector obtained after the second neural network performs feature mapping on the video frame; and the distance between the feature vectors of different video frames is used to characterize the similarity between different video frames;

[0036] A first processing module is configured to determine that the current video frame includes the target in response to a distance between the feature vector of the current video frame and the specified vector being less than a second threshold, and continue to track the target in a next video frame;

[0037] The next video frame is adjacent to the current video frame in time sequence and is located after the current video frame; the designated vector is an average value of feature vectors of multiple foreground images, and the foreground image is an image with the target as a foreground object.

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

[0039] The second processing module is further configured to track the target according to the distance between the feature vector of the current video frame and the feature vector of a previous video frame in response to the distance between the feature vector of the current video frame and the designated vector being greater than or equal to the second threshold;

[0040] The previous video frame is adjacent to the current video frame in time sequence and is located before the current video frame.

[0041] In a possible implementation, the second processing module further includes:

[0042] The first processing unit is configured to determine that the current video frame does not include the target in response to a distance between the feature vector of the current video frame and the feature vector of the previous video frame being greater than or equal to a third threshold.

[0043] In a possible implementation, the second processing module further includes:

[0044] A second processing unit is configured to track the target according to the classification probability of N consecutive video frames in response to the distance between the feature vector of the current video frame and the feature vector of the previous video frame being less than a third threshold;

[0045] The value of N is a positive integer, and N≥2; the N consecutive video frames include: the current video frame, and N-1 video frames that are located before the current video frame and adjacent to the current video frame in time sequence.

[0046] In a possible implementation manner, the second processing unit is further configured to:

[0047] In response to the N consecutive video frames not satisfying the target condition, determining that the current video frame includes the target, and continuing to track the target in the next video frame;

[0048] In response to the N consecutive video frames satisfying the target condition, stopping tracking the target;

[0049] The target condition is that the classification probability of the N consecutive video frames is less than or equal to the first threshold.

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

[0051] The third acquisition module is configured to acquire a training sample set, wherein the training sample set includes a plurality of the foreground images; input the plurality of the foreground images into the second neural network to obtain feature vectors of the plurality of the foreground images; and obtain an average value of the feature vectors of the plurality of the foreground images to obtain the specified vector.

[0052] In a possible implementation, the training process of the second neural network includes:

[0053] Acquire a training sample set, wherein the training sample set includes a plurality of the foreground images and a plurality of background images, wherein the background image is an image that does not contain the target or an image that uses the target as a background object;

[0054] Determine a designated sample image in the training sample set, and obtain a positive sample and a negative sample of the designated sample image; wherein the similarity between the positive sample and the designated sample image is greater than the similarity between the negative sample and the designated sample image; and the designated sample image is the foreground image or the background image;

[0055] Input the constructed sample triples into the initial neural network to obtain feature vectors of each sample triple; wherein each sample triple includes a specified sample image, a positive sample of the specified sample image, and a negative sample; wherein the specified sample image and the positive sample belong to the same category, and the specified sample image and the negative sample belong to different categories;

[0056] Constructing a triplet loss function according to the first distance and the second distance corresponding to each sample triplet; adjusting the network parameters of the initial neural network according to the triplet loss function to obtain the second neural network;

[0057] Among them, the convergence condition of the triplet loss function is: the first distance is less than the second distance; the first distance refers to the distance between the feature vector of the specified sample image and the feature vector of the positive sample in the same sample triplet, and the second distance refers to the distance between the feature vector of the specified sample image and the feature vector of the negative sample.

[0058] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0059] processor;

[0060] a memory for storing instructions executable by the processor;

[0061] Wherein, the processor is configured to execute the instructions to implement the above-mentioned target tracking method.

[0062] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the above-mentioned target tracking method.

[0063] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device is enabled to perform the above-mentioned target tracking method.

[0064] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0065] In the target tracking process, the disclosed embodiment will combine the classification probability and the feature vector to comprehensively detect whether the current video frame contains the target. In detail, the classification probability refers to the probability that the current video frame contains the target, and the distance between the feature vectors of different video frames is used to characterize the similarity between different video frames; in the actual discrimination process, only when the classification probability of the current video frame is less than the first threshold, and the distance between the feature vector of the current video frame and the specified vector is less than the second threshold, will it be determined that the current video frame contains the target; wherein the specified vector is the average value of the feature vectors of multiple foreground images, and the foreground image is an image with the target as the foreground object. Since the judgment of whether the video frame contains the target is based on a comprehensive combination of multiple factors, the classification accuracy in the target (such as hand) tracking process can be improved, thereby avoiding the occurrence of mistracking or missed tracking, and improving the robustness of target tracking.

[0066] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0068] Figure 1 The present invention is a flowchart of a target tracking method according to an exemplary embodiment.

[0069] Figure 2 The present invention is a flowchart of a target tracking method according to an exemplary embodiment.

[0070] Figure 3 The figure is an overall execution flow chart of a target tracking solution according to an exemplary embodiment.

[0071] Figure 4 is a schematic diagram of a triple according to an exemplary embodiment.

[0072] Figure 5 The invention is a block diagram of a target tracking device according to an exemplary embodiment.

[0073] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0074] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0075] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0076] The user information involved in the present disclosure may be information authorized by the user or fully authorized by all parties.

[0077] Before explaining the embodiments of the present disclosure in detail, some terms involved in the embodiments of the present disclosure are first introduced.

[0078] CNN (Convolutional Neural Network): It is a type of feedforward neural network that uses artificial neurons to respond to units around a certain range of receptive fields and has outstanding performance in the field of image processing.

[0079] Bbox (bounding box): It is the boundary of the object edge during object detection. In principle, the bounding box should be close to the edge of the object.

[0080] Target: refers to the target of detection and tracking, and the target is exemplarily a hand. In addition, the target can also be other body parts, which is not specifically limited in the embodiments of the present disclosure.

[0081] The following is an introduction to the implementation environment of the target tracking solution involved in the embodiments of the present disclosure.

[0082] The target tracking solution provided by the embodiment of the present disclosure is executed by an electronic device. Exemplarily, the electronic device is a terminal, and the types of the terminal include but are not limited to smart phones, desktop computers, laptop computers, tablet computers, etc. In addition, the electronic device can also be a server. For example, the terminal uploads the video to the server. Since the server performs target tracking in the video, the embodiment of the present disclosure does not specifically limit this.

[0083] In one possible implementation, taking the target as a hand, when using a deep learning algorithm for tracking, it relies on a large amount of manually annotated training data. The CNN model may misdetect images that have not appeared in the training data, that is, it may misclassify the non-hand part of the image as a hand, or misclassify the hand as a non-hand, resulting in mistracking or missed tracking.

[0084] In the disclosed embodiment, based on the above CNN model, a branch network is trained using a large amount of manually annotated hand training data, which can map the input image to a high-dimensional feature space with close intra-class distance and long inter-class distance, so as to obtain a feature vector representing the features of the current input image, which is referred to as an embedding vector in this article. The space where the feature vector exists is called the feature space.

[0085] Taking video as an example, the distance between the embedding vector of the current video frame and the embedding vector of the previous video frame, and the distance between the embedding vector of the current video frame and the category center of the hand in the embedding space will be calculated, and these two distances will be combined with the binary classification results of the CNN model to detect whether the current video frame contains a hand, thereby improving the robustness of the tracking process. Among them, the category center refers to the mean of the embedding vector of the foreground image in the training sample set. This paper determines this vector as the category center of the embedding vector of the foreground image. Exemplarily, the foreground image is an image with the target as the foreground object, and the background image is an image that does not contain the target or an image with the target as the background object.

[0086] The target tracking scheme of the embodiment of the present disclosure is explained in detail through the following embodiments.

[0087] Figure 1 is a flow chart of a target tracking method according to an exemplary embodiment. Figure 1 As shown, the method is used in an electronic device and includes the following steps.

[0088] In step 101, the current video frame to be processed is input into the first neural network to obtain the classification probability of the current video frame; wherein the classification probability is the probability that the current video frame contains the target.

[0089] In step 102, in response to the classification probability being less than or equal to the first threshold, the current video frame is input into the second neural network to obtain a feature vector of the current video frame; wherein the feature vector is a mathematical vector obtained after feature mapping of the video frame by the second neural network; and the distance between the feature vectors of different video frames is used to characterize the similarity between different video frames.

[0090] In step 103, in response to the distance between the feature vector of the current video frame and the designated vector being less than a second threshold, it is determined that the current video frame includes the target, and the target is continued to be tracked in the next video frame; wherein the next video frame is temporally adjacent to the current video frame and is located after the current video frame; the designated vector is an average value of feature vectors of multiple foreground images, and the foreground image is an image with the target as the foreground object.

[0091] The method provided by the embodiment of the present disclosure combines the classification probability and the feature vector to comprehensively detect whether the current video frame contains the target during the target tracking process. In detail, the classification probability refers to the probability that the current video frame contains the target, and the distance between the feature vectors of different video frames is used to characterize the similarity between different video frames; in the actual discrimination process, the current video frame is judged to contain the target only when the classification probability of the current video frame is less than the first threshold, and the distance between the feature vector of the current video frame and the specified vector is less than the second threshold; wherein the specified vector is the average value of the feature vectors of multiple foreground images, and the foreground image is an image with the target as the foreground object. Since the judgment of whether the video frame contains the target is based on a comprehensive combination of multiple factors, the classification accuracy in the target (such as hand) tracking process can be improved, thereby avoiding the occurrence of mistracking or missed tracking, and improving the robustness of target tracking.

[0092] In a possible implementation, the method further includes:

[0093] In response to the distance between the feature vector of the current video frame and the designated vector being greater than or equal to the second threshold, tracking the target according to the distance between the feature vector of the current video frame and the feature vector of a previous video frame;

[0094] The previous video frame is adjacent to the current video frame in time sequence and is located before the current video frame.

[0095] In a possible implementation manner, tracking the target according to the distance between the feature vector of the current video frame and the feature vector of the previous video frame includes:

[0096] In response to a distance between the feature vector of the current video frame and the feature vector of the previous video frame being greater than or equal to a third threshold, it is determined that the current video frame does not include the target.

[0097] In a possible implementation manner, tracking the target according to the distance between the feature vector of the current video frame and the feature vector of the previous video frame includes:

[0098] In response to a distance between the feature vector of the current video frame and the feature vector of the previous video frame being less than a third threshold, tracking the target according to classification probabilities of N consecutive video frames;

[0099] The value of N is a positive integer, and N≥2; the N consecutive video frames include: the current video frame, and N-1 video frames that are located before the current video frame and adjacent to the current video frame in time sequence.

[0100] In a possible implementation, tracking the target according to the classification probability of N consecutive video frames includes:

[0101] In response to the N consecutive video frames not satisfying the target condition, determining that the current video frame includes the target, and continuing to track the target in the next video frame;

[0102] In response to the N consecutive video frames satisfying the target condition, stopping tracking the target;

[0103] The target condition is that the classification probability of the N consecutive video frames is less than or equal to the first threshold.

[0104] In a possible implementation, the specified vector is obtained by the following method:

[0105] Acquire a training sample set, wherein the training sample set includes a plurality of the foreground images;

[0106] Inputting the plurality of foreground images into the second neural network to obtain feature vectors of the plurality of foreground images;

[0107] The designated vector is obtained by obtaining an average value of the feature vectors of the plurality of foreground images.

[0108] In a possible implementation, the training process of the second neural network includes:

[0109] Acquire a training sample set, wherein the training sample set includes a plurality of the foreground images and a plurality of background images, wherein the background image is an image that does not contain the target or an image that uses the target as a background object;

[0110] Determine a designated sample image in the training sample set, and obtain a positive sample and a negative sample of the designated sample image; wherein the similarity between the positive sample and the designated sample image is greater than the similarity between the negative sample and the designated sample image; and the designated sample image is the foreground image or the background image;

[0111] Input the constructed sample triples into the initial neural network to obtain feature vectors of each sample triple; wherein each sample triple includes a specified sample image, a positive sample of the specified sample image, and a negative sample; wherein the specified sample image and the positive sample belong to the same category, and the specified sample image and the negative sample belong to different categories;

[0112] Constructing a triplet loss function according to the first distance and the second distance corresponding to each sample triplet; adjusting the network parameters of the initial neural network according to the triplet loss function to obtain the second neural network;

[0113] Among them, the convergence condition of the triplet loss function is: the first distance is less than the second distance; the first distance refers to the distance between the feature vector of the specified sample image and the feature vector of the positive sample in the same sample triplet, and the second distance refers to the distance between the feature vector of the specified sample image and the feature vector of the negative sample.

[0114] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present disclosure, and will not be described in detail here.

[0115] Figure 2 FIG. 1 is a flow chart of a target tracking method according to an exemplary embodiment. Taking a human hand as an example, Figure 3 The overall execution flow chart shown in the figure explains this solution in detail. Figure 2 As shown, the following steps are included.

[0116] In step 201, the electronic device converts a video to be processed into a video image sequence, where the video image sequence includes a plurality of video frames.

[0117] In one possible implementation, the target tracking solution provided by the embodiment of the present disclosure can track human hands in a video (referred to as the video to be processed in this article), that is, draw the bbox of the human hand for the video frame in which the human hand appears in the video, and do not draw the bbox if the human hand leaves the video screen.

[0118] For example, in actual tracking, the video is usually split into continuous video frames, that is, the video to be processed is converted into a video image sequence, which includes multiple continuous video frames. After that, it is determined whether each video frame contains a hand; if it contains a hand, the bbox of the hand is drawn; if it does not contain a hand, the bbox is not drawn.

[0119] As an example, the video to be processed can be converted into a video image sequence through a video frame segmentation tool.

[0120] In step 202, the electronic device performs image preprocessing on the current video frame to be processed, and inputs the preprocessed current video frame into the first neural network to obtain the classification probability of the current video frame; wherein the classification probability is the probability that the target is contained in the current video frame.

[0121] Exemplarily, image preprocessing includes but is not limited to: cropping and alignment, which are not specifically limited in the embodiments of the present disclosure. The first neural network is a binary classification network. The first neural network is obtained by training an initial convolutional neural network based on a training sample set with labeled classification information.

[0122] In a possible implementation, the training process of the first neural network includes:

[0123] 2021. Input the sample images in the preprocessed training sample set into an initial convolutional neural network with a cross entropy loss function, and obtain the prediction classification results of the sample images in the training sample set output by the initial convolutional neural network. The training sample set includes multiple foreground images and multiple background images, that is, the sample images include both foreground images and background images.

[0124] 2022. Based on the cross entropy loss function, determine whether the labeled classification results of the sample images in the training sample set are consistent with the predicted classification results.

[0125] 2023. When the labeled classification result is inconsistent with the predicted classification result, the weight value in the initial convolutional neural network is updated repeatedly and cyclically until the labeled classification result is consistent with the predicted classification result, thereby obtaining the first neural network.

[0126] In the real-time tracking stage, the embodiment of the present disclosure first judges the current video frame through the binary classification result predicted by the first neural network; if the binary classification result output by the first neural network indicates that the probability of the current video frame containing a hand is greater than the first threshold, it is determined that the current video frame contains a hand, the bbox of the hand is drawn in the current video, and the tracking continues. Otherwise, the following step 203 is executed. Exemplarily, the value of the first threshold can be 0.5, which is not specifically limited in the embodiment of the present disclosure.

[0127] In step 203, in response to the classification probability being less than or equal to the first threshold, the electronic device inputs the current video frame into the second neural network to obtain a feature vector of the current video frame.

[0128] The feature vector is a mathematical vector obtained by performing feature mapping on the video frame through the second neural network; the distance between the feature vectors of different video frames is used to characterize the similarity between different video frames.

[0129] In the disclosed embodiment, based on the first neural network, a network branch (embedding branch network, also called the second neural network) is designed separately. The output of this network branch is a vector, which represents the feature vector of the input image and is referred to as an embedding vector in this article.

[0130] It should be noted that the purpose of designing this network branch is to encode different input images into different vectors, and it is expected that the distance between the feature vectors of the foreground image and the foreground image is close, and the distance between the feature vectors of the foreground image and the background image is far. The distance between two feature vectors is a representation of the similarity of the two input images. The closer the distance between the feature vectors, the higher the similarity of the two input images; the farther the distance between the feature vectors, the lower the similarity of the two input images.

[0131] As an example, the disclosed embodiment uses Triplet Loss to train the embedding branch network. The feature vector output by the embedding branch network after training has the characteristics that the distance between the feature vectors of the foreground image and the foreground image is close, and the distance between the feature vectors of the foreground image and the background image is far.

[0132] In short, the second neural network is used to map the input image into a feature space where the intra-class distance is close and the inter-class distance is far.

[0133] In a possible implementation, the training process of the second neural network includes:

[0134] 2031. Obtain a training sample set, which includes a plurality of foreground images and a plurality of background images; determine a specified sample image in the training sample set, and obtain a positive sample and a negative sample of the specified sample image.

[0135] The similarity between the positive sample and the designated sample image is greater than the similarity between the negative sample and the designated sample image; the designated sample image is a foreground image or a background image. The designated sample image is also referred to as an anchor sample image in this article.

[0136] 2032. Input the constructed sample triples into the initial convolutional neural network to obtain the feature vectors of each sample triplet; wherein each sample triplet includes a specified sample image, a positive sample of the specified sample image, and a negative sample; wherein the specified sample image and the positive sample belong to the same category, and the specified sample image and the negative sample belong to different categories.

[0137] like Figure 4As shown in FIG. 1 , a sample triplet includes an anchor sample (Anchor), a positive sample (Positive) and a negative sample (Negative), that is, a (Anchor, Positive, Negative) triplet. The anchor sample is also referred to as a designated sample image in this article.

[0138] For example, the specified sample image in a sample triplet may come from a part of the samples in the training sample set, and the positive sample and the negative sample may come from another part of the samples in the training sample set. Alternatively, the specified sample image in a sample triplet may come from the training sample set, and the positive sample and the negative sample may come from other data sources, which is not specifically limited in the embodiments of the present disclosure.

[0139] Since each sample triplet includes a specified sample image, a positive sample of the specified sample image, and a negative sample, a sample triplet can be mapped through the initial convolutional neural network to obtain a feature triplet:

[0140] like Figure 4 As shown in the figure, the expected relationship between the feature vectors is that the distance between the feature vector of the anchor and the feature vector of the positive in the feature space (also called the embedding space) is closer than the distance between the feature vector of the anchor and the feature vector of the negative in the feature space, that is, after learning, the distance should be Figure 4 The distribution relationship shown.

[0141] 2033. Construct a triplet loss function according to the first distance and the second distance corresponding to each sample triplet; and adjust the network parameters of the initial neural network according to the triplet loss function to obtain a second neural network.

[0142] In the embodiment of the present disclosure, the expression of the triple loss function is:

[0143]

[0144] Among them, loss refers to the triple loss function, Refers to the Euclidean distance between the feature vector of the specified sample image and the feature vector of the positive sample in the same sample triplet, which is also called the first distance; It represents the Euclidean distance between the feature vector of the specified sample image and the feature vector of the negative sample in the same sample triplet, which is also called the second distance; margin refers to the fixed minimum interval, and the value of i is a positive integer.

[0145] Among them, the goal of optimization is to make the above triplet loss function converge, that is, to make the distance between the specified sample image and the positive sample in the same sample triplet as close as possible, and the distance between the specified sample image and the negative sample as far as possible.

[0146] In a possible implementation, the convergence condition is: the first distance is less than the second distance; the first distance refers to the distance between the feature vector of the specified sample image and the feature vector of the positive sample in the same sample triplet in the feature space, and the second distance refers to the distance between the feature vector of the specified sample image and the feature vector of the negative sample in the feature space.

[0147] As an example, the embodiment of the present disclosure uses a stochastic gradient descent algorithm to optimize Triplet Loss until convergence, so that the obtained second neural network can better extract feature vectors.

[0148] It should be noted that the reason for setting a fixed minimum margin is that: in addition to making the distance between the feature expression of the specified sample image and the positive sample as small as possible, and the distance between the feature expression of the specified sample image and the negative sample as large as possible, there must also be a minimum interval between the distance between the specified sample image and the negative sample, and the distance between the specified sample image and the positive sample, to ensure the accuracy of learning.

[0149] The feature vector of the current video frame is also called the embedding vector of the current video frame.

[0150] The disclosed embodiment uses Triplet Loss to train the second neural network. The feature vector output by the trained second neural network has the characteristics that the distance between the feature vectors of the foreground image and the foreground image is close, and the distance between the feature vectors of the foreground image and the background image is far, so that in the target tracking process, a more accurate classification result can be obtained, thereby improving the target tracking effect.

[0151] In step 204, in response to the distance between the feature vector of the current video frame and the designated vector being less than a second threshold, the electronic device determines that the current video frame includes a target, and continues to track the target in the next video frame.

[0152] The next video frame is adjacent to the current video frame in time sequence and is located after the current video frame; the specified vector is an average value of feature vectors of multiple foreground images.

[0153] In the disclosed embodiment, the designated vector is obtained based on the feature vector of the foreground image in the training sample set.

[0154] In one possible implementation, the designated vector is obtained by the following method: obtaining a training sample set, which includes multiple foreground images; inputting the multiple foreground images into a second neural network to obtain feature vectors of the multiple foreground images; and obtaining an average value of the feature vectors of the multiple foreground images to obtain the designated vector.

[0155] The average of the embedding vectors of the foreground image in the sample training set is obtained to obtain a mean vector, which is considered to be the category center of the embedding vector of the foreground image. In other words, the specified vector is the category center of the target in the feature space. Therefore, using the specified vector as the judgment condition for whether to continue tracking the target can ensure the classification accuracy during the target tracking process.

[0156] Exemplarily, the value of the second threshold may be 0.8, which is not specifically limited in the embodiments of the present disclosure.

[0157] That is, this step will obtain and calculate the distance d between the embedding vector of the current video frame and the category center, and set a threshold. If the distance d is less than the threshold, the current video frame is determined to be a foreground image, that is, the current video frame contains a hand, and the bbox of the hand is drawn; if the distance d is greater than or equal to the threshold, the current video frame is determined to be a background image, that is, the current video frame does not contain a hand, and the bbox of the hand is not drawn.

[0158] In step 205, in response to the distance between the feature vector of the current video frame and the designated vector being greater than or equal to the second threshold, the electronic device tracks the target according to the distance between the feature vector of the current video frame and the feature vector of the previous video frame.

[0159] The previous video frame is adjacent to the current video frame in time sequence and is located before the current video frame.

[0160] In the embodiment of the present disclosure, in addition to obtaining the distance between the feature vector of the current video frame and the specified vector, since the time interval between adjacent video frames is small, the position and hand shape of the human hand in adjacent video frames do not change much. Therefore, it is also possible to detect whether the video frame contains a hand through the distance between the embedding vectors of adjacent video frames.

[0161] In a possible implementation, tracking a target according to a distance between a feature vector of a current video frame and a feature vector of a previous video frame includes:

[0162] 2051. In response to a distance between a feature vector of a current video frame and a feature vector of a previous video frame being greater than or equal to a third threshold, determine that the current video frame does not include a target.

[0163] Exemplarily, the value of the third threshold may be 0.8, which is not specifically limited in the embodiment of the present disclosure. Since the current video frame does not include the target, the bbox of the target is not drawn in the current video frame, and the current video frame is discarded.

[0164] In the embodiment of the present disclosure, in addition to obtaining the distance between the feature vector of the current video frame and the specified vector, since the time interval between adjacent video frames is small, the position and shape of the target in adjacent video frames do not change much. Therefore, the embodiment of the present disclosure also supports detecting whether the video frame contains the target through the distance between the feature vectors of adjacent video frames. This scheme further ensures the classification accuracy in the target tracking process, and the target tracking effect is better.

[0165] In addition, if the distance between the feature vector of the current video frame and the specified vector is not less than the second threshold, and the distance between the feature vector of the current video frame and the feature vector of the previous video frame is not less than the third threshold, it indicates that the current video does not include the target. This judgment method not only has higher classification accuracy, but also enriches the judgment method of target tracking.

[0166] 2052. In response to a distance between a feature vector of a current video frame and a feature vector of a previous video frame being less than a third threshold, tracking a target according to classification probabilities of N consecutive video frames; wherein N is a positive integer, and N ≥ 2; the N consecutive video frames include: a current video frame, and N-1 video frames that are chronologically before the current video frame and immediately adjacent to the current video frame.

[0167] In a possible implementation, tracking a target according to classification probabilities of N consecutive video frames includes:

[0168] 2052-1. In response to N consecutive video frames not satisfying the target condition, determine that the current video frame includes the target, and continue to track the target in the next video frame.

[0169] 2052-2. In response to N consecutive video frames satisfying the target condition, stop tracking the target.

[0170] The target condition is that the classification probability of N consecutive video frames is less than or equal to the first threshold. For example, the value of N can be 3. If the value of the first threshold is 0.5, that is, if there is no situation where the classification probability of 3 consecutive video frames is less than 0.5, then the tracking continues. If the classification probability of 3 consecutive video frames is less than 0.5, then the tracking is not continued.

[0171] In addition, if the distance between the feature vector of the current video frame and the specified vector is not less than the second threshold, and the distance between the feature vector of the current video frame and the feature vector of the previous video frame is less than the third threshold, the disclosed embodiment will also track the target based on the classification probability of N consecutive frames. This method not only has high classification accuracy, but also enriches the determination method of target tracking. Among them, if the classification probability of N consecutive video frames is less than or equal to the first threshold, it indicates that the current target has most likely disappeared in the video screen, and the target is stopped from being tracked; otherwise, the tracking is continued. Since the determination of whether a video frame contains a target is based on a comprehensive combination of multiple factors, the classification accuracy in the target tracking process can be improved, thereby avoiding the occurrence of mistracking or missed tracking, and improving the robustness of target tracking.

[0172] Combine the following Figure 3 The overall execution process of the tracking solution provided by the embodiment of the present disclosure is described.

[0173] like Figure 3 As shown, in the real-time tracking stage, after image preprocessing of the current video frame, the first neural network is input to obtain the classification probability of the current video frame (such as the probability that the current video frame contains a hand); the preprocessed current video frame is input to the second neural network to obtain the embedding vector of the current video frame; that is, the current video frame is first judged by the predicted binary classification result; if the binary classification result indicates that the probability that the current video frame contains a hand is greater than a first threshold value, such as 0.5, then continue to track and draw the bbox of the hand;

[0174] Otherwise, obtain the distance between the embedding vector of the current video frame and the category center. The closer the distance is, the more similar it is, and the more likely it is to be judged as a hand. For example, if the distance is greater than the second threshold, such as 0.8, it is judged to be a hand, and continue tracking and drawing the bbox of the hand.

[0175] Otherwise, obtain the distance between the embedding vector of the current video frame and the embedding vector of the previous video frame; if the distance is greater than or equal to a third threshold, such as 0.8, it is determined to be not a hand, and the current video frame is discarded;

[0176] Otherwise, continue to determine whether the classification probability of N consecutive videos is not greater than the first threshold. If it does not exceed N frames, continue tracking and draw the bbox of the hand; otherwise, stop tracking and the process ends.

[0177] The disclosed embodiment proposes an embedding branch network, and the feature vector output by the embedding branch network has the characteristics that the distance between the feature vectors of the foreground image and the foreground image is close, and the distance between the feature vectors of the foreground image and the background image is far. In short, the embedding branch network is used to map the input image to a feature space with close distance within the class and long distance between classes. The final judgment result of whether the hand is contained in the video frame is obtained based on the embedding vector of the input image and the classification probability of the two classifications, which can obtain more accurate classification results in the target tracking process and greatly reduce the missed detection rate in the tracking process.

[0178] In summary, in the target tracking process, the disclosed embodiment will combine the classification probability and the feature vector to comprehensively detect whether the current video frame contains the target. In detail, the classification probability refers to the probability that the current video frame contains the target, and the distance between the feature vectors of different video frames is used to characterize the similarity between different video frames; in the actual discrimination process, only when the classification probability of the current video frame is less than the first threshold, and the distance between the feature vector of the current video frame and the specified vector is less than the second threshold, will it be determined that the current video frame contains the target; wherein the specified vector is the average value of the feature vectors of multiple foreground images, and the foreground image is an image with the target as the foreground object. Since the judgment of whether the video frame contains the target is based on a comprehensive combination of multiple factors, the classification accuracy in the target (such as hand) tracking process can be improved, thereby avoiding the occurrence of mistracking or missed tracking, and improving the robustness of target tracking.

[0179] Figure 5 is a block diagram of a target tracking device according to an exemplary embodiment. Figure 5 The device includes a first acquisition module 501, a second acquisition module 502 and a first processing module 503.

[0180] The first acquisition module 501 is configured to input the current video frame to be processed into the first neural network to obtain the classification probability of the current video frame; wherein the classification probability is the probability that the target is contained in the current video frame;

[0181] The second acquisition module 502 is configured to input the current video frame into a second neural network in response to the classification probability being less than or equal to a first threshold value, to obtain a feature vector of the current video frame; wherein the feature vector is a mathematical vector obtained after the second neural network performs feature mapping on the video frame; and the distance between the feature vectors of different video frames is used to characterize the similarity between different video frames;

[0182] The second processing module 503 is configured to determine that the current video frame includes the target in response to the distance between the feature vector of the current video frame and the specified vector being less than a second threshold, and continue to track the target in the next video frame;

[0183] The next video frame is adjacent to the current video frame in time sequence and is located after the current video frame; the designated vector is an average value of feature vectors of multiple foreground images, and the foreground image is an image with the target as a foreground object.

[0184] The device provided by the embodiment of the present disclosure combines the classification probability and the feature vector to comprehensively detect whether the current video frame contains the target during the target tracking process. In detail, the classification probability refers to the probability that the current video frame contains the target, and the distance between the feature vectors of different video frames is used to characterize the similarity between different video frames; in the actual discrimination process, the current video frame is judged to contain the target only when the classification probability of the current video frame is less than the first threshold value, and the distance between the feature vector of the current video frame and the specified vector is less than the second threshold value; wherein the specified vector is the average value of the feature vectors of multiple foreground images, and the foreground image is an image with the target as the foreground object. Since the judgment of whether the video frame contains the target is based on a comprehensive combination of multiple factors, the classification accuracy in the target (such as hand) tracking process can be improved, thereby avoiding the occurrence of mistracking or missed tracking, and improving the robustness of target tracking.

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

[0186] The second processing module is further configured to track the target according to the distance between the feature vector of the current video frame and the feature vector of a previous video frame in response to the distance between the feature vector of the current video frame and the designated vector being greater than or equal to the second threshold;

[0187] The previous video frame is adjacent to the current video frame in time sequence and is located before the current video frame.

[0188] In a possible implementation, the second processing module further includes:

[0189] The first processing unit is configured to determine that the current video frame does not include the target in response to a distance between the feature vector of the current video frame and the feature vector of the previous video frame being greater than or equal to a third threshold.

[0190] In a possible implementation, the second processing module further includes:

[0191] A second processing unit is configured to track the target according to the classification probability of N consecutive video frames in response to the distance between the feature vector of the current video frame and the feature vector of the previous video frame being less than a third threshold;

[0192] The value of N is a positive integer, and N≥2; the N consecutive video frames include: the current video frame, and N-1 video frames that are located before the current video frame and adjacent to the current video frame in time sequence.

[0193] In a possible implementation manner, the second processing unit is further configured to:

[0194] In response to the N consecutive video frames not satisfying the target condition, determining that the current video frame includes the target, and continuing to track the target in the next video frame;

[0195] In response to the N consecutive video frames satisfying the target condition, stopping tracking the target;

[0196] The target condition is that the classification probability of the N consecutive video frames is less than or equal to the first threshold.

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

[0198] The third acquisition module is configured to acquire a training sample set, wherein the training sample set includes a plurality of the foreground images; input the plurality of the foreground images into the second neural network to obtain feature vectors of the plurality of the foreground images; and obtain an average value of the feature vectors of the plurality of the foreground images to obtain the specified vector.

[0199] In a possible implementation, the training process of the second neural network includes:

[0200] Acquire a training sample set, wherein the training sample set includes a plurality of the foreground images and a plurality of background images, wherein the background image is an image that does not contain the target or an image that uses the target as a background object;

[0201] Determine a designated sample image in the training sample set, and obtain a positive sample and a negative sample of the designated sample image; wherein the similarity between the positive sample and the designated sample image is greater than the similarity between the negative sample and the designated sample image; and the designated sample image is the foreground image or the background image;

[0202] Input the constructed sample triples into the initial neural network to obtain feature vectors of each sample triple; wherein each sample triple includes a specified sample image, a positive sample of the specified sample image, and a negative sample; wherein the specified sample image and the positive sample belong to the same category, and the specified sample image and the negative sample belong to different categories;

[0203] Constructing a triplet loss function according to the first distance and the second distance corresponding to each sample triplet; adjusting the network parameters of the initial neural network according to the triplet loss function to obtain the second neural network;

[0204] Among them, the convergence condition of the triplet loss function is: the first distance is less than the second distance; the first distance refers to the distance between the feature vector of the specified sample image and the feature vector of the positive sample in the same sample triplet, and the second distance refers to the distance between the feature vector of the specified sample image and the feature vector of the negative sample.

[0205] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present disclosure, and will not be described in detail here.

[0206] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0207] Figure 6 The structure block diagram of an electronic device 600 provided by an exemplary embodiment of the present disclosure is shown. Generally, the device 600 includes: a processor 601 and a memory 602 .

[0208] The processor 601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 601 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 601 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 601 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 601 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0209] The memory 602 may include one or more computer-readable storage media, which may be non-transitory. The memory 602 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 602 is used to store at least one instruction, which is used to be executed by the processor 601 to implement the target tracking method provided by the method embodiment of the present disclosure.

[0210] In some embodiments, the device 600 may also optionally include: a peripheral device interface 603 and at least one peripheral device. The processor 601, the memory 602 and the peripheral device interface 603 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 603 via a bus, a signal line or a circuit board. Specifically, the peripheral devices include: a display screen 605 and a power supply 609.

[0211] The peripheral device interface 603 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 601 and the memory 602. In some embodiments, the processor 601, the memory 602, and the peripheral device interface 603 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 601, the memory 602, and the peripheral device interface 603 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.

[0212] The display screen 604 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 604 is a touch display screen, the display screen 604 also has the ability to collect touch signals on the surface or above the surface of the display screen 604. The touch signal can be input to the processor 601 as a control signal for processing. At this time, the display screen 604 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 604 can be a front panel of the device 600; the display screen 604 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc.

[0213] The power supply 605 is used to power the various components in the device 600. The power supply 605 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 605 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged through a wired line, and a wireless rechargeable battery is a battery that is charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0214] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation on the device 600, and the device 600 may include more or less components than those shown in the figure, or combine some components, or adopt a different arrangement of components.

[0215] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions, and the instructions can be executed by a processor of the electronic device 600 to complete the above-mentioned target tracking method. Optionally, the storage medium can be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0216] In an exemplary embodiment, a computer program product is further provided. When instructions in the computer program product are executed by a processor of the electronic device 600, the electronic device 600 can perform the target tracking method in the above method embodiment.

[0217] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0218] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A target tracking method, characterized in that: include: Inputting the current video frame to be processed into the first neural network to obtain the classification probability of the current video frame; wherein the classification probability is the probability that the target is contained in the current video frame; In response to the classification probability being less than or equal to the first threshold, the current video frame is input into a second neural network to obtain a feature vector of the current video frame; wherein the feature vector is a mathematical vector obtained after the second neural network performs feature mapping on the video frame; and the distance between the feature vectors of different video frames is used to characterize the similarity between different video frames; In response to a distance between a feature vector of the current video frame and a specified vector being less than a second threshold, determining that the current video frame includes the target, and continuing to track the target in a next video frame; The next video frame is adjacent to the current video frame in time sequence and is located after the current video frame; the designated vector is an average value of feature vectors of multiple foreground images, and the foreground image is an image with the target as a foreground object.

2. The target tracking method according to claim 1, characterized in that: The method further comprises: In response to the distance between the feature vector of the current video frame and the designated vector being greater than or equal to the second threshold, tracking the target according to the distance between the feature vector of the current video frame and the feature vector of a previous video frame; The previous video frame is adjacent to the current video frame in time sequence and is located before the current video frame.

3. The target tracking method according to claim 2, characterized in that: Tracking the target according to the distance between the feature vector of the current video frame and the feature vector of the previous video frame includes: In response to a distance between the feature vector of the current video frame and the feature vector of the previous video frame being greater than or equal to a third threshold, it is determined that the current video frame does not include the target.

4. The target tracking method according to claim 2, characterized in that: Tracking the target according to the distance between the feature vector of the current video frame and the feature vector of the previous video frame includes: In response to a distance between the feature vector of the current video frame and the feature vector of the previous video frame being less than a third threshold, tracking the target according to classification probabilities of N consecutive video frames; The value of N is a positive integer, and N≥2; the N consecutive video frames include: the current video frame, and N-1 video frames that are located before the current video frame and adjacent to the current video frame in time sequence.

5. The target tracking method according to claim 4, characterized in that: Tracking the target according to the classification probability of N consecutive video frames includes: In response to the N consecutive video frames not satisfying the target condition, determining that the current video frame includes the target, and continuing to track the target in the next video frame; In response to the N consecutive video frames satisfying the target condition, stopping tracking the target; The target condition is that the classification probability of the N consecutive video frames is less than or equal to the first threshold.

6. The target tracking method according to claim 1, characterized in that: The specified vector is obtained by the following method: Acquire a training sample set, wherein the training sample set includes a plurality of the foreground images; Inputting the plurality of foreground images into the second neural network to obtain feature vectors of the plurality of foreground images; The designated vector is obtained by obtaining an average value of the feature vectors of the plurality of foreground images.

7. The target tracking method according to claim 1, characterized in that: The training process of the second neural network includes: Acquire a training sample set, wherein the training sample set includes a plurality of the foreground images and a plurality of background images, wherein the background image is an image that does not contain the target or an image that uses the target as a background object; Determine a designated sample image in the training sample set, and obtain a positive sample and a negative sample of the designated sample image; wherein the similarity between the positive sample and the designated sample image is greater than the similarity between the negative sample and the designated sample image; and the designated sample image is the foreground image or the background image; Input the constructed sample triples into the initial neural network to obtain feature vectors of each sample triple; wherein each sample triple includes a specified sample image, a positive sample of the specified sample image, and a negative sample; wherein the specified sample image and the positive sample belong to the same category, and the specified sample image and the negative sample belong to different categories; Constructing a triplet loss function according to the first distance and the second distance corresponding to each sample triplet; adjusting the network parameters of the initial neural network according to the triplet loss function to obtain the second neural network; Among them, the convergence condition of the triplet loss function is: the first distance is less than the second distance; the first distance refers to the distance between the feature vector of the specified sample image and the feature vector of the positive sample in the same sample triplet, and the second distance refers to the distance between the feature vector of the specified sample image and the feature vector of the negative sample.

8. A target tracking device, characterized in that: include: A first acquisition module is configured to input the current video frame to be processed into a first neural network to obtain a classification probability of the current video frame; wherein the classification probability is a probability that the target is contained in the current video frame; A second acquisition module is configured to input the current video frame into a second neural network in response to the classification probability being less than or equal to a first threshold value, to obtain a feature vector of the current video frame; wherein the feature vector is a mathematical vector obtained after the second neural network performs feature mapping on the video frame; and the distance between the feature vectors of different video frames is used to characterize the similarity between different video frames; A first processing module is configured to determine that the current video frame includes the target in response to a distance between the feature vector of the current video frame and the specified vector being less than a second threshold, and continue to track the target in a next video frame; The next video frame is adjacent to the current video frame in time sequence and is located after the current video frame; the designated vector is an average value of feature vectors of multiple foreground images, and the foreground image is an image with the target as a foreground object.

9. The target tracking device according to claim 8, characterized in that: The device also includes: The second processing module is further configured to track the target according to the distance between the feature vector of the current video frame and the feature vector of a previous video frame in response to the distance between the feature vector of the current video frame and the designated vector being greater than or equal to the second threshold; The previous video frame is adjacent to the current video frame in time sequence and is located before the current video frame.

10. The target tracking device according to claim 9, characterized in that: The second processing module further includes: The first processing unit is configured to determine that the current video frame does not include the target in response to a distance between the feature vector of the current video frame and the feature vector of the previous video frame being greater than or equal to a third threshold.

11. The target tracking device according to claim 9, characterized in that: The second processing module further includes: A second processing unit is configured to track the target according to the classification probability of N consecutive video frames in response to the distance between the feature vector of the current video frame and the feature vector of the previous video frame being less than a third threshold; The value of N is a positive integer, and N≥2; the N consecutive video frames include: the current video frame, and N-1 video frames that are located before the current video frame and adjacent to the current video frame in time sequence.

12. The target tracking device according to claim 11, characterized in that: The second processing unit is further configured to: In response to the N consecutive video frames not satisfying the target condition, determining that the current video frame includes the target, and continuing to track the target in the next video frame; In response to the N consecutive video frames satisfying the target condition, stopping tracking the target; The target condition is that the classification probability of the N consecutive video frames is less than or equal to the first threshold.

13. The target tracking device according to claim 8, characterized in that: The device also includes: The third acquisition module is configured to acquire a training sample set, wherein the training sample set includes a plurality of the foreground images; input the plurality of the foreground images into the second neural network to obtain feature vectors of the plurality of the foreground images; and acquire an average value of the feature vectors of the plurality of the foreground images to obtain the specified vector.

14. The target tracking device according to claim 8, characterized in that: The training process of the second neural network includes: Acquire a training sample set, wherein the training sample set includes a plurality of the foreground images and a plurality of background images, wherein the background image is an image that does not contain the target or an image that uses the target as a background object; Determine a designated sample image in the training sample set, and obtain a positive sample and a negative sample of the designated sample image; wherein the similarity between the positive sample and the designated sample image is greater than the similarity between the negative sample and the designated sample image; and the designated sample image is the foreground image or the background image; Input the constructed sample triples into the initial neural network to obtain feature vectors of each sample triple; wherein each sample triple includes a specified sample image, a positive sample of the specified sample image, and a negative sample; wherein the specified sample image and the positive sample belong to the same category, and the specified sample image and the negative sample belong to different categories; Constructing a triplet loss function according to the first distance and the second distance corresponding to each sample triplet; adjusting the network parameters of the initial neural network according to the triplet loss function to obtain the second neural network; Among them, the convergence condition of the triplet loss function is: the first distance is less than the second distance; the first distance refers to the distance between the feature vector of the specified sample image and the feature vector of the positive sample in the same sample triplet, and the second distance refers to the distance between the feature vector of the specified sample image and the feature vector of the negative sample.

15. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the target tracking method according to any one of claims 1 to 7.

16. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the target tracking method as claimed in any one of claims 1 to 7.

17. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device is enabled to perform the target tracking method according to any one of claims 1 to 7.