Target recognition model training method and device, computer equipment, medium and product

By extracting and fusing trajectory features through a dual-branch network, combined with similarity calculation and pseudo-label optimization, the problem of pedestrian re-identification models relying on highly labeled datasets and external interference during training is solved, achieving higher recognition accuracy and stability.

CN121582965APending Publication Date: 2026-02-27CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511760355.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-27
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Existing pedestrian re-identification models rely on highly labeled datasets during training and are subject to strong interference from external factors, resulting in low recognition accuracy.

Method used

A dual-branch network is used for trajectory feature extraction and fusion. Through similarity calculation and pseudo-label optimization, contrast loss, proximity loss and supervision loss functions are constructed to train the dual-branch network and improve the recognition accuracy of the model.

Benefits of technology

It improves the accuracy of trajectory features, reduces noise label interference, enhances the effectiveness of unsupervised learning, and improves the model's recognition accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121582965A_ABST
    Figure CN121582965A_ABST
Patent Text Reader

Abstract

The invention relates to a target recognition model training method and device, computer equipment, a medium and a product. The method comprises the following steps: extracting a current track feature of a current track through each branch network of a double-branch network, combining the current track feature with a previous track feature of the current track to obtain a branch track feature, obtaining a comprehensive track feature based on the branch track features of all the branch networks, and obtaining the comprehensive track feature of the current track. Aiming at a reference trajectory different from the collection source of the current trajectory, obtaining a similar trajectory set based on the comprehensive trajectory feature of the current trajectory and the current secondary trajectory feature of the reference trajectory, and obtaining a credible trajectory set based on the similar trajectory sets of all branch networks; and determining a target similar trajectory from the credible trajectory set according to the comprehensive trajectory features, taking a pseudo tag of the target similar trajectory as a target tag of the current trajectory, and performing current training on the double-branch network based on the target tags of all the trajectories. By adopting the method, the recognition accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of deep learning, in particular to a target recognition model training method and device, computer equipment, medium and product. BACKGROUND

[0002] Person Re-identification (ReID), also known as person re-identification, is a technology that uses computer vision technology to determine whether a specific pedestrian exists in an image or video sequence. It is considered a sub-problem of image retrieval, aiming to make up for the visual limitations of fixed cameras and can be combined with pedestrian detection / tracking technology.

[0003] Currently, a person re-identification model is usually trained based on strong supervision information to enable the model to learn the basic feature representation of pedestrians. However, this training method relies on a high-labeled dataset, and external factors interfere strongly with model training, resulting in low recognition accuracy of the person re-identification model. SUMMARY

[0004] Therefore, it is necessary to provide a target recognition model training method, device, computer equipment, medium and product that can improve recognition accuracy to solve the above technical problems.

[0005] In a first aspect, the present application provides a target recognition model training method, comprising:

[0006] For each branch network of the dual-branch network, the current sub-track feature of the current track is extracted through the branch network, and the current sub-track feature is combined with the previous sub-track feature of the current track to obtain a branch track feature;

[0007] Based on the branch track features of all branch networks, a comprehensive track feature is obtained;

[0008] For reference tracks with different collection sources from the current track, based on the comprehensive track feature of the current track and the current sub-track feature of the reference track, a similar track set is obtained;

[0009] Based on the similar track sets of all branch networks, a trusted track set is obtained, and a target similar track is determined from the trusted track set according to the comprehensive track feature;

[0010] The pseudo-label of the target similar track is used as the target label of the current track, and the dual-branch network is trained based on the target labels of all tracks.

[0011] In one of the embodiments, the step of extracting the current sub-track feature of the current track through the branch network comprises:

[0012] The trajectory image of the current trajectory is processed by the branch network to extract an image feature vector in the trajectory image.

[0013] An average value of all image feature vectors corresponding to the current trajectory is taken as a current-time trajectory feature of the current trajectory.

[0014] In one of the embodiments, the method further comprises:

[0015] A trajectory set corresponding to a video to be processed is obtained, and a pseudo label is added to a trajectory in the trajectory set; the trajectory set comprises trajectories of a plurality of target objects; and the trajectory carries source information of acquisition.

[0016] In one of the embodiments, based on the branch trajectory features of all branch networks, the step of obtaining the comprehensive trajectory feature comprises:

[0017] An average value of the branch trajectory features of all branch networks is taken as the comprehensive trajectory feature.

[0018] In one of the embodiments, based on the comprehensive trajectory feature of the current trajectory and the current-time trajectory feature of the reference trajectory, the step of obtaining the similar trajectory set comprises:

[0019] A first similarity between the comprehensive trajectory feature of the current trajectory and the current-time trajectory feature of the reference trajectory is obtained, and a set of all reference trajectories corresponding to a first similarity satisfying a preset condition is taken as the similar trajectory set.

[0020] In one of the embodiments, based on the similar trajectory sets of all branch networks, the step of obtaining the trusted trajectory set comprises:

[0021] An intersection of the similar trajectory sets of all branch networks is taken as the trusted trajectory set.

[0022] In one of the embodiments, the step of determining a target similar trajectory from the trusted trajectory set according to the comprehensive trajectory feature comprises:

[0023] Second similarities between the comprehensive trajectory feature of the current trajectory and comprehensive trajectory features of reference trajectories in the trusted trajectory set are respectively obtained, and a reference trajectory corresponding to a highest second similarity is taken as the target similar trajectory.

[0024] In one of the embodiments, the step of performing the current-time training on the double-branch network based on the target labels of all trajectories comprises:

[0025] A contrast loss function and a proximity loss function are constructed, and a supervision loss function is constructed based on the target labels of all trajectories.

[0026] The contrast loss function, the proximity loss function and the supervision loss function are weighted and summed to obtain a total loss function, and the double-branch network is trained based on the total loss function.

[0027] In one of the embodiments, the process of constructing the contrast loss function comprises:

[0028] The target image is obtained from the trajectory image of the current trajectory, and the positive sample image and the negative sample image are obtained based on the target image; the positive sample image is an image other than the target image in the trajectory image; the negative sample image is an image of other trajectories except the current trajectory and with the same collection source as the target image;

[0029] Based on the image feature vector of the target image, the image feature vector of the positive sample image and the image feature vector of the negative sample image, a set of contrast loss functions is constructed.

[0030] The average value of all loss functions in the set of contrast loss functions is taken as the contrast loss function.

[0031] In one of the embodiments, the process of constructing the proximity loss function comprises:

[0032] Based on the similarity between the comprehensive trajectory feature of the current trajectory and the comprehensive trajectory feature of each reference trajectory in the set of trusted trajectories, a first loss term is constructed.

[0033] Based on the similarity between the comprehensive trajectory feature and the branch trajectory feature of all trajectories, a second loss term is constructed.

[0034] The proximity loss function is constructed according to the first loss term and the second loss term.

[0035] In one of the embodiments, the supervision loss function is a cross-entropy loss function; the supervision loss function takes the comprehensive trajectory feature as input and takes the target label as supervision signal, and is used to constrain the consistency between the predicted probability distribution of the double-branch network and the target label.

