Trajectory classification method and system based on deep convolutional neural network
Through deep convolutional neural networks and feature extraction technology, the problem of information loss and poor generalization ability in ship trajectory classification is solved, more accurate ship static information acquisition and maritime situation awareness are achieved, and the efficiency of maritime traffic management is improved.
Patent Information
- Application Number
- CN202410882198.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2024-10-11
AI Technical Summary
Existing ship trajectory classification methods have problems with information loss and poor generalization ability in the field of maritime traffic. In particular, due to the instability of AIS data and the variability of MMSI numbers, static information of ships cannot be accurately obtained.
Using a method based on deep convolutional neural networks, through data preprocessing, static trajectory information classification and spatiotemporal image trajectory classification steps, combined with a two-way long short-term memory network, a multi-head self-attention mechanism and a convolutional neural network, the static and convolutional neural network of the ship trajectory are extracted. Dynamic features, build biSAMNet and ResNet_6 models, convert grid sequences into single-channel grayscale images to reduce information loss.
It effectively extracts the semantic features of ship trajectories, improves classification accuracy, enhances maritime situation awareness, reduces the occurrence of maritime accidents, and provides reliable data support for maritime management.
Smart Images

Figure CN118760981A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to a data classification method in the field of transportation, and in particular to a trajectory classification method in the field of marine ship shipping transportation. Background Art
[0002] At present, in the field of marine transportation, the Automatic Identification System (AIS) plays a vital role in ensuring shipping safety and effectively monitoring ship operations. However, the AIS data sent by ships is not completely reliable, and there may be problems such as being unable to obtain relevant information about a specific ship based on the ship's unique identification code MMSI number. Ship trajectory classification plays an important role in many industries. For example, fishery management departments can use it to monitor illegal fishing vessels, and maritime security agencies can use it to prevent maritime terrorist attacks and smuggling. At present, many studies have proposed different ship trajectory classification methods, which involve manual or automatic learning of trajectory features. There are two main problems with the methods currently used for ship trajectory classification: first, most studies use unsupervised cluster analysis, and its clustering results are often based on trajectory shapes and fail to effectively reveal semantic information; second, in supervised classification methods, most of them require the use of high-quality AIS data to manually construct complex input features.
[0003] Although the Automatic Identification System (AIS) provides a Maritime Mobile Service Identity (MMSI, similar to a car license plate) that can uniquely identify a ship, the instability of the marine network signal and the possibility of the MMSI number being manually changed often result in errors in the received ship information. The archival information of ships is global, not based on countries like car archives. In addition, since the archival information of many ships is inaccurate or missing, queries for the same MMSI number often result in different results in different ship archives, making it a challenge to obtain accurate ship information. The trajectory of a ship is determined, and extracting ship-related information from the trajectory through classification has always been an important research topic in transportation engineering and transportation geography. There are many studies on ship trajectory classification, most of which use machine learning and rely on manually defined feature extractors. In addition, the definitions of classes in the classification are different, and there is a problem of poor generalization ability.
[0004] Research on trajectory classification methods in the field of ship shipping transportation mainly focuses on:
[0005] 1) A method for identifying abnormal trajectories based on hybrid semantic embedding. This framework effectively solves the defect that existing abnormal trajectory identification methods cannot capture the sequence information in the trajectory and the common information between different OD-pairs. It can effectively mine the spatiotemporal features in historical trajectories and integrate multiple types of semantic information. However, this technology does not adopt the microscopic behavior of ship navigation, but targets the trajectory of normal ship navigation, constructs a spatiotemporal graph network structure, and classifies ship trajectories based on trajectory images;
[0006] 2) A big data processing method based on convolutional neural network is implemented, which can process the function processing of highly dense trajectory data in the terminal area, and the target tracking framework combining the multi-target detection model of deep learning and the filtering method can track the movement of multiple targets in a long time series after multi-module improvement. However, this technology does not utilize the complex network formed by ship trajectories, and combines ship archives and graph model calculation theory to apply neural networks to ship trajectory classification.
[0007] Based on the problems and shortcomings of the existing ship system trajectory classification technology in the use of neural network methods, it is urgent to develop a trajectory classification method suitable for the field of ship shipping and transportation, and infer the static information of the ship by analyzing the trajectory data of the ship sailing at sea. This process includes collecting the ship's location data (such as longitude and latitude, timestamp, etc.), using deep learning methods for classification, and mining the semantic characteristics of ship behavior. This has important application value in the fields of maritime traffic management, fishery supervision, and marine environmental protection. On the one hand, by identifying and classifying different ship trajectories, it can help maritime agencies more effectively monitor ship activities in the sea area, detect suspicious ship behavior, enhance maritime situation awareness capabilities, and prevent and reduce the occurrence of maritime accidents. On the other hand, it can also provide data support for the study of ship navigation behavior. Summary of the invention
[0008] In order to solve the problems existing in the prior art, the embodiments of the present application provide a trajectory classification method and system based on a deep convolutional neural network, which solves the problem that the existing trajectory classification method is not applicable.
[0009] In a first aspect, an embodiment of the present application provides a trajectory classification method based on a deep convolutional neural network, comprising:
[0010] Data preprocessing step: Based on the original trajectory data to be classified, data cleaning and trajectory compression conversion are performed to output a compressed grid sequence;
[0011] Static trajectory information classification step: the compressed grid sequence encoding is input into the pre-built static trajectory classification model, where the trajectory static classification model adopts a bidirectional long short-term memory network and a multi-head self-attention mechanism to extract context information in the trajectory sequence through the bidirectional long short-term memory network, and uses a multi-head self-attention mechanism combined with a block maximum pooling method to extract trajectory semantic information, and comprehensively outputs the static information classification results of the trajectory;
[0012] Spatiotemporal image trajectory classification step: convert the encoding of the grid sequence before compression into a single-channel grayscale image, input the pre-built spatiotemporal image trajectory classification model for feature extraction and classification, and output the dynamic image information classification result of the trajectory, wherein the trajectory image classification model adopts an improved convolutional neural network;
[0013] The static trajectory information classification step and the spatiotemporal image trajectory classification step are performed synchronously or superimposedly.
[0014] In the embodiment of the present invention, the data preprocessing step further includes:
[0015] Data cleaning step: Based on the original trajectory data, clean the redundant fields, retain the valid static trajectory information and dynamic trajectory information, group and sort all the cleaned data, and output the final cleaned trajectory data;
[0016] Outlier point removal step: find and delete outliers in the cleaned trajectory data, evaluate the importance of trajectory points, and gradually remove minor points to reduce the density of trajectory points, and output the trajectory data after outlier processing;
[0017] Grid processing step: convert the longitude and latitude values of the continuous trajectory points in the trajectory data after the abnormal point processing into the corresponding discrete grid point numbers. After the conversion is completed, the static trajectory information corresponding to the number is obtained by matching according to the pre-stored database;
[0018] Word embedding vector training steps: Based on static trajectory information, use the text representation model to train word embedding vectors for the grid points of the grid sequence, and output the word vectors of the grid points.
[0019] In an embodiment of the present invention, the above-mentioned trajectory static information classification step includes:
[0020] Static trajectory model construction steps: Use bidirectional long short-term memory network biLSTM, multi-head self-attention mechanism and block maximum pooling layer method to build a static trajectory classification model biSAMNet;
[0021] Static information classification step: Based on the word embedding, a bidirectional long short-term memory network is used to concatenate the bidirectional output of the word vector with the original word vector at the corresponding time point, and the semantic vector of the time point is output;
[0022] Block max pooling step: After using the block max pooling layer to select the most important features of each part of the semantic vector; the data after activation and layer normalization is expanded, and the dimension is reduced through the fully connected layer, and finally multi-category data classification is performed through the softmax activation function, and the final static trajectory information classification result is output.
[0023] In the embodiment of the present invention, the above-mentioned spatiotemporal image trajectory classification step includes:
[0024] Steps for building a spatiotemporal image trajectory classification model: The spatiotemporal image trajectory classification model is built based on the improved neural network model of ResNet. The first convolution layer in the ResNet model uses a dilated convolution.
[0025] Grid sequence conversion step: converting the grid sequence before compression into a single-channel grayscale image;
[0026] Spatiotemporal image trajectory classification step: input the single-channel grayscale image into the spatiotemporal trajectory classification model to automatically identify key features and automatically capture the features of the local area;
[0027] The calculation steps of the dilated convolution are as follows: based on the input size of the grayscale image, the convolution step size, the convolution padding size, the equivalent convolution kernel size, the actual convolution kernel size and the dilation rate, the convolution output size is calculated.
[0028] In the embodiment of the present invention, the above-mentioned static trajectory classification model biSAMNet includes: the first layer is a bidirectional LSTM network; the second layer is a GELU function activation and layer normalization; the third layer is a multi-head self-attention model; the fourth layer is a block maximum pooling layer; the fifth layer is a GELU function activation and layer normalization; the sixth layer is a fully connected layer.
[0029] In an embodiment of the present invention, the static information classification step further includes:
[0030] For the i-th word vector, the concatenated semantic vector obtained is: the left context represents c l (x i ), the right context represents c r (x i ) and the word embedding vector e(x) of the i-th word vector itself i ) The three are spliced together; the formula is expressed as:
[0031] c l (x i )=f(W l c l (x i-1 )+W sl e(x i-1 ))
[0032] c r (x i )=f(W r c r (x i+1 )+W sT e(x i+1 ))
[0033] e * (x i )=[c l (x i ); e(x i );c r (x i )]
[0034] Among them, W l is the weight matrix used to transfer the current hidden layer state to the next layer, W sl is the weight matrix used to fuse the current word vector with its previous context information, W sr is the weight matrix used to fuse the current word vector with its context information.
[0035] In the embodiment of the present invention, the GELU function formula is expressed as:
[0036]
[0037] Among them, x is the concatenated semantic vector; Tanh function is an extension of Sigmoid function;
[0038] The block maximum pooling layer formula is expressed as:
[0039]
[0040] Among them, Ni and Cj represent the coordinates of the feature map, k represents the number of feature channels of the feature map, m represents the offset of the step size, and stride represents the step size.
[0041] In a second aspect, an embodiment of the present application provides a trajectory classification device based on a deep convolutional neural network, using the trajectory classification method based on a deep convolutional neural network as described above, the system includes:
[0042] Data preprocessing module: Based on the original trajectory data to be classified, it performs data cleaning and data format conversion, and outputs a compressed grid sequence;
[0043] Static trajectory information classification module: The compressed grid sequence encoding is input into the pre-built static trajectory classification model. The trajectory static classification model uses a bidirectional long short-term memory network and a multi-head b-attention mechanism to extract contextual information in the trajectory sequence through the bidirectional long short-term memory network. The multi-head b-attention mechanism is combined with the block maximum pooling method to extract trajectory semantic information and comprehensively output the static information classification results of the trajectory.
[0044] Spatiotemporal image trajectory classification module: converts the encoding of the grid sequence before compression into a single-channel grayscale image, inputs the pre-built spatiotemporal image trajectory classification model for feature extraction and classification, and outputs the dynamic image information classification result of the trajectory. The trajectory image classification model adopts an improved convolutional neural network.
[0045] In a third aspect, an embodiment of the present application provides an electronic device, which adopts a trajectory classification device based on a deep convolutional neural network as described above, and the electronic device is connected to an information display device, which is used to display the evaluation result according to display parameters and attributes set by the user or through an artificial intelligence model.
[0046] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the trajectory classification method based on a deep convolutional neural network as described above.
[0047] Compared with the related prior art, it has the following outstanding beneficial effects:
[0048] (1) This paper proposes a trajectory classification model that combines the attention mechanism with a recurrent neural network. The model can effectively process the ship trajectory consisting of a series of longitude and latitude data, and verifies the practicality of the method of converting trajectory data into natural language expression. The information loss problem that may be caused by trajectory compression technology is proposed. Therefore, an image dataset is constructed from a spatial perspective, and a convolutional neural network is introduced to construct a classification model based on trajectory images, so that the deep neural network can capture more feature details in the original trajectory.
[0049] (2) The present invention adopts an innovative method to directly convert the original grid sequence into a single-channel grayscale image of matching size. This conversion enables the present invention to process trajectory information from a new perspective, effectively avoiding the information loss that may occur during the compression of the grid sequence. In order to evaluate the correlation between the trajectory grayscale image and the semantic label, the present invention selected six convolutional neural networks with different architectures for experimental testing. It is worth noting that through ablation experiments, the present invention observed that the combination of biSAMNet and ResNet_6 can extract trajectory information with minimal information loss and effectively utilize the entire grid sequence, thereby achieving further performance improvement in trajectory classification tasks.
[0050] (3) To address the information loss problem caused by compressing the trajectory into a grid sequence, the present invention converts the original trajectory into a single-channel grayscale image of uniform size as the spatial feature of the trajectory, and constructs a neural network based on the improved ResNet for feature extraction and classification. That is, an original trajectory is converted in two different ways and then processed in different ways respectively, with text representing its sequential features and pictures representing its spatial features. Extensive experiments were conducted on real-world datasets. Experimental results show that the model of the present invention can effectively further extract trajectory features and improve classification accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0052] Figure 1 It is a schematic diagram of the flow of the trajectory classification method based on deep convolutional neural network of the present invention;
[0053] Figure 2 Schematic diagram of a trajectory classification system based on a deep convolutional neural network of the present invention;
[0054] Figure 3 This is a flow chart of a trajectory classification method based on a deep convolutional neural network according to a specific embodiment of the present invention;
[0055] Figure 4 This is a schematic diagram of data cleaning and trajectory compression in a specific embodiment of the present invention;
[0056] Figure 5 It is a schematic diagram of outlier processing in a trajectory segment according to a specific embodiment of the present invention;
[0057] Figure 6 A schematic diagram of a grid sequence conversion process according to a specific embodiment of the present invention;
[0058] Figure 7 This is a schematic diagram of the network structure of biSAMNet, a specific embodiment of the present invention;
[0059] Figure 8 This is a schematic diagram of grouped maximum pooling according to a specific embodiment of the present invention;
[0060] Fig. 9 This is a schematic diagram of grayscale image conversion processing according to a specific embodiment of the present invention;
[0061] Fig.10 It is a schematic diagram of the convolution calculation process of a specific embodiment of the present invention;
[0062] Fig.11A schematic diagram of an application scenario according to an embodiment of the present application;
[0063] Fig.12 is a schematic diagram of a first electronic device according to an embodiment of the present application;
[0064] Fig.13 Schematic diagram of the hardware structure of a second electronic device according to an embodiment of the present application.
[0065] In the above picture:
[0066] 10Data Preprocessing Module
[0067] 20 Static trajectory classification module
[0068] 30 Spatiotemporal image trajectory classification module. DETAILED DESCRIPTION
[0069] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0070] Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. In addition, it can also be understood that although the efforts made in this development process may be complicated and lengthy, for ordinary technicians in this field related to the content disclosed in this application, some changes in design, manufacturing or production based on the technical content disclosed in this application are just conventional technical means, and should not be understood as insufficient content disclosed in this application.
[0071] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent.
[0072] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0073] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a kind of", "the" and the like involved in this application do not indicate a quantitative limitation and may represent the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more.
[0074] It should be noted that the processor described in the present invention is the control center of the electronic device, which can be a processor or a general term for multiple processing elements. For example, it can be one or more central processing units (CPUs), or application specific integrated circuits (ASICs), or one or more integrated circuits configured to implement the embodiments of the present invention, such as one or more microprocessors (digital signal processors, DSPs), or one or more field programmable gate arrays (FPGAs).
[0075] Optionally, the processor can perform various functions of the electronic device by running or executing a software program stored in the memory, and calling data stored in the memory.
[0076] In a specific implementation, as an embodiment, the processor may include one or more CPUs. Each of these processors may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor here may refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions). Electronic devices may include: servers, desktop computers, laptops, smart phones, tablet computers, embedded computers, etc., wherein the embedded computers include vehicles and robots, etc.
[0077] The memory is used to store the software program for executing the solution of the present invention, and the execution is controlled by the processor. The specific implementation method can refer to the above method embodiment and will not be repeated here.
[0078] It should be noted that the structure of the electronic device shown in the drawings of the present invention does not constitute a limitation thereto, and the actual knowledge structure recognition device may include more or fewer components than shown in the drawings, or a combination of certain components, or a different arrangement of components.
[0079] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0080] It should also be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.
[0081] In the present invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0082] It should also be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0083] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0084] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0085] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0086] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0087] The present invention aims to propose a trajectory classification model that combines an attention mechanism with a recurrent neural network. The model can effectively process ship trajectories consisting of a series of longitude and latitude data, and verifies the practicality of the method of converting trajectory data into natural language expressions. The proposed trajectory compression technology may cause information loss. The image dataset will be constructed from a spatial perspective, and a convolutional neural network will be introduced to construct a classification model based on trajectory images, so that the deep neural network can capture more feature details in the original trajectory. The present invention adopts an innovative method to directly convert the original grid sequence into a single-channel grayscale image with matching size. This conversion enables the present invention to process trajectory information from a new perspective, effectively avoiding the information loss that may occur during the compression of the grid sequence. In order to evaluate the correlation between the trajectory grayscale image and the semantic label, the present invention selects six convolutional neural networks with different architectures for experimental testing. It is worth noting that through ablation experiments, the present invention observes that the combination of biSAMNet and ResNet_6 can extract trajectory information with minimal information loss and effectively utilize the entire grid sequence, thereby achieving further performance improvement in the trajectory classification task.
[0088] The present invention proposes a semantic feature mining work for ship trajectories. The "semantics" of the present invention involves a series of static information of the ship, such as ship category and length. The present invention adopts a classification method for feature mining, proposes an innovative grid coding method, and combines two models with a progressive relationship: biSAMNet and ResNet_6. Through rigorous experimental verification, the algorithm of the present invention has shown a high application prospect. The trajectory classification model can assist maritime agencies to more effectively monitor ship activities in the sea area and prevent maritime accidents.
[0089] The main achievements of the present invention include:
[0090] (1) The method of the present invention proposes a module for preprocessing automatic identification system (AIS) data. Considering that the original form of AIS data is not suitable for direct import into neural networks, the continuous GPS coordinates are converted into discrete grid codes, and the Visvalingam-Whyatt algorithm is used to compress the overly long grid sequences to adapt to the requirements of neural network input. In addition, word2vec is used to train word embedding vectors for grid points;
[0091] (2) The method of the present invention proposes a ship trajectory classification model biSAMNet. The model accepts compressed grid codes as input, treats these sequences as text, and uses the static information of the ship as the classification label. This process is similar to the text classification task in natural language processing. By extracting contextual information in the trajectory sequence through a bidirectional long short-term memory network (biLSTM), and combining the attention mechanism with the block maximum pooling method, the model can effectively extract and analyze the trajectory semantic information. The ablation experiment confirms the effectiveness of the word2vec word embedding vector;
[0092] (3) The method of the present invention proposes a ResNet_6 model based on a convolutional neural network. In order to solve the problems of information loss caused by grid sequence compression and some sequences being too long even after compression, this chapter proposes a solution to convert the grid sequence before compression into a single-channel grayscale image. In view of the limitation of image size, the present invention simplifies the ResNet structure, retaining only 6 layers, and uses dilated convolution to expand the receptive field of the model. The ablation experiment results show that this model can work in parallel with the biSAMNet model mentioned above to achieve more comprehensive information extraction;
[0093] In summary, the method and model proposed in this paper are not only innovative in theory, but also demonstrate their ability to automatically extract and classify raw ship trajectory data in practical applications. By combining grid processing with geographic semantic information, it can provide valuable reference for decision-making of maritime personnel.
[0094] The present invention infers the static information of the ship by analyzing the trajectory data of the ship sailing at sea. This process includes collecting the location data of the ship (such as longitude and latitude, timestamp, etc.), using deep learning methods for classification, and mining the semantic features of the ship's behavior. In the relevant experiments in this article, two representative features, ship category and ship length, are specifically selected. This has important application value in the fields of maritime traffic management, fishery supervision, marine environmental protection, etc. On the one hand, by identifying and classifying different ship trajectories, it can help maritime agencies more effectively monitor ship activities in the sea area, detect suspicious ship behavior, enhance maritime situation awareness capabilities, prevent and reduce the occurrence of maritime accidents, and on the other hand, it can also provide data support for the study of ship navigation behavior.
[0095] like Figure 1 As shown, the embodiment of the present application provides a trajectory classification method based on a deep convolutional neural network, including:
[0096] Data preprocessing step S10: Based on the original trajectory data to be classified, data cleaning and trajectory compression conversion are performed to output a compressed grid sequence;
[0097] Static trajectory information classification step S20: inputting the compressed grid sequence encoding into a pre-built static trajectory classification model, wherein the trajectory static classification model adopts a bidirectional long short-term memory network and a multi-head self-attention mechanism, extracts context information in the trajectory sequence through the bidirectional long short-term memory network, adopts a multi-head self-attention mechanism combined with a block maximum pooling method, extracts trajectory semantic information, and comprehensively outputs the static information classification result of the trajectory;
[0098] Spatiotemporal image trajectory classification step S30: converting the encoding of the grid sequence before compression into a single-channel grayscale image, inputting the pre-built spatiotemporal image trajectory classification model for feature extraction and classification, and outputting the dynamic image information classification result of the trajectory, wherein the trajectory image classification model adopts an improved convolutional neural network;
[0099] The static trajectory information classification step S20 and the spatiotemporal image trajectory classification step S30 are performed synchronously or superimposed.
[0100] In the embodiment of the present invention, the data preprocessing step S10 further includes:
[0101] Data cleaning step: Based on the original trajectory data, clean the redundant fields, retain the valid static trajectory information and dynamic trajectory information, group and sort all the cleaned data, and output the final cleaned trajectory data;
[0102] Outlier point removal step: find and delete outliers in the cleaned trajectory data, evaluate the importance of trajectory points, and gradually remove minor points to reduce the density of trajectory points, and output the trajectory data after outlier processing;
[0103] Grid processing step: convert the longitude and latitude values of the continuous trajectory points in the trajectory data after the abnormal point processing into the corresponding discrete grid point numbers. After the conversion is completed, the static trajectory information corresponding to the number is obtained by matching according to the pre-stored database;
[0104] Word embedding vector training steps: Based on static trajectory information, use the text representation model to train word embedding vectors for the grid points of the grid sequence, and output the word vectors of the grid points.
[0105] In the embodiment of the present invention, the above-mentioned trajectory static information classification step S20 includes:
[0106] Static trajectory model construction steps: Use bidirectional long short-term memory network biLSTM, multi-head self-attention mechanism and block maximum pooling layer method to build a static trajectory classification model biSAMNet;
[0107] Static information classification step: Based on the word embedding, a bidirectional long short-term memory network is used to concatenate the bidirectional output of the word vector with the original word vector at the corresponding time point, and the semantic vector of the time point is output;
[0108] Block max pooling step: After using the block max pooling layer to select the most important features of each part of the semantic vector; the data after activation and layer normalization is expanded, and the dimension is reduced through the fully connected layer, and finally multi-category data classification is performed through the softmax activation function, and the final static trajectory information classification result is output.
[0109] In the embodiment of the present invention, the above-mentioned spatiotemporal image trajectory classification step S30 includes:
[0110] Steps for building a spatiotemporal image trajectory classification model: The spatiotemporal image trajectory classification model is built based on the improved neural network model of ResNet. The first convolution layer in the ResNet model uses a dilated convolution.
[0111] Grid sequence conversion step: converting the grid sequence before compression into a single-channel grayscale image;
[0112] Spatiotemporal image trajectory classification step: input the single-channel grayscale image into the spatiotemporal trajectory classification model to automatically identify key features and automatically capture the features of the local area;
[0113] The calculation steps of the dilated convolution are as follows: based on the input size of the grayscale image, the convolution step size, the convolution padding size, the equivalent convolution kernel size, the actual convolution kernel size and the dilation rate, the convolution output size is calculated.
[0114] In an embodiment of the present invention, the above-mentioned static trajectory classification model biSAMNet includes: the first layer is a bidirectional LSTM network; the second layer is a GELU function activation and layer normalization; the third layer is a multi-head b attention model; the fourth layer is a block maximum pooling layer; the fifth layer is a GELU function activation and layer normalization; the sixth layer is a fully connected layer.
[0115] In the embodiment of the present invention, the static information classification step S20 further includes:
[0116] For the i-th word vector, the concatenated semantic vector obtained is: the left context represents c l (x i ), the right context represents c r (x i ) and the word embedding vector e(x) of the i-th word vector itself i ) The three are spliced together; the formula is expressed as:
[0117] c l (x i )=f(Wl c l (x i-1 )+W sl e(x i-1 ))
[0118] c r (x i )=f(W r c r (x i+1 )+W sr e(x i+1 ))
[0119] e * (x i )=[c l (x i ); e(x i );c r (x i )]
[0120] Among them, W l is the weight matrix used to transfer the current hidden layer state to the next layer, W sl is the weight matrix used to fuse the current word vector with its previous context information, W sr is the weight matrix used to fuse the current word vector with its context information.
[0121] In the embodiment of the present invention, the GELU function formula is expressed as:
[0122]
[0123] Among them, x is the concatenated semantic vector; Tanh function is an extension of Sigmoid function;
[0124] The block maximum pooling layer formula is expressed as:
[0125]
[0126] Among them, Ni and Cj represent the coordinates of the feature map, k represents the number of feature channels of the feature map, m represents the offset of the step size, and stride represents the step size.
[0127] In a second aspect, the embodiment of the present application provides a trajectory classification device based on a deep convolutional neural network, using the trajectory classification method based on a deep convolutional neural network as described above, such as Figure 2 As shown, the system includes:
[0128] Data preprocessing module 10: based on the original trajectory data to be classified, performs data cleaning and data format conversion, and outputs a compressed grid sequence;
[0129] Static trajectory information classification module 20: input the compressed grid sequence encoding into a pre-built static trajectory classification model, wherein the trajectory static classification model adopts a bidirectional long short-term memory network and a multi-head self-attention mechanism, extracts context information in the trajectory sequence through the bidirectional long short-term memory network, and adopts a multi-head self-attention mechanism combined with a block maximum pooling method to extract trajectory semantic information, and comprehensively outputs the static information classification result of the trajectory;
[0130] The spatiotemporal image trajectory classification module 30 converts the encoding of the grid sequence before compression into a single-channel grayscale image, inputs the pre-built spatiotemporal image trajectory classification model for feature extraction and classification, and outputs the dynamic image information classification result of the trajectory, wherein the trajectory image classification model adopts an improved convolutional neural network.
[0131] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings:
[0132] Figure 3 The schematic diagram of the specific embodiment of the method of the present invention is as follows: Figure 3 As shown:
[0133] 1. Data cleaning and trajectory compression
[0134] Figure 4 This is a flow chart of a specific embodiment of the data cleaning and trajectory compression method of the present invention. The processing flow is as follows: Figure 4 As shown:
[0135] While AIS provides a feature-rich and easily accessible data resource for maritime professionals and researchers, there is a potential for errors and inaccuracies in AIS data. Most of these inaccuracies and errors occur in manually entered data, which covers static information (such as MMSI, ship size, IMO number, ship name, type and call sign) as well as voyage-related information (such as estimated time of arrival and intended destination). For example, although the MMSI number of each ship is supposed to be unique, Mazzarella et al. pointed out that different ships sometimes share the same MMSI number. In addition, Watson et al. found that AIS data often contains blank or inaccurate ETA reports. In addition to the problem of manually entered data, even data automatically generated by sensors can be erroneous. Harati-Mokhtari et al. pointed out that AIS may report incorrect position information if the positioning system fails or is not properly connected to the AIS device. In some extreme cases, there are even reports that some ships turn off their AIS. AIS data is also characterized by large data volume. Considering that AIS is updated every 10 seconds, a single ship can generate more than 3 million records in a year. Observing the data of 5,000 ships for three years will accumulate 40 billion records. Considering the inaccuracy and large quantity of AIS data, the method proposed in this chapter only requires three fields in the AIS data: longitude, latitude and timestamp. No other fields are required. At the same time, the grid coding method is used to convert tens of thousands of raw data into a row of grid sequences.
[0136] Table-1 Original data style
[0137]
[0138] An original AIS message contains all fields, represented by t original It contains dynamic information such as longitude, latitude, timestamp, speed and static information at time t.
[0139] t original = {mmsi,lon t ,lat t ,time t ,sog t ,heading t ,cog t ,…} (-1)
[0140] The purpose of this paper is to classify static information based on as little original information as possible. Therefore, only three dynamic information, longitude, latitude, and timestamp, are retained. At the same time, the mmsi number that can uniquely identify the ship is retained. process As shown in Table-1.
[0141] tprocess = {mmsi,lon t ,lat t ,time t} (-2)
[0142] Then all t within a certain period of time process First group by the mmsi field, and then sort by the time timestamp in ascending order. Note that if the time of the current data is t The time from the last data t-1 If the interval is too long, it is considered as a new track of the ship. In the experiment, 1 day (86400s) is used. Then, the track corresponding to each ship is reached, but at this time t process The number of points is very large, and there are abnormal data points that need to be deleted.
[0143] 2. Outliers in trajectory segments
[0144] The AIS system may generate errors in the process of receiving information due to objective reasons such as sensor noise, object obstruction, network transmission, etc. Figure 5 These outliers need to be judged by the speed value between two adjacent points in the track segment. The speed and Haversine distance calculation formula between two track points of the ship is (-3), where t n is the time difference between two points, in seconds; V n Indicates that the ship is at t n The average speed in m / s; d n is the distance between two points, r is the radius of the earth, which is 6371.393km; is the longitude and latitude of point 1, in radians. Predicted heading speed V n ′ =V n-1 +(V n-1 -V n-2 ), threshold ε n = k × V n-1 , where k∈[0.3,0.7]. If |V n -V n ′ |>ε n , then delete the nth trajectory point.
[0145]
[0146] After removing the abnormal points, the present invention discovered another problem: the density of the track points is too high. For example, although the actual navigation distance may be only one kilometer, thousands of AIS data points are used to depict this track. This data redundancy will result in an overly long data sequence after the track points are converted into grid codes, making it impossible to apply them effectively. The Visvalingam-Whyatt algorithm effectively reduces the number of points by evaluating the importance of each point and gradually removing minor points, retaining the core features of the geometric form, and greatly improving the efficiency of AIS data processing. It is particularly suitable for Web maps and mobile applications with limited resources, ensuring the accuracy of geographic shapes and the efficiency of data processing.
[0147] In the Visvalingam-Whyatt algorithm, the importance is related to the area of the triangle formed by each point and its two sides. Given a string of 2D points, The importance of each internal point is calculated by finding the area of the triangle formed by the internal point and its direct neighbors. This can be done quickly using the matrix determinant. Or using formula (-4), if A_i is less than a given threshold p, then delete the point and repeat the process until the entire sequence is traversed.
[0148]
[0149] Table-2 Data style after processing
[0150]
[0151] 3. Convert longitude and latitude tracks to grid sequences
[0152] After that, gridding is performed, which converts the continuous longitude and latitude values into corresponding discrete grid point numbers. The specific operation is to first divide a series of predefined grids, and then correspond each longitude and latitude point to the grid it falls on. If the track point is located in a certain grid area, it is considered that the ship has passed this grid point. The conversion process is as follows Figure 6 After the conversion is completed, the corresponding static information is obtained by matching the MMSI to the ship file. In this paper, the ship type and ship length (interval) are used as label values. The sample data is shown in Table 2.
[0153] 4. Word2vec word embedding vector training
[0154] For the problems with the original data mentioned above, the present invention first cleans the data, then compresses the trajectory to delete a large amount of redundant data, and then converts the continuous longitude and latitude data into a discrete grid sequence by means of grid coding, and finally uses the word2vec model to train the word embedding vector of each grid. Based on the AIS data collected in real scenarios, a trajectory similarity analogy experiment was conducted, and it was found that the performance of the word2vec word embedding vector is better than that of the one-hot encoding vector.
[0155] After obtaining the coded sequence, the present invention adopts the strategy of treating it as natural language and trains all sequences using the Skip-gram with Negative Sampling (SGNS) training method. Although a considerable number of sequences cannot be associated with specific ship archives, considering the unsupervised learning characteristics of Word2Vec, that is, no data labels are required, the present invention uses all sequences for training. Specifically, the corpus of the Skip-gram model includes each word w∈V w and the context c∈V of the word c , where V w and V c are word vocabulary and context vocabulary respectively. Among them, w comes from an unlabeled corpus, which contains w 1 ,w 2 ,…,w n (usually n is very large), and the word w i The context of a word is the word w surrounding it in a window of length 2L i-L ,…,w i-1 ,w i+1 ,…,w i+L The present invention uses D to represent the set of word pairs generated by the observed word and its context. The present invention uses #(w,c) to represent the number of times the word pair (w,c) appears in D. and Represent the number of times w and c appear in D respectively.
[0156] Each word w∈V w All represented as a vector Likewise, each context c∈V c Represented as a vector Where d is the dimension of the embedding. The specific values in the vector are regarded as the parameters to be learned by the model. The vector can also be Treat as |W w |×d matrix W, convert the vector It is called |V c |×d rows in the matrix C. In this case, W i (Ci ) refers to the vector representation of the i-th word (context) in the corresponding vocabulary.
[0157] Consider whether a pair of words (w, c) comes from D. Assume that P(D=1|w, c) is the probability that (w, c) comes from D, and P(D=0|w, c)=1-P(D=1|w, c) is the probability that it does not come from D. The probability distribution model is:
[0158]
[0159] in and are d-dimensional vectors that the model needs to learn. The goal of negative sampling is to maximize the probability P(D=1|w,c) for the observed word pair (w,c), and at the same time maximize the probability P(D=0|w,c) for the randomly selected negative sample, under the premise that randomly extracting the context of a given word will produce an unobserved word pair (w,c). Therefore, the goal of SGNS for a single (w,c) is:
[0160]
[0161] Where k is the number of negative samples, c N It is based on the empirical distribution of single characters The sampled context is obtained. The goal is to train in an online manner by performing stochastic gradient updates on the word pairs observed in D. The global goal is then to sum the word pairs w,c observed in the corpus:
[0162]
[0163] Optimizing this objective results in observed word-context pairs having similar embeddings while diversifying unobserved pairs. Intuitively, words that appear in similar contexts should have similar embeddings, and SGNS maximizes the dot product of similar words.
[0164] 5. Classify the static information of the trajectory
[0165] The proposed classification method uses only the two most basic location information of longitude and latitude, combined with attention mechanisms and other methods to classify the static information of the trajectory. Through a large number of experiments on real ship trajectory datasets, the experimental results prove the effectiveness of the method of the present invention, and at the same time prove the effectiveness of the word2vec pre-trained word embedding vector in the previous chapter, which can better help the deep network understand the geographical semantics of different grids, thereby improving the trajectory classification performance. The present invention designs a network model (biSAMNet) that combines a bidirectional long short-term memory network and self-attention. By using a bidirectional long short-term memory network to capture the contextual information of the text, the word order is retained to the maximum extent, and the original word embedding is spliced in the obtained output. Then, a multi-head self-attention layer is used to strengthen the key information, and the key part of the text is extracted by the chunk-max pooling technique. This technology obtains coarse-grained location information by retaining the relative order information of multiple local feature values. Even if the absolute location information is not retained, it can ensure that the feature is not missed when it appears significantly multiple times. The model uses the Gaussian Error Linear Unit (GELU) activation function. Compared with the ELU and RELU functions, the GELU function can adapt to different learning rates and show more complex curvature on the entire function curve, making it easier to approximate complex nonlinear functions.
[0166] 1) GELU is an activation function in neural networks. It can adapt to a variety of learning rate settings and is particularly effective in the field of natural language processing. In order to understand the characteristics of the GELU function in more detail, this section will compare and analyze it with other common activation functions, including Sigmoid, Tanh, ReLU, and LeakyReLU.
[0167] (1) Sigmoid: The Sigmoid function is in the form of σ(x) = 1 / (1+e -x ), which maps the input to the interval (0,1). However, when the input value is particularly large or small, the gradient of the Sigmoid function approaches zero, which will cause the so-called gradient vanishing problem. This problem will affect the update of weights during the training of deep learning models, thus limiting the application scenarios of the Sigmoid function in the field of deep learning.
[0168] (2) Tanh: Tanh function is an extension of Sigmoid function, which is in the form of tan(x)=(e x -e -x ) / (e x +e -x ), mapping the input to the interval (-1,1). Although the Tanh function solves the problem that the output of the Sigmoid function is not centered at zero, the problem of gradient disappearance still exists.
[0169] (3) ReLU: The ReLU function is in the form of f(x) = max(0,x). It remains linear for positive numbers, which simplifies the calculation of gradients and helps reduce the amount of calculation during model training. However, ReLU returns to zero when processing negative inputs, which may cause some neurons to stop activating, which is often called the "dead neuron" problem.
[0170] (4) LeakyReLU: To address the limitations of ReLU, researchers proposed the LeakyReLU function. It is defined as f(x) = x when x ≥ 0, and f(x) = α x when x < 0, where α is a small constant. The design of LeakyReLU ensures that the gradient is preserved even if the input is negative, avoiding the problem of gradient disappearance.
[0171] GELU was proposed by Hendrycks and Gimpel in 2016, and its mathematical formula is x = Φ(x), where Φ(x) is the cumulative distribution function of the standard normal distribution. The characteristic of the GELU function is that it can simulate the random inactivation (dropout) of weights, so it performs well when processing language data with uncertainty. Compared with other activation functions, GELU has several significant differences. This non-convex, non-monotonic function is not linear in the positive domain and has curvature at all points. ReLU and ELU are convex monotone activation functions, which are linear in the positive domain and may lack curvature. Therefore, increasing curvature and non-monotonicity may make GELU easier to approximate complex functions than ReLU or ELU. In addition, ReLU(x) = x(x>0) and GELU(x) = x·Φ(x)(μ=0,σ=1), the present invention can see that ReLU gates the input according to the sign of the input, while GELU weights the input according to the difference between the input and other inputs.
[0172] In summary, the reason why GELU shines in natural language processing tasks is that its powerful nonlinear modeling ability combined with the simulated dropout effect can enhance the model's ability to capture data generalization. This ability is particularly critical in scenarios where subtle differences in speech and complex contextual relationships require highly sensitive processing. Although other activation functions have their advantages in specific applications, in the face of the complexity and uncertainty of the field of NLP, GELU has demonstrated its excellent adaptability and effectively processed nonlinear features in information.
[0173] 6. b iSAMNet network structure
[0174] Figure 7 b is a schematic diagram of the iSAMNet network structure. Figure 7As shown in Figure 1, biSAMNet mainly integrates a bidirectional long short-term memory network, a multi-head self-attention mechanism, and a block maximum pooling layer. In short, when faced with a text raw input x of length n, i , biSAMNet first converts the text into the corresponding word vector e(x i ). Subsequently, the biLSTM network is used to process these word vectors to obtain the bidirectional feature representation of each word at different time points. On this basis, the model will compare the bidirectional output of the biLSTM with the original word vector e(x i ) are concatenated as the semantic vector of this time step. Specifically, for the i-th word, the semantic vector obtained is the left context representation c l (x i ), the right context represents c r (x i ) and the word embedding vector e(x i ) are composed of the three, see formula (-8)-(-10) for details. Among them, W l represents the weight matrix used to transfer the current hidden layer state to the next layer, and W sl is the weight matrix used to fuse the current word vector with its context information.
[0175] c l (x i )=f(W l c l (x i-1 )+W sl e(x i-1 )) (-8)
[0176] c r (x i )=f(W r c r (x i+1 )+W sr e(x i+1 )) (-9)
[0177] e * (x i )=[c l (x i ); e(x i );c r (x i )] (-10)
[0178] The concatenated vector is first processed by the GELU activation function. When tanh is used to approximate the GELU function, the calculation process is shown in formula (-11). The vector is then processed by layer normalization, and the standardization operation is performed according to formula (-12). Layer normalization is to apply standardization technology in the model to normalize the output of each layer to a uniform scale. This process calculates the mean and variance of all features of each sample, and performs corresponding scaling and offset adjustments accordingly to achieve data normalization. This technology significantly reduces the model's sensitivity to features of different ranges, improves training efficiency and the stability of input data processing, and thus accelerates the convergence of the model.
[0179]
[0180] Then, the block max pooling layer is used to select the most important features of each part. In this way, biSAMNet can automatically determine which feature plays a more important role in the text classification process. The block max pooling layer is as shown in formula (-13). The block max pooling layer is a downsampling technique commonly used in neural networks, such as Figure 8 As shown in the figure, it first divides the input data into multiple blocks, and then takes the maximum value in each block as the representative of the block. This operation can retain multiple local maximum features and their relative order, rather than relying solely on a global maximum. Block maximum pooling can therefore better retain and highlight key local features, while reducing data dimensions and the complexity of subsequent calculations.
[0181]
[0182] Finally, the data after activation and layer normalization is expanded, and the dimension is reduced through the fully connected layer, and finally multi-category classification is performed through the softmax function. The Softmax function is widely used in multi-classification problems in machine learning. It can convert any real-valued k-dimensional vector into another k-dimensional real vector, where the value of the i-th item is as shown in formula (-14), where the value of each dimension is limited to between [0,1], and the sum of the values of all dimensions is ensured to be 1, so the converted vector can be regarded as a probability distribution. In the output layer of the neural network, the Softmax function is usually used to predict the probability of each category, and the category with the highest probability is used as the predicted output of the model. The specific calculation method is to first calculate the exponent of each element in the original vector, and then divide the exponent of each element by the sum of the exponents of all elements to achieve normalization, so as to obtain the final probability distribution. The cross entropy loss is calculated according to (-15), M is the number of categories, y is the number of categories, and ic is 0 / 1, if the true category of sample i is c, it is equal to 1, otherwise it is equal to 0, p ic is the predicted probability that observation i belongs to category c.
[0183]
[0184] Comparative experimental results
[0185] Table-3 Comparison of classification performance of biSAMNet and other trajectory classification methods
[0186]
[0187] In order to fully verify the application effect of our proposed deep learning model in the field of navigation, the present invention uses ship trajectory data collected in real navigation scenarios for training and testing. In order to ensure the fairness of the test, the present invention also retrains and evaluates several other popular trajectory classification models on the same dataset, while ensuring that the core parameters of these models remain consistent. Specifically, the present invention selects five network models that are widely used in text classification, and performs five-category tasks on the ship type dataset and four-category tasks on the ship length dataset. The comparison results are shown in Table 3. It can be seen from the table that the method proposed by the present invention is very effective. On the ship category dataset, the precision, recall, and F 1 The scores and accuracy rates reached 95.01%, 90.42%, 92.50%, and 95.10% respectively. Compared with other methods, except that the accuracy rate was slightly lower than that of the biLSTM_Attention model, all other methods achieved good results. On the ship length dataset, the model of the present invention is significantly better than other models. This is mainly because the method of the present invention can pay attention to the characteristics of each part, effectively avoiding the information loss problem caused by focusing only on the overall maximum value, helping the deep network to focus on the key trajectory area, thereby improving the trajectory classification performance.
[0188] 7. Classification of trajectory spatiotemporal images
[0189] The trajectory compression technology proposed in this paper can solve the problem of information loss that may be caused by constructing an image dataset from a spatial perspective and introducing a convolutional neural network to build a classification model based on trajectory images, so that the deep neural network can capture more feature details in the original trajectory.
[0190] The main contributions of the proposed trajectory classification model based on deep convolutional neural network include the following two aspects: (1) In order to solve the information loss problem caused by compressing the trajectory into a grid sequence, the original trajectory is converted into a single-channel grayscale image of uniform size as the spatial feature of the trajectory, and a neural network based on the improved ResNet is constructed for feature extraction and classification. That is, an original trajectory is converted in two different ways and then processed in different ways respectively, with text representing its sequential features and images representing its spatial features. Extensive experiments were conducted on real-world datasets. Experimental results show that the model of the present invention can effectively further extract trajectory features and improve classification accuracy.
[0191] The deep learning model proposed in the present invention is key to using an image-based method to represent trajectory data and using CNN to extract features, thereby solving the many limitations of converting trajectories into text. The input of the model is a grayscale image converted from a grid sequence, and the output is a classification label of the ship, which is consistent with the previous research content. Specifically, for an uncompressed grid sequence consisting of hundreds of thousands of grid points, the present invention counts the access frequency of each grid, and normalizes and maps these frequencies to a grayscale value range of 50-255, ensuring that grid sequences of different lengths can be uniformly represented on a grayscale image of a fixed size. The grayscale image effectively expresses the spatial distribution characteristics of the ship's trajectory, which allows CNN to effectively process it. CNN uses multiple convolutional layers to automatically identify key features in the data, such as the complex spatial patterns of ships, including mooring, anchoring, straight sailing, and turning. At the same time, the convolutional layer has the characteristics of a local receptive field, which can capture the characteristics of local areas in the trajectory data, providing support for understanding and analyzing the behavior patterns of ships.
[0192] The conversion process is as follows Fig. 9 As shown, after statistics, the original trajectory is converted into a two-dimensional array X, which contains 31*28 elements, and the element in the i-th row and j-th column is recorded as x ij , the present invention hopes to normalize this array to a new range [50,255], and the minimum value is converted to 50 in order to fully distinguish the difference between the grid points that the ship has passed and the grid points that it has not passed. First, find the maximum value x in the array max and the minimum value x min . Then calculate the normalized scale s and offset d. Then convert each element x in the array ij Normalization is performed, and the process is as shown in formula (-16)-(-18).
[0193]
[0194] d=ax min ×s (-17)
[0195] xmormalized =x i ×s+d (-18)
[0196] Taking into account the small size of trajectory data images, the present invention reduces the size of ResNet to 6 layers, and uses dilated convolution on the first convolution layer. Dilated convolution, also known as expanded convolution, is a special type of convolution operation that introduces a dilation rate parameter on the basis of traditional convolution kernels to expand the receptive field of the convolution kernel. By inserting holes (i.e., zero padding) between adjacent elements of the convolution kernel, dilated convolution can cover a larger input area without increasing the number of parameters and computational cost. The main advantage of dilated convolution is that it can capture broader contextual information, which is particularly valuable for processing tasks that require global information. In addition, dilated convolution avoids the resolution reduction caused by continuous pooling operations, thereby allowing the network to learn more refined features while maintaining the resolution of the feature map. After introducing the dilation rate, the output size calculation formula of the convolution is as follows (-19)-(-20). Among them, w out Indicates the output size, w in represents the input size, stride represents the step size, padding represents the padding size, K represents the equivalent convolution kernel size, k represents the actual convolution kernel size, and r represents the void ratio. When the convolution kernel size is 3 and the void ratio is 2, the calculation process is as follows: Fig.10 shown.
[0197]
[0198] K=k+(k-1)·(r-1) (-20)
[0199] Fig.11 Schematic diagram of application scenario of the embodiment of the present invention, such as Fig.11 As shown, the trajectory classification method and device based on deep convolutional neural network of the present invention can be applied to a variety of scenarios, such as trajectory classification of aviation systems, ship systems or heavy truck systems, but the present invention is not limited to this. The present invention can also be applied to trajectory classification in other scenarios.
[0200] Thirdly, Fig.12 As shown, an embodiment of the present application provides a first electronic device A, which can also be connected to a data acquisition device C and an information display device D through a wired or wireless information transmission scheme. The first electronic device A adopts a trajectory classification device B based on a deep convolutional neural network as described above. The electronic device may be connected to an information display device, and the information display device is used to display the evaluation result according to display parameters and attributes set by the user or through an artificial intelligence model.
[0201] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the trajectory classification method based on a deep convolutional neural network as described above is implemented.
[0202] In addition, combined Figure 1 The trajectory classification method based on a deep convolutional neural network described in the embodiment of the present application can be implemented by a second electronic device. Fig.13 Schematic diagram of the hardware structure of a second electronic device according to an embodiment of the present application.
[0203] The second electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The second electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are only used as examples, and are not intended to limit the implementation of the present invention described and / or required herein. The second electronic device may be the same or different from the first electronic device A.
[0204] Fig.13 A schematic block diagram of a second electronic device that can be used to implement an embodiment of the present invention is shown. The computer device may include a processor 81 and a memory 82 storing computer program instructions.
[0205] In some of these embodiments, the computer device may further include a communication interface 83 and a bus 80. Fig.13 As shown, the processor 81, the memory 82, and the communication interface 83 are connected via a bus 80 and communicate with each other.
[0206] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A trajectory classification method based on deep convolutional neural network, characterized in that: include: Data preprocessing step: Based on the original trajectory data to be classified, data cleaning and trajectory compression conversion are performed to output a compressed grid sequence; Static trajectory information classification step: inputting the encoding of the compressed grid sequence into a pre-built static trajectory classification model, wherein the trajectory static classification model adopts a bidirectional long short-term memory network and a multi-head self-attention mechanism, extracting context information in the trajectory sequence through the bidirectional long short-term memory network, adopting the multi-head self-attention mechanism combined with a block maximum pooling method to extract trajectory semantic information, and comprehensively outputting the static information classification result of the trajectory; The spatiotemporal image trajectory classification step: converting the encoding of the grid sequence before compression into a single-channel grayscale image, inputting the pre-built spatiotemporal image trajectory classification model for feature extraction and classification, and outputting the dynamic image information classification result of the trajectory, wherein the trajectory image classification model adopts an improved convolutional neural network; The static trajectory information classification step and the spatiotemporal image trajectory classification step are performed synchronously or superimposedly.
2. The trajectory classification method based on deep convolutional neural network according to claim 1 is characterized in that: The data preprocessing step also includes: Data cleaning step: Based on the original trajectory data, clean the redundant fields, retain the valid static trajectory information and dynamic trajectory information, group and sort all the cleaned data, and output the final cleaned trajectory data; Outlier point removal step: searching and removing outliers from the cleaned trajectory data, evaluating the importance of trajectory points, and gradually removing minor points to reduce the density of trajectory points, and outputting trajectory data after outlier point processing; Grid processing step: converting the latitude and longitude values of the continuous trajectory points in the trajectory data after the abnormal point processing into corresponding discrete grid point numbers, and after the conversion is completed, obtaining the static trajectory information corresponding to the number according to the pre-stored database matching; Word embedding vector training step: Based on the static trajectory information, a text representation model is used to train word embedding vectors for the grid points of the grid sequence, and the word vectors of the grid points are output.
3. The trajectory classification method based on deep convolutional neural network according to claim 1 is characterized in that: The trajectory static information classification step includes: Static trajectory model construction steps: using bidirectional long short-term memory network biLSTM, multi-head self-attention mechanism and block maximum pooling layer method to construct the static trajectory classification model biSAMNet; Static information classification step: based on the word vector after word embedding, the bidirectional long short-term memory network is used to splice the bidirectional output of the word vector with the original word vector at the corresponding time point, and the semantic vector at the time point is output; Block max pooling step: After using the block max pooling layer to select the most important features of each part of the semantic vector; the data after activation and layer normalization is expanded, and the dimension is reduced through the fully connected layer, and finally multi-category data classification is performed through the softmax activation function, and the final static trajectory information classification result is output.
4. The trajectory classification method based on deep convolutional neural network according to claim 1 is characterized in that: The spatiotemporal image trajectory classification step comprises: The step of constructing a spatiotemporal image trajectory classification model is as follows: the spatiotemporal image trajectory classification model is constructed based on a neural network model improved by ResNet, wherein the first convolution layer in the ResNet model adopts a dilated convolution; Grid sequence conversion step: converting the grid sequence before compression into a single-channel grayscale image; Spatiotemporal image trajectory classification step: inputting the single-channel grayscale image into the spatiotemporal trajectory classification model to automatically identify key features and automatically capture features of local areas; The hole convolution calculation step is as follows: based on the input size of the grayscale image, the convolution step size, the convolution padding size, the equivalent convolution kernel size, the actual convolution kernel size and the hole rate, the convolution output size is calculated.
5. The trajectory classification method based on deep convolutional neural network according to claim 3 is characterized in that: The static trajectory classification model biSAMNet includes: the first layer is a bidirectional LSTM network; the second layer is a GELU function activation and layer normalization; the third layer is a multi-head self-attention model; the fourth layer is a block maximum pooling layer; the fifth layer is a GELU function activation and layer normalization; the sixth layer is a fully connected layer.
6. The trajectory classification method based on deep convolutional neural network according to claim 5, characterized in that: The static information classification step further comprises: For the i-th word vector, the concatenated semantic vector obtained is: the left context represents c l (x i ), the right context represents c r (x i ) and the word embedding vector e(x i ) The three are spliced together; the formula is expressed as: c l (x i )=f(W l c l (x i-1 )+W sl e(x i-1 )) c r (x i )=f(W r c r (x i+1 )+W sr e(x i+1 )) e * (x i )=[c l (x i );e(x i );c r (x i )] Among them, W l is the weight matrix used to transfer the current hidden layer state to the next layer, W sl is the weight matrix used to fuse the current word vector with its previous context information, W sr is the weight matrix used to fuse the current word vector with its context information.
7. The trajectory classification method based on deep convolutional neural network according to claim 6, characterized in that: The GELU function formula is expressed as: Wherein, x is the concatenated semantic vector; Tanh function is an extension of Sigmoid function; The block maximum pooling layer formula is expressed as: Among them, Ni and Cj represent the coordinates of the feature map, k represents the number of feature channels of the feature map, m represents the offset of the step size, and stride represents the step size.
8. A trajectory classification device based on a deep convolutional neural network, using the trajectory classification method based on a deep convolutional neural network as claimed in any one of claims 1 to 7, characterized in that: The system comprises: Data preprocessing module: Based on the original trajectory data to be classified, it performs data cleaning and data format conversion, and outputs a compressed grid sequence; Static trajectory information classification module: input the encoding of the compressed grid sequence into a pre-built static trajectory classification model, wherein the trajectory static classification model adopts a bidirectional long short-term memory network and a multi-head self-attention mechanism, extracts context information in the trajectory sequence through the bidirectional long short-term memory network, adopts the multi-head self-attention mechanism combined with a block maximum pooling method to extract trajectory semantic information, and comprehensively outputs the static information classification result of the trajectory; Spatiotemporal image trajectory classification module: convert the encoding of the grid sequence before compression into a single-channel grayscale image, input the pre-built spatiotemporal image trajectory classification model for feature extraction and classification, and output the dynamic image information classification result of the trajectory, wherein the trajectory image classification model adopts an improved convolutional neural network.
9. An electronic device, characterized in that: A trajectory classification device based on a deep convolutional neural network as described in any one of claim 8 is used, and the electronic device is connected to an information display device, which is used to display the evaluation result according to display parameters and attributes set by the user or through an artificial intelligence model.
10. A storage medium for storing a computer program for executing the trajectory classification method based on a deep convolutional neural network as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Trajectory recognition model training method and trajectory recognition method
CN112766339A
Vehicle track prediction model construction method combining data driving and knowledge guiding
CN117141517A
Natural language processing using a neural network
US20180349359A1
Cited By
Agricultural machine track analysis method based on remote sensing image enhancement
CN120296398A
Model training method and trajectory prediction method based on multi-dimensional feature fusion
CN120561884A
Five-axis numerical control machining small line segment grouping method based on track fairing strategy
CN121069900A
