Track classification method and device, equipment, storage medium and product
By extracting the trajectory point sequence from the trajectory of the moving object, using the feature extraction layer and decoder in the classification model, and combining the terrain type information for trajectory classification, the problem of low trajectory classification accuracy in the existing technology is solved, and higher classification accuracy is achieved.
Patent Information
- Application Number
- CN202510542528.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-08-15
AI Technical Summary
When facing multi-objective classification and large-scale data processing, the existing trajectory recognition technology has a high misjudgment rate and low trajectory classification accuracy, especially in complex scenarios.
By extracting the trajectory point sequence from the trajectory of the moving object, using the feature extraction layer in the classification model to extract the feature vectors and dependencies, combining the terrain type information, using the first and second decoders for trajectory classification, and determining the type of the moving object.
The accuracy of trajectory classification is improved, and it can better distinguish confusing targets, comprehensively consider the overall pattern and local behavior of moving objects, and improve classification accuracy.
Smart Images

Figure CN120493052A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a trajectory classification method, apparatus, device, storage medium, and product. Background Art
[0002] With the development of technology, it is now possible to collect a variety of trajectories, providing an important basis for improving traffic management and public safety. The large number of trajectories requires corresponding trajectory recognition technology. Trajectory recognition technology collects, processes, and analyzes the continuous position information of moving objects to restore their movement paths and discover their behavioral characteristics. Trajectory recognition technology automatically identifies and categorizes motion patterns based on the characteristics of spatiotemporal trajectories, thereby converting discrete spatiotemporal data into interpretable motion patterns.
[0003] Existing methods are mostly based on static trajectory analysis or shallow machine learning models, which struggle to effectively handle environmental interference. This is particularly true for multi-target classification with multiple targets and real-time processing of large amounts of data. In complex scenarios, the misclassification rate is high, and trajectory classification accuracy is low. Summary of the Invention
[0004] The embodiments of the present application provide a trajectory classification method, apparatus, device, storage medium, and product, which can improve the accuracy of trajectory classification.
[0005] In a first aspect, the present application provides a trajectory classification method, the method comprising:
[0006] Extracting a corresponding trajectory point sequence from the trajectory of the moving object;
[0007] Using the feature extraction layer in the classification model to extract the feature vectors of the trajectory point sequence and the dependency relationship between the feature vectors to obtain trajectory feature information;
[0008] The first decoder in the prediction layer of the classification model is used to parse the trajectory feature information to obtain a first object type corresponding to the trajectory; the second decoder in the prediction layer of the classification model is used to parse the trajectory feature information based on the first object type to obtain a second object type corresponding to each sub-trajectory in the trajectory; and the moving object type of the trajectory is determined based on the first object type and each of the second object types.
[0009] In some possible implementations, before utilizing a first decoder in a prediction layer in a classification model to parse the trajectory feature information to obtain a first object class corresponding to the trajectory, the method further includes:
[0010] Obtaining information about the type of terrain passed by the moving object;
[0011] determining a motion region type label of the motion object according to the terrain type information;
[0012] The utilizing a first decoder in a prediction layer in a classification model to parse the trajectory feature information to obtain a first object type corresponding to the trajectory includes:
[0013] Parsing the motion region type label using a first decoder in a prediction layer in a classification model to obtain object type bias information;
[0014] The first decoder is used to parse the trajectory feature information based on the object type bias information to obtain a first object type corresponding to the trajectory.
[0015] In some possible implementations, the terrain type information includes water area information and / or land area information, and determining the motion region type label of the moving object based on the terrain type information includes:
[0016] When the terrain type information only includes water area information, determining the movement area type label of the movement object as a water transport object;
[0017] When the terrain type information includes only land information, determining the motion region type label of the motion object as a land object;
[0018] In a case where the terrain type information includes land information and water area information, it is determined that the motion region type label of the motion object is a flying object.
[0019] In some possible implementations, extracting a corresponding trajectory point sequence from the trajectory of the moving object includes:
[0020] Get the trajectory of the moving object;
[0021] Extracting a position sequence of the moving object in the trajectory, the position sequence comprising a plurality of position points, each of the position points comprising position information corresponding to the moving object and a corresponding timestamp;
[0022] embedding virtual trajectory points between different position points of the moving object according to the position sequence to determine a plurality of trajectory points corresponding to the moving object;
[0023] A trajectory point sequence corresponding to the moving object is obtained according to the multiple trajectory points and the timestamps corresponding to the trajectory points.
[0024] In some possible implementations, embedding virtual trajectory points between different position points of the moving object according to the position sequence to determine a plurality of trajectory points corresponding to the moving object includes:
[0025] generating virtual trajectory points between each of the position points according to the spatiotemporal intervals between each of the position points and the corresponding adjacent position points;
[0026] A plurality of trajectory points corresponding to the moving object are determined according to each of the position points and the virtual trajectory points.
[0027] In some possible implementations, the feature extraction layer includes at least one self-attention module. The feature extraction layer in the classification model is used to extract feature vectors of the trajectory point sequence and dependencies between the feature vectors to obtain trajectory feature information, including:
[0028] Processing the time information and space information in the trajectory point sequence to construct a spatiotemporal relationship matrix of the trajectory points;
[0029] The following steps are performed in sequence according to each self-attention module in the feature extraction layer: multi-head self-attention calculation is performed on the spatiotemporal relationship matrix to obtain spatiotemporal key information; the spatiotemporal relationship matrix and the spatiotemporal key information are processed by a feedforward neural network in the self-attention module to obtain spatiotemporal relationship features;
[0030] The spatiotemporal relationship feature is used as trajectory feature information corresponding to the trajectory.
[0031] In some possible implementations, before extracting the feature vectors of the trajectory point sequence and the dependency relationship between the feature vectors using the feature extraction layer in the classification model to obtain trajectory feature information, the method further includes:
[0032] Acquire a training sample set, the training sample set including a plurality of training samples, each of the training samples including a historical trajectory of a moving object sample and a corresponding trajectory type label;
[0033] For each training sample, perform the following steps:
[0034] Inputting the historical trajectory into the feature extraction layer of the preset classification model to obtain historical feature information corresponding to the historical trajectory;
[0035] The historical feature information is parsed by a first decoder and a second decoder in a preset classification model to obtain a trajectory type prediction result corresponding to the historical trajectory;
[0036] Determining a total loss function value of the preset classification model according to the trajectory type prediction result and the trajectory type label;
[0037] When the total loss function value does not meet the training stop condition, the model parameters of the preset classification model are adjusted, and the preset classification model after the training parameters are adjusted is trained using the training sample set until the training stop condition is met, thereby obtaining the trained classification model.
[0038] In some possible implementations, parsing the historical feature information using the first decoder and the second decoder in the preset classification model to obtain a trajectory type prediction result corresponding to the historical trajectory includes:
[0039] Parsing the historical feature information through a first decoder in a preset classification model to obtain an object type prediction result corresponding to the historical trajectory and an object type label corresponding to each sub-trajectory in the historical trajectory;
[0040] Based on the object type prediction result, the historical feature information is parsed by a second decoder in a preset classification model to obtain a label prediction result corresponding to each sub-track in the historical track;
[0041] Obtaining a trajectory type prediction result corresponding to the historical trajectory according to the object type prediction result and each of the label prediction results;
[0042] Determining the total loss function value of the preset classification model according to the trajectory type prediction result and the trajectory type label includes:
[0043] Obtaining a first loss value according to a difference between the trajectory type prediction result and the trajectory type label;
[0044] Obtaining a second loss value based on the difference between each of the label prediction results and the corresponding object type label;
[0045] The total loss function value of the preset classification model is calculated based on the first loss value and the second loss value.
[0046] In some possible implementations, calculating the total loss function value of the preset classification model based on the first loss value and the second loss value includes:
[0047] Obtaining a preset weight for a second loss value;
[0048] Calculating the product of the second loss value and the preset weight;
[0049] The total loss function value of the preset classification model is obtained according to the sum of the product and the first loss value.
[0050] In a second aspect, the present application provides a trajectory classification device, comprising:
[0051] An extraction module, used to extract a corresponding trajectory point sequence from the trajectory of the moving object;
[0052] The extraction module is further configured to extract the feature vectors of the trajectory point sequence and the dependency relationship between the feature vectors using the feature extraction layer in the classification model to obtain trajectory feature information;
[0053] a parsing module, configured to parse the trajectory feature information using a first decoder in a prediction layer in a classification model to obtain a first object type corresponding to the trajectory; parse the trajectory feature information based on the first object type using a second decoder in the prediction layer in the classification model to obtain a second object type corresponding to each sub-trajectory in the trajectory; and determine a moving object type of the trajectory based on the first object type and each of the second object types.
[0054] In a third aspect, the present application provides a trajectory classification device, comprising: a processor, and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the trajectory classification method described above.
[0055] In a fourth aspect, the present application provides a computer-readable storage medium having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, the trajectory classification method as described above is implemented.
[0056] In a fifth aspect, the present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device performs the trajectory classification method described above.
[0057] The trajectory classification method, apparatus, device, storage medium and product provided in the embodiments of the present application extract the corresponding trajectory point sequence from the trajectory of the moving object, and then use the feature extraction layer in the classification model to extract the feature vectors of the trajectory point sequence and the dependency relationship between the feature vectors to obtain trajectory feature information, and then use the first decoder to parse the trajectory feature information to obtain the first object type corresponding to the trajectory; use the second decoder to parse the trajectory feature information based on the first object type to obtain the second object type corresponding to each sub-trajectory in the trajectory, and finally determine the moving object type of the trajectory. In this way, based on the classification result of the first decoder with high accuracy that integrates global information, the process of classifying each sub-trajectory in the trajectory in the second decoder is constrained, thereby comprehensively considering the overall pattern and local behavior of the moving object, better distinguishing various easily confused targets, and improving the accuracy of trajectory classification. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] The present application can be better understood from the following description of specific embodiments of the present application in conjunction with the accompanying drawings, in which:
[0059] Other features, objects and advantages of the present application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings, in which the same or similar reference numerals represent the same or similar features.
[0060] Figure 1 This is a flow chart of a vehicle trajectory classification method provided by one embodiment of the present application;
[0061] Figure 2 is a flow chart of a vehicle trajectory classification method provided by another embodiment of the present application;
[0062] Figure 3 This is a flowchart of model training provided by an embodiment of the present application;
[0063] Figure 4 This is a flowchart of a self-attention mechanism provided by an embodiment of the present application;
[0064] Figure 5 This is a flow chart of a self-attention module provided by one embodiment of the present application;
[0065] Figure 6 This is a schematic diagram of the overall flow of model processing provided by one embodiment of the present application;
[0066] Figure 7 This is a schematic diagram of a pre-classification process provided by an embodiment of the present application;
[0067] Figure 8 is a structural diagram of a trajectory classification device provided by another embodiment of the present application;
[0068] Figure 9 Schematic diagram of the hardware structure of the trajectory classification device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0069] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is merely to provide a better understanding of the present application by illustrating the examples of the present application.
[0070] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, the elements defined by the phrase "comprising..." do not exclude the presence of other identical elements in the process, method, article, or device comprising the elements.
[0071] Trajectory: A trajectory is a sequence of geometric positions with timestamps. The discrete representation of a trajectory is a series of two-tuples. The position vector Indicates that at timestamp t j The location point at the moment, Through time t j To sort, for t j ≤t j+1 Due to the sampling nature of the position acquisition technique, trajectory data are sampled at discrete time stamps.
[0072] Trajectory Segmentation: Trajectory segmentation is to divide a trajectory into disjoint segments according to certain criteria (such as time interval, trajectory shape, or semantics) in order to extract richer knowledge from trajectory data.
[0073] Transformer: A deep learning architecture based on the self-attention mechanism, designed specifically for processing sequence data and built on the self-attention mechanism.
[0074] In order to solve the problems of the prior art, the embodiments of the present application provide a trajectory classification method, apparatus, device, storage medium and product. The trajectory classification method provided by the embodiments of the present application is first introduced below.
[0075] Figure 1 FIG. 1 is a flow chart of a trajectory classification method provided by an embodiment of the present application. Figure 1 As shown, the method may include the following steps: S101 to S103.
[0076] S101: extracting a corresponding trajectory point sequence from the trajectory of the moving object.
[0077] In practice, a trajectory is a record of the spatial position of a moving object over a period of time, typically a continuous sequence of multiple position points. All trajectory points are identified and extracted from the input data. Each trajectory point typically includes spatial coordinates and a timestamp. The extraction process involves reading the moving object's historical position data from the data source, arranging this data in chronological order, and extracting the corresponding trajectory point sequence. The extracted trajectory point sequence is stored as a list or array, with each point containing the specific spatial position and time information.
[0078] S102: Utilizing the feature extraction layer in the classification model to extract feature vectors of the trajectory point sequence and the dependency relationship between the feature vectors, to obtain trajectory feature information.
[0079] In practice, the feature extraction layer is the part of the classification model responsible for extracting useful features from the raw input data. In deep learning models, the feature extraction layer typically consists of a series of convolutional layers and fully connected layers. Its purpose is to convert input data (such as a sequence of trajectory points) into a more representative feature vector for subsequent learning and reasoning.
[0080] At this stage, the trajectory point sequence is processed by the classification model's feature extraction layer. Specifically, the feature extraction layer extracts one or more feature vectors from the original trajectory point sequence through a series of mathematical operations. Feature vectors are high-dimensional representations of the trajectory point sequence and contain key attribute information about the trajectory. Because dependencies often exist between trajectory points, the feature extraction layer not only extracts the features of each trajectory point but also needs to capture the temporal dependencies between these feature points. After processing by the feature extraction layer, the model outputs a set of feature vectors representing the trajectory. These feature vectors are known as "trajectory feature information." This information contains the multidimensional characteristics of the trajectory and can be used for subsequent classification or prediction.
[0081] S103: Utilize the first decoder in the prediction layer of the classification model to parse the trajectory feature information and obtain a first object type corresponding to the trajectory. Utilize the second decoder in the prediction layer of the classification model to parse the trajectory feature information based on the first object type and obtain a second object type corresponding to each sub-trajectory in the trajectory. Determine the moving object type of the trajectory based on the first object type and each second object type.
[0082] In a specific implementation, the prediction layer is part of the classification model and is responsible for converting the feature vector into the final output. The prediction layer is usually composed of a series of decoders, which are responsible for performing reverse reasoning from the extracted feature information to output a specific classification result. The task of the first decoder in the prediction layer is to parse the first object type corresponding to the trajectory based on the extracted trajectory feature information. For example, assuming that the moving objects corresponding to the trajectory have different types (such as "vehicle", "pedestrian", etc.), the first decoder will determine these types based on the trajectory feature information.
[0083] The first decoder processes the trajectory features through a series of operations and ultimately outputs a classification result. This output is typically a probability distribution, representing the probability of each object type. The model selects the object type with the highest probability as the final output. Ultimately, the first decoder outputs a label or category, indicating the primary object type to which the trajectory belongs. For example, the output might be "pedestrian" or "car."
[0084] The second decoder's primary task is to further refine the analysis of each sub-track within the trajectory, based on the first object type obtained by the first decoder, to determine the second object type for each sub-track. The second decoder utilizes this information from the first object type to perform a more detailed analysis of the trajectory. Depending on the output of the first decoder, the second decoder will employ different processing strategies. Through the second decoder's processing, each sub-track within the trajectory will be classified as a different object type, and the second decoder will output the specific category for each sub-track. Based on this information from the first and second object types, the moving object type of the trajectory can be integrated and determined.
[0085] The trajectory classification method provided by the embodiment of the present application extracts the corresponding trajectory point sequence from the trajectory of the moving object, and then uses the feature extraction layer in the classification model to extract the feature vectors of the trajectory point sequence and the dependency relationship between the feature vectors to obtain trajectory feature information, and then uses the first decoder to parse the trajectory feature information to obtain the first object type corresponding to the trajectory; uses the second decoder to parse the trajectory feature information based on the first object type to obtain the second object type corresponding to each sub-trajectory in the trajectory, and finally determines the moving object type of the trajectory. In this way, based on the classification result of the first decoder with higher accuracy that integrates global information, the process of classifying each sub-trajectory in the trajectory in the second decoder is constrained, thereby comprehensively considering the overall pattern and local behavior of the moving object, better distinguishing various easily confused targets, and improving the accuracy of trajectory classification.
[0086] In order to accurately infer the type of moving object from the raw data, in some embodiments, reference Figure 2 Before S103 , the method may further include the following steps: S201 to S202 .
[0087] S201: Acquire information on the type of terrain that the moving object passes through.
[0088] A moving object is an object or entity that moves within a certain period of time. It can be a vehicle, pedestrian, aircraft, or other different types of objects. Terrain type information refers to the nature, structure, or characteristics of the different surfaces, areas, or scenes that the moving object passes through.
[0089] In a specific implementation, terrain-related information is obtained from external data sources. These data sources may include maps, satellite imagery, and other sources. Based on the external map data, the terrain type corresponding to the area where the moving object is located must be determined or obtained. The terrain features of each location point are extracted and labeled from the input geographic data, ultimately obtaining information about the terrain type that the moving object has passed through.
[0090] S202: Determine a motion region type label of the motion object according to the terrain type information.
[0091] The motion region type label is a classification result of further abstraction of terrain information. It indicates the nature of the region where the moving object is located.
[0092] In a specific implementation, the motion area where the moving object is located is determined according to the different terrain types it passes through, and the different terrain type information is mapped to a higher-level motion area type label.
[0093] S103 may include the following steps: S1031 to S1032.
[0094] S1031: Utilize the first decoder in the prediction layer of the classification model to parse the motion region type label to obtain object type bias information.
[0095] Object type bias information refers to a preliminary inference or biased judgment about the type of moving objects. It reflects the model's tendency to predict object types based on the motion region type label. For example, if the motion region label is "land area," the model may tend to predict the object types as "car" and "pedestrian."
[0096] In a specific implementation, the first decoder receives input data from a pre-determined "motion region type label." This label contains the type of geographic region in which the moving object resides. The first decoder analyzes the input label to infer bias information about the object type. Using the neural network structure of the classification model, the first decoder calculates the relevant bias for each object type.
[0097] S1032: Utilize the first decoder to parse the trajectory feature information based on the object type bias information to obtain a first object type corresponding to the trajectory.
[0098] In its implementation, the first decoder uses both object type bias information and trajectory feature information for analysis. Using a deep neural network, the first decoder combines this information with trajectory features to infer the specific moving object type. The output of the first decoder is the final "first object type," or the specific classification label for the moving object.
[0099] The above-mentioned implementation of the embodiment of the present application obtains the terrain type information passed by the moving object, infers the motion area type label, and then analyzes the object type bias information, and finally combines the trajectory feature information to make the final object type inference, so as to efficiently and accurately infer the type of the moving object from the original data.
[0100] In order to achieve rapid and automatic classification of sports area type labels, in some embodiments, the terrain type information includes water area information and / or land information. S202 may include the following steps: S2021 to S2023.
[0101] S2021: When the terrain type information only includes water area information, determine that the motion area type label of the motion object is a water transport object.
[0102] Water body information refers to the water bodies in a terrain area, usually rivers, lakes, oceans, etc. Water transport objects refer to objects that only operate on water bodies, such as ships.
[0103] In practice, water area information is typically obtained from external data sources. If the terrain information indicates the current area is an ocean, lake, river, or similar, and no significant land features are detected, the area is considered "water area." If a moving object is located solely in water areas, the object is labeled "water-borne object."
[0104] S2022: When the terrain type information only includes land information, determine the motion region type label of the motion object as a land object.
[0105] Land information refers to the land portion of a terrain area, including forests, mountains, plains, deserts, and other landforms. Land objects refer to objects that move on land, typically cars, motorcycles, pedestrians, and so on.
[0106] In a specific implementation, ground information can be obtained through satellite imagery or ground sensors. The terrain type information is checked. If the information only contains land, the moving object is assigned a "land object" label. In other words, if there is no water within the moving object's trajectory, the label is determined to be "land object."
[0107] S2023: When the terrain type information includes land information and water area information, determine that the motion region type label of the motion object is a flying object.
[0108] In a specific implementation, a flying object refers to an object capable of moving in the air, such as an airplane or helicopter. If the trajectory of a moving object contains both land and water information, it indicates that the moving object can move between these areas, and the moving object is labeled as a "flying object."
[0109] The above-mentioned implementation method of the embodiment of the present application identifies the moving object as a "water transport object" when the terrain type information only includes water areas; identifies the moving object as a "land object" when the terrain type information only includes land; and identifies the moving object as a "flying object" when the terrain type information includes both water areas and land. The label of the moving object is determined based on different combinations of terrain information, and fast and automatic classification is achieved using data analysis and judgment logic.
[0110] In order to supplement the spatial and temporal integrity of the acquired trajectory data, in some embodiments, S101 may include the following steps: S1011 to S1014.
[0111] S1011: Obtain the trajectory of the moving object.
[0112] In a specific implementation, real-time data of a moving object is collected to obtain the trajectory of the moving object.
[0113] S1012: Extracting a position sequence of the moving object in the trajectory, where the position sequence includes a plurality of position points, each of which includes position information corresponding to the moving object and a corresponding timestamp.
[0114] In the implementation, each location point and its corresponding timestamp are extracted from the acquired trajectory data to obtain the position sequence of the moving object. Trajectory data consists of multiple sampling points, each of which contains the location and time of the moving object at a specific moment. Each location point consists of coordinates that describe the spatial position of the moving object at a specific time. The timestamp records the acquisition time of each location point.
[0115] S1013: embedding virtual trajectory points between different position points of the moving object according to the position sequence, and determining a plurality of trajectory points corresponding to the moving object.
[0116] In practice, virtual trajectory points are generated through interpolation. Virtual trajectory points are inserted into an existing position sequence to increase the density of trajectory data, improving trajectory smoothness and accuracy. If the sampling frequency of the position sequence is low, one or more virtual trajectory points are calculated between two adjacent actual position points using existing data points through interpolation.
[0117] S1014: Obtain a trajectory point sequence corresponding to the moving object according to the multiple trajectory points and the timestamps corresponding to the respective trajectory points.
[0118] In the specific implementation, all actual trajectory points and inserted virtual trajectory points are combined and sorted by timestamp to form a complete trajectory point sequence. Each trajectory point in the trajectory point sequence contains a combination of position and time, indicating the specific position of the moving object at each moment.
[0119] The above-mentioned implementation method of the embodiment of the present application obtains the trajectory data of the moving object through a sensor or positioning device, extracts a position sequence containing position information and timestamps from the trajectory data, inserts virtual trajectory points between adjacent actual position points, increases the accuracy and density of the trajectory, sorts all position points and timestamps, and generates a complete trajectory point sequence, thereby supplementing the spatial and temporal integrity of the acquired trajectory data.
[0120] In order to obtain a complete sequence of moving object trajectory points, in some implementations, S1013 may include the following steps: S10131 to S10132.
[0121] S10131: Generate virtual trajectory points between each position point according to the spatiotemporal interval between each position point and its corresponding adjacent position points.
[0122] In the implementation, the location points and their timestamps are first extracted from the trajectory data, and the temporal and spatial intervals between each adjacent location point are calculated. Based on the temporal and spatial intervals between adjacent location points, virtual trajectory points are generated using an interpolation method, such as linear interpolation or spline interpolation. The interpolated location and time points constitute a virtual trajectory point, and virtual trajectory points are continuously generated between each location point.
[0123] S10132: Determine multiple trajectory points corresponding to the moving object based on the various position points and virtual trajectory points.
[0124] In the specific implementation, after generating virtual trajectory points, all position points and the generated virtual trajectory points are collected together to form a data set containing all trajectory points. The trajectory points at this time include not only the actual position points (points collected by the sensor) but also virtual points (points generated by the interpolation algorithm), thereby determining multiple trajectory points corresponding to the moving object.
[0125] The above-mentioned implementation of the embodiment of the present application calculates the time and space intervals between adjacent position points and uses a suitable interpolation method to generate virtual trajectory points, thereby filling more details in the trajectory, bringing together all position points and virtual trajectory points, and sorting them in chronological order to finally obtain a complete sequence of trajectory points of the moving object.
[0126] In order to obtain accurate trajectory feature information, in some embodiments, the feature extraction layer includes at least one self-attention module, S102, which may include the following steps: S1021 to S1023.
[0127] S1021: Processing the time information and space information in the trajectory point sequence to construct a spatiotemporal relationship matrix of the trajectory points.
[0128] In the implementation, the timestamp and location coordinates of each trajectory point are extracted from the trajectory point sequence. This information is used to calculate the spatiotemporal relationships between the trajectory points. The time difference and spatial distance between any two trajectory points are calculated. The spatiotemporal relationships between all pairs of trajectory points are aggregated into a symmetric matrix, where each element represents the spatiotemporal relationship between two trajectory points, resulting in the spatiotemporal relationship matrix of the trajectory points.
[0129] S1022: Execute the following steps in sequence for each self-attention module in the feature extraction layer: Perform multi-head self-attention calculation on the spatiotemporal relationship matrix to obtain spatiotemporal key information. Process the spatiotemporal relationship matrix and spatiotemporal key information through the feedforward neural network in the self-attention module to obtain spatiotemporal relationship features.
[0130] In the specific implementation, the spatiotemporal relationship matrix is input into the self-attention module. In multi-head self-attention, we first map the spatiotemporal relationship matrix into multiple subspaces. A different attention head is used to calculate an attention score for each subspace, indicating the degree of dependence of a trajectory point on other trajectory points, thereby obtaining spatiotemporal key information. This spatiotemporal key information is then processed by a feedforward neural network. Feedforward neural networks typically contain multiple fully connected layers, which can further perform nonlinear mapping on the input information to extract the spatiotemporal relationship characteristics of the trajectory.
[0131] S1023: Using the spatiotemporal relationship feature as trajectory feature information corresponding to the trajectory.
[0132] In the specific implementation, after self-attention calculation and feedforward neural network processing, the obtained spatiotemporal relationship features are a deep representation of the complex relationship between trajectory points, and the spatiotemporal relationship features are used as the trajectory feature information corresponding to the trajectory.
[0133] The above-mentioned implementation of the embodiment of the present application extracts the time and space information of the trajectory points, constructs a time-space relationship matrix, obtains the relationship between the trajectory points, calculates the time-space key information through the self-attention mechanism, and further processes it using a feedforward neural network, thereby extracting the time-space characteristics of the trajectory and obtaining accurate trajectory feature information for subsequent tasks to be processed and analyzed.
[0134] In order to obtain a suitable classification model, in some embodiments, reference Figure 3Before S102 , the method may further include the following steps: S301 to S306 .
[0135] S301: Acquire a training sample set, where the training sample set includes multiple training samples, and each training sample includes a historical trajectory of a moving object sample and a corresponding trajectory type label.
[0136] In practice, the training sample set is a dataset used to train the classification model. It contains multiple training samples. Each training sample consists of two parts: a historical trajectory and a corresponding trajectory type label. A historical trajectory refers to the movement path of a moving object over a period of time. It typically includes spatial position data corresponding to multiple timestamps. The trajectory type label is a classification label for the historical trajectory, indicating the trajectory type.
[0137] For each training sample, perform the following steps:
[0138] S302: Input the historical trajectory into the feature extraction layer of the preset classification model to obtain historical feature information corresponding to the historical trajectory.
[0139] In the specific implementation, the historical trajectory is input into the feature extraction layer, and the patterns or rules hidden in the data are extracted from the historical trajectory to obtain the historical feature information corresponding to the historical trajectory.
[0140] S303: parsing the historical feature information through the first decoder and the second decoder in the preset classification model to obtain a trajectory type prediction result corresponding to the historical trajectory.
[0141] In a specific implementation, the input historical feature information is initially processed by the first decoder, which outputs a trajectory type prediction. The second decoder then makes further adjustments based on the first decoder's results to improve prediction accuracy, resulting in a trajectory type prediction corresponding to the historical trajectory.
[0142] S304: Determine a total loss function value of a preset classification model according to the trajectory type prediction result and the trajectory type label.
[0143] In the implementation, a loss function is calculated to measure the error between the predicted result and the true label. The loss function generates a numerical value based on the difference between the predicted result and the label, which represents the performance of the model on the current training sample.
[0144] S305: Determine whether the total loss function value of the preset classification model meets the preset training stop condition.
[0145] In the specific implementation, check whether the total loss function value meets the conditions for stopping training. For example, if the loss function value is small enough or the number of training times has reached the set maximum, then stop training; otherwise, proceed to the next step of adjustment.
[0146] S306: When the total loss function value does not meet the training stop condition, adjust the model parameters of the preset classification model, and use the training sample set to train the preset classification model with adjusted parameters until the training stop condition is met, thereby obtaining the trained classification model.
[0147] In practice, if the loss function value does not meet the stopping condition, the model will be further trained using the training sample set. In this process, the performance of the classification model is optimized by continuously adjusting the model parameters until the loss function value meets the set condition, resulting in a trained classification model.
[0148] The above implementation of the present application embodiment continuously adjusts the model parameters to enable the model to better learn from historical trajectory data and make accurate trajectory type predictions. By repeatedly executing the above steps, the performance of the classification model is gradually improved until the training stop condition is met, thereby obtaining a suitable classification model.
[0149] In order to obtain an accurate total loss function value, in some embodiments, S303 may include the following steps: S3031 to S3033.
[0150] S3031: parsing the historical feature information through a first decoder in a preset classification model to obtain an object type prediction result corresponding to the historical trajectory and an object type label corresponding to each sub-trajectory in the historical trajectory.
[0151] In a specific implementation, the first decoder receives input historical feature information and uses a multi-layer neural network to predict the object type for each historical trajectory. The first decoder also divides the entire trajectory into multiple sub-trajectories based on the historical feature information and assigns an object type label to each sub-trajectory.
[0152] S3032: Based on the object type prediction result, the historical feature information is parsed by a second decoder in the preset classification model to obtain a label prediction result corresponding to each sub-track in the historical track.
[0153] In a specific implementation, the second decoder analyzes the dynamic features of each sub-trajectory one by one based on the input historical features and object type prediction results, thereby predicting the label of each sub-trajectory and obtaining the label prediction results corresponding to each sub-trajectory in the historical trajectory.
[0154] S3033: Obtain a trajectory type prediction result corresponding to the historical trajectory based on the object type prediction result and each label prediction result.
[0155] In a specific implementation, the object type prediction result output by the first decoder and the sub-track label prediction results output by the second decoder are combined to obtain the type of the entire track.
[0156] S304 may include the following steps: S3041 to S3043.
[0157] S3041: Obtain a first loss value based on the difference between the trajectory type prediction result and the trajectory type label.
[0158] In the specific implementation, by comparing the error between the prediction result and the label, a loss function is used to quantify the error and obtain a first loss value. If the prediction is correct, the loss value is small; if the prediction is wrong, the loss value is large.
[0159] S3042: Obtain a second loss value based on the difference between each label prediction result and the corresponding object type label.
[0160] In the specific implementation, the label prediction result of each sub-track is compared with the actual object type label, and the error is calculated using the same loss function to obtain a second loss value. This loss value reflects the accuracy of the sub-track classification.
[0161] S3043: Calculate the total loss function value of the preset classification model based on the first loss value and the second loss value.
[0162] In practice, the total loss function is calculated by combining the first and second loss values. These two loss values together determine the optimization direction of the model during training. The goal of the model is to minimize the total loss function value, thereby improving overall classification accuracy.
[0163] The above implementation of the embodiment of the present application obtains a first loss value based on the difference between the trajectory type prediction result and the trajectory type label, and then obtains a second loss value based on the difference between each label prediction result and the corresponding object type label, thereby calculating the total loss function value of the preset classification model and obtaining an accurate total loss function value.
[0164] In order to improve the overall prediction accuracy, in some embodiments, S3043 may include the following steps: S30431 to S30433.
[0165] S30431: Obtain the preset weight of the second loss value.
[0166] In practice, the preset weights are typically set manually by the model developer based on experimental results to indicate the influence of the second loss term on the total loss. The preset weight values are extracted from the model configuration.
[0167] S30432: Calculate the product of the second loss value and the preset weight.
[0168] In a specific implementation, a second loss value is determined, and the second loss value is multiplied by a preset weight to obtain a weighted loss term.
[0169] S30433: Obtain a total loss function value of the preset classification model based on the sum of the product and the first loss value.
[0170] In the specific implementation, the first loss value and the weighted second loss value are added together to obtain the total loss value. This total loss value will be used as the optimization target during the model training process.
[0171] The above implementation of the embodiment of the present application determines the importance of the loss item in the total loss by obtaining the preset weight of the second loss value from the model configuration, multiplies the second loss value by its preset weight to obtain a weighted second loss item, adds the weighted second loss item to the first loss value, and calculates the final total loss function value, ensuring that each loss item is weighted according to its relative importance, thereby improving the overall prediction accuracy.
[0172] In some embodiments, the Transformer network structure is entirely composed of multi-head attention and feedforward neural networks. Multi-Head Attention is composed of multiple self-attention mechanisms. Figure 4 As shown, Q represents the content at other locations that currently need to be focused on; K represents the content features at other locations; and V represents the specific information actually involved in the weighted calculation. The processing process includes steps: S401 to S405.
[0173] S401: Calculate the dot product between the query matrix (Q) and the transpose of the key matrix (K) to generate an attention score matrix. S402: Scale the attention scores to prevent the dot product result from being too large, resulting in unstable gradients. S403: Apply a mask to the attention scores. For example, a padding mask and a causal mask. S404: Normalize the scaled attention scores to generate an attention weight matrix, which represents the degree of attention each position pays to the current position. S405: Multiply the attention weight matrix with the value matrix (V) to obtain a weighted context representation.
[0174] You can refer to Figure 5, the position encoding in the Transformer model is to introduce the information of each position in the sequence into the model to help the model understand the order and position relationship of the input sequence. In Transformer, position encoding is usually introduced by adding it to the input embedding vector. There are two main types of position encoding: absolute position encoding. Absolute position encoding usually uses a combination of sine and cosine functions, and sine functions of different frequencies are used to represent the position information of different positions. Relative position encoding: Relative position encoding takes into account the relative distance between tokens in the sequence to adjust the weight calculation in the attention mechanism. The processing process includes steps: S501 to S505.
[0175] S501: Normalize the point features; S502: Compress the normalized point features to reduce dimensionality or remove redundant dimensions; S503: Split the input features into multiple groups of parallel "heads", each group independently calculates self-attention; S504: Normalize the self-attention features; S505: Based on multi-layer perception, it is used in feedforward neural networks to enhance the nonlinear expression ability of the normalized self-attention features and obtain the final output. Each Transformer encoding block contains a self-attention mechanism for dynamically modeling the relationship between trajectory points. The trajectory data undergoes embedding, position encoding, and Transformer encoding blocks in sequence, and finally outputs global features for classification, and local features for sub-path labeling. This allows the model to accurately distinguish complex trajectories (such as drones and birds, ships and vehicles), improving classification robustness and efficiency.
[0176] Point-based trajectory classification is to learn a one-to-one mapping X→Y to convert discrete trajectory data sequences Mapped to the corresponding label sequence Y = {y0,...,y k}, where y i Represents a tuple Category labels. In this embodiment, {bird, person, car, drone, lawn mower, boat}. Given a trajectory classification dataset D, trajectory classification is to train a function f(·) that maps from the possible input space to the probability distribution of category values Y. The resulting trajectory classification function f takes trajectory X as input and returns Y based on what f has learned, that is, Y = f(X). In general, Y can be a discrete label or a probability of belonging to a specific category. Given a trajectory dataset X and a set S containing h sub-trajectories, the sub-trajectory transformation converts X into a real-valued matrix T∈R n×h , obtained by the best fit of each trajectory X∈X and each sub-trajectory S∈S. Typically, the minimum distance to the best fit of S in each X is calculated through a sliding window of length l.
[0177] To solve the problem of trajectory classification, a deep learning-based trajectory classification model is proposed. It receives as input a feature sequence containing location, time, and any other attributes annotated in the sub-trajectory. In the field of trajectory prediction and trajectory classification, it is necessary to pay special attention to the temporal order and the contextual relationship of trajectory data. There are many inherent similarities between natural language and trajectory data, such as sequential characteristics and contextual relevance. The specific structure of the model can be found in Figure 6 First, pre-classification is performed through classification labeling 601. Continuous feature embedding of the input points is performed through continuous point embedding 602, including position encoding and attribute encoding. Repeated Transformer modules 603 are used for feature extraction, and then multi-layer perception and skip connections 604 are used to output the final classification result.
[0178] The model consists of three parts, using an embedding layer to represent a sequence of sub-trajectories. By converting complex high-dimensional trajectory data into a lower-dimensional dense vector, the embedding layer helps simplify subsequent processing steps while retaining important spatiotemporal information. After processing by the embedding layer, the resulting point embedding sequence is It is combined with the class label Cls of the corresponding trajectory classification. These vectors are input together into multiple standard Transformer encoding blocks for in-depth learning. Each Transformer block includes a self-attention mechanism and a feedforward neural network, which can effectively capture the complex dependencies and interactions between points in the sequence. At the top of the model, there are two types of decoders. The first decoder is responsible for using class labels to predict trajectory classification; the second decoder assigns independent labels to each subpath as additional supervision information to improve the model's generalization ability and prediction accuracy. This dual decoder design enables the model to not only perform well in classification prediction, but also provide more support for result interpretation, enhancing the model's applicability and flexibility.
[0179] Trajectory data typically consists of a series of timestamped geographic points that may not be uniformly distributed in time. Trajectory point embedding is used to process discrete trajectories with timestamps to adapt to and handle irregular time intervals and sampling rates. This allows the model to more accurately understand and depict the actual dynamics of trajectory data. Trajectory point embedding is generated dynamically based on the local neighborhood of each point and its time-space interval in the trajectory. This is achieved by defining functions f and p on a continuous domain and integrating them together, as follows:
[0180]
[0181] Where p(·) represents the input trajectory data; f is a continuous kernel function that is responsible for capturing the relationship between points. The continuous convolution is approximated by Monte Carlo integration and is expressed as:
[0182]
[0183] where N(x) is the set of neighboring points of point x in the local window, and the function g(·) is parameterized according to the time interval Δt and the spatial interval Δd, so that it can adapt to the specific spatiotemporal context of each trajectory point.
[0184] In the prediction layer, enhanced labels generated by the main model are used as additional supervisory signals during the training of the refinement model. This helps the refinement model improve its accuracy and generalization when processing complex trajectory data. A dynamic aggregation method is used to process the output tokens, enhancing the model's understanding of subpath context and using the enhanced labels for effective supervised learning. Combined with a knowledge distillation strategy, the model effectively improves its ability to process trajectory data, especially for classifying complex and dynamically changing trajectories. This approach not only enhances the model's learning ability but also improves performance in real-world applications.
[0185] Knowledge distillation is applied to the model to improve performance. First, a base model, serving as the master model, is trained without subpath labels. This model classifies trajectory categories and outputs predicted class labels. The base model is then used to generate enhanced labels for each subpath of each trajectory instance. After obtaining enhanced labels for all subpaths, these labels are used to train a new model, the refined model. The refined model leverages the knowledge provided by the master model for more refined learning and prediction.
[0186] In order to incorporate subpath annotations into the training process, the loss function is designed to minimize the difference between the predicted labels and the true labels of the entire trajectory and its subpaths. The total loss L for the training instance can be expressed as follows:
[0187] L=L Cls (y,y′)+αL sub (y sub ,y′ sub )
[0188] Among them, L Cls (y,y′) is the classification loss of the main task, which is used to measure the error between the predicted label y′ and the true label y. sub (y sub ,y′ sub ) is the auxiliary loss of subpath annotation, which is used to refine the pseudo label y generated by the model. sub and the subpath label y′ predicted by the base model sub α is a regularization parameter that controls the relative importance of the subpath annotation loss in the overall loss function.
[0189] To improve the accuracy of object type recognition and reduce the complexity of model processing, a set of pre-classification rules based on geographic information is designed. By combining the geographic location information (latitude and longitude) of the motion trajectory with specific geographic features (such as river boundaries), the model can effectively perform preliminary classification of moving objects, providing auxiliary information for model training and prediction. Figure 7 , including the following steps: S701 to S703. S701: First, obtain the boundary data of the river from the geographic information system, match the nearest river data according to the latitude and longitude of the trajectory, and obtain the boundary of the river. The ray method can be used to quickly check whether any given trajectory point is within the river boundary. S702: Determine whether the trajectory passes through water. If the trajectory point is completely on land, it means that the complete object is completely on land, and is further distinguished as a person, a car or a lawn mower. S703: Afterwards, if the trajectory point is completely within the river boundary, it can be preliminarily determined to be a ship. If the trajectory point partially passes through the river but is not completely within the river boundary, it can be preliminarily classified as a drone or a bird.
[0190] The pre-classification results are integrated into the model as additional input features. To accommodate these additional features, the model architecture is adjusted accordingly to ensure that the pre-classification information can be effectively utilized. In addition, the training process is optimized for data containing pre-classification labels.
[0191] Based on the trajectory classification method provided in the above embodiment, the present application also provides a specific implementation of a trajectory classification device. Please refer to the following embodiment.
[0192] See first Figure 8 The trajectory classification device 800 provided in the embodiment of the present application includes the following modules:
[0193] The extraction module 801 is used to extract the corresponding trajectory point sequence from the trajectory of the moving object.
[0194] The extraction module 801 is further configured to utilize the feature extraction layer in the classification model to extract the feature vectors of the trajectory point sequence and the dependency relationship between the feature vectors to obtain trajectory feature information.
[0195] Parsing module 802 is configured to parse the trajectory feature information using a first decoder in the prediction layer of the classification model to obtain a first object type corresponding to the trajectory. A second decoder in the prediction layer of the classification model parses the trajectory feature information based on the first object type to obtain a second object type corresponding to each sub-trajectory in the trajectory. Based on the first object type and each second object type, the moving object type of the trajectory is determined.
[0196] As an implementation of the present application, the trajectory classification device 800 may further include:
[0197] The acquisition module is used to obtain the terrain type information passed by the moving object.
[0198] The determination module is used to determine the motion area type label of the motion object according to the terrain type information.
[0199] The parsing module is used to parse the motion region type label using the first decoder in the prediction layer in the classification model to obtain object type bias information.
[0200] The parsing module is further configured to use the first decoder to parse the trajectory feature information based on the object type bias information to obtain a first object type corresponding to the trajectory.
[0201] As an implementation of this application, the determination module includes:
[0202] The determining unit is used to determine that the motion area type label of the motion object is a water transport object when the terrain type information only includes water area information.
[0203] The determining unit is further configured to determine, when the terrain type information only includes land information, that the motion region type label of the motion object is a land object.
[0204] The determining unit is further configured to determine that the motion region type label of the motion object is a flying object when the terrain type information includes land information and water area information.
[0205] As an implementation of the present application, the extraction module 801 includes:
[0206] The acquisition unit is used to acquire the trajectory of the moving object.
[0207] The extraction unit is used to extract a position sequence of the moving object in the trajectory, where the position sequence includes a plurality of position points, and the position points include position information corresponding to the moving object and a corresponding time stamp.
[0208] The determining unit is used to embed virtual trajectory points between different position points of the moving object according to the position sequence, and determine multiple trajectory points corresponding to the moving object.
[0209] The determining unit is further configured to obtain a trajectory point sequence corresponding to the moving object according to the multiple trajectory points and the time stamps corresponding to the respective trajectory points.
[0210] As an implementation of the present application, the determining unit includes:
[0211] The generating subunit is used to generate virtual trajectory points between each position point according to the time and space interval between each position point and the corresponding adjacent position points.
[0212] The determination subunit is used to determine multiple trajectory points corresponding to the moving object according to each position point and the virtual trajectory point.
[0213] As an implementation of the present application, the extraction module 801 includes:
[0214] The construction unit is used to process the time information and space information in the trajectory point sequence and construct the spatiotemporal relationship matrix of the trajectory points.
[0215] The computation unit is configured to sequentially perform the following steps for each self-attention module in the feature extraction layer: It performs multi-head self-attention computation on the spatiotemporal relationship matrix to obtain spatiotemporal key information. The spatiotemporal relationship matrix and spatiotemporal key information are processed by the feedforward neural network in the self-attention module to obtain spatiotemporal relationship features.
[0216] The determining unit is configured to use the spatiotemporal relationship feature as trajectory feature information corresponding to the trajectory.
[0217] As an implementation of the present application, the trajectory classification device 800 may further include:
[0218] The acquisition module is used to acquire a training sample set, where the training sample set includes multiple training samples, and each training sample includes a historical trajectory of a moving object sample and a corresponding trajectory type label.
[0219] The determination module is used to input the historical trajectory into the feature extraction layer in the preset classification model to obtain the historical feature information corresponding to the historical trajectory.
[0220] The parsing module is used to parse the historical feature information through the first decoder and the second decoder in the preset classification model to obtain the trajectory type prediction result corresponding to the historical trajectory.
[0221] The determination module is further used to determine the total loss function value of the preset classification model based on the trajectory type prediction result and the trajectory type label.
[0222] The adjustment module is used to adjust the model parameters of the preset classification model when the total loss function value does not meet the training stop condition, and use the training sample set to train the preset classification model with adjusted parameters until the training stop condition is met, thereby obtaining the trained classification model.
[0223] As an implementation of this application, the parsing module includes:
[0224] The parsing unit is configured to parse the historical feature information through a first decoder in a preset classification model to obtain an object type prediction result corresponding to the historical trajectory and an object type label corresponding to each sub-trajectory in the historical trajectory.
[0225] The parsing unit is further configured to parse the historical feature information based on the object type prediction result through a second decoder in a preset classification model to obtain a label prediction result corresponding to each sub-track in the historical track.
[0226] The determination unit is used to obtain a trajectory type prediction result corresponding to the historical trajectory based on the object type prediction result and each label prediction result.
[0227] The determination unit is further used to determine the total loss function value of the preset classification model based on the trajectory type prediction result and the trajectory type label, including:
[0228] The determination unit is further configured to obtain a first loss value according to a difference between the trajectory type prediction result and the trajectory type label.
[0229] The determination unit is further configured to obtain a second loss value based on the difference between each label prediction result and the corresponding object type label.
[0230] The calculation unit is further used to calculate the total loss function value of the preset classification model based on the first loss value and the second loss value.
[0231] As an implementation of the present application, a computing unit includes:
[0232] An acquisition subunit is used to obtain a preset weight of the second loss value.
[0233] The calculation subunit is used to calculate the product of the second loss value and the preset weight.
[0234] The determination subunit is used to obtain a total loss function value of the preset classification model based on the sum of the product and the first loss value.
[0235] Each module in the trajectory classification device provided in the embodiment of the present application can implement each step in the above-mentioned trajectory classification method and achieve corresponding effects. For the sake of brevity, they are not repeated here.
[0236] Figure 9 A schematic diagram of the structure of the trajectory classification hardware provided in an embodiment of the present application is shown.
[0237] The trajectory classification device may include a processor 901 and a memory 902 storing computer program instructions.
[0238] Specifically, the processor 901 may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0239] The memory 902 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 902 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 902 may include removable or non-removable (or fixed) media. Where appropriate, the memory 902 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 902 is a non-volatile solid-state memory.
[0240] The memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the trajectory classification method according to any one embodiment of the present disclosure.
[0241] The processor 901 reads and executes computer program instructions stored in the memory 902 to implement any one of the trajectory classification methods in the above embodiments.
[0242] In one example, the trajectory classification device may further include a communication interface 903 and a bus 99. Figure 9 As shown, the processor 901 , the memory 902 , and the communication interface 903 are connected via a bus 910 and communicate with each other.
[0243] The communication interface 903 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0244] Bus 910 includes hardware, software or both, and the components of online data flow metering equipment are coupled to each other. For example, but not limitation, bus can include accelerated graphics port (AGP) or other graphics bus, enhanced industry standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industry standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 910 can include one or more buses. Although the present application embodiment describes and shows specific bus, the application considers any suitable bus or interconnection.
[0245] In addition, in conjunction with the trajectory classification method in the above embodiments, embodiments of the present application may provide a computer storage medium for implementation. The computer storage medium stores computer program instructions. When the computer program instructions are executed by a processor, any of the trajectory classification methods in the above embodiments is implemented.
[0246] An embodiment of the present application further provides a computer program product, including a computer program, which, when executed, implements any one of the trajectory classification methods in the above embodiments.
[0247] It should be understood that the present application is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of the present application is not limited to the specific steps described and illustrated. Those skilled in the art can make various changes, modifications, and additions, or change the order of the steps after understanding the spirit of the present application.
[0248] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium that can store or transmit information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROMs, flash memories, erasable ROMs (EROMs), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0249] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps. In other words, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0250] Aspects of the present disclosure have been described above with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit. It is also understood that each box in the block diagram and / or flowchart and the combination of the boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0251] The above description is only a specific embodiment of the present application. Those skilled in the art will clearly understand that for the convenience and brevity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the scope of protection of the present application.
Claims
1. A trajectory classification method, characterized in that: The method comprises: Extracting a corresponding trajectory point sequence from the trajectory of the moving object; Using the feature extraction layer in the classification model to extract the feature vectors of the trajectory point sequence and the dependency relationship between the feature vectors to obtain trajectory feature information; The first decoder in the prediction layer of the classification model is used to parse the trajectory feature information to obtain a first object type corresponding to the trajectory; the second decoder in the prediction layer of the classification model is used to parse the trajectory feature information based on the first object type to obtain a second object type corresponding to each sub-trajectory in the trajectory; and the moving object type of the trajectory is determined based on the first object type and each of the second object types.
2. The trajectory classification method according to claim 1, characterized in that Before parsing the trajectory feature information using a first decoder in a prediction layer in a classification model to obtain a first object class corresponding to the trajectory, the method further includes: Obtaining information about the type of terrain passed by the moving object; determining a motion region type label of the motion object according to the terrain type information; The utilizing a first decoder in a prediction layer in a classification model to parse the trajectory feature information to obtain a first object type corresponding to the trajectory includes: Parsing the motion region type label using a first decoder in a prediction layer in a classification model to obtain object type bias information; The first decoder is used to parse the trajectory feature information based on the object type bias information to obtain a first object type corresponding to the trajectory.
3. The trajectory classification method according to claim 2, characterized in that: The terrain type information includes water area information and / or land area information. Determining the motion region type label of the motion object according to the terrain type information includes: When the terrain type information only includes water area information, determining the movement area type label of the movement object as a water transport object; When the terrain type information includes only land information, determining the motion region type label of the motion object as a land object; In a case where the terrain type information includes land information and water area information, it is determined that the motion region type label of the motion object is a flying object.
4. The trajectory classification method according to claim 1, characterized in that The step of extracting a corresponding trajectory point sequence from the trajectory of the moving object comprises: Get the trajectory of the moving object; Extracting a position sequence of the moving object in the trajectory, the position sequence comprising a plurality of position points, each of the position points comprising position information corresponding to the moving object and a corresponding timestamp; embedding virtual trajectory points between different position points of the moving object according to the position sequence to determine a plurality of trajectory points corresponding to the moving object; A trajectory point sequence corresponding to the moving object is obtained according to the multiple trajectory points and the timestamps corresponding to the trajectory points.
5. The trajectory classification method according to claim 4, characterized in that: The step of embedding virtual trajectory points between different position points of the moving object according to the position sequence to determine a plurality of trajectory points corresponding to the moving object includes: generating virtual trajectory points between each of the position points according to the spatiotemporal intervals between each of the position points and the corresponding adjacent position points; A plurality of trajectory points corresponding to the moving object are determined according to each of the position points and the virtual trajectory points.
6. The trajectory classification method according to claim 1, characterized in that: The feature extraction layer includes at least one self-attention module. The feature extraction layer in the classification model is used to extract the feature vectors of the trajectory point sequence and the dependency relationship between the feature vectors to obtain trajectory feature information, including: Processing the time information and space information in the trajectory point sequence to construct a spatiotemporal relationship matrix of the trajectory points; The following steps are performed in sequence according to each self-attention module in the feature extraction layer: multi-head self-attention calculation is performed on the spatiotemporal relationship matrix to obtain spatiotemporal key information; the spatiotemporal relationship matrix and the spatiotemporal key information are processed by a feedforward neural network in the self-attention module to obtain spatiotemporal relationship features; The spatiotemporal relationship feature is used as trajectory feature information corresponding to the trajectory.
7. The trajectory classification method according to any one of claims 1 to 6, characterized in that: Before extracting the feature vectors of the trajectory point sequence and the dependency relationship between the feature vectors using the feature extraction layer in the classification model to obtain trajectory feature information, the method further includes: Acquire a training sample set, the training sample set including a plurality of training samples, each of the training samples including a historical trajectory of a moving object sample and a corresponding trajectory type label; For each training sample, perform the following steps: Inputting the historical trajectory into a feature extraction layer in a preset classification model to obtain historical feature information corresponding to the historical trajectory; The historical feature information is parsed by a first decoder and a second decoder in a preset classification model to obtain a trajectory type prediction result corresponding to the historical trajectory; Determining a total loss function value of the preset classification model according to the trajectory type prediction result and the trajectory type label; When the total loss function value does not meet the training stop condition, the model parameters of the preset classification model are adjusted, and the preset classification model after the training parameters are adjusted is trained using the training sample set until the training stop condition is met, thereby obtaining the trained classification model.
8. The trajectory classification method according to claim 7, characterized in that: The first decoder and the second decoder in the preset classification model are used to parse the historical feature information to obtain a trajectory type prediction result corresponding to the historical trajectory, including: Parsing the historical feature information through a first decoder in a preset classification model to obtain an object type prediction result corresponding to the historical trajectory and an object type label corresponding to each sub-trajectory in the historical trajectory; Based on the object type prediction result, the historical feature information is parsed by a second decoder in a preset classification model to obtain a label prediction result corresponding to each sub-track in the historical track; Obtaining a trajectory type prediction result corresponding to the historical trajectory according to the object type prediction result and each of the label prediction results; Determining the total loss function value of the preset classification model according to the trajectory type prediction result and the trajectory type label includes: Obtaining a first loss value according to a difference between the trajectory type prediction result and the trajectory type label; Obtaining a second loss value based on the difference between each of the label prediction results and the corresponding object type label; The total loss function value of the preset classification model is calculated based on the first loss value and the second loss value.
9. The trajectory classification method according to claim 8, characterized in that: The calculating the total loss function value of the preset classification model according to the first loss value and the second loss value includes: Obtaining a preset weight for a second loss value; Calculating the product of the second loss value and the preset weight; The total loss function value of the preset classification model is obtained according to the sum of the product and the first loss value.
10. A trajectory classification device, characterized in that: The device comprises: An extraction module, used to extract a corresponding trajectory point sequence from the trajectory of the moving object; The extraction module is further configured to extract the feature vectors of the trajectory point sequence and the dependency relationship between the feature vectors using the feature extraction layer in the classification model to obtain trajectory feature information; a parsing module, configured to parse the trajectory feature information using a first decoder in a prediction layer in a classification model to obtain a first object type corresponding to the trajectory; parse the trajectory feature information based on the first object type using a second decoder in the prediction layer in the classification model to obtain a second object type corresponding to each sub-trajectory in the trajectory; and determine a moving object type of the trajectory based on the first object type and each of the second object types.
11. A trajectory classification device, characterized in that: The device includes: a processor and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the trajectory classification method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the trajectory classification method according to any one of claims 1 to 9 is implemented.
13. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device is caused to perform the trajectory classification method according to any one of claims 1 to 9.