[0036] In a second aspect, the application further provides a training device of a target identification model, comprising:

[0037] The feature extraction module is configured to extract, for each branch network of the double-branch network, a current-time trajectory feature of a current trajectory by the branch network, and combine the current-time trajectory feature with a previous-time trajectory feature of the current trajectory to obtain a branch trajectory feature.

[0038] The trajectory fusion module is configured to obtain a comprehensive trajectory feature based on the branch trajectory features of all branch networks.

[0039] The similarity calculation module is configured to, for a reference trajectory different from the collection source of the current trajectory, acquire a similar trajectory set based on the comprehensive trajectory feature of the current trajectory and the current sub-trajectory feature of the reference trajectory.

[0040] The target acquisition module is configured to acquire a trusted trajectory set based on the similar trajectory sets of all branch networks, and determine a target similar trajectory from the trusted trajectory set according to the comprehensive trajectory feature.

[0041] The model training module is configured to take the pseudo label of the target similar trajectory as the target label of the current trajectory, and perform current sub-training on the double branch network based on the target labels of all trajectories.

[0042] In a third aspect, the present application further provides a computer device, including a memory and a processor, the memory stores a computer program, and the processor implements the method steps of any one of the first aspect when executing the computer program.

[0043] In a fourth aspect, the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the method steps of any one of the first aspect.

[0044] In a fifth aspect, the present application further provides a computer program product, including a computer program, and the computer program is executed by a processor to implement the method steps of any one of the first aspect.

[0045] The training method and device of the target recognition model, the computer device, the medium and the product described above can improve the accuracy of the trajectory feature, reduce the interference of the noise label, improve the effectiveness of the unsupervised learning, and thus improve the accuracy of the model. BRIEF DESCRIPTION OF DRAWINGS

[0046] In order to make the technical solutions in the embodiments of the present application or the related art clearer, the accompanying drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the accompanying drawings in the following description are only some embodiments of the present application, and other related drawings can be obtained by those skilled in the art without any creative effort on the premise of the accompanying drawings.

[0047] Figure 1 An application environment diagram of the training method of the target recognition model in one embodiment;

[0048] Figure 2 A flowchart of the training method of the target recognition model in one embodiment;

[0049] Figure 3 A flowchart of the training method of the target recognition model in another embodiment;

[0050] Figure 4 A network architecture diagram of the double-branch network model in one embodiment;

[0051] Figure 5 A structural block diagram of the training device of the target recognition model in one embodiment;

[0052] Figure 6 An internal structure diagram of the computer device in one embodiment. DETAILED DESCRIPTION

[0053] In order to make the technical solutions in the embodiments of the present application or the related art clearer, the accompanying drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the accompanying drawings in the following description are only some embodiments of the present application, and other related drawings can be obtained by those skilled in the art without any creative effort on the premise of the accompanying drawings.

[0054] In the unsupervised pedestrian re-identification task, the usual practice is to first pre-train the model using a labeled source dataset, which allows the model to learn the basic feature representation of pedestrians. Subsequently, this pre-trained model is used to process the unlabeled target dataset and generate pseudo labels for these data. Then, according to the assigned pseudo labels and the results of clustering analysis, the model is further fine-tuned to adapt to the data characteristics of the specific target domain. This method aims to transfer knowledge from the source domain to the target domain, so that the model can better understand and adapt to the changes in data distribution in the new environment. However, during the model training process, there will be various random factors interfering with the extracted pedestrian feature vector of one branch, which has certain one-sidedness.

[0055] Based on this, the embodiment of the application provides a pedestrian re-identification method based on a double-branch neighboring cooperative learning, which is composed of intra-camera double-branch network cooperative contrast learning and inter-camera double-branch network neighboring cooperative learning. The complementary nature of the identity features learned by the double-branch network can be utilized, and through contrast learning and inter-camera identity feature mining, the model can finally learn more robust identity features, thereby improving the recognition accuracy of the model.

[0056] The training method of the target identification model provided by the embodiment of the application can be applied to an application environment as shown in Figure 1 . The terminal 102 communicates with the server 104 through a network. The data storage system can store the data required to be processed by the server 104. The data storage system can be integrated on the server 104, or placed on a cloud or other network server. The terminal 102 is configured to, for each branch network of the double-branch network, extract a current track feature of a current track of the branch network, combine the current track feature with a previous track feature of the current track to obtain a branch track feature, obtain a comprehensive track feature based on the branch track features of all the branch networks, obtain a similar track set based on the comprehensive track feature of the current track and a current track feature of a reference track different from the current track in collection source, obtain a trusted track set based on the similar track sets of all the branch networks, determine a target similar track from the trusted track set according to the comprehensive track feature, take a pseudo label of the target similar track as a target label of the current track, and perform a current-time training on the double-branch network based on the target labels of all the tracks. The terminal 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, unmanned aerial vehicles, low-altitude flying vehicles, Internet of Things devices, and portable wearable devices. The Internet of Things device can be a smart speaker, a smart television, a smart air conditioner, a smart vehicle device, a projection device, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The server 104 can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0057] In an exemplary embodiment, as shown in Figure 2 , a training method of a target identification model is provided. The method is applied to the terminal 102 in Figure 1 as an example, which includes the following steps 202 to 210. Wherein:

[0058] S202: For each branch network of the dual-branch network, a current sub-trajectory feature of the current trajectory is extracted by the branch network, and the current sub-trajectory feature is combined with a previous sub-trajectory feature of the current trajectory to obtain a branch trajectory feature.

[0059] Optionally, in an unsupervised pedestrian re-identification scenario, the model gradually optimizes the feature representation through iterative training. Each branch network extracts a feature vector from a pedestrian image. For each trajectory, the feature extracted in the current iteration (current sub-trajectory feature) is combined with the feature of the previous iteration (previous sub-trajectory feature) to form an updated branch trajectory feature. By introducing historical feature information, the feature change is smoothed, the random fluctuations and noise interference in the training process are reduced, and the stability and consistency of the feature representation are improved. This combination allows the model to retain previously learned knowledge while incorporating new iteration features, making feature optimization smoother and more reliable.

[0060] S204: Based on the branch trajectory features of all branch networks, a comprehensive trajectory feature is obtained.

[0061] Optionally, the dual-branch network can learn pedestrian features from different angles, with complementarity. By fusing the trajectory features of the two branches, a comprehensive trajectory feature is obtained. By utilizing the diversity of the dual-branch, the respective feature advantages are combined, a more robust and comprehensive feature representation is generated, the bias or one-sidedness that may be introduced by a single branch is reduced, the feature is more discriminative, and a foundation is laid for subsequent inter-camera learning and pseudo-label optimization.

[0062] S206: For reference trajectories different from the collection source of the current trajectory, based on the comprehensive trajectory feature of the current trajectory and the current sub-trajectory feature of the reference trajectory, a similar trajectory set is obtained.

