Discriminative target tracking method and device based on spatiotemporal information fusion
The discriminative target tracking method through spatiotemporal information fusion, processing image features and using prediction networks solves the problem of low target tracking accuracy in the existing technology and achieves higher tracking accuracy and system performance.
Patent Information
- Application Number
- CN202111467399.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-03
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2041-12-03
AI Technical Summary
The target tracking accuracy in the existing technology is low, and it is difficult to effectively track the location of the target object.
A discriminative target tracking method using spatiotemporal information fusion is used to obtain historical image collections and test images, process training image features and test image features, perform feature fusion, and use a prediction network to determine the target object's border and foreground and background probabilities, thereby improving tracking accuracy. sex.
The accuracy of target tracking is improved, the position of the target object and the foreground and background probability can be determined more accurately, and the performance of the tracking system is enhanced.
Smart Images

Figure CN114419414B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer vision and pattern recognition, and in particular to a discriminative target tracking method and device based on spatiotemporal information fusion. Background Art
[0002] With the development of computer vision and pattern recognition technology, its application is becoming more and more extensive, and target tracking is one of its application directions. Target tracking refers to tracking a given target in order to obtain the target's position. It is widely used in many aspects such as human tracking, vehicle tracking, or gesture tracking in intelligent interactive systems.
[0003] In the prior art, target tracking is generally achieved by using template matching or similarity measurement, but there is a problem of low target tracking accuracy. Summary of the invention
[0004] The present invention provides a time-space information fusion discriminative target tracking method, device, electronic device and storage medium, which are used to solve the defect of low target tracking accuracy in the prior art and achieve the purpose of improving target tracking accuracy.
[0005] The present invention provides a discriminative target tracking method with spatiotemporal information fusion, comprising: obtaining a historical image set and a test image, wherein each historical image in the historical image set and the test image both include a target object to be tracked; processing each of the historical images in the historical image set to obtain a training image feature set, and processing the test image to obtain a test image feature; processing each of the training image features in the training image feature set to obtain spatiotemporal discriminative image features; performing block processing on the test image features and then performing convolution, and adding a first position code to obtain a target test image feature; performing feature fusion on the spatiotemporal discriminative image features and the target test image features to obtain an adaptive spatiotemporal image feature; performing feature fusion on the test image features and the adaptive spatiotemporal image features to obtain a mixed image feature; processing the mixed image features to obtain a target border containing the target object and a foreground-background probability of the target object; and determining the target object to be tracked based on the target border and the foreground-background probability.
[0006] According to a discriminative target tracking method based on spatiotemporal information fusion provided by the present invention, obtaining a historical image set and a test image includes: obtaining an initial image; in the initial image, obtaining the center coordinates of the object image area corresponding to the target object; obtaining the area size corresponding to the object image area, and obtaining an area extension value based on the area size and the size expansion coefficient; extending in an extension direction corresponding to the area extension value based on the center coordinates and the area extension value to obtain an extension coordinate; using an image area within the extension coordinates as a captured image area, and determining the captured images as the historical image and the test image, respectively; the historical image is any image in the historical image set.
[0007] According to a discriminative target tracking method based on spatiotemporal information fusion provided by the present invention, the processing of each of the training image features in the training image feature set to obtain spatiotemporal discriminative image features includes: performing convolution on each of the training image features in the training image feature set after block processing to obtain an intermediate image feature set, adding a second position code to each of the intermediate image features in the intermediate image feature set and extracting spatiotemporal scene information to obtain spatiotemporal discriminative image features.
[0008] According to a discriminative target tracking method based on spatiotemporal information fusion provided by the present invention, the processing of mixed image features to obtain a target border containing a target object and a foreground and background probability of the target object includes: acquiring a prediction network, the prediction network including a regression network and a classification network; inputting the mixed image features into the regression network for processing to obtain the target border features; inputting the mixed image features into the classification network for processing to obtain the foreground and background probabilities.
[0009] According to a discriminative target tracking method for spatiotemporal information fusion provided by the present invention, the regression network includes a first fully connected layer and an activation layer, the classification network includes a second fully connected layer, and the mixed image features are input into the regression network for processing to obtain the target border features, including: transmitting the mixed image features to the first fully connected layer through the first input layer of the regression network, processing the mixed image features through the first fully connected layer to obtain mixed image intermediate features; performing nonlinear processing on the mixed image intermediate features using the activation layer to obtain the target border features; the mixed image features are input into the classification network for processing to obtain the foreground background probabilities, including: transmitting the mixed image features to the second fully connected layer through the second input layer, the second fully connected layer including at least one layer; and classifying the mixed image features through the second fully connected layer to obtain the foreground background probabilities.
[0010] According to a discriminative target tracking method with spatiotemporal information fusion provided by the present invention, the method also includes: determining a network loss value of a prediction network, the network loss value including a regression network loss value corresponding to the regression network and a classification network loss value corresponding to the classification network; using a stochastic gradient descent method, adjusting network parameters in a direction that reduces the loss value until both the regression network and the classification network converge; wherein network convergence can be at least one of a network loss value being less than a preset threshold or a number of training times reaching a preset number of times.
[0011] According to a discriminative target tracking method with spatiotemporal information fusion provided by the present invention, the method also includes: obtaining the adaptive spatiotemporal image features corresponding to the current image, and the first updated adaptive spatiotemporal image features corresponding to the forward training image corresponding to the current image; obtaining the second updated adaptive spatiotemporal image features of the current image based on the adaptive spatiotemporal image features and the first updated adaptive spatiotemporal image features.
[0012] The present invention also provides a target tracking device, comprising: a first processing module, used to obtain a historical image set and a test image, wherein each historical image in the historical image set and the test image both include a target object to be tracked; a second processing module, used to process each of the historical images in the historical image set to obtain a training image feature set, and to process the test image to obtain a test image feature; a third processing module, used to process each of the training image features in the training image feature set to obtain a spatiotemporal discriminative image feature; a fourth processing module, used to perform convolution on the test image feature after block processing, and add a first position code to obtain a target test image feature; the spatiotemporal discriminative image feature and the target test image feature are feature-fused to obtain an adaptive spatiotemporal image feature; a fifth processing module, used to perform feature fusion on the test image feature and the adaptive spatiotemporal image feature to obtain a mixed image feature; a sixth processing module, used to process the mixed image feature to obtain a target border containing the target object and a foreground-background probability of the target object; and a seventh processing module, used to determine the target object to be tracked based on the target border and the foreground-background probability.
[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-described discriminative target tracking methods are implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described discriminative target tracking methods.
[0015] The present invention also provides a computer program product, comprising a computer program, characterized in that when the computer program is executed by a processor, the steps of any of the above-mentioned discriminative target tracking methods are implemented.
[0016] The discriminative target tracking method and device based on spatiotemporal information fusion provided by the present invention, by acquiring a historical image set and a test image, each historical image in the historical image set and the test image both include a target object to be tracked; processing each of the historical images in the historical image set to obtain a training image feature set, and processing the test image to obtain a test image feature; processing each of the training image features in the training image feature set to obtain spatiotemporal discriminative image features; performing convolution after block processing on the test image features, and adding a first position code to obtain a target test image feature; fusing the spatiotemporal discriminative image features and the target test image features to obtain an adaptive spatiotemporal image feature; fusing the test image features and the adaptive spatiotemporal image features to obtain a mixed image feature; processing the mixed image features to obtain a target frame containing the target object and a foreground and background probability of the target object; and determining the target object to be tracked based on the target frame and the foreground and background probability. By comprehensively processing the test image features and the training image feature set, the target frame corresponding to the target object and the foreground and background probability of the target object are obtained, thereby improving the accuracy of target tracking. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 It is one of the scene application diagrams of the discriminative target tracking method provided by the present invention;
[0019] Figure 2 It is one of the flow charts of the discriminative target tracking method provided by the present invention;
[0020] Figure 3 This is the second flow chart of the discriminative target tracking method provided by the present invention;
[0021] Figure 4 This is the third flow chart of the discriminative target tracking method provided by the present invention;
[0022] Figure 5 This is a fourth flow chart of the discriminative target tracking method provided by the present invention;
[0023] Figure 6 This is the fifth flow chart of the discriminative target tracking method provided by the present invention;
[0024] Figure 7 It is one of the structural schematic diagrams of the discriminative target tracking method provided by the present invention;
[0025] Figure 8 This is the second structural diagram of the discriminative target tracking method provided by the present invention;
[0026] Fig. 9 This is the third structural diagram of the discriminative target tracking method provided by the present invention;
[0027] Fig.10 This is the fourth structural diagram of the discriminative target tracking method provided by the present invention;
[0028] Fig.11 It is a structural schematic diagram of the target tracking device provided by the present invention;
[0029] Fig.12 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] The discriminative target tracking method provided in this application can be applied to Figure 1In the application environment shown, it is specifically applied to a target tracking system. The target tracking system includes a terminal 102 and a server 104, wherein the terminal 102 communicates with the server 104 through a network. The server 104 executes a discriminative target tracking method based on spatiotemporal information fusion. Specifically, the terminal 102 sends a historical image set and a test image to be processed. Accordingly, the server 104 obtains a historical image set and a test image, wherein each historical image in the historical image set and the test image include a target object to be tracked; each historical image in the historical image set is processed to obtain a training image feature set, and the test image is processed to obtain a test image feature; each training image feature in the training image feature set is processed to obtain a spatiotemporal discriminative image feature; the test image feature is processed in blocks and then convolved, and a first position code is added to obtain a target test image feature; the spatiotemporal discriminative image feature and the target test image feature are feature-fused to obtain an adaptive spatiotemporal image feature; the test image feature and the adaptive spatiotemporal image feature are feature-fused to obtain a mixed image feature; the mixed image feature is processed to obtain a target bounding box containing the target object and a foreground and background probability of the target object; based on the target bounding box and the foreground and background probability, the target object to be tracked is determined. The terminal 102 may be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0032] Combine the following Figure 2-Figure 6 The discriminative object tracking method of the present invention is described.
[0033] In one embodiment, Figure 2 As shown in FIG. 1 , a discriminative target tracking method is provided, which is applied to Figure 1 The server in the example is used to illustrate the following steps:
[0034] Step 202: Acquire a historical image set and a test image, wherein each historical image and test image in the historical image set includes a target object to be tracked.
[0035] The target object refers to an object that exists in the historical image set and the test image and is used for tracking. For example, an animal that needs to be tracked exists in the historical image set, and the animal can be considered as the target object to be tracked.
[0036] Specifically, the server can receive an image sequence sent by the terminal, and use the image sequence as a historical image set, or arbitrarily select an image in the image sequence as a test image, or use the image sequence locally stored in the server as a historical image set, or arbitrarily select an image in the image sequence as a test image.
[0037] In one embodiment, the historical image set can be obtained by online tracking images, with the first frame image as the initial image, and the training image is obtained by amplifying the first frame image data. During online tracking, the current image is gradually added to the historical image set and the earlier images are gradually eliminated, and the historical image set is always kept to contain 20 training images.
[0038] In one embodiment, the server may extract random video frames or video frame sequences from a local dataset as the historical image set and the test image. For example, a random video frame sequence may be extracted from a local dataset named GOT-10k, LaSOT, or TrackingNet as the historical image set and the test image.
[0039] Step 204: Process each historical image in the historical image set to obtain a training image feature set, and process the test image to obtain a test image feature.
[0040] Specifically, after receiving a series of image frames, the server randomly determines an image among them as the test image to be processed, and the rest are a set of historical images to be processed. In the set of historical images and the test images, the target image area where the target object is located is expanded according to a certain cropping multiple as the center, and the obtained cropped images are used as training images and test images. Feature extraction is performed on the training images and the test images to obtain training image features and test image features, respectively.
[0041] In one embodiment, each historical image set in the historical image set is normalized to obtain an image of size 20×256×256×3, and the image is input into the ResNet50 backbone network, and the image features of the fourth group of convolutional layers conv4 on the backbone network are extracted, and an image of size 20×16×16×1024 is output. The image is reduced in dimension using a 1×1 convolutional layer to obtain a training image feature of size 20×16×16×256. The same method is used to obtain a test image feature, and the image size is 1×16×16×256.
[0042] Step 206: Process each training image feature in the training image feature set to obtain spatiotemporal discriminative image features.
[0043] Specifically, after obtaining the training image feature set and the test image feature, the server processes each training image feature in the training image feature set to obtain spatiotemporal discriminative image features because each training image feature in the training image feature set is an image with spatiotemporal features.
[0044] In one embodiment, taking Transformer as an example, the training image features are first divided into blocks, and each 4×4 spatial area is used as a block of image features. The block of image features is composed of the series connection of each spatial position feature of the original image, that is, the resolution is reduced to 1 / 16 of the original, and the number of channels is increased to 16 times the original. The image feature size after blocking is 20×4×4×4096. Then a 1×1 convolution is used to perform feature dimensionality reduction processing, and the image feature size is 20×4×4×256, which is the training image feature after blocking. A predefined first spatial position code of 4×4×256 is added to each 4×4×256 feature in the training image features after blocking, and a 320×256 image feature is obtained after the feature dimension is reorganized. The spatiotemporal image feature is input into the Transformer autoencoder, which consists of two layers. Each layer consists of a standard multi-head autocorrelation module, two residual connection modules and a multi-layer perceptron. The Key, Value and Query of the multi-head autocorrelation module are all the training image features after 320×256 block reorganization. Finally, an image feature of 320×256 is output, which is the spatiotemporal discriminative feature.
[0045] Step 208, performing convolution on the test image features after block processing, and adding the first position code to obtain the target test image features; performing feature fusion on the spatiotemporal discriminative image features and the target test image features to obtain the adaptive spatiotemporal image features.
[0046] Specifically, after obtaining the test image features and the spatiotemporal discriminative image features, the server performs convolution on the test image features after block processing, and adds a first position code to obtain the target test image features, and fuses the spatiotemporal discriminative image features and the target test image features to obtain adaptive spatiotemporal image features.
[0047] In one embodiment, taking Transformer as an example, the test image features are divided into blocks and convolved to obtain image features of size 4×4×256, which are the test image features after division. A predefined spatial position encoding of size 4×4×256 is added to the test image features after division. After the feature dimensions are reorganized, a 16×256 feature is obtained. The image features and spatiotemporal discriminative image features are input into the Transformer inter-encoder. The encoder comprises two layers, each of which comprises a standard multi-head autocorrelation module, a multi-head cross-correlation module, and two residual connection modules. And a multi-layer perceptron, the Query, Key and Value of the multi-head autocorrelation module are the test image features after block reorganization of 6×256, the Query of the multi-head cross-correlation module is the test image features after block reorganization of 16×256, and the output feature size is 16×256 image features. The image features are passed through a residual connection layer as the Query of the multi-head cross-correlation module, and the Key and Value of the multi-head cross-correlation module are 320×256 spatiotemporal discriminative image features. Finally, 16×256 image features are output, which are adaptive spatiotemporal image features.
[0048] Step 210: Fusing the test image features and the adaptive spatiotemporal image features to obtain mixed image features.
[0049] Specifically, after obtaining the adaptive spatiotemporal image features, the server combines the above-mentioned test image features to perform feature fusion to obtain mixed image features.
[0050] In one embodiment, taking Transformer as an example, the test image before segmentation, that is, the test image features of size 16×16×256, are reorganized into test image features of size 256×256, and the above-mentioned adaptive spatiotemporal image features of size 16×256 and the reorganized test image features are input into the Transformer inter-encoder, and each layer of the encoder includes a standard multi-head autocorrelation module, a multi-head cross-correlation module, three residual connection modules and a multi-layer perceptron, and the Query, Key and Value of the multi-head autocorrelation module are the test image features of 256×256, and the output feature size is 256×256 image features, and the image features are used as the Query of the multi-head cross-correlation module after passing through a residual connection layer, and the Key and Value of the multi-head cross-correlation module are the above-mentioned adaptive spatiotemporal image features of 16×256, and the output feature size is 256×256 image features. The inter-encoder of the Transformer in this embodiment includes two layers, and the output size is 256×256 mixed image features.
[0051] Step 212, processing the mixed image features to obtain a target bounding box containing the target object and a foreground-background probability of the target object.
[0052] Among them, the foreground background probability refers to the foreground probability and background probability of the target object, where the foreground probability is the probability of the target object occupying the target border, and the background probability is the probability of the scene information other than the target object occupying the target border. The probability can be expressed as a percentage or as a score. For example, a foreground probability of 80% means that the target object occupies 80% of the target border. The foreground probability and the background probability together constitute the image features within the target border, such as a foreground probability of 80% and a background probability of 20%.
[0053] In one embodiment, the server processes the mixed image features and obtains the target bounding box containing the target object and the foreground and background probabilities of the target object in the target bounding box through the prediction head network. It can be understood that the prediction head network can also be expressed as a prediction network. Specifically, the mixed image features can be input into the prediction network, and the prediction network includes two branch networks, namely a classification network and a regression network. The classification network includes a fully connected layer, and the regression network includes three fully connected layers and a relu (Rectified Linear Unit) activation layer. The classification network outputs image features with a feature size of 16×16×2, which corresponds to the foreground and background probabilities; the regression network outputs image features with a feature size of 16×16×4, which corresponds to the center coordinates of the target bounding box, the length of the target bounding box, and the width of the target bounding box.
[0054] Step 214, determining the target object to be tracked based on the target bounding box and the foreground-background probability.
[0055] Specifically, after the server obtains the target frame and the foreground-background probability, the target object to be tracked can be determined by the foreground-background probability of the target object in the target frame. For example, if the target object to be tracked is an animal in the initial image, and the foreground probability of the animal in the foreground-background probability is 80%, the animal with the foreground probability of 80% in the target frame is used as the target object to be tracked.
[0056] In one embodiment, the server compares the foreground-background probability with the foreground-background probability threshold, and when the foreground probability of the target object is greater than or equal to the foreground probability threshold in the foreground-background probability threshold, it is determined to be a target object to be tracked; when the foreground-background probability of the target object is less than or equal to the foreground probability threshold in the foreground-background probability threshold, it is a non-tracked target object; or, when the background probability of the target object is less than or equal to the background probability threshold in the foreground-background probability threshold, it is determined to be a target object to be tracked; when the background probability of the target object is greater than or equal to the background probability threshold in the foreground-background probability threshold, it is a non-tracked target object.
[0057] The above-mentioned discriminative target tracking method based on spatiotemporal information fusion obtains a historical image set and a test image, wherein each historical image in the historical image set and the test image both include the target object to be tracked; each historical image in the historical image set is processed to obtain a training image feature set, and the test image is processed to obtain a test image feature; each training image feature in the training image feature set is processed to obtain a spatiotemporal discriminative image feature; the test image feature is processed in blocks and then convolved, and a first position code is added to obtain a target test image feature; the spatiotemporal discriminative image feature and the target test image feature are feature-fused to obtain an adaptive spatiotemporal image feature; the test image feature and the adaptive spatiotemporal image feature are feature-fused to obtain a mixed image feature; the mixed image feature is processed to obtain a target frame containing the target object and the foreground and background probability of the target object; and the target object to be tracked is determined based on the target frame and the foreground and background probability. By comprehensively processing the test image feature and the training image feature set, the target frame corresponding to the target object and the foreground and background probability of the target object are obtained, thereby improving the accuracy of target tracking.
[0058] In one embodiment, Figure 3 As shown, the initial image is processed to obtain the training image features and the test image features, including:
[0059] Step 302: Acquire an initial image.
[0060] Specifically, the server is connected to the image or video acquisition device, acquires images or videos through the image or video acquisition device, and transmits the acquired images or videos to the server.
[0061] In one embodiment, the server may extract video frames from the acquired video and use the extracted video frames as initial images.
[0062] Step 304: in the initial image, obtain the center coordinates of the object image area corresponding to the target object.
[0063] The object image region refers to an image region where an object exists, and the region can be considered as a frame region that includes the object.
[0064] Specifically, the server uses the upper left corner of the object image area as the origin and uses the coordinates of the origin to obtain the center coordinates of the object image area. For example, if the length of the object image area is H and the width is W, the center coordinates are (W / 2, -H / 2).
[0065] Step 306 , obtaining a region size corresponding to the object image region, and obtaining a region extension value based on the region size and the size expansion coefficient.
[0066] The size expansion coefficient refers to the coefficient that can expand the size.
[0067] Specifically, after obtaining the center coordinates, the server can obtain the region extension value based on the region size and the size expansion coefficient. For example, if the region size is W*H and the size expansion coefficient is 4, the region extension value is 4W*4H. It can be understood that when the expansion coefficient is 4, the training image can contain more scene information.
[0068] Step 308 , extending in an extension direction corresponding to the area extension value based on the center coordinates and the area extension value to obtain extension coordinates.
[0069] Specifically, after obtaining the area extension value, the server can extend the object image area in the width direction and the height direction of the object image area to obtain the extension coordinates. It can be understood that the extension coordinates can be obtained with the center coordinates as the reference coordinates, or with the origin of the image area as the reference coordinates.
[0070] Step 310: The image region within the extended coordinates is used as a captured image region, and the captured images are respectively determined as training images and test images, and the historical image is any image in the historical image set.
[0071] Specifically, after the server obtains the extended coordinates, it uses the image area as the cut-out image area according to the extended coordinates to obtain a training image and a test image, respectively.
[0072] In this embodiment, an initial image is acquired, and in the initial image, the center coordinates of the object image area corresponding to the target object are acquired, the area size corresponding to the object image area is acquired, and the area extension value is obtained based on the area size and the size expansion coefficient. The area is extended in an extension direction corresponding to the area extension value based on the center coordinates and the area extension value to obtain the extension coordinates, and the image area within the extension coordinates is used as the captured image area. The captured images are respectively determined as training images and test images, thereby achieving the purpose of accurately acquiring training image features and test image features.
[0073] In one embodiment, processing each training image feature in a training image feature set to obtain spatiotemporal discriminative image features includes: performing convolution on each training image feature in the training image feature set after block processing to obtain an intermediate image feature set, adding a second position code to each intermediate image feature in the intermediate image feature set and extracting spatiotemporal scene information to obtain spatiotemporal discriminative image features.
[0074] In one embodiment, taking Transformer as an example, the training image features are first divided into blocks, and each 4×4 spatial area is used as a block of image features. The block of image features is the concatenation of the features of each spatial position of the original image, that is, the image resolution is reduced to 1 / 16 of the original, and the number of channels is increased to 16 times the original. The feature size after block division is 20×4×4×4096. Then, a 1×1 convolution is used to perform feature dimensionality reduction processing to obtain a feature size of 20×4×4×256, which is the training image feature after block division. For each 4×4×256 in the training image feature after block division, The feature of the size is added with a predefined second spatial position code of 4×4×256, and the feature dimension is reorganized to obtain a feature of 320×256. The spatiotemporal image feature is input into the Transformer autoencoder, which includes two layers, each layer includes a standard multi-head autocorrelation module, two residual connection modules and a multi-layer perceptron. The Key, Value and Query of the multi-head autocorrelation module are all training image features after block reorganization of 320×256, and finally the image feature of size 320×256 is output, which is the spatiotemporal discriminative feature. The second position code in this embodiment is the same as the first position code in step 208.
[0075] In one embodiment, Figure 4 As shown, the mixed image features are processed to obtain the target bounding box containing the target object and the foreground and background probabilities of the target object, including:
[0076] Step 402: Obtain a prediction network, which includes a regression network and a classification network.
[0077] Specifically, the server forms an artificial intelligence network through a sensor and determines the artificial intelligence network as a prediction network. There are two branch networks in the prediction network, namely a regression network and a classification network, and the regression network and the classification network are parallel networks, and each network has its own function.
[0078] Step 404: Input the mixed image features into a regression network for processing to obtain target border features.
[0079] Specifically, the server inputs the obtained mixed image features into the regression network in the prediction network for processing to obtain the predicted target border features, which are expressed as The first two values represent the center coordinates of the predicted target border, and the last two values represent the width and length of the predicted target border, respectively.
[0080] In one embodiment, in the regression network, since the position far from the center of the target object tends to generate a low-quality predicted target bounding box, if the predicted position falls outside the elliptical area at the center of the target object, the generated predicted value will not be calculated in the regression loss; if the predicted position falls within the elliptical area at the center of the target object, it is considered to be the predicted target bounding box. The loss function of the regression network can be expressed as:
[0081]
[0082] Among them, b (i,j) represents the true target bounding box, represents the predicted target border, and IoU represents the union function of the real target border and the predicted target border, where Expressed as a formula:
[0083]
[0084] Among them, x and y are the center coordinates of the real target frame, and They are the center coordinates of the predicted target bounding box, w represents the width of the image, and h represents the height of the image.
[0085] Step 406: Input the mixed image features into the classification network for processing to obtain the foreground-background probability.
[0086] Specifically, the server inputs the obtained mixed image features into the classification network in the prediction network for processing, and obtains the foreground and background probabilities of the target object in the target network.
[0087] In one embodiment, the loss function in the classification network is the cross entropy loss, which is expressed as the formula:
[0088]
[0089] Among them, N represents the total number of samples and n represents the sample.
[0090] In this embodiment, by obtaining a prediction network, which includes a regression network and a classification network, the mixed image features are input into the regression network for processing to obtain the target border features, and the mixed image features are input into the classification network for processing to obtain the foreground background probability, thereby achieving the purpose of accurately obtaining the target border features and the foreground background probability.
[0091] In one embodiment, the regression network includes a first fully connected layer and an activation layer, the classification network includes a second fully connected layer, and the mixed image features are input into the regression network for processing to obtain the target border features, including: transmitting the mixed image features to the first fully connected layer through the first input layer of the regression network, processing the mixed image features through the first fully connected layer to obtain the mixed image intermediate features; performing nonlinear processing on the mixed image intermediate features using the activation layer to obtain the target border features; inputting the mixed image features into the classification network for processing to obtain the foreground background probabilities, including: transmitting the mixed image features to the second fully connected layer through the second input layer, the second fully connected layer including at least one layer; and classifying the mixed image features through the second fully connected layer to obtain the foreground background probabilities.
[0092] Specifically, the regression network includes three fully connected layers and an activation layer. The server inputs the mixed image features into the three fully connected layers in sequence through the input layer of the regression network. The output image features are processed nonlinearly through the activation layer to obtain the target border features. At the same time, the server transmits the mixed image features to the fully connected layer of the classification network through the input layer of the classification network, and obtains the foreground-background probability after binary classification.
[0093] In this embodiment, by setting the specific levels of the regression network and the classification network, the purpose of accurately obtaining the target frame features and the foreground and background probabilities can be achieved.
[0094] In one embodiment, Figure 5 As shown, the discriminative target tracking method based on spatiotemporal information fusion also includes:
[0095] Step 502: determine a network loss value of the prediction network, where the network loss value includes a regression network loss value corresponding to the regression network and a classification network loss value corresponding to the classification network.
[0096] Specifically, the network loss value of the prediction network can be obtained by weighted calculation between the regression network loss value and the classification network loss value.
[0097] In one embodiment, the overall loss of the prediction network can be expressed as:
[0098]
[0099] Among them, λ1=λ2=1 is the loss weighting coefficient, which can be obtained by combining the above formula (1) and formula (3).
[0100] Step 504, using the stochastic gradient descent method, adjust the network parameters in the direction of reducing the loss value until both the regression network and the classification network converge; wherein the network convergence can be at least one of the network loss value being less than a preset threshold or the number of training times reaching a preset number of times.
[0101] Specifically, after obtaining the network loss value of the prediction network, the server can adjust the prediction network until the regression network and the classification network in the prediction network converge. For example, in order to reduce the operating pressure of the server, the training samples are divided into small sample sets, 20 pairs of images are selected from each small sample set, and the 20 pairs of images include 20 training images and 20 test images. The number of training iterations is 400 times, and the learning rate for the first 200 training times is set to 0.0001, and the learning rate for the next 200 training times is set to 0.00001, until the network loss value is less than the preset threshold, or the obtained target border features and foreground background probabilities no longer change.
[0102] In this embodiment, by determining the network loss value of the prediction network, the stochastic gradient descent method is used to adjust the network parameters in the direction of reducing the loss value until both the regression network and the classification network converge, thereby achieving the purpose of more accurately obtaining the target border features and foreground background probabilities.
[0103] In one embodiment, Figure 6 As shown, the method also includes:
[0104] Step 602: Obtain the adaptive spatiotemporal image features corresponding to the current image and the first updated adaptive spatiotemporal image features corresponding to the forward training image corresponding to the current image.
[0105] The forward training image refers to an image before the current image. The timestamp of the image can be used as a judgment reference, and the image with a timestamp before the current image is called the forward training image.
[0106] Specifically, the server obtains an initial image by executing, processes the initial image, obtains training image features or test image features; extracts scene information from the training image features and adds a first position code to obtain adaptive spatiotemporal image features, and then obtains discriminative image features corresponding to the current image. At the same time, the first updated adaptive spatiotemporal image features corresponding to the forward training image can be obtained through the initial discriminative image features. For example, the adaptive spatiotemporal image features corresponding to the current image are expressed as F t , the updated adaptive spatiotemporal image feature of the forward training image corresponding to the current image is expressed as , the updated adaptive spatiotemporal image feature of the current image is expressed as
[0107] In one embodiment, the server obtains two frames of images with a preset interval in the video as the current training image and the forward training image. For example, the forward training image and the current training image are video frames with an interval of 10 frames. The image area where the target bounding box containing the target object is predicted to be located is used as the center, and an image with a size of 4×4 times the image area is cropped from the forward training image as the new current training image. By processing the current training image and the forward training image, the adaptive spatiotemporal image features corresponding to the current training image and the first updated adaptive spatiotemporal image features corresponding to the forward training image corresponding to the current training image are obtained.
[0108] Step 604: Obtain a second updated adaptive spatiotemporal image feature of the current training image according to the adaptive spatiotemporal image feature and the first updated adaptive spatiotemporal image feature.
[0109] Specifically, after obtaining the adaptive spatiotemporal image features corresponding to the current training image and the first updated adaptive spatiotemporal image features corresponding to the forward training image, the server can obtain the second updated adaptive spatiotemporal image features of the current training image through the functional relationship between the adaptive spatiotemporal image features, the first updated adaptive spatiotemporal image features, and the second updated adaptive spatiotemporal image features. For example, assuming that the adaptive spatiotemporal image features corresponding to the current training image are expressed as F t , the first adaptive spatiotemporal image feature after the update of the forward training image corresponding to the current training image is expressed as , the updated second adaptive spatiotemporal image feature of the current training image is expressed as , then the second adaptive spatiotemporal image feature Expressed as a formula:
[0110]
[0111] Among them, γ represents the update parameter, which can be selected as 0.01.
[0112] It can be understood that the initial adaptive spatiotemporal image feature is determined as F0, and so on, the adaptive spatiotemporal image feature of each frame of image is continuously updated.
[0113] In this embodiment, by obtaining the adaptive spatiotemporal image features corresponding to the current training image and the first updated adaptive spatiotemporal image features corresponding to the forward training image corresponding to the current training image, the second updated adaptive spatiotemporal image features of the current training image are obtained based on the adaptive spatiotemporal image features and the first updated adaptive spatiotemporal image features. This can achieve the goal of accurately obtaining the updated adaptive spatiotemporal image features of the current training image as one of the features for generating mixed image features, thereby improving the robustness of the discriminative target tracking method based on spatiotemporal information fusion.
[0114] In one embodiment, Figure 7 As shown, the black box in any historical image in the historical image set is the target object to be tracked. After the historical image set is processed by CNN (Convolutional Neural Networks), a training image feature set is obtained. After each training image feature in the training image feature set is divided into blocks and convolutional processed, it is input into the Transformer autoencoder to obtain spatiotemporal discriminative image features, and the spatiotemporal discriminative image features are input into the first Transformer interencoder. After the test image is processed by CNN, a test image feature is obtained. After the test image feature is divided into blocks and convolutional processed, it is input into the first Transformer interencoder. After being processed by the first Transformer interencoder, an adaptive spatiotemporal image feature is obtained. The adaptive spatiotemporal image feature is input into the second Transformer interencoder. Combined with the test image feature input into the second Transformer interencoder, a mixed image feature is obtained. The mixed image feature is input into the prediction network to predict the target bounding box of the target object and the foreground and background probability of the target object.
[0115] In one embodiment, Figure 8 As shown in the figure, the training image features are input into the Transformer autoencoder, and the absolute position encoding is added to each spatial position of the features at K (Key) and Q (Query) input to the encoder, and a feature map of the same size as the training image is output, that is, the spatiotemporal discriminative image features. It can be understood that H in the figure represents the length of the image feature, W represents the width of the image feature, C represents the dimension of the image feature, M× represents M identical modules, and N× represents N identical modules.
[0116] In one embodiment, the first Transformer inter-encoder and the second Transformer inter-encoder both include: Fig. 9 The structure shown includes 1 autocorrelation module, 3 residual connection modules, 1 cross-correlation module and a perceptron. The two inputs in the Transformer inter-encoder are respectively connected to the autocorrelation module and the cross-correlation module and output from the residual connection module.
[0117] In one embodiment, Fig.10 As shown in FIG. 1 , the structure of the prediction head network includes two perceptrons, which respectively output foreground background probability and target bounding box, and the input end inputs the above-mentioned mixed image features.
[0118] The target tracking device provided by the present invention is described below. The target tracking device described below and the discriminability described above can be referred to each other.
[0119] In one embodiment, Fig.11 As shown, a target tracking device 1100 is provided, comprising: a first processing module 1102, a second processing module 1104, a third module 1106, a fourth module 1108, a fifth processing module 1110, a sixth processing module 1112 and a seventh processing module 1114, wherein: the first processing module is used to obtain a historical image set and a test image, each of the historical images in the historical image set and the test image includes a target object to be tracked; the second processing module is used to process each of the historical images in the historical image set to obtain a training image feature set, and to process the test image to obtain a test image feature; the third processing module is used to process each of the historical images in the training image feature set The invention further comprises a processing module for processing each of the training image features to obtain spatiotemporal discriminative image features; a fourth processing module for performing convolution on the test image features after block processing, and adding a first position code to obtain a target test image feature; performing feature fusion on the spatiotemporal discriminative image features and the target test image features to obtain an adaptive spatiotemporal image feature; a fifth processing module for performing feature fusion on the test image features and the adaptive spatiotemporal image features to obtain a mixed image feature; a sixth processing module for processing the mixed image features to obtain a target bounding box containing a target object and a foreground-background probability of the target object; and a seventh processing module for determining the target object to be tracked based on the target bounding box and the foreground-background probability.
[0120] In one embodiment, the first processing module 1102 is used to obtain an initial image; in the initial image, obtain the center coordinates of the object image area corresponding to the target object; obtain the area size corresponding to the object image area, and obtain the area extension value based on the area size and the size expansion coefficient; based on the center coordinates and the area extension value, extend in the extension direction corresponding to the area extension value to obtain the extension coordinates; use the image area located within the extension coordinates as the captured image area, and determine the captured images as the historical image and the test image respectively; the historical image is any image in the historical image set.
[0121] In one embodiment, the third processing module 1106 is used to perform convolution on each of the training image features in the training image feature set after block processing to obtain an intermediate image feature set, add a second position code to each of the intermediate image features in the intermediate image feature set and extract spatiotemporal scene information to obtain spatiotemporal discriminative image features.
[0122] In one embodiment, the sixth processing module 1112 is used to obtain a prediction network, which includes a regression network and a classification network; input the mixed image features into the regression network for processing to obtain the target border features; input the mixed image features into the classification network for processing to obtain the foreground background probability.
[0123] In one embodiment, the sixth processing module 1112 is used to transfer the mixed image features to the first fully connected layer through the first input layer of the regression network, process the mixed image features through the first fully connected layer to obtain mixed image intermediate features; use the activation layer to perform nonlinear processing on the mixed image intermediate features to obtain the target border features; transfer the mixed image features to the second fully connected layer through the second input layer, the second fully connected layer includes at least one layer; classify the mixed image features through the second fully connected layer to obtain the foreground background probability.
[0124] In one embodiment, a discriminative target tracking device based on spatiotemporal information fusion is used to determine the network loss value of a prediction network, the network loss value including a regression network loss value corresponding to the regression network and a classification network loss value corresponding to the classification network; using a gradient descent method, the network parameters are adjusted in a direction that reduces the loss value until both the regression network and the classification network converge; wherein the network convergence can be at least one of the network loss value being less than a preset threshold or the number of training times reaching a preset number of times.
[0125] In one embodiment, a discriminative target tracking device based on spatiotemporal information fusion is used to obtain adaptive spatiotemporal image features corresponding to a current training image, and first updated adaptive spatiotemporal image features corresponding to a forward training image corresponding to the current training image; based on the adaptive spatiotemporal image features and the first updated adaptive spatiotemporal image features, a second updated adaptive spatiotemporal image feature of the current training image is obtained.
[0126] Fig.12 An example of a physical structure diagram of an electronic device is shown in FIG. Fig.12 As shown, the electronic device may include: a processor (processor) 1210, a communication interface (Communications Interface) 1220, a memory (memory) 1230 and a communication bus 1240, wherein the processor 1210, the communication interface 1220, and the memory 1230 communicate with each other through the communication bus 1240. The processor 1210 can call the logic instructions in the memory 1230 to execute a discriminative target tracking method based on spatiotemporal information fusion, the method comprising: obtaining a historical image set and a test image, wherein each historical image in the historical image set and the test image both include a target object to be tracked; processing each of the historical images in the historical image set to obtain a training image feature set, and processing the test image to obtain a test image feature; processing each of the training image features in the training image feature set to obtain spatiotemporal discriminative image features; performing block processing on the test image features and then convolving them, and adding a first position code to obtain a target test image feature; performing feature fusion on the spatiotemporal discriminative image features and the target test image features to obtain an adaptive spatiotemporal image feature; performing feature fusion on the test image features and the adaptive spatiotemporal image features to obtain a mixed image feature; processing the mixed image features to obtain a target bounding box containing the target object and a foreground and background probability of the target object; and determining the target object to be tracked based on the target bounding box and the foreground and background probability.
[0127] In addition, the logic instructions in the above-mentioned memory 1230 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
[0128] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the above-mentioned discriminative target tracking method based on spatiotemporal information fusion, and the method includes: acquiring a historical image set and a test image, each historical image in the historical image set and the test image each including a target object to be tracked; processing each of the historical images in the historical image set to obtain a training image feature set, and processing the test image to obtain a test image feature set. ; Process each of the training image features in the training image feature set to obtain spatiotemporal discriminative image features; perform convolution on the test image features after block processing, and add a first position code to obtain a target test image feature; fuse the spatiotemporal discriminative image features and the target test image features to obtain an adaptive spatiotemporal image feature; fuse the test image features and the adaptive spatiotemporal image features to obtain a mixed image feature; process the mixed image features to obtain a target bounding box containing the target object and a foreground-background probability of the target object; determine the target object to be tracked based on the target bounding box and the foreground-background probability.
[0129] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a discriminative target tracking method based on spatiotemporal information fusion, the method comprising: obtaining a historical image set and a test image, wherein each historical image in the historical image set and the test image both include a target object to be tracked; processing each of the historical images in the historical image set to obtain a training image feature set, and processing the test image to obtain a test image feature; processing each of the training image features in the training image feature set to obtain spatiotemporal discriminative image features; performing block processing on the test image features, performing convolution, and adding a first position code to obtain a target test image feature; performing feature fusion of the spatiotemporal discriminative image features and the target test image features to obtain an adaptive spatiotemporal image feature; performing feature fusion of the test image features and the adaptive spatiotemporal image features to obtain a mixed image feature; processing the mixed image features to obtain a target bounding box containing the target object and a foreground-background probability of the target object; and determining the target object to be tracked based on the target bounding box and the foreground-background probability.
[0130] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
[0131] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0132] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A discriminative target tracking method based on spatiotemporal information fusion, It is characterized in that include: Acquire a historical image set and a test image, wherein each historical image in the historical image set and the test image include a target object to be tracked; Processing each of the historical images in the historical image set to obtain a training image feature set, and processing the test image to obtain a test image feature; Processing each of the training image features in the training image feature set to obtain spatiotemporal discriminative image features; The test image features are processed into blocks and then convolved, and a first position code is added to obtain target test image features; the spatiotemporal discriminative image features and the target test image features are fused to obtain adaptive spatiotemporal image features; Fusing the test image features with the adaptive spatiotemporal image features to obtain mixed image features; Processing the mixed image features to obtain a target bounding box containing the target object and a foreground-background probability of the target object; Based on the target bounding box and the foreground-background probability, the target object to be tracked is determined.
2. The discriminative target tracking method based on spatiotemporal information fusion according to claim 1, It is characterized in that The obtaining of the historical image set and the test image comprises: Get the initial image; In the initial image, obtaining the center coordinates of the object image area corresponding to the target object; Acquire a region size corresponding to the object image region, and obtain a region extension value based on the region size and a size expansion coefficient; Extending in an extension direction corresponding to the area extension value based on the center coordinates and the area extension value to obtain an extension coordinate; The image area within the extended coordinates is used as a captured image area, and the captured images are respectively determined as the historical image and the test image; the historical image is any image in the historical image set.
3. The discriminative target tracking method based on spatiotemporal information fusion according to claim 1, It is characterized in that The processing of each of the training image features in the training image feature set to obtain spatiotemporal discriminative image features includes: Each of the training image features in the training image feature set is processed in blocks and then convolved to obtain an intermediate image feature set. A second position code is added to each intermediate image feature in the intermediate image feature set, and spatiotemporal scene information is extracted to obtain spatiotemporal discriminative image features.
4. The discriminative target tracking method based on spatiotemporal information fusion according to claim 1, It is characterized in that The processing of the mixed image features to obtain the target frame containing the target object and the foreground and background probabilities of the target object includes: Acquire a prediction network, wherein the prediction network includes a regression network and a classification network; Inputting the mixed image features into the regression network for processing to obtain the target frame features; The mixed image features are input into the classification network for processing to obtain the foreground-background probability.
5. The discriminative target tracking method based on spatiotemporal information fusion according to claim 4, It is characterized in that The regression network includes a first fully connected layer and an activation layer, the classification network includes a second fully connected layer, and the mixed image features are input into the regression network for processing to obtain the target frame features, including: The mixed image features are transmitted to the first fully connected layer through the first input layer of the regression network, and the mixed image features are processed by the first fully connected layer to obtain mixed image intermediate features; Using the activation layer to perform nonlinear processing on the intermediate features of the mixed image to obtain the target border features; The inputting the mixed image features into the classification network for processing to obtain the foreground-background probability comprises: Transmitting the mixed image features to the second fully connected layer through the second input layer, where the second fully connected layer includes at least one layer; The mixed image features are classified through the second fully connected layer to obtain the foreground-background probability.
6. The discriminative target tracking method based on spatiotemporal information fusion according to claim 4, It is characterized in that The method further comprises: Determine a network loss value of the prediction network, wherein the network loss value includes a regression network loss value corresponding to the regression network and a classification network loss value corresponding to the classification network; Using the stochastic gradient descent method, the network parameters are adjusted in a direction that reduces the loss value until both the regression network and the classification network converge; wherein the network convergence can be at least one of the network loss value being less than a preset threshold or the number of training times reaching a preset number of times.
7. The discriminative target tracking method based on spatiotemporal information fusion according to any one of claims 1 to 6, It is characterized in that The method further comprises: Acquire the adaptive spatiotemporal image feature corresponding to the current image, and the first updated adaptive spatiotemporal image feature corresponding to the forward training image corresponding to the current image; A second updated adaptive spatiotemporal image feature of the current image is obtained according to the adaptive spatiotemporal image feature and the first updated adaptive spatiotemporal image feature.
8. A discriminative target tracking device based on spatiotemporal information fusion, It is characterized in that include: A first processing module is used to obtain a historical image set and a test image, wherein each historical image in the historical image set and the test image includes a target object to be tracked; A second processing module is used to process each of the historical images in the historical image set to obtain a training image feature set, and to process the test image to obtain a test image feature; A third processing module, used for processing each of the training image features in the training image feature set to obtain spatiotemporal discriminative image features; The fourth processing module is used to perform convolution after block processing on the test image feature, and add the first position code to obtain the target test image feature; perform feature fusion on the spatiotemporal discriminative image feature and the target test image feature to obtain the adaptive spatiotemporal image feature; A fifth processing module, used for fusing the test image features with the adaptive spatiotemporal image features to obtain mixed image features; A sixth processing module, used for processing the mixed image features to obtain a target frame containing the target object and a foreground-background probability of the target object; The seventh processing module is used to determine the target object to be tracked based on the target border and the foreground-background probability.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the steps of the discriminative target tracking method based on spatiotemporal information fusion as described in any one of claims 1 to 7 are implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the discriminative target tracking method based on spatiotemporal information fusion as described in any one of claims 1 to 7 are implemented.
11. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the discriminative target tracking method based on spatiotemporal information fusion as described in any one of claims 1 to 7 are implemented.
