Target tracking method, system, computer device and storage medium
Target tracking is performed by fusing visual and text features, which solves the tracking anomaly problems caused by scale changes, deformation and other factors in the existing technology, and improves the robustness and reliability of target tracking.
Patent Information
- Application Number
- CN202410845843.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-06-27
AI Technical Summary
Existing target tracking technology is prone to abnormalities or tracking failures under factors such as scale changes, deformation, occlusion, rapid movement, and illumination changes.
The method of fusing visual features and text features is used for target tracking. By obtaining the visual feature information and text feature information of the image to be tracked, encoding and fusion are obtained to obtain the fused feature coding block, which is used to match detection objects and historical tracking objects, and update the target tracking sequence. .
It improves the robustness and reliability of target tracking, reduces the risk of misrecognition caused by interference factors, and enhances the richness of feature expression.
Smart Images

Figure CN118379515B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image recognition technology, and in particular to a target tracking method, a target tracking system, a computer device, and a computer-readable storage medium. Background Art
[0002] Target tracking technologies such as MOT (Multi-Object Tracking) are widely used in technical fields such as autonomous driving, video surveillance, and behavior recognition. However, in the process of target tracking, it is easy for the tracked target to be abnormal or fail to be tracked due to scale changes, deformation, occlusion, rapid movement, lighting changes, noise, etc. Summary of the invention
[0003] Based on this, it is necessary to provide a target tracking method, a target tracking system, a computer device and a computer-readable storage medium to address the above-mentioned technical problems, which can integrate visual features and text features for target tracking, which is conducive to enhancing the robustness of target tracking features to improve the reliability of target tracking.
[0004] On the one hand, a target tracking method is provided, which includes: obtaining visual feature information of a detection object in an image to be tracked, encoding the visual feature information to obtain a visual coding block; encoding text feature information of the image to be tracked to obtain a text coding block; wherein the text feature information is used to describe the detection object in the image to be tracked; fusing the visual coding block and the text coding block to obtain a fused feature coding block of each detection target in the image to be tracked; and using the fused feature coding block to match the detection object with the historical tracking object to update the target tracking sequence.
[0005] In one embodiment of the present application, a text coding block obtained by encoding text feature information of an image to be tracked includes: obtaining a preset description sample set; wherein the description sample set includes a plurality of description texts; encoding the description text to obtain a description coding block; matching the description coding block with a visual coding block of a detection object, and obtaining a description coding block for describing each detection object as a text coding block.
[0006] In one embodiment of the present application, matching the description coding block with the visual coding block of the detection object includes: respectively calculating the feature similarity between the visual coding block of each detection object and each description coding block; based on the feature similarity, selecting a preset number of description coding blocks as the text coding block of each detection object; wherein, the same description coding block is allowed to be selected for different detection objects.
[0007] In one embodiment of the present application, fusing the visual coding block and the text coding block includes:
[0008] ;
[0009] Among them, E t query Represents a fused feature coding block; T1 and T2 represent the first text coding block and the second text coding block of a detected object respectively; (T1, T2) represents the concatenation of the first text coding block and the second text coding block; V represents the visual coding block of a detected object; CrossAttn((T1, T2), V) represents the fusion of the concatenated first text coding block with the second text coding block and the visual coding block into the cross attention layer.
[0010] In one embodiment of the present application, obtaining a preset description sample set includes: obtaining a number of text descriptors of multiple description categories; wherein the description categories include one or more of motion status categories, clothing color categories, luggage status categories, and appearance accessories categories; extracting text descriptors of each description category to construct a description text; and taking a collection of description texts constructed based on the text descriptors as a description sample set.
[0011] In one embodiment of the present application, encoding visual feature information to obtain a visual coding block includes: encoding the visual feature information to obtain an intermediate coding block; inputting the intermediate coding block into a pre-trained feature adaptation unit, and performing feature adaptation processing on the intermediate coding block to obtain a visual coding block.
[0012] In one embodiment of the present application, the feature adaptation process of the feature adaptation unit is expressed as:
[0013] ;
[0014] Where V(x) represents the visual encoding block; Clip Image (x) represents the intermediate coding block; α represents the hyperparameter; W1 and W2 represent the weight parameters of the linear layer of the feature adaptation unit respectively; Relu() represents the activation function.
[0015] In one embodiment of the present application, training the feature adaptation unit includes: fixing the model parameters of the image encoder that encodes the visual feature information, and iteratively training the feature adaptation unit; the loss function in the iterative training of the feature adaptation unit is:
[0016] ;
[0017] Among them, T i represents the number of targets to be tracked contained in the i-th frame training sample; l cls represents the classification loss for classifying the target to be tracked; l l1 Represents the regression loss of the detection box size of the target to be tracked; l giouRepresents the intersection-over-union loss between the detection box and the true value box of the target to be tracked; λ cls , l1 , giou All represent hyperparameters.
[0018] In one embodiment of the present application, obtaining visual feature information of a detection object in an image to be tracked includes: performing image feature extraction on the image to be tracked to obtain a visual feature vector; capturing the detection object in the image to be tracked, constructing a detection frame of the detection object, and obtaining position information of the detection object; and using the visual feature vector and the position information as visual feature information.
[0019] In one embodiment of the present application, updating the target tracking sequence includes: obtaining a forward tracking sequence of a forward video frame; wherein the forward video frame represents an image occurring at a historical moment compared to an image to be tracked; the forward tracking sequence represents a target tracking sequence obtained by performing target tracking on the forward video frame; decoding the fusion feature encoding of the image to be tracked to obtain a tracking sequence to be complemented; fusing the tracking sequence to be complemented with the forward tracking sequence through a fusion function to obtain a target tracking sequence of the image to be tracked.
[0020] In one embodiment of the present application, the fusion function is:
[0021] ;
[0022] Among them, M t tck represents the target tracking sequence; β represents the preset weight parameter; M t-1 tck represents the forward tracking sequence; O t tck Represents the fused feature encoding of the image to be tracked.
[0023] In one embodiment of the present application, the fused feature encoding of the image to be tracked is decoded to obtain the tracking sequence to be complemented, including: obtaining the tracking sequence template; using the tracking sequence template as a key vector and a numerical vector, and the fused feature encoding block as a query vector, to perform attention mechanism learning; performing residual processing and forward propagation processing on the results of the attention mechanism learning, to obtain the tracking sequence to be complemented and the target tracking frame of the image to be tracked.
[0024] On the other hand, a target tracking system is provided, which includes: a first feature extractor, a first encoder, a second encoder, a feature fusion module and a decoder; the first feature extractor is used to obtain visual feature information of a detection object in an image to be tracked; the first encoder is connected to the first feature extractor, and is used to encode the visual feature information to obtain a visual coding block; the second encoder is used to encode the text feature information of the image to be tracked to obtain a text coding block; wherein the text feature information is used to describe the detection object in the image to be tracked; the feature fusion module is used to fuse the visual coding block and the text coding block to obtain a fused feature coding block of each detection target in the image to be tracked; the decoder is used to use the fused feature coding block to match the detection object with the historical tracking object to update the target tracking sequence.
[0025] In one embodiment of the present application, a feature fusion module includes a similarity unit, a text selection unit and a fusion unit; the similarity calculation unit is connected to the first encoder and the second encoder, and is used to calculate the feature similarity between the visual coding block of each detection object and each description coding block; the text selection unit is connected to the similarity calculation unit, and is used to select a preset number of description coding blocks based on the feature similarity as the text coding blocks of each detection object; wherein, the same description coding block is allowed to be selected for different detection objects; the fusion unit is connected to the first encoder and the text selection unit, and is used to fuse the visual coding blocks of each detection object and the text coding blocks matching them.
[0026] In one embodiment of the present application, the decoder also includes an attention layer, a first addition and normalization layer, a forward propagation layer and a second addition and normalization layer connected in sequence; wherein the input of the attention layer includes a fused feature coding block as a query vector, a key vector and a preset tracking sequence template as a numerical vector; the output of the fused feature coding block and the attention layer serves as the input of the first addition and normalization layer; and the output end of the first addition and normalization layer is also connected to the second addition and normalization layer.
[0027] In one embodiment of the present application, the first encoder includes a first encoding unit and a feature adaptation unit; the first encoding unit is connected to the first feature extractor, and is used to encode the visual feature information output by the first feature extractor to obtain an intermediate coding block; the feature adaptation unit is connected to the first encoding unit, and is used to input the intermediate coding block, perform feature adaptation processing on the intermediate coding block, and output a visual coding block.
[0028] In one embodiment of the present application, the feature adaptation unit includes a first linear layer, an activation layer, and a second linear layer connected in sequence; the input end of the first linear layer is connected to the first encoding unit; the output of the first encoding unit is connected to the output of the second linear layer as a residual connection, and the output of the second linear layer is residually processed with the output of the first encoding unit to obtain a visual coding block.
[0029] In one embodiment of the present application, the target tracking system also includes a memory; the memory is connected to the decoder, and is used to store a forward tracking sequence of forward video frames; wherein the forward video frame represents an image occurring at a historical moment compared to the image to be tracked; the forward tracking sequence represents a target tracking sequence obtained by performing target tracking on the forward video frame; the decoder is used to decode the fusion feature encoding of the image to be tracked to obtain a tracking sequence to be complemented; and the tracking sequence to be complemented is fused with the forward tracking sequence through a fusion function to obtain a target tracking sequence of the image to be tracked.
[0030] On the other hand, a computer device is provided, comprising an internal memory, a processor, and a computer program stored in the internal memory and executable on the processor, wherein the processor implements the steps of the target tracking method in any one of the above-mentioned embodiments when executing the computer program.
[0031] On the other hand, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the target tracking method in any of the above embodiments are implemented.
[0032] The above-mentioned target tracking method, target tracking system, computer device and computer-readable storage medium encode the visual feature information of the image to be tracked to obtain a visual coding block, and encode the text feature information describing the detection object in the image to be tracked to obtain a text coding block, so as to integrate the visual features of the image to be tracked and the descriptive text information into the features used for target tracking, enrich the feature expression used for target tracking, and perform target tracking in combination with descriptive text information, which can help reduce the risk of misidentification caused by interference factors, so as to enhance the robustness of the target tracking features, and thus improve the reliability of target tracking. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 This is a schematic diagram of an application scenario of an embodiment of the target tracking method of the present application;
[0034] Figure 2 It is a structural schematic diagram of an embodiment of the target tracking system of the present application;
[0035] Figure 3 is a structural schematic diagram of another embodiment of the target tracking system of the present application;
[0036] Figure 4 It is a structural diagram of an embodiment of a first encoder of the present application;
[0037] Figure 5 It is a structural diagram of an embodiment of a decoder of the present application;
[0038] Figure 6It is a flowchart of an embodiment of the target tracking method of the present application;
[0039] Figure 7 is a flowchart of another embodiment of the target tracking method of the present application;
[0040] Figure 8 This is a flowchart of an embodiment of obtaining a text descriptor in the present application;
[0041] Fig. 9 is a diagrammatic illustration of an embodiment of matching description coding blocks and visual coding blocks of the present application;
[0042] Fig.10 This is a schematic diagram of an actual scene of an embodiment of the target tracking method of the present application;
[0043] Fig.11 It is a structural diagram of an embodiment of a computer device of the present application. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0045] In order to solve the technical problem that target tracking is easily disturbed in the related art, the present application provides a target tracking method, a target tracking system, a computer device and a computer-readable storage medium. The target tracking method includes: obtaining visual feature information of the detected object in the image to be tracked, encoding the visual feature information to obtain a visual coding block; encoding the text feature information of the image to be tracked to obtain a text coding block; wherein the text feature information is used to describe the detected object in the image to be tracked; fusing the visual coding block and the text coding block to obtain a fused feature coding block of each detected target in the image to be tracked; using the fused feature coding block to match the detected object with the historical tracking object to update the target tracking sequence. The specific structure and working principle of the present application are described in detail below.
[0046] See also Figure 1 , Figure 1 It is a schematic diagram of an application scenario of an embodiment of the target tracking method of the present application.
[0047] In one embodiment, the target tracking method in this embodiment can be applied to Figure 1 In the application environment shown.
[0048] The terminal 102 communicates with the computing system 104 via a network, a wired connection, or the like.
[0049] The terminal 102 can take a picture of the environment it is in. The taken image can be transmitted to the computing system 104 in the form of a video stream, a video frame, etc., so that the target tracking system provided in the computing system 104 can perform target tracking.
[0050] The terminal 102 may be, but is not limited to, a mobile phone, a computer, a smart watch, a video recorder, a monitoring device, a driving recorder, etc. The computing function of the computing system 104 may be implemented by an independent server or a server cluster consisting of multiple servers.
[0051] See also Figure 2 , Figure 2 It is a structural diagram of an embodiment of a target tracking system of the present application.
[0052] In one embodiment, the target tracking system may include a first feature extractor 21 , a first encoder 22 , a second encoder 23 , a feature fusion module 24 and a decoder 25 .
[0053] The first feature extractor 21 may be used to obtain visual feature information of a detection object in an image to be tracked.
[0054] The first encoder 22 is connected to the first feature extractor 21. The first encoder 22 can be used to encode the visual feature information to obtain a visual coding block.
[0055] The second encoder 23 can be used to encode the text feature information of the image to be tracked to obtain a text encoding block. The text feature information is used to describe the detection object in the image to be tracked. For example, the text feature information can describe the appearance characteristics and motion state of the detection object, which is not limited here.
[0056] The feature fusion module 24 can be used to fuse the visual coding block and the text coding block to obtain the fused feature coding block of each detection target in the image to be tracked.
[0057] The decoder 25 may be connected to the feature fusion module 24. As such, the decoder 25 may be used to match the detected object with the historical tracked object using the fused feature encoding block to update the target tracking sequence.
[0058] It can be seen that in this embodiment, the visual feature information of the image to be tracked is encoded by the first encoder 22 to obtain a visual coding block, and the text feature information describing the detected object in the image to be tracked is encoded by the second encoder 23 to obtain a text coding block. As such, in this embodiment, the visual features of the image to be tracked and the descriptive text information can be integrated into the features used for target tracking, enriching the feature expression used for target tracking, and combining the descriptive text information for target tracking, which can help reduce the risk of misidentification caused by interference factors such as occlusion and noise, so as to enhance the robustness of the target tracking features, and thus improve the reliability of target tracking.
[0059] See also Figure 3 , Figure 3 It is a structural diagram of another embodiment of the target tracking system of the present application.
[0060] In one embodiment, the target tracking system may further include a memory.
[0061] The memory may be connected to the decoder 25 to store a forward tracking sequence of a forward video frame, wherein the forward video frame represents an image occurring at a historical moment compared to the image to be tracked; and the forward tracking sequence represents a target tracking sequence obtained by tracking the target on the forward video frame.
[0062] The decoder 25 can decode the fusion feature code of the image to be tracked to obtain the tracking sequence to be complemented, and fuse the tracking sequence to be complemented with the forward tracking sequence through a fusion function to obtain the target tracking sequence of the image to be tracked.
[0063] Please continue reading Figure 3 In one embodiment, the first feature extractor 21 may include a feature extraction unit 211 and a detection unit 212 , and the feature extraction unit 211 is connected to the detection unit 212 .
[0064] The image to be tracked can be input into the feature extraction unit 211 for image feature extraction to obtain a visual feature vector. The visual feature vector can be input into the detection unit 212 so that the detection unit 212 can detect whether there is a detection object in the image to be tracked. In other words, the detection unit 212 can capture the detection object in the image to be tracked, construct a detection frame of the detection object, and further obtain the position information of the detection object. In this way, the visual feature vector and the position information can be used as visual feature information input into the first encoder 22 to combine the visual features of the image to be tracked during the target tracking process.
[0065] Optionally, the feature fusion module 24 may include a similarity unit, a text selection unit 242 and a fusion unit 243 .
[0066] Specifically, the similarity calculation unit 241 may be connected to the first encoder 22 and the second encoder 23. As such, the similarity calculation unit 241 may be used to calculate the feature similarity between the visual coding block of each detection object and each description coding block.
[0067] The text selection unit 242 may be connected to the similarity calculation unit 241 to select a preset number of description coding blocks based on feature similarity as text coding blocks for each detection object, wherein the same description coding block may be selected for different detection objects.
[0068] The fusion unit 243 may be connected to the first encoder 22 and the text selection unit 242 to fuse the visual coding blocks of each detected object and the text coding blocks matching the visual coding blocks.
[0069] See also Figure 4 , Figure 4 It is a schematic structural diagram of an embodiment of the first encoder 22 of the present application.
[0070] In one embodiment, the first encoder 22 includes a first encoding unit 221 and a feature adaptation unit 222 .
[0071] The first encoding unit 221 is connected to the first feature extractor 21. The first encoding unit 221 is used to encode the visual feature information output by the first feature extractor 21 to obtain an intermediate encoding block.
[0072] The feature adaptation unit 222 is connected to the first encoding unit 221, and is used to input the intermediate encoding block, perform feature adaptation processing on the intermediate encoding block, and output a visual encoding block.
[0073] Further, the feature adaptation unit 222 may include a first linear layer 2221, an activation layer 2222, and a second linear layer 2223 connected in sequence. As such, this embodiment is conducive to streamlining the feature adaptation unit, improving the training efficiency of the feature adaptation unit, and improving the efficiency of feature adaptation processing for the intermediate coding block, and reducing the delay of target tracking. Optionally, the feature adaptation unit 222 may be a Transformer (a deep learning model architecture) model, etc., which is not limited here.
[0074] An input terminal of the first linear layer 2221 may be connected to the first encoding unit 221 .
[0075] The output of the first coding unit 221 may also be connected as a residual connection to the output of the second linear layer 2223. In this way, the output of the second linear layer 2223 and the output of the first coding unit 221 are subjected to residual processing to obtain a visual coding block.
[0076] See also Figure 5 , Figure 5 It is a schematic diagram of the structure of an embodiment of a decoder 25 of the present application.
[0077] In one embodiment, the decoder 25 includes an attention layer 251, a first addition and normalization layer 252, a forward propagation layer 253, and a second addition and normalization layer 254 connected in sequence.
[0078] The input of the attention layer 251 includes a fused feature encoding block as a query vector, a preset tracking sequence template as a key vector and a numerical vector. The output of the fused feature encoding block and the attention layer 251 is used as the input of the first addition and normalization layer 252. The output end of the first addition and normalization layer 252 is also connected to the second addition and normalization layer 254.
[0079] For the specific definition of the target tracking system, please refer to the definition of the target tracking method in the following text, which will not be repeated here. Each module in the above target tracking system can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the internal memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0080] The specific target tracking principle of the target tracking system of the present application, that is, the target tracking method of the present application is described in detail below.
[0081] See also Figure 6 , Figure 6 It is a flowchart of an embodiment of the target tracking method of the present application.
[0082] S101: Obtain visual feature information of a detection object in an image to be tracked, and encode the visual feature information to obtain a visual encoding block.
[0083] In this embodiment, the image to be tracked may contain a detection object, and the detection object may be a historical tracking object or a newly appeared object to be tracked. When the detection object is a historical tracking object, the two are matched to perform target tracking.
[0084] Visual feature information is information used to describe the image features of the image to be tracked. For example, the image features may include at least one of the color features, texture features, shape features, and spatial relationship features of the image to be tracked. Alternatively, the image features may include global features that macroscopically describe the image to be tracked and regional features that describe each local area, which is not limited here.
[0085] Image coding refers to the technology of representing an image or the information contained in the image with fewer bits while meeting a certain quality requirement.
[0086] In other words, after obtaining the image to be tracked in this embodiment, feature extraction can be performed on the image to be tracked to obtain visual feature information of the detected object in the image to be tracked, and the obtained visual feature information can be encoded to obtain a visual coding block for describing the visual features of the image to be tracked.
[0087] S102: Encoding text feature information of the image to be tracked to obtain a text encoding block; wherein the text feature information is used to describe the detection object in the image to be tracked.
[0088] In this embodiment, the text feature information is used to describe the detected object in the image to be tracked. This means that the text feature information is feature information in the form of text, and can provide a text description of the features of the detected object in the image to be tracked.
[0089] In this embodiment, text feature information of the image to be tracked is obtained, and the obtained text feature information is encoded to obtain a text encoding block for describing the text features of the image to be tracked, so as to integrate the text features in the target tracking process.
[0090] In this way, when there are occlusions, exposures, scale changes, etc. in the image to be tracked, it can be further identified based on the text features describing the detected object, which is helpful to make up for the missing feature descriptions of visual features affected by image quality. This is helpful to improve the richness of the image feature description dimension and enhance the robustness of the target tracking feature. Among them, robustness refers to the characteristics of the system maintaining certain performance under certain (structure, size) parameter perturbations.
[0091] S103: Fusing the visual coding block and the text coding block to obtain a fused feature coding block of each detection target in the image to be tracked.
[0092] In this embodiment, in response to encoding visual feature information to obtain a visual coding block and encoding text feature information to obtain a text coding block, the visual coding block and the text coding block are fused to obtain a fused feature coding block that can fuse the visual features of the image to be tracked and the text features.
[0093] Optionally, the fusion of the visual coding block and the text coding block may be a weighted fusion, superposition, splicing, etc. of the two, which is not limited here.
[0094] S104: Use the fused feature coding block to match the detected object with the historical tracking object to update the target tracking sequence.
[0095] In this embodiment, in response to obtaining the fused feature coding block, the fused feature coding block can be used to match the detection object in the image to be tracked with the historical tracking object, and the target tracking sequence can be updated. In this way, the tracking trajectory of the historical tracking object can be updated. Furthermore, the detection object newly appearing in the image to be tracked can be used as a new tracking object, and a new target tracking sequence can be established for it to track its trajectory.
[0096] It can be seen that in this embodiment, the visual feature information of the image to be tracked can be encoded to obtain a visual coding block. At the same time, in this embodiment, the text feature information describing the detected object in the image to be tracked can also be encoded to obtain a text coding block. In this way, the visual features of the image to be tracked and the descriptive text information can be integrated into the features used for target tracking, enriching the feature expression used for target tracking, and combining the descriptive text information for target tracking, which can help reduce the risk of misidentification caused by interference factors such as occlusion and noise, so as to enhance the robustness of the target tracking features, and thus improve the reliability of target tracking.
[0097] See also Figure 7 , Figure 7 It is a flowchart of another embodiment of the target tracking method of the present application.
[0098] In one embodiment, image features may be extracted from the image to be tracked to obtain a visual feature vector. A feature extraction unit may be established using a network model such as CNN (Convolutional Neural Networks) or RNN (Recurrent Neural Network), and the image to be tracked may be input into the feature extraction unit to extract the visual features expressed by the image to obtain a visual feature vector.
[0099] The visual feature vector can be input into the detection unit so that the detection unit can detect whether the detection object exists in the image to be tracked in combination with the visual features. The detection object existing in the image to be tracked is captured, and a detection frame of the detection object is constructed to obtain the location information of the detection object. Optionally, the detection unit can be a model such as YOLO (Visual Object Detection Algorithm), SSD (Single Shot MultiBox Detector, single-step multi-box target detection), etc.
[0100] In this way, the obtained visual feature vector and position information can be used as visual feature information, thereby improving the richness of the content expression of the visual feature information, so that the visual feature information contains the visual features of the image to be tracked, and also contains the position information of the detection object, which is beneficial to improve the matching accuracy between the detection object and the historical tracking object, and further helps to improve the reliability of target tracking.
[0101] In response to obtaining visual feature information expressing the image to be tracked, the visual feature information can be encoded to obtain an intermediate coding block. That is, the visual feature information can be input into a first coding unit such as a CLIP (Constrastive Language-Image Pre-training, multimodal pre-trained neural network) image encoder, and the visual feature information can be encoded using the first coding unit to obtain an intermediate coding block. In layman's terms, the intermediate coding block is the output obtained by encoding the visual feature information by the first coding unit, which can exist in the form of a coding vector, etc., which is not limited here.
[0102] That is to say, in this embodiment, the feature adaptation unit can be further trained to learn more detailed image features that are conducive to recognition, and the first coding unit parameters can be fine-tuned through the feature adaptation unit instead of directly adjusting the first coding unit, thereby further improving the detail of image feature extraction while ensuring the coding reliability of the first coding unit, that is, the feature adaptation unit can be used to improve the feature expression accuracy of the visual coding block. In this way, the intermediate coding block can be input into the pre-trained feature adaptation unit, and the intermediate coding block can be subjected to feature adaptation processing to obtain the visual coding block.
[0103] Specifically, the feature adaptation unit structure in this embodiment can be shown as an example in 4, and the feature adaptation unit includes a first linear layer, an activation layer, and a second linear layer, which is conducive to streamlining the feature adaptation unit, improving the training efficiency of the feature adaptation unit, and improving the efficiency of feature adaptation processing of the intermediate coding block, and reducing the delay of target tracking. As such, the calculation formula of the feature adaptation processing of the feature adaptation unit can be shown as follows:
[0104] Formula 1-1
[0105] Where V(x) represents the visual encoding block; Clip Image (x) represents the intermediate coding block; α represents the hyperparameter; W1 and W2 represent the weight parameters of the linear layer of the feature adaptation unit, that is, the weight parameters of the first linear layer and the second linear layer respectively; Relu() represents the activation function.
[0106] Furthermore, the feature adaptation unit may also include more linear layers and activation layers, which will not be described in detail here.
[0107] Optionally, when training the feature adaptation unit, the model parameters of the image encoder that encodes the visual feature information may be fixed, and the feature adaptation unit may be iteratively trained. That is, as shown in Formula 1-1, when training the feature adaptation unit, the model parameters of the first encoding unit may be fixed, and W1 and W2 of the feature adaptation unit may be learned and updated using Formula 1-1.
[0108] In layman's terms, during the training process of the feature adaptation unit, the model parameters of the first encoding unit can be frozen, and the feature adaptation unit is trained to learn the model parameters of the feature adaptation unit, reducing the part of the training and updating of the model parameters of the first encoder. Moreover, through the additional feature adaptation unit, the model parameters of the first encoding unit can be fine-tuned, which is beneficial to improve the training efficiency and ensure the reliability of the first encoding unit.
[0109] Furthermore, the loss function in the iterative training of the feature adaptation unit can be expressed as follows:
[0110] Formula 1-2
[0111] Among them, T i represents the number of targets to be tracked contained in the i-th frame training sample; l cls represents the classification loss for classifying the target to be tracked; l l1 Represents the regression loss of the detection box size of the target to be tracked; l giou Represents the intersection-over-union loss between the detection box and the true value box of the target to be tracked; λ cls , l1 , giou All represent hyperparameters.
[0112] In an alternative embodiment, the first encoding unit may be trusted after training, and the encoding block output by the first encoding unit may be used as the visual encoding block, which is not limited here.
[0113] Please continue reading Figure 7 In one embodiment, a description text describing the detected object in the image to be tracked may be obtained. The description text may be obtained based on a pre-constructed text descriptor, so as to facilitate representing the maximum text description information through the minimum text descriptor, and to be able to combine prior knowledge in the target tracking process, so as to improve the reliability of target tracking and also help improve the efficiency of target tracking. Optionally, each description text / text descriptor may describe a feature.
[0114] Specifically, several text descriptors of multiple description categories may be obtained, wherein the description category includes one or more of a motion state category, a clothing color category, a luggage state category, and an appearance accessory category.
[0115] like Figure 8 As shown in the example, Figure 8 1 is a flow chart of an embodiment of obtaining a text descriptor in the present application. For example, Figure 8 The example shows that the description categories include movement status category, clothing color category, luggage status category, and appearance accessories category.
[0116] Specifically, training samples may be acquired in advance, and statistical analysis may be performed on the training samples to form text descriptors. For example, text descriptors within the motion state category may include: walking people, running people, standing people, squatting people. Text descriptors within the luggage state category may include: people with bags, people with boxes, people with children, people pushing carts. Text descriptors within the clothing color category may include: red clothes, green clothes, blue clothes, black clothes, white clothes. Text descriptors within the category may include: people wearing skirts, people wearing hats, people wearing sunglasses, people with long hair, and people with short hair.
[0117] Furthermore, the text descriptors of each description category may be extracted to construct the description text. In other words, the description text may include at least one text descriptor of the description category. For example, the description text may be red clothes, belt bag; or, the description text may be red clothes.
[0118] The set of description texts constructed based on the text descriptor can be used as a description sample set. In this way, when constructing text features for the detection object in the image to be tracked, the description text can be selected from the description sample set to simplify the process of constructing the text features of the detection object, which can improve the efficiency of obtaining text feature information, thereby facilitating the improvement of target tracking efficiency.
[0119] That is to say, in this embodiment, a preset description sample set can be obtained. Wherein, the description sample set includes multiple description texts. The description texts can be encoded by the second encoding unit to obtain description coding blocks. The description coding blocks are matched with the visual coding blocks of the detection objects to obtain description coding blocks for describing each detection object as text coding blocks. Wherein, the second encoding unit can be a text encoder such as a CLIP text encoder, which is not limited here.
[0120] As such, this embodiment can automatically match the text coding block suitable for the detection object based on the visual features of the detection object expressed by the visual coding block, which is beneficial to significantly reduce the tedious operation of manually labeling the text features of the detection object, and is also beneficial to improving the efficiency of obtaining the text features of the detection object.
[0121] Optionally, the text encoding blocks obtained by encoding each description text in the description sample set may be reused, which is not limited here.
[0122] Specifically, the feature similarity between the visual coding block of each detection object and each description coding block can be calculated respectively. For example, the feature similarity can be cosine similarity, Euclidean distance, etc., which is not limited here. A preset number of description coding blocks are selected based on the feature similarity as the text coding blocks of each detection object. Among them, it is allowed to select the same description coding block for different detection objects. Among them, the preset number can be one, two, three, four, etc., which is not limited here. In this way, it is conducive to enriching the text feature expression in the text coding block. By calculating the similarity between the visual coding block and the description coding block, the visual feature expression of the image to be tracked can be effectively referenced when selecting text features, which is conducive to improving the reliability of the feature expression of the text coding block.
[0123] In an alternative embodiment, a plurality of text feature categories may be preset. Feature extraction is performed on each detection object in the image to be tracked, and the detection object is classified based on the extracted features to match its text feature category, and the text features of its text feature category are assigned to the detection object in the image to be tracked. Optionally, a plurality of classification models may be constructed, corresponding to different description types, to obtain a plurality of description texts of the detection object. The description texts assigned to the detection object after classification are spliced in a preset order, and vectorized to obtain a text vector, and the text vector is encoded to obtain a text encoding block.
[0124] like Fig. 9 As shown in the example, Fig. 9 1 is a diagrammatic illustration of an embodiment of matching description coding blocks and visual coding blocks of the present application. For example, the preset number may be two, that is, two description coding blocks may be selected as text coding blocks of detection objects.
[0125] like Fig. 9 As shown in the example, V1, V2, ..., Vm represent the visual features of m detection targets; T1, T2, ..., Tn represent n description texts. The cosine similarity between the visual features of each detection target and the n text features is calculated respectively, that is, the visual features of each detection target have feature similarities corresponding to the n description texts.
[0126] For each detected target’s visual feature, sort its feature similarity with the n description texts. Select the description text with the highest and second highest similarity with the detected target’s visual feature as the detection target’s description text, that is, select the corresponding description coding block as the detection target’s text coding block.
[0127] like Fig. 9 In the example, the text feature with the highest similarity to the visual feature of the detected object can be labeled as #1, the description text with the highest and second highest similarity to the visual feature of the detected object can be labeled as #2, and so on.
[0128] That is to say, in this embodiment, according to the similarity sorting result, the top h similarity text information features can be selected and concatenated as the text features of the detection object, such as Fig. 9 The h=2 shown in the example means that the two most significant text semantic features that can best express the current detection object are extracted each time.
[0129] Please continue reading Figure 7 In response to obtaining the video coding block and the text coding block of each detection object, the video coding block and the text coding block of the detection object can be fused. Optionally, in this embodiment, the fused visual coding block and the text coding block can be in the form of splicing. For example, the calculation formula for fusion of the visual coding block and the text coding block can be as follows:
[0130] Formula 1-3
[0131] Among them, E t query Represents a fused feature coding block; T1 and T2 represent the first text coding block and the second text coding block of a detected object respectively; (T1, T2) represents the concatenation of the first text coding block and the second text coding block; V represents the visual coding block of a detected object; CrossAttn((T1, T2), V) represents the fusion of the concatenated first text coding block with the second text coding block and the visual coding block into the cross attention layer.
[0132] The fusion feature code of the image to be tracked can be further decoded to obtain a tracking sequence to be supplemented. The tracking sequence to be supplemented represents the trajectory change of the detection object obtained based on the current image to be tracked, and can be further integrated with the historical trajectory of the detection object in time sequence to facilitate the complete tracking of the trajectory change of the target and improve the reliability of the tracking trajectory. When the detection object is the tracking target that appears for the first time in the current image to be tracked, the decoded sequence can be used as the target tracking sequence of the detection object.
[0133] Specifically, a tracking sequence template can be obtained. The tracking sequence template includes visual features and text features. Optionally, the tracking sequence template can be obtained based on the target tracking sequence of adjacent forward video frames. That is to say, in the present embodiment, a tracking sequence template is pre-set, which is also beneficial to improve the format uniformity of the target tracking sequence for target tracking, so as to improve the operational consistency of parsing and analyzing the target tracking sequence, and improve the reliability of target tracking. The tracking sequence template can be used as a key vector and a numerical vector, and the fused feature encoding block can be used as a query vector to perform attention mechanism learning. The results of the attention mechanism learning are subjected to residual processing and forward propagation processing to obtain the to-be-complemented tracking sequence and the target tracking frame of the image to be tracked.
[0134] Furthermore, a forward tracking sequence of the forward video frame can be obtained, wherein the forward video frame represents an image occurring at a historical moment compared to the image to be tracked; and the forward tracking sequence represents a target tracking sequence obtained by tracking the target on the forward video frame.
[0135] In this way, the to-be-complemented tracking sequence and the forward tracking sequence can be fused through a fusion function to obtain a target tracking sequence of the image to be tracked.
[0136] For example, the calculation formula of the fusion function can be shown as follows:
[0137] Formula 1-4
[0138] Among them, M t tck represents the target tracking sequence; β represents the preset weight parameter; M t-1 tck represents the forward tracking sequence; O t tck Represents the fused feature encoding of the image to be tracked.
[0139] After the target tracking sequence is obtained through weighted calculation, the target tracking sequence can be stored in a memory so as to be used for target tracking decoding of the next frame.
[0140] It can be seen that in this embodiment, natural language features are introduced to track multiple targets in order to take into account the problem that the tracking target may be affected by noise such as scale change, deformation, and illumination change, which may lead to reduced tracking performance. In other words, in this embodiment, the underlying texture features of the target object can be extracted through visual features, and the high-level semantic features of the target object can be extracted through natural language features. The fusion of high-level semantic features and underlying texture features is used to significantly improve the robustness of target tracking, so as to cope with the noise effects such as scale change, deformation, and illumination change that may occur during the tracking process.
[0141] For example, Fig.10 As shown in the example, Fig.10 It is a schematic diagram of an actual scene of an embodiment of the target tracking method of the present application.
[0142] exist Fig.10In the second schematic diagram shown as an example, although "white" semantic noise is introduced due to the occlusion of the tracking target, it still contains the semantic feature of "red clothes". This semantic feature is combined with the visual texture feature and calculated with the historical tracking template, so that the tracking target can still be effectively tracked. In the third schematic diagram, the text feature extractor will recognize three types of semantic information: "red clothes, carrying a bag, and wearing a hat". According to the similarity calculation between the text feature and the visual feature, in this embodiment, "red clothes, hat" can be selected as the text feature description of the current frame and used for target tracking. The description feature is updated in the tracking template by template updating, which improves the robustness of the tracking template and helps reduce the impact of noise during the tracking process.
[0143] In summary, in the process of learning visual features, this application adopts the idea of transfer learning, and can use the adapter module to learn the visual feature extraction module; and in the process of learning text features, the language features can be selected through the similarity calculation of visual-language features to meet the multi-features of the tracking target; for the selected language features, this embodiment can fuse the visual-language features through the cross-attention mechanism to form a fusion feature for target tracking. In addition, in the process of multi-target tracking, this embodiment can update the target tracking feature template (i.e., the tracking sequence template) through the memory of the visual-language feature to enhance the robustness of the tracking feature.
[0144] It should be understood that although Figure 6-Figure 10 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 6-Figure 10 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0145] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps of the target tracking method described above are implemented, which will not be described in detail here.
[0146] See also Fig.11 , Fig.11 It is a structural diagram of an embodiment of a computer device of the present application.
[0147] In one embodiment, the computer device may be a server, and its internal structure diagram may be as follows: Fig.11 As shown in the example.
[0148] The computer device includes a processor, an internal memory, a network interface and a database connected through a system bus. The processor of the computer device is used to provide computing and control capabilities. The internal memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store forward tracking sequences, and / or text descriptors, and / or description texts and other data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a target tracking method is implemented.
[0149] Those skilled in the art will understand that Fig.11 The structure shown as an example is merely a block diagram of a portion of the structure related to the present application solution, and does not constitute a limitation on the computer device to which the present application solution is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0150] In one embodiment, a computer device is provided, including an internal memory, a processor, and a computer program stored in the internal memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0151] S101: Obtain visual feature information of a detection object in an image to be tracked, and encode the visual feature information to obtain a visual encoding block.
[0152] S102: Encoding text feature information of the image to be tracked to obtain a text encoding block; wherein the text feature information is used to describe the detection object in the image to be tracked.
[0153] S103: Fusing the visual coding block and the text coding block to obtain a fused feature coding block of each detection target in the image to be tracked.
[0154] S104: Use the fused feature coding block to match the detected object with the historical tracking object to update the target tracking sequence.
[0155] In one embodiment, when encoding the text feature information of the image to be tracked to obtain a text coding block, the processor further implements the following steps when executing the computer program: obtaining a preset description sample set; wherein the description sample set includes multiple description texts; encoding the description text to obtain a description coding block; matching the description coding block with the visual coding block of the detection object, and obtaining the description coding block used to describe each detection object as a text coding block.
[0156] In one embodiment, when matching the description coding block with the visual coding block of the detection object, the processor also implements the following steps when executing the computer program: respectively calculating the feature similarity between the visual coding block of each detection object and each description coding block; based on the feature similarity, respectively selecting a preset number of description coding blocks as the text coding blocks of each detection object; wherein, it is allowed to select the same description coding block for different detection objects.
[0157] In one embodiment, when the visual coding block and the text coding block are fused, the processor further implements the following steps when executing the computer program:
[0158] ;
[0159] Among them, E t query Represents a fused feature coding block; T1 and T2 represent the first text coding block and the second text coding block of a detected object respectively; (T1, T2) represents the concatenation of the first text coding block and the second text coding block; V represents the visual coding block of a detected object; CrossAttn((T1, T2), V) represents the fusion of the concatenated first text coding block with the second text coding block and the visual coding block into the cross attention layer.
[0160] In one embodiment, when obtaining a preset description sample set, the processor also implements the following steps when executing the computer program: obtaining a number of text descriptors of multiple description categories; wherein the description categories include one or more of motion state categories, clothing color categories, luggage state categories, and appearance accessories categories; extracting text descriptors of each description category to construct description texts; and taking a collection of description texts constructed based on text descriptors as a description sample set.
[0161] In one embodiment, when visual feature information is encoded to obtain a visual coding block, the processor also implements the following steps when executing a computer program: encoding the visual feature information to obtain an intermediate coding block; inputting the intermediate coding block into a pre-trained feature adaptation unit, and performing feature adaptation processing on the intermediate coding block to obtain a visual coding block.
[0162] In one embodiment, when the processor executes the computer program, the following steps are further implemented: the feature adaptation processing of the feature adaptation unit is expressed as:
[0163] ;
[0164] Where V(x) represents the visual encoding block; Clip Image (x) represents the intermediate coding block; α represents the hyperparameter; W1 and W2 represent the weight parameters of the linear layer of the feature adaptation unit respectively; Relu() represents the activation function.
[0165] In one embodiment, when training the feature adaptation unit, the processor further implements the following steps when executing the computer program: fixing the model parameters of the image encoder that encodes the visual feature information, and iteratively training the feature adaptation unit; the loss function in the iterative training of the feature adaptation unit is:
[0166] ;
[0167] Among them, T i represents the number of targets to be tracked contained in the i-th frame training sample; l cls represents the classification loss for classifying the target to be tracked; l l1 Represents the regression loss of the detection box size of the target to be tracked; l giou Represents the intersection-over-union loss between the detection box and the true value box of the target to be tracked; λ cls , l1 , giou All represent hyperparameters.
[0168] In one embodiment, when obtaining visual feature information of a detection object in an image to be tracked, the processor also implements the following steps when executing a computer program: performing image feature extraction on the image to be tracked to obtain a visual feature vector; capturing the detection object in the image to be tracked, and constructing a detection frame of the detection object to obtain position information of the detection object; and using the visual feature vector and the position information as visual feature information.
[0169] In one embodiment, when updating the target tracking sequence, the processor further implements the following steps when executing the computer program: obtaining a forward tracking sequence of a forward video frame; wherein the forward video frame represents an image occurring at a historical moment compared to the image to be tracked; the forward tracking sequence represents a target tracking sequence obtained by performing target tracking on the forward video frame; decoding the fusion feature encoding of the image to be tracked to obtain a tracking sequence to be complemented; fusing the tracking sequence to be complemented with the forward tracking sequence through a fusion function to obtain a target tracking sequence of the image to be tracked.
[0170] In one embodiment, when the processor executes the computer program, the following steps are further implemented: the fusion function is:
[0171] ;
[0172] Among them, M t tck represents the target tracking sequence; β represents the preset weight parameter; M t-1 tck represents the forward tracking sequence; O t tck Represents the fused feature encoding of the image to be tracked.
[0173] In one embodiment, when the fused feature code of the image to be tracked is decoded to obtain the tracking sequence to be complemented, the processor further implements the following steps when executing the computer program: obtaining the tracking sequence template; using the tracking sequence template as the key vector and the numerical vector, and the fused feature coding block as the query vector, to perform attention mechanism learning; performing residual processing and forward propagation processing on the result of the attention mechanism learning, to obtain the tracking sequence to be complemented and the target tracking frame of the image to be tracked.
[0174] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0175] S101: Obtain visual feature information of a detection object in an image to be tracked, and encode the visual feature information to obtain a visual encoding block.
[0176] S102: Encoding text feature information of the image to be tracked to obtain a text encoding block; wherein the text feature information is used to describe the detection object in the image to be tracked.
[0177] S103: Fusing the visual coding block and the text coding block to obtain a fused feature coding block of each detection target in the image to be tracked.
[0178] S104: Use the fused feature coding block to match the detected object with the historical tracking object to update the target tracking sequence.
[0179] In one embodiment, when encoding the text feature information of the image to be tracked to obtain a text coding block, the computer program further implements the following steps when executed by the processor: obtaining a preset description sample set; wherein the description sample set includes multiple description texts; encoding the description text to obtain a description coding block; matching the description coding block with the visual coding block of the detection object, and obtaining the description coding block used to describe each detection object as a text coding block.
[0180] In one embodiment, when the description coding block is matched with the visual coding block of the detection object, the computer program also implements the following steps when executed by the processor: respectively calculating the feature similarity between the visual coding block of each detection object and each description coding block; based on the feature similarity, respectively selecting a preset number of description coding blocks as the text coding blocks of each detection object; wherein, it is allowed to select the same description coding block for different detection objects.
[0181] In one embodiment, when the visual coding block and the text coding block are fused, the computer program further implements the following steps when executed by the processor:
[0182] ;
[0183] Among them, E t query Represents a fused feature coding block; T1 and T2 represent the first text coding block and the second text coding block of a detected object respectively; (T1, T2) represents the concatenation of the first text coding block and the second text coding block; V represents the visual coding block of a detected object; CrossAttn((T1, T2), V) represents the fusion of the concatenated first text coding block with the second text coding block and the visual coding block into the cross attention layer.
[0184] In one embodiment, when obtaining a preset description sample set, the computer program also implements the following steps when executed by the processor: obtaining a number of text descriptors of multiple description categories; wherein the description categories include one or more of motion state categories, clothing color categories, luggage state categories, and appearance accessories categories; extracting text descriptors of each description category to construct description texts; and taking a collection of description texts constructed based on text descriptors as a description sample set.
[0185] In one embodiment, when visual feature information is encoded to obtain a visual coding block, the computer program also implements the following steps when executed by a processor: encoding the visual feature information to obtain an intermediate coding block; inputting the intermediate coding block into a pre-trained feature adaptation unit, and performing feature adaptation processing on the intermediate coding block to obtain a visual coding block.
[0186] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: the feature adaptation process of the feature adaptation unit is expressed as:
[0187] ;
[0188] Where V(x) represents the visual encoding block; Clip Image (x) represents the intermediate coding block; α represents the hyperparameter; W1 and W2 represent the weight parameters of the linear layer of the feature adaptation unit respectively; Relu() represents the activation function.
[0189] In one embodiment, when training the feature adaptation unit, the computer program further implements the following steps when executed by the processor: fixing the model parameters of the image encoder that encodes the visual feature information, and iteratively training the feature adaptation unit; the loss function in the iterative training of the feature adaptation unit is:
[0190] ;
[0191] Among them, T i represents the number of targets to be tracked contained in the i-th frame training sample; l cls represents the classification loss for classifying the target to be tracked; l l1 Represents the regression loss of the detection box size of the target to be tracked; l giou Represents the intersection-over-union loss between the detection box and the true value box of the target to be tracked; λ cls , l1 , giou All represent hyperparameters.
[0192] In one embodiment, when obtaining visual feature information of a detection object in an image to be tracked, the computer program also implements the following steps when executed by a processor: performing image feature extraction on the image to be tracked to obtain a visual feature vector; capturing the detection object in the image to be tracked, constructing a detection frame of the detection object, and obtaining position information of the detection object; and using the visual feature vector and the position information as visual feature information.
[0193] In one embodiment, when updating the target tracking sequence, the computer program also implements the following steps when executed by the processor: obtaining a forward tracking sequence of a forward video frame; wherein the forward video frame represents an image occurring at a historical moment compared to the image to be tracked; the forward tracking sequence represents a target tracking sequence obtained by performing target tracking on the forward video frame; decoding the fusion feature encoding of the image to be tracked to obtain a tracking sequence to be complemented; fusing the tracking sequence to be complemented with the forward tracking sequence through a fusion function to obtain a target tracking sequence of the image to be tracked.
[0194] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: the fusion function is:
[0195] ;
[0196] Among them, M t tck represents the target tracking sequence; β represents the preset weight parameter; M t-1 tck represents the forward tracking sequence; O t tck Represents the fused feature encoding of the image to be tracked.
[0197] In one embodiment, when the fused feature encoding of the image to be tracked is decoded to obtain the tracking sequence to be complemented, the computer program further implements the following steps when executed by the processor: obtaining the tracking sequence template; using the tracking sequence template as the key vector and the numerical vector, and the fused feature encoding block as the query vector, to perform attention mechanism learning; performing residual processing and forward propagation processing on the result of the attention mechanism learning, to obtain the tracking sequence to be complemented and the target tracking frame of the image to be tracked.
[0198] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to internal memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile internal memory. Non-volatile internal memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile internal memory may include random access internal memory (RAM) or external cache internal memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct Rambus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0199] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0200] The embodiments described above only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application.
Claims
1. A target tracking method, characterized in that: The target tracking method comprises: Acquire visual feature information of a detection object in an image to be tracked, and encode the visual feature information to obtain a visual encoding block; A text encoding block obtained by encoding text feature information of the image to be tracked; wherein the text feature information is used to describe the detection object in the image to be tracked; Fusing the visual coding block and the text coding block to obtain a fused feature coding block of each detection target in the image to be tracked; Matching the detected object with the historical tracking object using the fused feature encoding block to update the target tracking sequence; The encoding of the visual feature information to obtain a visual coding block comprises: Encoding the visual feature information to obtain an intermediate coding block; Inputting the intermediate coding block into a pre-trained feature adaptation unit, performing feature adaptation processing on the intermediate coding block to obtain the visual coding block; The feature adaptation processing of the intermediate coding block includes: the intermediate coding block is input into the feature adaptation unit, and the output after passing through the first linear layer, the activation layer and the second linear layer of the feature adaptation unit in sequence is subjected to residual processing with the intermediate coding block; Training the feature adaptation unit includes: Fixing the model parameters of the image encoder for encoding the visual feature information, and iteratively training the feature adaptation unit; The text encoding block obtained by encoding the text feature information of the image to be tracked includes: Obtaining a preset description sample set; wherein the description sample set includes a plurality of description texts; Encoding the description text to obtain a description coding block; Matching the description coding block with the visual coding block of the detection object, and obtaining a description coding block for describing each of the detection objects as the text coding block; The matching of the description coding block with the visual coding block of the detected object comprises: Calculating the feature similarity between the visual coding block of each detection object and each description coding block respectively; Based on the feature similarity, a preset number of the description coding blocks are selected as text coding blocks for each of the detection objects; wherein, the same description coding block is allowed to be selected for different detection objects.
2. The target tracking method according to claim 1, characterized in that: The fusing of the visual coding block and the text coding block comprises: ; Among them, E t query Represents the fused feature coding block; T1 and T2 respectively represent the first text coding block and the second text coding block of a detection object; (T1, T2) represents the splicing processing of the first text coding block and the second text coding block; V represents the visual coding block of the detection object; CrossAttn((T1, T2), V) means that the spliced first text coding block is fused with the second text coding block and the visual coding block by inputting the cross attention layer.
3. The target tracking method according to claim 1, characterized in that: The step of obtaining a preset description sample set includes: Acquire a plurality of text descriptors of multiple description categories; wherein the description categories include one or more of a motion state category, a clothing color category, a luggage state category, and an appearance accessory category; Extracting text descriptors of each of the description categories to construct the description text; The set of description texts constructed based on the text descriptors is used as the description sample set.
4. The target tracking method according to claim 1, characterized in that: The feature adaptation process of the feature adaptation unit is expressed as: ; Wherein, V(x) represents the visual coding block; Clip Image (x) represents the intermediate coding block; α represents a hyperparameter; W1 and W2 respectively represent weight parameters of the linear layer of the feature adaptation unit; Relu() represents an activation function.
5. The target tracking method according to claim 1, characterized in that: The loss function in the iterative training of the feature adaptation unit is: ; Among them, T i represents the number of targets to be tracked contained in the i-th frame training sample; l cls represents the classification loss for classifying the target to be tracked; l l1 represents the regression loss of the detection box size of the target to be tracked; l giou represents the intersection-over-union loss between the detection frame and the true value frame of the target to be tracked; cls , l1 , giou All represent hyperparameters.
6. The target tracking method according to claim 1, characterized in that: The step of obtaining visual feature information of the detected object in the image to be tracked includes: Extracting image features from the image to be tracked to obtain a visual feature vector; Capturing the detection object in the image to be tracked, constructing a detection frame of the detection object, and obtaining position information of the detection object; The visual feature vector and the position information are used as the visual feature information.
7. The target tracking method according to claim 1, characterized in that: The updating target tracking sequence includes: Acquire a forward tracking sequence of a forward video frame; wherein the forward video frame represents an image occurring at a historical moment compared to the image to be tracked; and the forward tracking sequence represents a target tracking sequence obtained by performing target tracking on the forward video frame; Decoding the fusion feature code of the image to be tracked to obtain a tracking sequence to be supplemented; The to-be-complemented tracking sequence and the forward tracking sequence are fused through a fusion function to obtain a target tracking sequence of the to-be-tracked image.
8. The target tracking method according to claim 7, characterized in that: The fusion function is: ; Among them, M t tck represents the target tracking sequence; β represents the preset weight parameter; M t-1 tck represents the forward tracking sequence; t tck The fused feature code representing the image to be tracked.
9. The target tracking method according to claim 7, characterized in that: The decoding of the fusion feature code of the image to be tracked to obtain a tracking sequence to be complemented includes: Get the tracking sequence template; Using the tracking sequence template as a key vector and a numerical vector, and using the fused feature encoding block as a query vector, to perform attention mechanism learning; The results learned by the attention mechanism are subjected to residual processing and forward propagation processing to obtain the to-be-complemented tracking sequence and the target tracking frame of the to-be-tracked image.
10. A target tracking system implementing the target tracking method according to any one of claims 1 to 9, characterized in that: The target tracking system comprises: A first feature extractor, used to obtain visual feature information of the detected object in the image to be tracked; A first encoder, connected to the first feature extractor, for encoding the visual feature information to obtain a visual coding block; A second encoder is used to encode text feature information of the image to be tracked to obtain a text encoding block; wherein the text feature information is used to describe the detection object in the image to be tracked; A feature fusion module, used to fuse the visual coding block and the text coding block to obtain a fused feature coding block of each detection target in the image to be tracked; A decoder, configured to match the detected object with a historical tracking object using the fused feature encoding block to update a target tracking sequence; The feature adaptation unit includes a first linear layer, an activation layer, and a second linear layer connected in sequence; The first encoder includes: a first encoding unit connected to the first feature extractor, used to encode the visual feature information output by the first feature extractor to obtain an intermediate coding block; a feature adaptation unit connected to the first encoding unit, used to input the intermediate coding block, perform feature adaptation processing on the intermediate coding block, and output the visual coding block; An input end of the first linear layer is connected to the first encoding unit; The output of the first coding unit is connected to the output of the second linear layer as a residual connection, and the output of the second linear layer is subjected to residual processing with the output of the first coding unit to obtain the visual coding block; The feature fusion module includes: A similarity calculation unit, connected to the first encoder and the second encoder, for calculating feature similarities between the visual coding blocks of each of the detection objects and each description coding block; a text selection unit connected to the similarity calculation unit, and configured to select a preset number of the description coding blocks based on the feature similarity as text coding blocks for each of the detection objects; wherein the same description coding blocks can be selected for different detection objects; A fusion unit is connected to the first encoder and the text selection unit, and is used to fuse the visual coding blocks of each of the detected objects and the text coding blocks matching them.
11. The target tracking system according to claim 10, characterized in that: The decoder also includes an attention layer, a first addition and normalization layer, a forward propagation layer, and a second addition and normalization layer connected in sequence; The input of the attention layer includes the fused feature encoding block as a query vector, a preset tracking sequence template as a key vector and a numerical vector; The output of the fused feature encoding block and the attention layer is used as the input of the first addition and normalization layer; The output end of the first addition and normalization layer is also connected to the second addition and normalization layer.
12. The target tracking system according to claim 10, characterized in that: The target tracking system further includes: A memory, connected to the decoder, for storing a forward tracking sequence of a forward video frame; wherein the forward video frame represents an image occurring at a historical moment compared to the image to be tracked; and the forward tracking sequence represents a target tracking sequence obtained by performing target tracking on the forward video frame; The decoder is used to decode the fusion feature code of the image to be tracked to obtain a tracking sequence to be complemented; and to fuse the tracking sequence to be complemented with a forward tracking sequence through a fusion function to obtain a target tracking sequence of the image to be tracked.
13. A computer device comprising an internal memory, a processor, and a computer program stored in the internal memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the target tracking method according to any one of claims 1 to 9 are implemented.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the target tracking method according to any one of claims 1 to 9 are implemented.