[0063] Optionally, since pedestrian re-identification needs to handle pedestrian matching problems under different cameras (cameras), there are differences in resolution, shooting angle, lighting, etc. between cameras, which will directly affect the feature quality. By calculating the similarity between the comprehensive trajectory feature of the current trajectory and the reference trajectory feature from other cameras, the top N most similar trajectories are selected to form a similar trajectory set, so that the model can mine the correlation of pedestrian identities between cameras and learn robust features across cameras.

[0064] S208: Based on the similar trajectory sets of all branch networks, a trusted trajectory set is obtained, and a target similar trajectory is determined from the trusted trajectory set according to the comprehensive trajectory feature.

[0065] Optionally, since different sets of similar trajectories can be generated by the two branches, by taking the intersection of the two sets, a set of trusted trajectories is obtained, ensuring that only trajectories considered similar by both branches are considered, improving the reliability of pseudo-labels. Then, from the set of trusted trajectories, the most similar trajectory is selected as the target similar trajectory according to the similarity between the comprehensive trajectory feature and the trajectories in the set. This consistent screening mechanism reduces the risk of false matches, making the pseudo-labels more accurate, thereby improving the quality of model learning.

[0066] S210: The pseudo-label of the target similar trajectory is taken as the target label of the current trajectory, and the current training of the dual-branch network is performed based on the target labels of all trajectories.

[0067] Optionally, in unsupervised learning, the pseudo-labels serve as supervision signals, and by assigning the pseudo-label of the target similar trajectory to the current trajectory, the model can perform supervised learning on the identity classification task (such as using cross-entropy loss). At the same time, combined with the intra-camera contrast learning loss and the inter-camera neighboring collaboration loss, the dual-branch network is jointly trained, enabling the model to learn more discriminative pedestrian identity features and optimize the feature representation. The optimization iteration of the pseudo-labels is performed, and as the training progresses, the model's adaptability to the target domain can be gradually improved.

[0068] In the training method of the above target recognition model, by extracting the current trajectory feature of the current trajectory through the branch network for each branch network of the dual-branch network, and combining the current trajectory feature with the previous trajectory feature of the current trajectory to obtain a branch trajectory feature, based on the branch trajectory features of all branch networks, a comprehensive trajectory feature is obtained, for reference trajectories with different collection sources from the current trajectory, based on the comprehensive trajectory feature of the current trajectory and the current trajectory feature of the reference trajectory, a set of similar trajectories is obtained, based on the set of similar trajectories of all branch networks, a set of trusted trajectories is obtained, and the target similar trajectory is determined from the set of trusted trajectories according to the comprehensive trajectory feature, the pseudo-label of the target similar trajectory is taken as the target label of the current trajectory, and the current training of the dual-branch network is performed based on the target labels of all trajectories, which can improve the accuracy of the trajectory feature, reduce the interference of noise labels, and improve the effectiveness of unsupervised learning, thereby improving the accuracy of the model.

[0069] In one exemplary embodiment, the step of extracting the current trajectory feature of the current trajectory through the branch network includes: processing the trajectory image of the current trajectory through the branch network to extract an image feature vector in the trajectory image; and taking the average of all image feature vectors corresponding to the current trajectory as the current trajectory feature of the current trajectory.

[0070] Optionally, the branch network adopts a backbone network such as ResNet-50, and has obtained initial weights through pre-training of a data set. The core role of pre-training is to enable the network to first master the general image feature extraction capability (such as edges, textures, local contours, etc.), and lay a foundation for subsequent learning of pedestrian exclusive features, so as to avoid the problems of low feature extraction efficiency and poor generalization ability caused by zero training. When extracting trajectory features, the trajectory image needs to be preprocessed first to ensure the consistency of the image format input into the network, so as to avoid interference with feature extraction caused by differences in image size. Subsequently, the preprocessed image is input into the branch network, and abstract features are gradually extracted through convolution layers, pooling layers and other levels, and finally a fixed-dimension image feature vector is output through a fully connected layer. The vector can accurately represent the identity information of a single pedestrian image.

[0071] Further, a trajectory is composed of multiple images (such as a walking sequence of a pedestrian in a monitoring video) continuously captured by the same pedestrian under the same camera. Although the images may be different in angle and posture, they belong to the same identity, and the feature vectors thereof have commonalities. By calculating the average value of all image feature vectors of the current trajectory, the common features of multiple images in a single trajectory can be fused, and the feature noise caused by changes in posture and local occlusion of a single image (such as a pedestrian being occluded in an image, and the feature vector thereof being deviated, which can be weakened after averaging) can be filtered.

[0072] In this embodiment, the trajectory image of the current trajectory is processed by the branch network to extract the image feature vector in the trajectory image, and the average value of all image feature vectors corresponding to the current trajectory is taken as the current trajectory feature of the current trajectory, which can improve the reliability of the trajectory feature, reduce the dependence on labeling in an unsupervised scene, and thus improve the generalization capability of the model.

[0073] In an exemplary embodiment, the method further comprises: obtaining a trajectory set corresponding to the to-be-processed video, and adding a pseudo label to a trajectory in the trajectory set; the trajectory set comprises trajectories of multiple target objects; and the trajectory carries acquisition source information.

[0074] Optionally, the to-be-processed video is usually collected by a multi-camera monitoring system, and a trajectory acquisition algorithm processes the video frames, first detects pedestrian targets in the frames, and then associates the same pedestrian in different frames through target appearance features and motion trajectory continuity (such as position and speed), and finally forms a trajectory. When each trajectory is generated, its acquisition source (i.e., corresponding camera number, position and other information) is recorded synchronously, and the acquisition source information needs to be relied on in subsequent model training to distinguish between intra-camera trajectories (i.e., collected by the same camera) and inter-camera trajectories (i.e., collected by different cameras), and to provide a basis for cross-scene feature adaptation.

[0075] Further, after the trajectory set is constructed, an initial pseudo label is assigned to each trajectory, and the pseudo label is only used as a temporary identity label without considering the real association between trajectories. The initial pseudo label is continuously optimized through model training in subsequent model training.

[0076] In this embodiment, by obtaining the trajectory set corresponding to the to-be-processed video and adding a pseudo label to the trajectories in the trajectory set, the video data can be converted into structured training samples, the data effectiveness is improved, and the model training accuracy is improved.

[0077] In an exemplary embodiment, based on the branch trajectory features of all branch networks, the step of obtaining the comprehensive trajectory feature includes: taking the average value of the branch trajectory features of all branch networks as the comprehensive trajectory feature.

[0078] Optionally, the dual-branch network obtains initial weights during pre-training, but in the subsequent fine-tuning process, the weight parameters will form slightly different feature extraction preferences due to random initialization bias and gradient update differences. Even if the same image of a trajectory is input, the dual-branch network will generate image feature vectors of different dimensions in the feature mapping process at the convolution and pooling levels due to the slight differences in parameters. This difference makes the branch trajectory features of the dual-branch not simply repeated, but respectively cover different feature dimensions of the pedestrian identity. By taking the average value, the complementary features of the dual-branch are integrated into a unified comprehensive trajectory feature, covering multiple dimensions of features and avoiding the one-sidedness of single branch features.

