A parcel waybill number recognition method based on target tracking
By combining the CRN collaborative representation learning network model and the Kalman filter algorithm with the Hungarian algorithm, the problems of insufficient accuracy and recall in parcel waybill number recognition in sorting centers were solved, achieving efficient and stable waybill number recognition and improving the intelligence level of the logistics system.
Patent Information
- Application Number
- CN202510159761.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-13
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2045-02-13
AI Technical Summary
Existing parcel tracking number identification methods have insufficient accuracy and recall in sorting centers and are prone to identification errors, especially when parcels are not in a fixed position or have the same appearance, and cannot effectively utilize the time information of parcel placement.
A target tracking-based approach is adopted. By designing a CRN collaborative representation learning network model and combining it with a multi-task learning framework, Kalman filtering and Hungarian algorithm are used for inter-frame data association. Furthermore, appearance features of package ReID are introduced, and a time window mechanism is used for waybill number matching to improve the accuracy and stability of recognition.
It achieves high accuracy (99.9%) and high recall (99%) in package tracking number identification, solves the problems of ID jump and information delay in multi-target tracking, improves the real-time performance and accuracy of the system, and enhances the robustness and adaptability of the model.
Smart Images

Figure CN120088501B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and in particular to a method for identifying package tracking numbers based on target tracking. Background Technology
[0002] In the logistics field, the problem of parcel tracking number recognition in narrow-slot sorting centers is a specialized image retrieval problem that has been extensively studied. The goal of parcel tracking number recognition is to provide the tracking number of a user querying for a specific parcel in a sorting slot. Candidate tracking numbers are derived from the set of tracking numbers of all parcels that have undergone six-sided scanning within a certain period before the parcel is placed in the slot.
[0003] Currently, there are two common methods for identifying package tracking numbers on sorting slots. One method involves installing a barcode scanner above the slot and scanning the waybill on the package surface to identify the tracking number. However, because the package's position on the slot is not fixed, the surface where the waybill is located may not be within the scanner's field of view and cannot be read. Although this method has a near 100% accuracy, its recall rate is low.
[0004] Another method involves comparing the image of the package at the parcel locker with the image obtained from a six-sided scan using ReID (Recognition by Identifier) to find the corresponding tracking number. A six-sided scanner, also known as a six-sided barcode scanner system, has five scanners on top and around the perimeter, and a bottom-mounted scanning module. It can reliably read the tracking number regardless of the package's orientation. However, six-sided scanners are expensive, and multiple narrowband scanners typically share a single one. Therefore, ReID is still needed to retrieve the tracking number corresponding to the package at the locker. The drawback of this method is that it is prone to misidentification when consecutively appearing packages with identical appearances. Therefore, the logistics industry needs a better method for identifying package tracking numbers.
[0005] The two methods mentioned above only focus on visual information and do not utilize the time information of package placement. This invention replaces the traditional ReID method with a target tracking method combined with the package placement time, achieving a waybill number identification algorithm with high accuracy and high recall. Summary of the Invention
[0006] The purpose of this invention is to solve the problems in the prior art by proposing a parcel tracking number identification method based on target tracking.
[0007] This invention is achieved through the following technical solution: This invention proposes a method for identifying package tracking numbers based on target tracking, the method comprising the following steps:
[0008] Step 1: Design and train the CRN collaborative representation learning network model. The CRN collaborative representation learning network model introduces a multi-task learning framework to jointly optimize the feature representations of object detection and ReID tasks.
[0009] In step one, a multi-task learning dataset is constructed: the object detection dataset contains 15,000 labeled images, totaling 50,000 different packages, as dataset A; the ReID task dataset contains 100,000 images, including 30,000 images of different packages, with image samples of each package from multiple perspectives and scenes, as dataset B;
[0010] The CRN collaborative representation learning network model specifically employs a reciprocal network (REN) for collaborative learning between different tasks. The reciprocal network separates the feature maps for object detection and ID embedding extraction into two different task-driven branches, thereby learning task-dependent representations. Specifically, given shared features, a novel structure combining self-relationships and cross-relationships is designed to enhance feature representations. Self-relationships prompt hidden nodes to learn task-dependent features, while cross-relationships aim to improve collaborative learning between the two tasks. Simultaneously, a scale-aware attention network (SAAN) is employed to improve the alignment of ID embedding extraction and enhance the model's adaptability to scale variations. The output of SAAN is a feature tensor containing rich semantics for all targets across all resolutions.
[0011] Step 2: First, the Kalman filter algorithm is used to predict the state of the target in the next frame. Then, the Hungarian algorithm is used to match the detection result of the current frame with the predicted state. Furthermore, the appearance features of the wrapper ReID are introduced to improve the accuracy and robustness of the association.
[0012] Step 3: Use the algorithm to match the trajectory with the waybill number to obtain the final matching result.
[0013] Furthermore, in step one, during the training of the CRN collaborative representation learning network model, it is necessary to simultaneously optimize both object detection and ReID tasks. The training objective of the CRN collaborative representation learning network model is to minimize the joint loss of the object detection and ReID tasks, thereby defining a multi-task loss function. The loss function is composed of target detection loss. and ReID loss The composition is determined by a tradeoff parameter λ to balance the contributions of the two tasks:
[0014]
[0015] The object detection task employs an anchor-based detection framework and uses cross-entropy loss. To classify the target category, and use smooth L1 loss. The location of the bounding box is regressed; therefore, the object detection loss is expressed as:
[0016]
[0017] Among them, y i It is the actual label of the anchor, p i It is the class probability predicted by the model, t i and These are the predicted bounding box parameters and the actual bounding box parameters, respectively.
[0018] The goal of the ReID task is to learn a discriminative feature representation such that different images of the same package are as close as possible in the feature space, while images of different packages are as far apart as possible. Therefore, triplet loss is used to optimize the ReID task. Given an anchor sample e... a A positive sample e p It shares the same package as the anchor point and a negative sample e. n Its package is different from that of the anchor point, and the triplet loss is expressed as:
[0019]
[0020] Where α is the interval parameter, used to control the distance between positive and negative samples, and [·]+ indicates taking a positive value.
[0021] Further, in step two, the CRN collaborative representation learning network model performs inference. During inference, the CRN collaborative representation learning network model receives an input image I and extracts multi-scale features F = Backbone(I) through the shared backbone network. Subsequently, the model splits into two branches: the object detection branch outputs the bounding box {b1, b2, ..., b} of the target through B = Detector(F). n}, where each b i Includes location and category information; the ReID branch extracts the appearance feature vector E = {e1, e2, ..., e} for each target through E = ReID(F). n},in It is a d-dimensional feature vector; finally, the CRN collaborative representation learning network model outputs both the target detection result and the corresponding ReID feature, realizing joint inference of detection and re-identification.
[0022] Furthermore, in step two, the Kalman filter algorithm is used to predict the state of the package in the next frame; assuming the target's state vector is... Where (x, y) represents the position of the target. The target's velocity is represented by x; the Kalman filter predicts the target's state in the next frame using a motion model: x k|k-1 =F k x k-1|k-1 ;where F k It is the state transition matrix, x k|k-1 It is the predicted state, xk-1|k-1 If the state estimate is from the previous frame, then the predicted covariance matrix is:
[0023]
[0024] Where P k|k-1 It predicts the covariance matrix, Q. k It is the process noise covariance matrix; when the new detection box observation value z k Upon arrival, the Kalman filter updates the state estimate using the following formula:
[0025]
[0026] Update the state estimate and covariance matrix:
[0027] x k|k =x k|k-1 +K k (z k -H k x k|k-1 )
[0028] P k|k =(IK k H k )P k|k-1 .
[0029] Furthermore, in step two, the Hungarian algorithm is used to match the detection results of the current frame with the predicted target state; the detection box z is calculated for each detection box. k With each predicted state x k|k-1 The matching cost between them; each element c of the cost matrix C i,j Let $\frac{i}{j}$ represent the matching cost between the $i$-th detection box and the $j$-th target trajectory. Based on location and appearance information, the Mahalanobis distance is used to measure the positional difference between the detection box and the predicted state.
[0030]
[0031] in It is the covariance matrix of the observation residuals;
[0032] Cosine similarity is used to measure the appearance feature vector e of the detection box and the target trajectory. i and e j Similarities between them:
[0033]
[0034] Ultimately, the matching cost c i,j It is a weighted sum of location and appearance information:
[0035]
[0036] The Hungarian algorithm is used to solve for the cost matrix C and find the optimal matching scheme.
[0037] Furthermore, in step three, a time window is constructed, assuming the package's arrival time is t. g The system received the waybill number at time t. s Then the time window W is defined as:
[0038] W = [t] g -Δt,t g +Δt]
[0039] Here, Δt is an adjustable time tolerance parameter used to control the size of the time window; through the time window, the system can search for package trajectories that match the waybill number within W.
[0040] Furthermore, in step three, a probabilistic matching model between the trajectory and the waybill number is established, assuming that there are N candidate package trajectories T = {T1, T2, ..., T} within the time window W. N}, each trajectory T i Contains a series of state information {x i ,y i ,t i ,e i}, where x i ,y i Indicates the location of the package, t i Represents a timestamp, e i This represents the appearance feature vector of the package;
[0041] For each candidate trajectory T i Calculate the matching probability P(T) between it and the waybill number. i |S), where S represents the relevant information of the waybill number, and the matching probability P(T) i |S) can be broken down into the following parts:
[0042] P(T i |S)=P(t i |t s )·P(e i |e s )
[0043]
[0044] Wherein, P(t) i |t s ) represents the trajectory T i timestamp t i With waybill number receiving time t s The degree of matching; assuming the time difference follows a Gaussian distribution; P(ei |e s ) represents the trajectory T i Appearance features e i The appearance characteristics of the package corresponding to the waybill number on a six-sided scan s The degree of matching is measured using cosine similarity to assess the similarity of appearance features.
[0045] Furthermore, in step three, after calculating the matching probabilities of all candidate trajectories, the maximum a posteriori probability criterion is used to select the optimal matching result, that is, the trajectory T with the highest matching probability is selected. * As the final matching result:
[0046]
[0047] The present invention also proposes an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the package tracking number identification method based on target tracking.
[0048] The present invention also proposes a computer-readable storage medium for storing computer instructions, which, when executed by a processor, implement the steps of the package tracking number identification method based on target tracking.
[0049] Compared with the prior art, the beneficial effects of the present invention are:
[0050] This invention effectively solves the competition problem between object detection and ReID tasks by designing a CRN collaborative representation learning network model and combining it with a multi-task learning framework, thus improving the model's robustness and generalization ability. Simultaneously, it employs Kalman filtering and the Hungarian algorithm for inter-frame data association and introduces the appearance features of package ReID, significantly alleviating the ID jump problem in multi-target tracking and enhancing tracking stability. Furthermore, through a time window mechanism and a probabilistic matching model, it solves the matching problem caused by package information transmission delays, improving the system's real-time performance and accuracy. Ultimately, this invention achieves efficient and stable package tracking number recognition with an accuracy of 99.9% and a recall of 99%. It possesses strong adaptability and broad application value. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0052] Figure 1This is a flowchart of the parcel tracking number identification method based on target tracking described in this invention;
[0053] Figure 2 This is a schematic diagram of the overall network structure of CRN;
[0054] Figure 3 This is a schematic diagram illustrating the results of object detection.
[0055] Figure 4 This is an example diagram illustrating the results of ReID clustering.
[0056] Figure 5 Example diagram of parcel tracking number recognition results;
[0057] Figure 6 A schematic diagram illustrating the recall rate of parcel tracking number recognition technology applied to a sorting center.
[0058] Figure 7 This diagram illustrates the accuracy of parcel tracking number recognition technology applied at a sorting center. Detailed Implementation
[0059] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0060] The objectives of this invention include:
[0061] Real-time issue: In order to minimize the processing time of each frame of video, we hope to use a small model to perform object detection and ReID tasks simultaneously, and then use a rule-based method to associate the data between frames to obtain the wrapping trajectory.
[0062] The excessive competition between object detection and ReID in multi-task learning: 1) Competition in object representation learning. In traditional multi-task learning, object class confidence, object scale, and ID information are obtained by processing shared feature tensors. While this method is efficient, it ignores the inherent differences between different tasks. 2) Competition in semantic hierarchy assignment. Modern object detection models always introduce feature pyramid structures to improve the localization accuracy of objects of different sizes. In this framework, objects of different scales are assigned to features of different resolutions. However, this assignment is unsuitable for ReID because it leads to a misalignment of semantic levels.
[0063] The ID change problem in multi-target tracking: Due to factors such as mutual occlusion and overlap between packages, the ID of the same package often changes during tracking, making it impossible to simply match the ID with the tracking number. Therefore, it is necessary to design an inter-frame data association algorithm that can keep the ID stable.
[0064] Package information delivery delay issue: Sometimes a package has already been placed in the locker, but the candidate tracking number only updates with new locker information several seconds later. Therefore, a module needs to be designed to handle the problem caused by package information delivery delay.
[0065] Therefore, this invention proposes a parcel tracking number identification method based on target tracking, specifically targeting the task of identifying parcel tracking numbers in logistics sorting centers. This method involves designing and training a proposed CRN cooperative representation learning network model on top of traditional target detection and ReID models to improve the model's ability to extract target spatial and appearance features. Then, based on the detection box IOU, appearance feature similarity, and depth classification, Kalman filtering and Hungarian matching algorithms are used to associate the target trajectories between frames. Finally, the tracking numbers of parcels near their sorting time (after a six-sided scan) are associated with the trajectories to obtain the corresponding tracking number for each frame. By introducing this method, parcel tracking number matching errors caused by overlap or motion blur can be alleviated, sorting efficiency can be improved, operating costs can be reduced, and the overall intelligence level of the logistics system can be enhanced.
[0066] Specifically, in combination Figures 1-7 This invention proposes a method for identifying package tracking numbers based on target tracking, the method comprising the following steps:
[0067] Step 1: Design and train the CRN collaborative representation learning network model to improve the model's ability to extract target space and appearance features. The CRN collaborative representation learning network model introduces a multi-task learning framework to jointly optimize the feature representation of target detection and ReID tasks, thereby enhancing the model's robustness and generalization ability in complex scenarios.
[0068] In step one, a multi-task learning dataset is constructed: To minimize the processing time for each frame of the video, this invention trains a small model to simultaneously perform object detection and ReID tasks. The object detection dataset contains 15,000 labeled images, totaling 50,000 different packages, and is designated as dataset A; the ReID task dataset contains 100,000 images, including 30,000 images of different packages, with each package having multiple viewpoints and scene image samples, and is designated as dataset B.
[0069] The CRN collaborative representation learning network model is as follows: To address the performance degradation in multi-task learning primarily stemming from excessive competition between object detection and ReID tasks, this invention fully considers the fundamental differences between the two tasks and designs a CRN model containing two sub-networks to solve this problem. This invention employs a reciprocal network (REN) for collaborative learning between different tasks. The reciprocal network separates the feature maps of object detection and ID embedding extraction into two different task-driven branches, thereby learning task-dependent representations. Specifically, given shared features, a novel structure combining self-relationships and cross-relationships is designed to enhance feature representations. Self-relationships prompt hidden nodes to learn task-dependent features, while cross-relationships aim to improve collaborative learning between the two tasks. Simultaneously, a scale-aware attention network (SAAN) is employed to improve the alignment of ID embedding extraction and enhance the model's adaptability to scale changes. This architecture enhances the influence of object-related regions and channels. The output of SAAN is a feature tensor containing rich semantics of all targets across all resolutions. Based on the above design principles, ID embedding based on aggregated features helps prevent semantic misalignment during the matching process.
[0070] Step 2: First, the Kalman filter algorithm is used to predict the state of the target in the next frame. Then, the Hungarian algorithm is used to match the detection result of the current frame with the predicted state. Furthermore, the appearance features of the wrapper ReID are introduced to improve the accuracy and robustness of the association.
[0071] Step three involves using an algorithm that matches the trajectory with the waybill number to obtain the final matching result. This can greatly mitigate the impact of the difference between the actual time the package is delivered and the time when the tracking system receives the new candidate waybill number.
[0072] In step one, during the training of the CRN collaborative representation learning network model, it is necessary to simultaneously optimize two tasks: object detection and ReID. To ensure that the two tasks can work collaboratively rather than compete with each other, this invention designs a multi-task loss function that combines the characteristics of Reciprocal Networks (REN) and Perceptual Scale Attention Networks (SAAN). The training objective of the CRN collaborative representation learning network model is to minimize the joint loss of the object detection and ReID tasks, thereby defining a multi-task loss function. The loss function is composed of target detection loss. and ReID loss The composition is determined by a tradeoff parameter λ to balance the contributions of the two tasks:
[0073]
[0074] The object detection task employs an anchor-based detection framework and uses cross-entropy loss. To classify the target category, and use smooth L1 loss. The location of the bounding box is regressed; therefore, the object detection loss is expressed as:
[0075]
[0076] Among them, y i It is the actual label of the anchor, p i It is the class probability predicted by the model, t i and These are the predicted bounding box parameters and the actual bounding box parameters, respectively.
[0077] The goal of the ReID task is to learn a discriminative feature representation such that different images of the same package are as close as possible in the feature space, while images of different packages are as far apart as possible. Therefore, triplet loss is used to optimize the ReID task. Given an anchor sample e... a A positive sample e p It shares the same package as the anchor point and a negative sample e. n Its package is different from that of the anchor point, and the triplet loss is expressed as:
[0078]
[0079] Where α is the interval parameter, used to control the distance between positive and negative samples, and [·]+ indicates taking a positive value.
[0080] In step two, the CRN collaborative representation learning network model performs inference. During inference, the CRN collaborative representation learning network model receives an input image I and extracts multi-scale features F = Backbone(I) through the shared backbone network. Subsequently, the model splits into two branches: the object detection branch outputs the bounding box {b1, b2, ..., b} of the target through B = Detector(F). n}, where each b i Includes location and category information; the ReID branch extracts the appearance feature vector E = {e1, e2, ..., e} for each target through E = ReID(F). n},in It is a d-dimensional feature vector; finally, the CRN collaborative representation learning network model outputs both the target detection result and the corresponding ReID feature, realizing joint inference of detection and re-identification.
[0081] In step two, the Kalman filter algorithm is used to predict the state of the package in the next frame; assuming the target's state vector is... Where (x, y) represents the position of the target. The target's velocity is represented by x; the Kalman filter predicts the target's state in the next frame using a motion model: x k|k-1=F k x k-1|k-1 ;where F k It is the state transition matrix, x k|k-1 It is the predicted state, x k-1|k-1 If the state estimate is from the previous frame, then the predicted covariance matrix is:
[0082]
[0083] Where P k|k-1 It predicts the covariance matrix, Q. k It is the process noise covariance matrix; when the new detection box observation value z k Upon arrival, the Kalman filter updates the state estimate using the following formula:
[0084]
[0085] Update the state estimate and covariance matrix:
[0086] x k|k =x k|k-1 +K k (z k -H k x k|k-1 )
[0087] P k|k =(IK k H k )P k|k-1 .
[0088] In step two, the Hungarian algorithm is used to match the detection results of the current frame with the predicted target state; the z-value of each detection box is calculated. k With each predicted state x k|k-1 The matching cost between them; each element c of the cost matrix C i,j Let $\frac{i}{j}$ represent the matching cost between the $i$-th detection box and the $j$-th target trajectory. Based on location and appearance information, the Mahalanobis distance is used to measure the positional difference between the detection box and the predicted state.
[0089]
[0090] in It is the covariance matrix of the observation residuals;
[0091] Cosine similarity is used to measure the appearance feature vector e of the detection box and the target trajectory. i and e j Similarities between them:
[0092]
[0093] Ultimately, the matching cost ci,j It is a weighted sum of location and appearance information:
[0094]
[0095] The Hungarian algorithm is used to solve for the cost matrix C to find the optimal matching scheme. The matching results will determine which detection boxes are associated with existing target trajectories and which detection boxes may represent newly emerging targets.
[0096] In step three, a time window is constructed. To address the inconsistency between the package arrival time and the system's receipt of the waybill number, this invention introduces a time window mechanism. Assume the package arrival time is t. g The system received the waybill number at time t. s Then the time window W is defined as:
[0097] W = [t] g -Δt,t g +Δt]
[0098] Here, Δt is an adjustable time tolerance parameter used to control the size of the time window; through the time window, the system can search for package trajectories that match the waybill number within W.
[0099] In step three, a probabilistic matching model between the trajectory and the waybill number is established. It is assumed that within a time window W, there are N candidate package trajectories T = {T1, T2, ..., T...}. N}, each trajectory T i Contains a series of state information {x i ,y i ,t i ,e i}, where x i ,y i Indicates the location of the package, t i Represents a timestamp, e i This represents the appearance feature vector of the package;
[0100] For each candidate trajectory T i Calculate the matching probability P(T) between it and the waybill number. i |S), where S represents information related to the tracking number, such as the physical characteristics of the package. The matching probability P(T) i |S) can be broken down into the following parts:
[0101] P(T i |S)=P(t i |t s )·P(e i |e s )
[0102]
[0103] Wherein, P(t) i |t s ) represents the trajectory T i timestamp t i With waybill number receiving time t s The degree of matching; assuming the time difference follows a Gaussian distribution; P(e i |e s ) represents the trajectory T i Appearance features e i The appearance characteristics of the package corresponding to the waybill number on a six-sided scan s The degree of matching is measured using cosine similarity to assess the similarity of appearance features.
[0104] In step three, after calculating the matching probabilities of all candidate trajectories, the maximum a posteriori probability criterion is used to select the optimal matching result, that is, the trajectory T with the highest matching probability is selected. * As the final matching result:
[0105]
[0106] To further enhance the system's adaptability, this invention also incorporates a feedback and update mechanism for the matching results. After each matching result is generated, the system updates the matching model based on the actual placement situation. Specifically, the system updates the model based on the actual placement time and the matching result T. * This allows for adjustments to the time window W and the parameters in the matching probability model, enabling the model to better adapt to changes in the real-world scenario.
[0107] The specific implementation of this invention will be described below using video data from a specific sorting center.
[0108] Step 1: Design the CRN as follows Figure 2 As shown, the CRN is trained using the AdamW optimizer, and then object detection and ReID are performed on the partitioned test set. The results are then compared with the ground truth. Figure 3 Here is an example of the object detection results. Figure 4 This is an example of the ReID clustering results. Compared to other neural networks that simultaneously achieve object detection and ReID, the mean evaluation metrics of CRN are shown in Table 1.
[0109] Table 1
[0110]
[0111] Step Two: In the inference phase, the CRN model simultaneously outputs the target detection results and corresponding ReID features through joint inference, achieving a seamless integration of detection and re-identification. Specifically, the model first extracts multi-scale features through a shared backbone network, and then outputs the target's bounding box information and appearance feature vector through the target detection branch and ReID branch, respectively. Next, the Kalman filter algorithm is used to predict the target's state in the next frame, including position and velocity information, and the Hungarian algorithm is used to match the detection results of the current frame with the predicted state. During the matching process, the cost matrix is constructed by combining the target's position information and appearance features, and the optimal matching scheme is solved to determine the association between the detection box and the existing target trajectory or the appearance of a new target. This process effectively alleviates the ID jump problem in multi-target tracking and improves the stability and accuracy of tracking.
[0112] Step 3: Through the above steps, the system can accurately obtain the tracking number corresponding to each package in each frame of the image, such as... Figure 5 As shown. To evaluate the performance of the entire waybill number recognition technology, the system underwent statistical analysis of accuracy and recall. Experimental results show that the accuracy of this technology is as high as 99.9%, and the recall rate also reaches 99%, as shown. Figure 6 and Figure 7 As shown in the figure, this result fully demonstrates the efficiency and reliability of the present invention in practical applications. It can effectively handle complex scenarios such as package information transmission delays and target obstruction, providing strong technical support for package sorting and logistics management.
[0113] The present invention also proposes an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the package tracking number identification method based on target tracking.
[0114] The present invention also proposes a computer-readable storage medium for storing computer instructions, which, when executed by a processor, implement the steps of the package tracking number identification method based on target tracking.
[0115] The memory in this application embodiment can be volatile memory or non-volatile memory, or it can include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DRRAM). It should be noted that the memory used in the methods described in this invention is intended to include, but is not limited to, these and any other suitable types of memory.
[0116] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., high-density digital video discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).
[0117] In implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software. The steps of the method disclosed in the embodiments of this application can be directly implemented by a hardware processor, or by a combination of hardware and software modules in the processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, detailed descriptions are omitted here.
[0118] It should be noted that the processor in the embodiments of this application can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiments can be completed by the integrated logic circuitry in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above methods.
[0119] The above provides a detailed description of the parcel tracking number identification method proposed in this invention. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.
Claims
1. A method for identifying package tracking numbers based on target tracking, characterized in that, The method includes the following steps: Step 1: Design and train the CRN collaborative representation learning network model. The CRN collaborative representation learning network model introduces a multi-task learning framework to jointly optimize the feature representations of object detection and ReID tasks. In step one, a multi-task learning dataset is constructed: the object detection dataset contains 15,000 labeled images, totaling 50,000 different packages, as dataset A; the ReID task dataset contains 100,000 images, including 30,000 images of different packages, with image samples of each package from multiple perspectives and scenes, as dataset B; The CRN collaborative representation learning network model specifically employs a reciprocal network (REN) for collaborative learning between different tasks. The reciprocal network separates the feature maps for object detection and ID embedding extraction into two different task-driven branches, thereby learning task-dependent representations. Specifically, given shared features, a novel structure combining self-relationships and cross-relationships is designed to enhance feature representations. Self-relationships prompt hidden nodes to learn task-dependent features, while cross-relationships aim to improve collaborative learning between the two tasks. Simultaneously, a scale-aware attention network (SAAN) is employed to improve the alignment of ID embedding extraction and enhance the model's adaptability to scale variations. The output of SAAN is a feature tensor containing rich semantics for all targets across all resolutions. Step 2: First, the Kalman filter algorithm is used to predict the state of the target in the next frame. Then, the Hungarian algorithm is used to match the detection result of the current frame with the predicted state. Furthermore, the appearance features of the wrapper ReID are introduced to improve the accuracy and robustness of the association. Step 3: Use the algorithm to match the trajectory with the waybill number to obtain the final matching result.
2. The method according to claim 1, characterized in that, In step one, during the training of the CRN collaborative representation learning network model, it is necessary to simultaneously optimize two tasks: object detection and ReID. The training objective of the CRN collaborative representation learning network model is to minimize the joint loss of the object detection and ReID tasks, thereby defining a multi-task loss function. The loss function is composed of target detection loss. and ReID loss The composition is determined by a tradeoff parameter λ to balance the contributions of the two tasks: The object detection task employs an anchor-based detection framework and uses cross-entropy loss. To classify the target category, and use smooth L1 loss. The location of the bounding box is regressed; therefore, the object detection loss is expressed as: Among them, y i It is the actual label of the anchor, p i It is the class probability predicted by the model, t i and These are the predicted bounding box parameters and the actual bounding box parameters, respectively. The goal of the ReID task is to learn a discriminative feature representation such that different images of the same package are as close as possible in the feature space, while images of different packages are as far apart as possible. Therefore, triplet loss is used to optimize the ReID task. Given an anchor sample e... a A positive sample e p It shares the same package as the anchor point and a negative sample e. n Its package is different from that of the anchor point, and the triplet loss is expressed as: Where α is the interval parameter, used to control the distance between positive and negative samples, and [·]+ indicates taking a positive value.
3. The method according to claim 1, characterized in that, In step two, the CRN collaborative representation learning network model performs inference. During inference, the CRN collaborative representation learning network model receives an input image I and extracts multi-scale features F = Backbone(I) through the shared backbone network. Subsequently, the model splits into two branches: the object detection branch outputs the bounding box {b1, b2, ..., b} of the target through B = Detector(F). n }, where each b i Includes location and category information; the ReID branch extracts the appearance feature vector E = {e1, e2, ..., e} for each target through E = ReID(F). n },in It is a d-dimensional feature vector; finally, the CRN collaborative representation learning network model outputs both the target detection result and the corresponding ReID feature, realizing joint inference of detection and re-identification.
4. The method according to claim 3, characterized in that, In step two, the Kalman filter algorithm is used to predict the state of the package in the next frame; assuming the target's state vector is... Where (x, y) represents the position of the target. The target's velocity is represented by x; the Kalman filter predicts the target's state in the next frame using a motion model: x k|k-1 =F k x k-1|k-1 ;where F k It is the state transition matrix, x k|k-1 It is the predicted state, x k-1|k-1 If the state estimate is from the previous frame, then the predicted covariance matrix is: Where P k|k-1 It predicts the covariance matrix, Q. k It is the process noise covariance matrix; when the new detection box observation value z k Upon arrival, the Kalman filter updates the state estimate using the following formula: Update the state estimate and covariance matrix: x k|k =x k|k-1 +K k (z k -H k x k|k-1 ) P k|k =(I-K k H k )P k|k-1 。 5. The method according to claim 4, characterized in that, In step two, the Hungarian algorithm is used to match the detection results of the current frame with the predicted target state; the z-value of each detection box is calculated. k With each predicted state x k|k-1 The matching cost between them; each element c of the cost matrix C i,j Let $\frac{i}{j}$ represent the matching cost between the $i$-th detection box and the $j$-th target trajectory. Based on location and appearance information, the Mahalanobis distance is used to measure the positional difference between the detection box and the predicted state. in It is the covariance matrix of the observation residuals; Cosine similarity is used to measure the appearance feature vector e of the detection box and the target trajectory. i and e j Similarities between them: Ultimately, the matching cost c i,j It is a weighted sum of location and appearance information: The Hungarian algorithm is used to solve for the cost matrix C and find the optimal matching scheme.
6. The method according to claim 1, characterized in that, In step three, a time window is constructed, assuming the package's arrival time is t. g The system received the waybill number at time t. s Then the time window W is defined as: W=[t g -Δt,t g +Δt] Here, Δt is an adjustable time tolerance parameter used to control the size of the time window; through the time window, the system can search for package trajectories that match the waybill number within W.
7. The method according to claim 6, characterized in that, In step three, a probabilistic matching model between the trajectory and the waybill number is established. It is assumed that within a time window W, there are N candidate package trajectories T = {T1, T2, ..., T...}. N }, each trajectory T i Contains a series of state information {x i ,y i ,t i ,e i }, where x i ,y i Indicates the location of the package, t i Represents a timestamp, e i This represents the appearance feature vector of the package; For each candidate trajectory T i Calculate the matching probability P(T) between it and the waybill number. i |S), where S represents the relevant information of the waybill number, and the matching probability P(T) i |S) can be broken down into the following parts: P(T i |S)=P(t i |t s )·P(e i |e s ) Wherein, P(t) i |t s ) represents the trajectory T i timestamp t i With waybill number receiving time t s The degree of matching; assuming the time difference follows a Gaussian distribution; P(e i |e s ) represents the trajectory T i Appearance features e i The appearance characteristics of the package corresponding to the waybill number on a six-sided scan s The degree of matching is measured using cosine similarity to assess the similarity of appearance features.
8. The method according to claim 7, characterized in that, In step three, after calculating the matching probabilities of all candidate trajectories, the maximum a posteriori probability criterion is used to select the optimal matching result, that is, the trajectory T with the highest matching probability is selected. * As the final matching result:
9. An electronic 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-8.
10. A computer-readable storage medium for storing computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the method according to any one of claims 1-8.
Citation Information
Patent Citations
Pedestrian re-identification algorithm implementation method based on HSV and SDALF
CN107679467A
Multi-target tracking method suitable for vehicle motion characteristics
CN116152297A