Trajectory segmentation labeling method and related device
By combining spatiotemporal clustering and multidimensional spatiotemporal features, efficient segmentation and labeling of trajectory data is achieved, solving the problems of low labeling efficiency and insufficient accuracy in existing technologies, and improving the adaptability and labeling accuracy of trajectory segmentation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-06
- Publication Date
- 2026-04-07
AI Technical Summary
Existing trajectory annotation methods have shortcomings in balancing efficiency and accuracy, trajectory segmentation, and human-computer collaboration, making it difficult to meet the needs of practical applications. In particular, traditional manual annotation is inefficient, automatic annotation is not accurate enough, and trajectory segmentation methods lack adaptability.
The trajectory data is clustered using a spatiotemporal clustering method, segmented using an adaptive sliding window, and manually labeled and automatically inferred using multidimensional spatiotemporal features. By acquiring multidimensional spatiotemporal features, the segmentation results are optimized to improve labeling efficiency.
While ensuring the accuracy of annotation, it significantly improved annotation efficiency, raising the annotation level from point level to segment level, thereby improving the precision and consistency of annotation.
Smart Images

Figure CN121456520B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of trajectory data processing, in particular to a trajectory segmentation labeling method and related equipment. BACKGROUND
[0002] With the rapid development and wide application of positioning technologies such as Global Positioning System (GPS), Automatic Identification System (AIS), Beidou navigation system, a large amount of spatio-temporal trajectory data of mobile targets (such as ships, vehicles, pedestrians, drones, etc.) is generated. These trajectory data record the position, speed, heading and other information of the mobile target in the form of time series, and contain rich behavior patterns and motion laws. In order to extract valuable behavior patterns from original trajectory data, it is necessary to label the trajectory data, that is, to associate the trajectory segment with its corresponding behavior. High-quality trajectory labeling data is the basis for training and verifying trajectory pattern recognition models, anomaly detection algorithms and behavior prediction systems.
[0003] However, the current trajectory data labeling mainly faces the following technical challenges and problems:
[0004] 1. Traditional trajectory labeling methods mainly include two types: complete manual labeling and complete automatic labeling. Complete manual labeling relies on manual viewing of trajectory data one by one and judgment according to expert experience. Although it can guarantee high accuracy, it takes tens of minutes or even longer time to label a trajectory containing thousands of trajectory points. For a data set containing thousands of trajectories, complete manual labeling may take weeks or even months, resulting in low labeling efficiency, and long repetitive labeling work is easy to cause labeling personnel fatigue, affecting labeling quality and consistency. Complete automatic labeling method can improve labeling efficiency, but has obvious shortcomings in accuracy and adaptability. Rule-based automatic labeling methods (such as speed threshold method, stay point detection method, etc.) rely on pre-set rules and fixed parameter thresholds, which are difficult to adapt to the diversified behavior characteristics of different scenarios and different types of mobile targets. For example, the fishing behavior characteristics of different types of ships in different sea areas differ greatly, and a unified speed threshold cannot accurately distinguish between fishing operations and slow sailing. Although the automatic labeling method based on machine learning can learn complex patterns, it often needs a large amount of high-quality labeling data for training, and the generalization ability and robustness of the model are poor. Most labeling methods use point-level classification strategy, which independently classifies and predicts each trajectory point, ignoring the continuity of trajectory and the continuity of behavior, resulting in frequent label jumps in prediction results, which incorrectly divides the same behavior pattern into multiple fragmented segments.
[0005] 2. Lack of effective trajectory segmentation method: trajectory segmentation is an important preprocessing step of trajectory analysis, which aims to divide the original trajectory into several relatively consistent segments according to the change of behavior characteristics. Reasonable trajectory segmentation can improve the accuracy and accuracy of labeling, and reduce the complexity of labeling. However, the existing trajectory segmentation method mainly segments based on fixed parameter threshold, which is simple and intuitive, but lacks comprehensive analysis and adaptive adjustment ability of trajectory spatio-temporal characteristics; But it is difficult to adapt to the diversified needs of different types of moving targets and different application scenarios.
[0006] In summary, the existing trajectory labeling method has deficiencies in the balance of efficiency and accuracy, trajectory segmentation, human-computer cooperation and other aspects, and it is difficult to meet the needs of practical applications. Therefore, there is an urgent need for a trajectory semi-automatic labeling method that combines spatio-temporal adaptive segmentation, a small amount of manual labeling and intelligent automatic inference, which can significantly improve the labeling efficiency while ensuring the accuracy of labeling. SUMMARY
[0007] The present application provides a trajectory segmentation labeling method and related equipment, which aims to significantly improve the labeling efficiency while ensuring the accuracy of labeling.
[0008] In order to achieve the above purpose, the present application provides a trajectory segmentation labeling method, comprising:
[0009] Step 1, obtaining the original trajectory data of the moving target;
[0010] Step 2, using a spatio-temporal clustering method to cluster the original trajectory data, obtaining a plurality of clustering clusters, and combining an adaptive sliding window to segment the trajectories in all clustering clusters to obtain a segmentation result;
[0011] Step 3, manually labeling the segmentation result to obtain a manual labeling result, and using the manual labeling result as prior knowledge to extract features from the segmentation result to obtain multi-dimensional spatio-temporal features;
[0012] Step 4, based on the multi-dimensional spatio-temporal features, automatically inferring the labels of the unmarked segments in the segmentation result to obtain an inference result, and calculating the confidence of the inference result;
[0013] Step 5, optimizing the inference result according to the confidence to obtain the trajectory labeling result of the moving target.
[0014] Further, before using the spatio-temporal clustering method to cluster the original trajectory data, it further comprises:
[0015] Pretreating the original trajectory data to obtain pretreated trajectory data.
[0016] Further, the original trajectory data is clustered by using a space-time clustering method to obtain a plurality of clustering clusters, including:
[0017] The space-time distance between any two trajectory points in the preprocessed trajectory data is calculated based on the ST-DBSCAN space-time clustering algorithm.
[0018] The trajectory points in the preprocessed trajectory data are clustered according to the space-time distance to obtain a plurality of clustering clusters.
[0019] Further, the calculation expression of the space-time distance between any two trajectory points in the preprocessed trajectory data based on the ST-DBSCAN space-time clustering algorithm is:
[0020] ;
[0021] Wherein, denotes the space-time distance between two trajectory points , , denotes the geographical distance between two trajectory points , , denotes the spatial neighborhood radius, denotes the time neighborhood radius, , denote the timestamps of trajectory points , .
[0022] Further, the segmentation result is manually annotated to obtain a manual annotation result, including:
[0023] The segmentation result is displayed in the form of a line through a map component;
[0024] The segmentation selection event is triggered by selecting the segmentation line, and the corresponding behavior label is selected for manual annotation in the segmentation selection event according to the space-time characteristics and behavior semantics of the trajectory, to obtain the manual annotation result.
[0025] Further, the multi-dimensional space-time characteristics include:
[0026] The time dynamic characteristics composed of average speed, speed standard deviation, speed change frequency and average acceleration;
[0027] The spatial pattern characteristics composed of trajectory curvature, convex hull area, local point density and heading change pattern.
[0028] Further, the expression for calculating the confidence of the inference result is:
[0029] ;
[0030] wherein, represents a confidence level, represents a maximum similarity, represents a standard deviation of top-k similarities, represents an average value of top-k similarities.
[0031] The application further provides a trajectory segmentation and labeling device, comprising:
[0032] an acquisition module, configured to acquire original trajectory data of a moving target;
[0033] a segmentation module, configured to cluster the original trajectory data by using a spatiotemporal clustering method to obtain a plurality of clustering clusters, and segment trajectories in all the clustering clusters by combining an adaptive sliding window to obtain a segmentation result;
[0034] an extraction module, configured to manually label the segmentation result to obtain a manual labeling result, and extract features of the segmentation result by taking the manual labeling result as prior knowledge to obtain multidimensional spatiotemporal features;
[0035] an inference module, configured to automatically infer labels of unlabeled segments in the segmentation result based on the multidimensional spatiotemporal features to obtain an inference result, and calculate a confidence level of the inference result;
[0036] an optimization module, configured to optimize the inference result according to the confidence level to obtain a trajectory labeling result of the moving target.
[0037] The application further provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the trajectory segmentation and labeling method when executing the computer program.
[0038] The application further provides a computer readable storage medium, which stores a computer program, and the computer program is executable on a processor to implement the trajectory segmentation and labeling method.
[0039] The above scheme of the application has the following beneficial effects:
[0040] The application obtains original trajectory data of a moving target, adopts a space-time clustering method to cluster the original trajectory data, obtains a plurality of clustering clusters, and combines an adaptive sliding window to segment trajectories in all the clustering clusters to obtain a segmentation result; the segmentation result is manually labeled to obtain a manual labeling result, the manual labeling result is taken as prior knowledge to extract features of the segmentation result to obtain multi-dimensional space-time features; un-labeled segments in the segmentation result are automatically labeled based on the multi-dimensional space-time features to obtain a labeling result, and a confidence of the labeling result is calculated; the labeling result is optimized according to the confidence to obtain a trajectory labeling result of the moving target; compared with the prior art, the application improves labeling intensity from a point level to a segmentation level through a collaborative mechanism of 'trajectory segmentation + manual labeling + label inference', and significantly improves labeling efficiency while ensuring labeling accuracy.
[0041] Other benefits of the application will be described in detail in the subsequent specific embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0042] Figure 1 A flowchart of an embodiment of the application is shown;
[0043] Figure 2 A structural diagram of a trajectory segmentation labeling device in an embodiment of the application is shown;
[0044] Figure 3 A structural diagram of a terminal device in an embodiment of the application is shown. DETAILED DESCRIPTION
[0045] To make the technical problems solved by the application, technical solutions and advantages clearer, the following will be described in detail with reference to the drawings and specific embodiments. Obviously, the described embodiments are part of the embodiments of the application, rather than all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor fall within the protection scope of the application.
[0046] In addition, the technical features involved in different embodiments of the application described below can be combined with each other as long as there is no conflict.
[0047] The application provides a trajectory segmentation labeling method and related equipment aiming at the existing problems.
[0048] As shown in Figure 1 An embodiment of the application provides a trajectory segmentation labeling method, which comprises:
[0049] Step 1, obtaining original trajectory data of a moving target;
[0050] Step 2: The original trajectory data is clustered using a spatiotemporal clustering method to obtain multiple clusters. An adaptive sliding window is then used to segment the trajectories in all clusters to obtain the segmentation results.
[0051] Step 3: Manually label the segmented results to obtain manually labeled results. Use the manually labeled results as prior knowledge to extract features from the segmented results and obtain multidimensional spatiotemporal features.
[0052] Step 4: Based on multidimensional spatiotemporal features, perform automatic label inference on the unlabeled segments in the segmentation results to obtain the inference results, and calculate the confidence level of the inference results;
[0053] Step 5: Optimize the inference results based on the confidence level to obtain the trajectory labeling results of the moving target.
[0054] The original trajectory data used in this embodiment of the invention is the AIS trajectory data of a ship in a certain sea area. The AIS trajectory data contains several ship trajectories, each trajectory consists of several trajectory points, and each trajectory point records the ship's maritime mobility service identifier, longitude, latitude, timestamp, speed, heading and other attribute information.
[0055] The preferred embodiment is that, before using the spatiotemporal clustering method to cluster the original trajectory data, the method further includes: preprocessing the original trajectory data to obtain preprocessed trajectory data.
[0056] In this embodiment of the invention, the preprocessing process includes:
[0057] A linear interpolation method is used to perform time series alignment processing on the trajectory data, unifying trajectory points with different sampling intervals to the same time interval;
[0058] The time series aligned trajectory data is subjected to coordinate system normalization processing, and the coordinates of all trajectory points are uniformly transformed to the WGS84 geographic coordinate system.
[0059] Based on rules such as sudden velocity changes, position jumps, and reversed timestamps, outlier detection and filtering are performed on the trajectory data after coordinate transformation to identify and process abnormal trajectory points.
[0060] For trajectory points lacking speed or heading attributes, calculations are performed to supplement them based on the position and time difference of adjacent points.
[0061] Specifically, a spatiotemporal clustering method is used to cluster the original trajectory data, resulting in multiple clusters, including:
[0062] The spatiotemporal distance between any two trajectory points in the preprocessed trajectory data is calculated based on the ST-DBSCAN spatiotemporal clustering algorithm.
[0063] Based on the spatiotemporal distance, the trajectory points in the preprocessed trajectory data are clustered to obtain multiple clusters.
[0064] Specifically, the expression for calculating the spatiotemporal distance between any two trajectory points in the preprocessed trajectory data based on the ST-DBSCAN spatiotemporal clustering algorithm is as follows:
[0065] ;
[0066] in, Represents two trajectory points , The spatiotemporal distance between them Represents two trajectory points , Geographical distance between them Represents the spatial neighborhood radius. Represents the time neighborhood radius. , Representing trajectory points respectively , Timestamp.
[0067] Two trajectory points , The geographical distance between them is calculated using the Haversine formula, which is expressed as follows:
[0068] ;
[0069] in, This represents the Earth's radius, approximately 6371 kilometers. Indicates latitude, Indicates longitude.
[0070] In an embodiment of the present invention, when And trajectory points The number of trajectory points contained within the spatiotemporal neighborhood is not less than the minimum number of trajectory points. Then the trajectory points As the core point, the core points that are reachable in time and space and their neighboring points are grouped into clusters in the same time and space.
[0071] In this embodiment of the invention, dense point groups are defined as dense clusters and sparse points are defined as noise clusters. For a continuous sequence of noise points, if it has temporal continuity and the duration exceeds a minimum threshold, the noise segment is promoted to an independent new cluster. This ensures that behavioral patterns can still be captured in less dense areas or when operations are scattered.
[0072] Specifically, by combining an adaptive sliding window to segment the trajectories in all clusters, the segmentation results are obtained, including:
[0073] First, arrange the trajectory points in chronological order to form an ordered sequence. And label the cluster to which each trajectory point belongs;
[0074] Then, segmented windows are constructed by permutation and cumulative clustering, with a window length threshold set as follows. The threshold The window is dynamically determined based on the total length of the trajectory, and the window construction process is as follows:
[0075] (1) Starting with the first cluster, add all trajectory points contained in it to the current window;
[0076] (2) Increment the subsequent clusters and their contained trajectory points in turn until the total number of trajectory points in the current window reaches or exceeds the threshold. ;
[0077] (3) Mark the current window as a segment. Record the sequence of trajectory points contained in the segment and the cluster identifier to which it belongs;
[0078] (4) When building the next window, an overlapping strategy is adopted: backtrack to the middle position of the current window, and start accumulating clusters from that position to build a new window;
[0079] (5) Repeat steps (2)-(4) until all trajectory points of the entire trajectory are covered.
[0080] The window construction method provided in this embodiment of the invention allows segment boundaries to be naturally aligned with behavior transition points. The number of clusters contained in each window varies depending on the density and size of the clusters. Dense large clusters may constitute a window on their own, while multiple small clusters may be combined into a window. The overlap between windows ensures the continuity of segment boundaries and avoids abrupt changes at window intersections.
[0081] It should be noted that the segmentation results of the embodiments of the present invention meet the following constraints: the segments of the same source trajectory do not overlap in time and are ordered in time, and each segment maintains behavioral continuity.
[0082] Specifically, the segmented results are manually annotated to obtain the manually annotated results, including:
[0083] The segmentation results are displayed in line form using a map component;
[0084] By selecting segmented lines to trigger segment selection events, and selecting corresponding behavior labels in the segment selection events based on the spatiotemporal characteristics and behavioral semantics of the trajectory, manual annotation results are obtained.
[0085] In this embodiment of the invention, manual annotation is achieved through a map visualization interface; behavioral tags are defined according to the application scenario, for example: fishery activity identification scenarios include fishing operations, navigation, anchoring, entering port, leaving port, etc.; cargo ship monitoring scenarios include normal navigation, waiting to enter port, berthing operations, slow movement, etc.
[0086] It should be noted that, in the embodiments of the present invention, when manual annotation is performed, the map visualization interface supports multi-scale interactive operations such as zooming and panning, allowing users to observe the spatial distribution pattern and motion characteristics of the trajectory from macro to micro.
[0087] In this embodiment of the invention, a key segment annotation strategy is adopted when performing manual annotation. Key segments include: segments near the seven points of the trajectory and the endpoint, which usually correspond to fixed behavior patterns such as entering and leaving ports; segments near obvious behavior transition points, representing the switching between different behavior patterns; and representative segments of typical behavior patterns, such as typical berthing patterns and typical navigation patterns. When the user clicks the "Start Annotation" button through the map visualization interface to enter the annotation mode, selects navigation as the annotation category, and clicks the target segment on the map to annotate. After the annotation is completed, the annotation source is manually selected. The user continues to manually annotate other key segments, following the key segment annotation strategy, focusing on annotating the trajectory start and end points, behavior transition points, and representative segments of typical behavior patterns.
[0088] It should be noted that the manual annotation in this embodiment of the invention is not applied to all segments, but only to key segments.
[0089] This invention establishes a priority management mechanism. For the same segment, if both manual and automatic annotations exist, the system only retains and displays the manual annotation results. In subsequent automatic inference processes, segments with existing manual annotations will not be overwritten by the automatic inference results. For segments with existing manual annotations, if the user clicks on the annotation again, the system prompts whether to modify the annotation. After the user confirms, the annotation information is updated.
[0090] Specifically, multidimensional spatiotemporal features include:
[0091] The time dynamic features, consisting of average velocity, velocity standard deviation, velocity change frequency, and average acceleration, are used to characterize the changes in the segmented motion state.
[0092] Spatial pattern features, consisting of trajectory curvature, convex hull area, local point density, and heading change pattern, are used to characterize the spatial morphological features of segments.
[0093] Specifically, the calculation process for multidimensional spatiotemporal features is as follows:
[0094] Average velocity, which is the average of the velocities of all trajectory points within a segment, is given by the formula:
[0095] ;
[0096] in, Indicates average speed. Indicates the first The velocity of each trajectory point Indicates the number of trajectory points;
[0097] The standard deviation of velocity is used to reflect the degree of fluctuation in velocity within a segment, and the formula is:
[0098] ;
[0099] in, Indicates the standard deviation of velocity;
[0100] The frequency of velocity change is the number of times the velocity change of adjacent points exceeds a threshold, and it is used to reflect the drasticness of the velocity change.
[0101] The average acceleration, which is the average value of the acceleration within a segment, is given by the formula:
[0102] ;
[0103] in, Indicates average acceleration;
[0104] Track curvature, used to reflect the degree of curvature of a track, is defined as the ratio of the actual length of the track to the straight-line distance between the start and end points. The formula is:
[0105] ;
[0106] in, Indicates the curvature of the trajectory. Indicates the actual length of the trajectory. This represents the straight-line distance between the start and end points. If the trajectory curvature is greater than 1, it indicates that the trajectory is curved or reciprocating. If the trajectory curvature is close to 1, it indicates that the trajectory is close to a straight line.
[0107] The convex hull area is the minimum convex hull area of the segmented trajectory point set, which is used to reflect the spatial coverage of the trajectory.
[0108] Local point density, used to reflect the distribution density of trajectory points per unit area, is expressed by the following formula:
[0109] ;
[0110] in, Indicates the number of trajectory points within a segment;
[0111] The heading change pattern refers to the statistical characteristics of the heading angle change, such as the heading standard deviation and the maximum turning angle, which are used to reflect the direction change pattern of the trajectory.
[0112] Specifically, automatic label inference for unlabeled segments in the segmentation results based on multidimensional spatiotemporal features can be achieved through one or more of the following strategies:
[0113] 1. Intra-track label inheritance strategy:
[0114] For unlabeled segments within the same cluster, calculate their temporal distance from labeled segments, and inherit the label of the labeled segment with the smallest temporal distance. The calculation formula is as follows:
[0115] ;
[0116] in, Indicates time distance, , These represent unmarked segments. start time, end time , These represent the labeled segments. The start time and end time;
[0117] This strategy is based on the assumption that behavioral patterns in adjacent time periods within the same trajectory are usually correlated.
[0118] 2. Label propagation strategy based on feature similarity:
[0119] First, the eigenvectors are normalized to obtain the normalized eigenvectors. :
[0120] ;
[0121] in, and The first The mean and standard deviation of each feature across all segments;
[0122] Then calculate the weighted Euclidean distance:
[0123] ;
[0124] in, For the first The weights of each feature satisfy... The weights can be determined by feature importance assessment or information gain method, and higher weights can be assigned to features with high discriminative power.
[0125] Feature similarity is defined as:
[0126] ;
[0127] Similarity value at Within the interval, the larger the value, the more similar the behavioral characteristics of the two segments are. The label of the labeled segment with the highest similarity is selected as the candidate label.
[0128] 3. Cluster-based label diffusion strategy:
[0129] Perform K-means clustering or DBSCAN clustering on the feature vectors of all segments, using labeled segments as seed points to spread labels to unlabeled segments within the same cluster. This strategy can effectively utilize the global similarity relationship between segments.
[0130] Specifically, the expression for calculating the confidence level of the inference result is:
[0131] ;
[0132] in, Indicates the confidence level. Indicates the maximum similarity. The standard deviation of the top-k similarity is represented by the following: This represents the average of the top-k similarities.
[0133] In this embodiment of the invention, the confidence formula comprehensively considers the highest similarity and the stability of the similarity distribution. When the highest similarity is high and the top-k similarity distribution is concentrated, the confidence is high; when... When the label is valid, it is recorded as an automatic label. This mechanism ensures the reliability of the automatic inference results and avoids incorrect labels with low confidence.
[0134] In this embodiment of the invention, the inference result includes information such as segment identifier, label, annotation source, and confidence level.
[0135] Specifically, step 5 includes:
[0136] The annotation coverage is calculated using the following expression:
[0137] ;
[0138] in, Indicates the annotation coverage. This indicates that the number of segments has been marked. Indicates the total number of segments;
[0139] The calculation expression for manually marking the scale is:
[0140] ;
[0141] in, This indicates that the scale was manually marked. This indicates the number of manually labeled segments;
[0142] The label distribution balance is calculated using entropy, and the expression is:
[0143] ;
[0144] in, This represents the entropy value. A larger entropy value indicates a more balanced label distribution, meaning a higher degree of label distribution balance. Indicates the number of label categories. Indicates the first The segmentation ratio of class tags;
[0145] The segmentation results are corrected and supplemented by adjusting the annotation coverage, the proportion of manually labeled items, and the evenness of label distribution. Steps 3 and 4 are repeated to achieve iterative optimization until... Furthermore, the labels are distributed reasonably, so optimization is stopped, and the trajectory labeling results of the moving target are obtained. The trajectory labeling results include segment identifiers, label types, label sources, and confidence information.
[0146] This invention acquires the original trajectory data of a moving target; it uses a spatiotemporal clustering method to cluster the original trajectory data, obtaining multiple clusters, and combines an adaptive sliding window to segment the trajectory in all clusters, obtaining segmentation results; it manually labels the segmentation results, obtaining manually labeled results, and uses the manually labeled results as prior knowledge to extract features from the segmentation results, obtaining multidimensional spatiotemporal features; based on the multidimensional spatiotemporal features, it automatically infers labels for unlabeled segments in the segmentation results, obtaining inference results, and calculates the confidence level of the inference results; it optimizes the inference results based on the confidence level, obtaining the trajectory labeling results of the moving target; compared with the prior art, this invention improves the labeling level from point level to segment level through a collaborative mechanism of "trajectory segmentation + manual labeling + label inference", significantly improving labeling efficiency while ensuring labeling accuracy.
[0147] Corresponding to the trajectory segmentation and annotation method described in the above embodiments, such as Figure 2 As shown, this embodiment of the invention also provides a trajectory segmentation and annotation device 100, which includes:
[0148] The acquisition module 101 is used to acquire the original trajectory data of the moving target;
[0149] The segmentation module 102 is used to cluster the original trajectory data using a spatiotemporal clustering method to obtain multiple clusters, and to segment the trajectory in all clusters using an adaptive sliding window to obtain the segmentation result.
[0150] Extraction module 103 is used to manually annotate the segmented results, obtain manually annotated results, and use the manually annotated results as prior knowledge to extract features from the segmented results to obtain multi-dimensional spatiotemporal features;
[0151] The inference module 104 is used to automatically infer labels for unlabeled segments in the segmentation results based on multidimensional spatiotemporal features, obtain inference results, and calculate the confidence level of the inference results;
[0152] The optimization module 105 is used to optimize the inference results based on the confidence level to obtain the trajectory labeling results of the moving target.
[0153] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0154] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0155] This invention also provides a terminal device, such as... Figure 3 As shown, the terminal device D10 of this embodiment includes: at least one processor D100 ( Figure 3 The diagram shows only one processor, a memory D101, and a computer program D102 stored in the memory D101 and executable on the at least one processor D100. When the processor D100 executes the computer program D102, it implements the trajectory segmentation annotation method described above.
[0156] The terminal device D10 can be a desktop computer, laptop, handheld computer, server, server cluster, or cloud server, etc. This terminal device may include, but is not limited to, a processor D100 and a memory D101. Those skilled in the art will understand that... Figure 3This is merely an example of terminal device D10 and does not constitute a limitation on terminal device D10. It may include more or fewer components than shown in the figure, or combine certain components, or different components, such as input / output devices, network access devices, etc.
[0157] The processor D100 can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0158] In some embodiments, the memory D101 may be an internal storage unit of the terminal device D10, such as a hard disk or memory of the terminal device D10. In other embodiments, the memory D101 may be an external storage device of the terminal device D10, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the terminal device D10. Furthermore, the memory D101 may include both internal and external storage units of the terminal device D10. The memory D101 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory D101 can also be used to temporarily store data that has been output or will be output.
[0159] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0160] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0161] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements a trajectory segmentation annotation method.
[0162] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to a building device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks.
[0163] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A trajectory segmentation and annotation method, characterized in that, include: Step 1: Obtain the raw trajectory data of the moving target; Step 2: The original trajectory data is clustered using a spatiotemporal clustering method to obtain multiple clusters. An adaptive sliding window is then used to segment the trajectories within all clusters, including: Arrange the trajectory points in chronological order to form an ordered sequence. And label the cluster to which each trajectory point belongs; Segmented windows are constructed using permutation-cumulative clustering, with a window length threshold set as follows. The threshold The segmented window is dynamically determined based on the total length of the trajectory. The process of constructing the segmented window is as follows: (1) Starting with the first cluster, add all trajectory points contained in it to the current window; (2) Increment the subsequent clusters and their contained trajectory points in turn until the total number of trajectory points in the current window reaches or exceeds the threshold. ; (3) Mark the current window as a segment. Record the sequence of trajectory points contained in the segment and the cluster identifier to which it belongs; (4) When building the next window, an overlapping strategy is adopted: backtrack to the middle position of the current window, and start accumulating clusters from that position to build a new window; (5) Repeat steps (2)-(4) until all trajectory points of the entire trajectory are covered to obtain the segmentation result; Step 3: Manually annotate the segmented results to obtain manually annotated results, and use the manually annotated results as prior knowledge to extract features from the segmented results to obtain multidimensional spatiotemporal features; Step 4: Based on multidimensional spatiotemporal features, perform automatic label inference on the unlabeled segments in the segmentation results to obtain the inference results, and calculate the confidence level of the inference results; Step 5: Optimize the inference result based on the confidence level to obtain the trajectory labeling result of the moving target.
2. The trajectory segmentation and annotation method according to claim 1, characterized in that, Before clustering the original trajectory data using a spatiotemporal clustering method, the following steps are also included: The original trajectory data is preprocessed to obtain preprocessed trajectory data.
3. The trajectory segmentation and annotation method according to claim 2, characterized in that, The original trajectory data was clustered using a spatiotemporal clustering method, resulting in multiple clusters, including: The spatiotemporal distance between any two trajectory points in the preprocessed trajectory data is calculated based on the ST-DBSCAN spatiotemporal clustering algorithm. Based on the spatiotemporal distance, the trajectory points in the preprocessed trajectory data are clustered to obtain multiple clusters.
4. The trajectory segmentation and annotation method according to claim 3, characterized in that, The expression for calculating the spatiotemporal distance between any two trajectory points in the preprocessed trajectory data based on the ST-DBSCAN spatiotemporal clustering algorithm is as follows: ; in, Represents two trajectory points , The spatiotemporal distance between them Represents two trajectory points , Geographical distance between them Represents the spatial neighborhood radius. Represents the time neighborhood radius. , Representing trajectory points respectively , Timestamp.
5. The trajectory segmentation and annotation method according to claim 3, characterized in that, The segmentation results are manually annotated to obtain the manually annotated results, including: The segmentation results are displayed in line form using a map component; By selecting segmented lines to trigger segment selection events, and selecting corresponding behavior labels in the segment selection events based on the spatiotemporal characteristics and behavioral semantics of the trajectory, manual annotation results are obtained.
6. The trajectory segmentation and annotation method according to claim 5, characterized in that, The multidimensional spatiotemporal features include: The time-dynamic characteristics consist of average velocity, velocity standard deviation, velocity change frequency, and average acceleration; Spatial pattern features consisting of trajectory curvature, convex hull area, local point density, and heading variation pattern.
7. The trajectory segmentation and annotation method according to claim 1, characterized in that, The expression for calculating the confidence level of the inference result is as follows: ; in, Indicates the confidence level. Indicates the maximum similarity. The standard deviation of the top-k similarity is represented by the following: This represents the average of the top-k similarities.
8. A trajectory segmentation and annotation device, characterized in that, include: The acquisition module is used to acquire the raw trajectory data of the moving target; The segmentation module is used to cluster the original trajectory data using a spatiotemporal clustering method to obtain multiple clusters, and then uses an adaptive sliding window to segment the trajectory within all clusters, including: Arrange the trajectory points in chronological order to form an ordered sequence. And label the cluster to which each trajectory point belongs; Segmented windows are constructed using permutation-cumulative clustering, with a window length threshold set as follows. The threshold The segmented window is dynamically determined based on the total length of the trajectory. The process of constructing the segmented window is as follows: (1) Starting with the first cluster, add all trajectory points contained in it to the current window; (2) Increment the subsequent clusters and their contained trajectory points in turn until the total number of trajectory points in the current window reaches or exceeds the threshold. ; (3) Mark the current window as a segment. Record the sequence of trajectory points contained in the segment and the cluster identifier to which it belongs; (4) When building the next window, an overlapping strategy is adopted: backtrack to the middle position of the current window, and start accumulating clusters from that position to build a new window; (5) Repeat steps (2)-(4) until all trajectory points of the entire trajectory are covered to obtain the segmentation result; The extraction module is used to manually annotate the segmented results to obtain manually annotated results, and use the manually annotated results as prior knowledge to extract features from the segmented results to obtain multidimensional spatiotemporal features; The inference module is used to automatically infer labels for unlabeled segments in the segmentation results based on multidimensional spatiotemporal features, obtain inference results, and calculate the confidence level of the inference results; An optimization module is used to optimize the inference result based on the confidence level to obtain the trajectory labeling result of the moving target.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the trajectory segmentation annotation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the trajectory segmentation annotation method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
An indoor semantic trajectory labeling and completion method in a low sampling location environment
CN109190656A
Data annotation method and system based on user behavior and attention tracking
CN120929832A