[0079] In this embodiment, by taking the average value of the branch trajectory features of all branch networks as the comprehensive trajectory feature, the complementary features of the dual-branch can be integrated, and the comprehensiveness and stability of the trajectory feature can be improved.

[0080] In an exemplary embodiment, based on the comprehensive trajectory feature of the current trajectory and the current sub-trajectory feature of the reference trajectory, the step of obtaining the similar trajectory set includes: obtaining a first similarity between the comprehensive trajectory feature of the current trajectory and the current sub-trajectory feature of the reference trajectory, and taking a set of all reference trajectories corresponding to the first similarity satisfying a preset condition as the similar trajectory set.

[0081] Optionally, the essence of the first similarity is to quantify the identity association degree between the comprehensive feature of the current trajectory and the current sub-feature of the reference trajectory through a mathematical method. Since the trajectory feature vector is an abstract representation of the pedestrian identity, the similarity of the feature vector directly corresponds to the consistency of the pedestrian identity. By calculating the first similarity between the comprehensive trajectory feature of the current trajectory and the current sub-trajectory feature of the reference trajectory, the reference trajectories with high similarity are selected to form the similar trajectory set, and the relatively most similar trajectories can be selected to ensure the effective recall of the similar trajectories.

[0082] In the embodiment, by obtaining the first similarity between the comprehensive trajectory feature of the current trajectory and the current sub-trajectory feature of the reference trajectory, the set of all reference trajectories corresponding to the first similarity satisfying the preset condition is taken as the similar trajectory set, the accurate association of cross-camera trajectories can be realized, the false matching caused by the difference between cameras is reduced, and the model cross-scene adaptability is strengthened.

[0083] In an exemplary embodiment, based on the similar trajectory set of all branch networks, the step of obtaining the trusted trajectory set comprises: taking the intersection of the similar trajectory sets of all branch networks as the trusted trajectory set.

[0084] Optionally, due to the differentiated feature preferences, the double branches will produce different screening results due to the different feature dimension when performing the step of obtaining the similar trajectory set, the trajectories that meet the similar conditions in multiple feature dimensions are screened out through the double branch feature verification by selecting the intersection of the similar trajectory sets of the double branches, only the trajectories existing in both sets are retained, and the reliability screening under double verification is realized.

[0085] In the embodiment, by taking the intersection of the similar trajectory sets of all branch networks as the trusted trajectory set, the reliability of the similar trajectory can be improved, the high-reliability input is provided for subsequent pseudo-label optimization, and the accuracy of the target label is improved.

[0086] In an exemplary embodiment, the step of determining the target similar trajectory from the trusted trajectory set according to the comprehensive trajectory feature comprises: respectively obtaining the second similarity between the comprehensive trajectory feature of the current trajectory and the comprehensive trajectory feature of each reference trajectory in the trusted trajectory set, and taking the reference trajectory corresponding to the highest second similarity as the target similar trajectory.

[0087] Optionally, the comprehensive trajectory feature is the mean fusion result of the branch trajectory features of the double branch networks, the complementary features of the double branches are integrated, the false judgment of the similarity caused by the one-sidedness of the single branch feature is avoided, and at the same time, the feature noise (such as the feature deviation caused by the camera light interference of a branch) of the single branch is weakened through mean fusion, so that the feature vector is more stable. The trusted trajectory set is the intersection of the similar trajectory sets of the double branches, the pseudo-similar trajectories are excluded through the consistency constraint of the double branches, but there are still multiple reference trajectories in the set, which need to be further screened to find the trajectory with the most consistent identity with the current trajectory, that is, the reference trajectory with the highest second similarity is selected as the target similar trajectory.

[0088] In the embodiment, by respectively obtaining the second similarity between the comprehensive trajectory feature of the current trajectory and the comprehensive trajectory feature of each reference trajectory in the trusted trajectory set, and taking the reference trajectory corresponding to the highest second similarity as the target similar trajectory, the accurate identity matching of cross-camera trajectories can be realized, the identity confusion risk is reduced, the optimal supervision signal is provided for subsequent pseudo-label optimization, and the label reliability is improved.

[0089] In an example embodiment, the step of performing the current training of the double-branch network based on the target labels of all trajectories comprises: constructing a contrast loss function and a proximity loss function, and constructing a supervised loss function based on the target labels of all trajectories; performing weighted summation on the contrast loss function, the proximity loss function and the supervised loss function to obtain a total loss function, and performing the current training of the double-branch network based on the total loss function.

[0090] Optionally, the core role of the contrast loss function is to let the model learn the representation rule that the same type of trajectory features are close to each other and different types of trajectory features are far away from each other in the same camera. The core role of the proximity loss function is to let the model learn the rule that the same pedestrian features are associated across cameras and different pedestrian features are separated across cameras. The core role of the supervised loss function is to provide a direct supervision signal for the model by using the target labels (optimized pseudo labels) to make up for the lack of real labels in the unsupervised scenario. By combining the three types of loss functions into a total loss function according to preset weights, the contrast loss (in-camera) and the proximity loss (across cameras) cover the same scene and cross-scene feature learning respectively, and the supervised loss provides label constraints, and the weighted combination of the three types of loss functions can avoid the training deviation caused by a single loss. During the training process, the weights can be adjusted according to the model performance to ensure that the loss function always adapts to the requirements of the training stage, and through multiple iterations, the model gradually converges to an optimal state with high feature discrimination and strong cross-camera robustness.

[0091] In the embodiment, by constructing the contrast loss function and the proximity loss function, constructing the supervised loss function based on the target labels of all trajectories, performing weighted summation on the contrast loss function, the proximity loss function and the supervised loss function to obtain a total loss function, and performing the current training of the double-branch network based on the total loss function, multi-objective collaborative optimization can be achieved, the training deviation caused by a single loss can be avoided, and the accuracy of the model can be improved.

[0092] In an example embodiment, the process of constructing the contrast loss function comprises: obtaining a target image from a trajectory image of a current trajectory, and obtaining a positive sample image and a negative sample image based on the target image; the positive sample image is an image other than the target image in the trajectory image; the negative sample image is an image of another trajectory other than the current trajectory which has the same source as the target image; constructing a contrast loss function set based on an image feature vector of the target image, an image feature vector of the positive sample image and an image feature vector of the negative sample image; and taking the average value of all loss functions in the contrast loss function set as the contrast loss function.

[0093] Optionally, the positive sample image is defined as an image other than the target image in the current trajectory, which has different poses and angles but belongs to the same identity, and the feature vectors thereof have natural commonality and can be used as learning basis for similar features. The negative sample image is defined as an image of other trajectories except the current trajectory, which has the same collection source (same camera) as the target image, and is in the same shooting environment (without camera difference interference) as the target image, and only has different identities, which can be used as learning basis for different features to avoid negative sample interference caused by camera difference. The feature vectors of the target image, the positive sample image and the negative sample image are extracted by the double-branch network respectively, and the two types of features jointly constitute the complete representation of the pedestrian identity. For all related scenes covering the double-branch features, multiple sets of feature comparisons need to be constructed. Through multiple loss averaging, the deviation of a single branch can be diluted through double-branch cross-validation, and the loss function can be ensured to reflect the true feature difference.

[0094] In the embodiment, the target image is obtained from the trajectory image of the current trajectory, the positive sample image and the negative sample image are obtained based on the target image, the image feature vector of the target image, the image feature vector of the positive sample image and the image feature vector of the negative sample image are used to construct a set of contrast loss functions, and the average value of all loss functions in the set of contrast loss functions is used as the contrast loss function, which can improve the reliability of the loss function, reduce the labeling dependence in the unsupervised scene, and thus improve the model accuracy.

[0095] In one exemplary embodiment, the process of constructing the proximity loss function includes: constructing a first loss term based on the similarity between the comprehensive trajectory feature of the current trajectory and the comprehensive trajectory feature of each reference trajectory in the set of trusted trajectories; constructing a second loss term based on the similarity between the comprehensive trajectory feature and the branch trajectory feature of all trajectories; and constructing the proximity loss function according to the first loss term and the second loss term.

[0096] Optionally, the core objective of the first loss term is to let the model strengthen the identity association between the current trajectory and the reference trajectory in the set of trusted trajectories in the cross-camera scenario. Since the reference trajectory in the set of trusted trajectories and the current trajectory come from different cameras (different sources of collection), and are verified by the double-branch as high-similarity trajectories, which are the core samples of cross-camera identity association, based on the comprehensive trajectory features of the current trajectory and the comprehensive trajectory features of the reference trajectory, the identity association strength between the two is quantified by cosine similarity, forming the first loss term, to ensure that the model learns the identity association of the cross-camera trusted trajectory first. The core objective of the second loss term is to keep the branch trajectory features of the double-branch respectively and the comprehensive trajectory features after fusion consistent, to avoid fusion failure caused by too large difference between the double-branch features. Since the comprehensive trajectory features are the mean fusion of the double-branch features, if the branch trajectory features of a branch and the comprehensive features deviate too much, it will lead to that the comprehensive features cannot effectively integrate complementary information, but become contradictory features. By calculating the similarity between the comprehensive trajectory features and the branch trajectory features of all trajectories respectively, the second loss term is formed to make the model optimize the double-branch parameters and reduce the deviation between the branch features and the comprehensive features. Finally, the proximity loss function forms an overall consideration of cross-camera identity learning and double-branch feature stability by weighted fusion of the first and second loss terms. Since the core objective of the proximity loss is to solve the cross-camera difference problem, the optimization weight of the first loss term needs to be guaranteed first, and the stability of the double-branch feature fusion is ensured through the second loss term to avoid the influence of branch feature confusion on the cross-camera learning effect, therefore, the priority of the first loss term is higher than that of the second loss term.

[0097] In this embodiment, by constructing the first loss term based on the similarity between the comprehensive trajectory features of the current trajectory and the comprehensive trajectory features of each reference trajectory in the set of trusted trajectories, constructing the second loss term based on the similarity between the comprehensive trajectory features and the branch trajectory features of all trajectories, and constructing the proximity loss function according to the first loss term and the second loss term, the model training stability can be improved, the cross-camera learning deviation can be avoided, high-quality cross-camera constraints can be provided for the total loss function, and thus the overall performance of the model can be improved.

[0098] In one exemplary embodiment, the supervised loss function is a cross-entropy loss function; the supervised loss function takes the comprehensive trajectory features as input and the target label as supervision signal, and is used to constrain the consistency between the prediction probability distribution of the double-branch network and the target label.

[0099] Optionally, in the pedestrian re-identification task, the model is essentially a classification model that maps trajectory features to identity categories, and the cross-entropy loss function can accurately measure the difference between the model's predicted probability distribution and the true label distribution. The cross-entropy loss quantifies the difference between the model's predicted probability for each identity category and the true class probability indicated by the target label, causing the model to increase the predicted probability for the target class and decrease the probability for non-target classes. The comprehensive trajectory feature is the mean fusion of the branch trajectory features of the dual-branch network. The cross-entropy loss is calculated using the comprehensive trajectory feature as input, avoiding the disconnection between the optimization objectives of the branch features and the comprehensive features, and ensuring that the supervision signal can effectively guide the quality improvement of the comprehensive features. The target label is the pseudo label of the reference trajectory with the highest similarity selected from the set of trusted trajectories. The set of trusted trajectories is the intersection of the dual-branch similar trajectory sets, which have been verified by the dual-branch consistency and excluded pseudo similar trajectories. The highest similarity selection further ensures that the target label is highly consistent with the true identity of the current trajectory, providing a pseudo supervision signal close to the true label for the cross-entropy loss. As the training progresses, the model's feature extraction capability improves, and the accuracy of the target label gradually increases. The supervision effect of the cross-entropy loss can be further strengthened through weight adjustment, thereby further improving the model's accuracy.

[0100] In one exemplary embodiment, a method for training a target recognition model is provided, the method comprising the steps of:

[0101] Obtaining a set of trajectories corresponding to a video to be processed, and adding a pseudo label to each trajectory in the set of trajectories; the set of trajectories includes trajectories of multiple target objects; each trajectory carries source information.

[0102] For each branch network of the dual-branch network, processing the trajectory image of the current trajectory through the branch network to extract an image feature vector from the trajectory image; and taking the average of all image feature vectors corresponding to the current trajectory as the current trajectory feature of the current trajectory.

[0103] Combining the current trajectory feature and the previous trajectory feature of the current trajectory to obtain a branch trajectory feature.

[0104] Taking the average of the branch trajectory features of all branch networks as the comprehensive trajectory feature.

[0105] For reference trajectories with different source information from the current trajectory, obtaining a first similarity between the comprehensive trajectory feature of the current trajectory and the current trajectory feature of the reference trajectory, and taking the set of all reference trajectories that satisfy a preset condition with respect to the first similarity as a similar trajectory set.

[0106] Taking the intersection of the similar trajectory sets of all branch networks as a set of trusted trajectories.

[0107] A second similarity between the comprehensive trajectory feature of the current trajectory and the comprehensive trajectory feature of each reference trajectory in the set of trusted trajectories is obtained, and a reference trajectory corresponding to the highest second similarity is taken as a target similar trajectory.

[0108] A target image is obtained from a trajectory image of the current trajectory, and a positive sample image and a negative sample image are obtained based on the target image; the positive sample image is an image other than the target image in the trajectory image; the negative sample image is an image of another trajectory except the current trajectory and having the same collection source as the target image; a set of contrast loss functions is constructed based on an image feature vector of the target image, an image feature vector of the positive sample image, and an image feature vector of the negative sample image; and an average value of all loss functions in the set of contrast loss functions is taken as a contrast loss function.

[0109] A first loss term is constructed based on a similarity between the comprehensive trajectory feature of the current trajectory and the comprehensive trajectory feature of each reference trajectory in the set of trusted trajectories; a second loss term is constructed based on a similarity between the comprehensive trajectory feature and branch trajectory features of all trajectories; and a proximity loss function is constructed according to the first loss term and the second loss term.

[0110] A supervised loss function is constructed based on target labels of all trajectories; a total loss function is obtained by weighted summation of the contrast loss function, the proximity loss function, and the supervised loss function, and the current training of the double-branch network is performed based on the total loss function.

[0111] The supervised loss function is a cross-entropy loss function; the supervised loss function takes the comprehensive trajectory feature as input and takes the target label as a supervision signal, and is used to constrain the consistency between a predicted probability distribution of the double-branch network and the target label.

[0112] As shown in the example of FIG. 8, to facilitate understanding, the method is applied to a pedestrian re-identification scene, and the specific steps include the following steps: Figure 3

[0113] (1) Obtain a public pedestrian re-identification dataset, and divide each dataset into two parts of a training set and a test set.

[0114] (2) Take each trajectory as a pedestrian identity, and record each trajectory as . Assuming that there are C pedestrian identities in the training set, then . At the same time, the camera information of each trajectory is associated with the trajectory, so the information of which camera collects each trajectory is known.

[0115] ​(3) To provide richer and more complementary pedestrian identity features, a dual-branch network model is adopted. The skeleton of each network branch is a ResNet-50 network structure, and the two branches are denoted as branch a and branch b, respectively. The network architecture of the dual-branch network model is as follows: Figure 4 As shown.

[0116] (4) The model is pre-trained using the dataset to give the network skeleton initial weights. Then the pedestrian images in the training set are adjusted to a size of 384×128, and the adjusted pedestrian images are input into the convolutional neural network. The feature vector of the pedestrian image is obtained through the pre-trained network skeleton.

[0117] (5) Denote the pedestrian identity feature vector as The average value of pedestrian features within the trajectory is regarded as the trajectory feature vector. In each training iteration, trajectory update is a dynamic process, calculated using the following formula: ,in, It is a constant. This represents the number of training iterations.

[0118] (6) For each trajectory, randomly select a pedestrian image as a query instance, denoted as , Other pedestrian images within the trajectory are taken as positive samples, denoted as... , Images of pedestrians within the camera's viewpoint but outside their designated trajectory are used as negative samples. After obtaining query instances, positive samples, and negative samples, the contrastive loss function is calculated using the following formula:

[0119]

[0120] in, For trajectory Total number of pedestrian images It is a constant parameter, which is set to 0.15 based on experience.

[0121] To fully utilize the differences and complementarities of the trajectory features extracted by the two branches, the contrastive loss functions are calculated for the query instance obtained from branch B and the positive and negative sample pairs obtained from branch B, the query instance obtained from branch A and the positive and negative sample pairs obtained from branch B, and the query instance obtained from branch B and the positive and negative sample pairs obtained from branch A, respectively. The corresponding calculation formulas are as follows:

[0122]

[0123]

[0124]

[0125] The above contrast loss function is averaged to form a dual-branch network cooperative contrast loss function, so that the model performs intra-camera dual-branch network cooperative contrast learning, and the calculation formula is as follows:

[0126]

[0127] (7) For the pedestrian re-identification task, learning only the intra-camera features is far from enough. In order to reduce the negative effects caused by the inconsistency of resolution, shooting angle, and illumination between different cameras, the inter-camera neighboring cooperative learning is performed through the dual-branch network. For the trajectory , first, the trajectory features extracted by branch A and the trajectory features extracted by branch B are obtained , the average of the two is taken as the new trajectory feature, denoted as: . The similarity between the new trajectory feature and the trajectories outside the cameras in branch A and branch B is calculated, and the calculation formula is as follows:

[0128]

[0129] The first N most similar trajectories to the trajectories outside the cameras of branch A are denoted as: , and similarly, the first N most similar trajectories to the trajectories outside the cameras of branch A are denoted as: , the intersection of the set and the set is calculated, denoted as: . Then the new trajectory and the trajectories in the set perform inter-camera neighboring cooperative learning, and the calculation formula is as follows:

[0130]

[0131] wherein, is the training set trajectory set.

[0132] (8) Since it is difficult for the model to extract discriminative pedestrian identity features without any supervision, to solve this problem, the pseudo labels are optimized through the dual-branch network, so that the pedestrian identity features are learned under the supervision of the pseudo labels.

[0133] Specifically, the most similar trajectory pseudo label in the set to the new trajectory feature is set as the new pseudo label of the trajectory , so as to mine the correlation between trajectories, represented as follows:

[0134]

[0135] wherein, is the pedestrian identity feature for the identity prediction probability.

[0136] (9) The pedestrian re-identification method of the double-branch neighboring collaborative learning is formed by jointly training the pedestrian identity features through the intra-camera double-branch network collaborative comparison learning and the inter-camera neighboring collaborative learning, and then combining the extracted pseudo-label matrix for supervised learning, and the specific calculation formula is as follows:

[0137]

[0138] wherein, is a hyperparameter of the loss function, which is set to 0.3 according to experience.

[0139] In the embodiment, the trajectory information and the camera information are combined with the comparison learning, so that the model learns more rich and complementary pedestrian identity features extracted by the double-branch, and the overall performance of the model is improved. At the same time, through the neighboring collaborative learning, the model learns the difference of the pedestrian identity between the cameras, and at the same time, the complementary advantages of the double-branch network are utilized, the pedestrian feature vector extracted is more robust, the clustering accuracy is higher, and the negative effects caused by the inconsistency of the resolution, the shooting angle, the illumination and the like between different cameras can be reduced, and the robustness of the model is improved. In addition, through the double-branch consistency constraint, the features between the double-branches are associated through the ranking optimization, the most similar trajectory label is obtained as the pseudo-label of the pedestrian identity, and then the identity feature learning is performed according to the pseudo-label, so that the model learns more detailed features of the pedestrian identity.

[0140] It should be understood that, although each step in the flowchart involved in each of the above embodiments is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other sequences. Moreover, at least part of the steps in the flowchart involved in each of the above embodiments can include multiple steps or stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps. It can be understood that the steps in different embodiments can be freely combined as needed, and various non-contradictory schemes formed by the combination are within the scope of protection of the present application.

[0141] Based on the same inventive concept, the embodiments of the present application also provide a target recognition model training device for implementing the target recognition model training method.

[0142] In an exemplary embodiment, as shown in Figure 5 A target recognition model training device is provided, comprising a feature extraction module 10, a trajectory fusion module 20, a similarity calculation module 30, a target acquisition module 40 and a model training module 50, wherein:

[0143] The feature extraction module 10 is configured to, for each branch network of the dual-branch network, extract a current sub-trajectory feature of a current trajectory by the branch network, and combine the current sub-trajectory feature with a previous sub-trajectory feature of the current trajectory to obtain a branch trajectory feature.

[0144] The trajectory fusion module 20 is configured to acquire a comprehensive trajectory feature based on the branch trajectory features of all the branch networks.

[0145] The similarity calculation module 30 is configured to, for a reference trajectory different from the acquisition source of the current trajectory, acquire a similar trajectory set based on the comprehensive trajectory feature of the current trajectory and a current sub-trajectory feature of the reference trajectory.

[0146] The target acquisition module 40 is configured to acquire a trusted trajectory set based on the similar trajectory sets of all the branch networks, and determine a target similar trajectory from the trusted trajectory set according to the comprehensive trajectory feature.

[0147] The model training module 50 is configured to take a pseudo label of the target similar trajectory as a target label of the current trajectory, and perform a current sub-training on the dual-branch network based on the target labels of all the trajectories.

[0148] In an exemplary embodiment, the feature extraction module 10 is further configured to process a trajectory image of the current trajectory by the branch network to extract an image feature vector in the trajectory image, and take an average value of all image feature vectors corresponding to the current trajectory as the current sub-trajectory feature of the current trajectory.

[0149] In an exemplary embodiment, the feature extraction module 10 is further configured to acquire a trajectory set corresponding to a to-be-processed video, and add a pseudo label to a trajectory in the trajectory set; the trajectory set comprises trajectories of a plurality of target objects; and the trajectory carries acquisition source information.

[0150] In an example embodiment, the trajectory fusion module 20 is further configured to obtain an average value of the branch trajectory features of all the branch networks as the comprehensive trajectory feature of the current trajectory.

[0151] In an example embodiment, the similarity calculation module 30 is further configured to obtain a first similarity between the comprehensive trajectory feature of the current trajectory and the current sub-trajectory feature of the reference trajectory, and obtain a set of reference trajectories corresponding to a first similarity satisfying a preset condition as the similar trajectory set.

[0152] In an example embodiment, the target obtaining module 40 is further configured to obtain an intersection of the similar trajectory sets of all the branch networks as the trusted trajectory set.

[0153] In an example embodiment, the target obtaining module 40 is further configured to obtain a second similarity between the comprehensive trajectory feature of the current trajectory and the comprehensive trajectory feature of each reference trajectory in the trusted trajectory set, respectively, and obtain a reference trajectory corresponding to the highest second similarity as the target similar trajectory.

[0154] In an example embodiment, the model training module 50 is further configured to construct a contrast loss function and a proximity loss function, and construct a supervision loss function based on the target labels of all the trajectories; perform weighted summation on the contrast loss function, the proximity loss function and the supervision loss function to obtain a total loss function, and perform current-time training on the double-branch network based on the total loss function.

[0155] In an example embodiment, the model training module 50 is further configured to obtain a target image from the trajectory image of the current trajectory, and obtain a positive sample image and a negative sample image based on the target image; the positive sample image is an image other than the target image in the trajectory image; the negative sample image is an image of another trajectory with the same acquisition source as the target image and other than the current trajectory; based on the image feature vector of the target image, the image feature vector of the positive sample image and the image feature vector of the negative sample image, a set of contrast loss functions is constructed; and an average value of all loss functions in the set of contrast loss functions is taken as the contrast loss function.

[0156] In an example embodiment, the model training module 50 is further configured to construct a first loss term based on the similarity between the comprehensive trajectory feature of the current trajectory and the comprehensive trajectory feature of each reference trajectory in the trusted trajectory set, construct a second loss term based on the similarity between the comprehensive trajectory feature and the branch trajectory features of all the trajectories, and construct a proximity loss function according to the first loss term and the second loss term.

[0157] In an example embodiment, the model training module 50 involves a supervised loss function which is a cross-entropy loss function; the supervised loss function takes the comprehensive trajectory features as input and takes the target label as a supervision signal, and is used to constrain the consistency between the prediction probability distribution of the double-branch network and the target label.

[0158] The various modules in the training device of the target recognition model can be implemented wholly or partially by software, hardware, and combinations thereof. The various modules can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a memory in a computer device in software form, so as to be called and executed by a processor to perform the operations corresponding to the various modules.

[0159] In an example embodiment, a computer device is provided, which can be a terminal, and an internal structure diagram thereof can be as shown in Figure 6 The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to perform wired or wireless communication with external terminals, and the wireless communication can be achieved through WIFI, mobile cellular network, near field communication (NFC), or other technologies. The computer program is executed by the processor to implement a training method of a target recognition model. The display unit of the computer device is configured to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer overlaid on the display screen, or can be a key, a trackball, or a touchpad arranged on the shell of the computer device, or can be an external keyboard, a touchpad, a mouse, or the like.

[0160] Those skilled in the art can understand that Figure 6 The structure shown in the above description is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. Specifically, the computer device can include more or fewer components than those shown in the figure, or can combine certain components, or have a different arrangement of components.

[0161] In an example embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program: for each branch network of a double-branch network, extracting a current sub-track feature of a current track by the branch network, and combining the current sub-track feature with a previous sub-track feature of the current track to obtain a branch track feature; obtaining a comprehensive track feature based on the branch track features of all branch networks; for a reference track different from a collection source of the current track, obtaining a similar track set based on the comprehensive track feature of the current track and a current sub-track feature of the reference track; obtaining a trusted track set based on the similar track sets of all branch networks, and determining a target similar track from the trusted track set according to the comprehensive track feature; taking a pseudo label of the target similar track as a target label of the current track, and performing a current sub-training on the double-branch network based on the target labels of all tracks.

[0162] In an example embodiment, the processor, when executing the computer program, is involved in extracting a current sub-track feature of a current track by a branch network, which includes: processing a track image of the current track by the branch network to extract an image feature vector in the track image; and taking an average value of all image feature vectors corresponding to the current track as the current sub-track feature of the current track.

[0163] In an example embodiment, the processor, when executing the computer program, is further involved in the following steps: obtaining a track set corresponding to a to-be-processed video, and adding a pseudo label to a track in the track set; the track set includes tracks of a plurality of target objects; and the track carries collection source information.

[0164] In an example embodiment, the processor, when executing the computer program, is involved in obtaining a comprehensive track feature based on the branch track features of all branch networks, which includes: taking an average value of the branch track features of all branch networks as the comprehensive track feature.

[0165] In an example embodiment, the processor, when executing the computer program, is involved in obtaining a similar track set based on the comprehensive track feature of the current track and a current sub-track feature of a reference track, which includes: obtaining a first similarity between the comprehensive track feature of the current track and the current sub-track feature of the reference track, and taking a set of all reference tracks corresponding to a first similarity satisfying a preset condition as the similar track set.

[0166] In an example embodiment, the processor, when executing the computer program, is involved in obtaining a trusted track set based on the similar track sets of all branch networks, which includes: taking an intersection of the similar track sets of all branch networks as the trusted track set.

[0167] In an embodiment, the processor, when executing the computer program, is directed to determine a target similar trajectory from the trusted trajectory set according to the comprehensive trajectory feature, including: obtaining second similarities between the comprehensive trajectory feature of the current trajectory and comprehensive trajectory features of reference trajectories in the trusted trajectory set respectively, and taking a reference trajectory corresponding to the highest second similarity as the target similar trajectory.

[0168] In an embodiment, the processor, when executing the computer program, is directed to perform the current-time training of the double-branch network based on the target label of all trajectories, including: constructing a contrast loss function and a proximity loss function, and constructing a supervised loss function based on the target label of all trajectories; performing weighted summation on the contrast loss function, the proximity loss function and the supervised loss function to obtain a total loss function, and performing the current-time training of the double-branch network based on the total loss function.

[0169] In an embodiment, the processor, when executing the computer program, is directed to construct the contrast loss function, including: obtaining a target image from a trajectory image of the current trajectory, and obtaining a positive sample image and a negative sample image based on the target image; the positive sample image is an image other than the target image in the trajectory image; the negative sample image is an image of a trajectory other than the current trajectory and having the same collection source as the target image; constructing a set of contrast loss functions based on an image feature vector of the target image, an image feature vector of the positive sample image and an image feature vector of the negative sample image; and taking an average value of all loss functions in the set of contrast loss functions as the contrast loss function.

[0170] In an embodiment, the processor, when executing the computer program, is directed to construct the proximity loss function, including: constructing a first loss term based on similarities between the comprehensive trajectory feature of the current trajectory and comprehensive trajectory features of reference trajectories in the trusted trajectory set; constructing a second loss term based on similarities between the comprehensive trajectory feature and branch trajectory features of all trajectories; and constructing the proximity loss function according to the first loss term and the second loss term.

[0171] In an embodiment, the processor, when executing the computer program, is directed to construct the supervised loss function, including: taking the comprehensive trajectory feature as an input and taking a target label as a supervision signal, and using the supervised loss function to constrain consistency between a predicted probability distribution of the double-branch network and the target label.

[0172] In an embodiment, a computer-readable storage medium is provided, and the computer-readable storage medium stores a computer program. The computer program is executed by a processor to implement the steps in the above-mentioned method embodiments.

[0173] In an embodiment, a computer program product is provided, and the computer program product includes a computer program. The computer program is executed by a processor to implement the steps in the above-mentioned method embodiments.

[0174] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.

[0175] The technical features of the above embodiments can be combined in any manner. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist, they should be considered as the scope of the present application.

[0176] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.

Claims

1. A training method for a target recognition model, characterized in that, The method includes: For each branch network of the dual-branch network, the current sub-trajectory feature of the current trajectory is extracted through the branch network, and the current sub-trajectory feature is combined with the previous trajectory feature of the current trajectory to obtain the branch trajectory feature; Based on the branch trajectory features of all branch networks, obtain comprehensive trajectory features; For reference trajectories whose acquisition sources are different from the current trajectory, a set of similar trajectories is obtained based on the comprehensive trajectory features of the current trajectory and the current sub-trajectory features of the reference trajectory; Based on the set of similar trajectories of all branch networks, a set of reliable trajectories is obtained, and the target similar trajectory is determined from the set of reliable trajectories according to the comprehensive trajectory features. The pseudo-labels of the target similar trajectories are used as the target labels of the current trajectory, and the dual-branch network is trained for the current iteration based on the target labels of all trajectories.

2. The method according to claim 1, characterized in that, The step of extracting the current sub-trajectory features of the current trajectory through the branch network includes: The branch network processes the trajectory image of the current trajectory to extract the image feature vector from the trajectory image; The average value of all image feature vectors corresponding to the current trajectory is taken as the current sub-trajectory feature of the current trajectory.

3. The method according to claim 1, characterized in that, The method further includes: Obtain the trajectory set corresponding to the video to be processed, and add pseudo-labels to the trajectories in the trajectory set; the trajectory set includes the trajectories of multiple target objects; the trajectories carry the acquisition source information.

4. The method according to claim 1, characterized in that, The process of obtaining comprehensive trajectory features based on the branch trajectory features of all branch networks includes: The average value of the branch trajectory features of all branch networks is taken as the comprehensive trajectory feature.

5. The method according to claim 1, characterized in that, The process of obtaining a set of similar trajectories based on the comprehensive trajectory features of the current trajectory and the current sub-trajectory features of the reference trajectory includes: Obtain the first similarity between the comprehensive trajectory features of the current trajectory and the current sub-trajectory features of the reference trajectory, and take the set of all reference trajectories whose first similarity satisfies a preset condition as the similar trajectory set.

6. The method according to claim 1, characterized in that, The process of obtaining a reliable trajectory set based on the similar trajectory set of all branch networks includes: The intersection of the sets of similar trajectories of all branch networks is taken as the set of reliable trajectories.

7. The method according to claim 1, characterized in that, The step of determining the target similar trajectory from the set of reliable trajectories based on the comprehensive trajectory features includes: The second similarity between the comprehensive trajectory features of the current trajectory and the comprehensive trajectory features of each reference trajectory in the set of trusted trajectories is obtained respectively, and the reference trajectory with the highest second similarity is taken as the target similar trajectory.

8. The method according to claim 2, characterized in that, The current training of the dual-branch network based on the target labels of all trajectories includes: Construct contrastive loss functions and neighbor loss functions, and construct a supervised loss function based on the target labels of all trajectories; The contrast loss function, the neighbor loss function, and the supervision loss function are weighted and summed to obtain the total loss function. The dual-branch network is then trained based on the total loss function.

9. The method according to claim 8, characterized in that, The process of constructing the contrastive loss function includes: A target image is obtained from the trajectory image of the current trajectory, and positive sample images and negative sample images are obtained based on the target image; the positive sample images are other images in the trajectory image besides the target image; the negative sample images are images of other trajectories besides the current trajectory that have the same acquisition source as the target image. Based on the image feature vector of the target image, the image feature vector of the positive sample image, and the image feature vector of the negative sample image, a set of contrastive loss functions is constructed; The average value of all loss functions in the set of contrastive loss functions is used as the contrastive loss function.

10. The method according to claim 8, characterized in that, The process of constructing the proximity loss function includes: Based on the similarity between the comprehensive trajectory features of the current trajectory and the comprehensive trajectory features of each reference trajectory in the set of trusted trajectories, a first loss term is constructed; A second loss term is constructed based on the similarity between the comprehensive trajectory features and the branch trajectory features of all trajectories; Based on the first loss term and the second loss term, construct the nearest neighbor loss function.

11. The method according to claim 8, characterized in that, The supervised loss function is the cross-entropy loss function; the supervised loss function takes the comprehensive trajectory features as input and the target label as the supervised signal, and is used to constrain the consistency between the predicted probability distribution of the dual-branch network and the target label.

12. A training device for a target recognition model, characterized in that, The device includes: The feature extraction module is used to extract the current sub-trajectory features of the current trajectory through each branch network of the dual-branch network, and combine the current sub-trajectory features with the previous trajectory features of the current trajectory to obtain the branch trajectory features; The trajectory fusion module is used to obtain comprehensive trajectory features based on the branch trajectory features of all branch networks; The similarity calculation module is used to obtain a set of similar trajectories based on the comprehensive trajectory features of the current trajectory and the current sub-trajectory features of the reference trajectory, for reference trajectories that have different acquisition sources from the current trajectory. The target acquisition module is used to acquire a set of reliable trajectories based on the set of similar trajectories of all branch networks, and to determine the target similar trajectory from the set of reliable trajectories according to the comprehensive trajectory features. The model training module is used to take the pseudo-labels of the target similar trajectories as the target labels of the current trajectory, and to perform the current training on the dual-branch network based on the target labels of all trajectories.

13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 11.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 11.

15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 11.