Personalized ship recommendation method for sailors based on graph neural network and Transform enabling
By constructing a knowledge graph based on multi-source data fusion and a breadth-depth dual-pathway model, combined with a three-dimensional comparative learning framework, the limitations of crew skill matching in the crew dispatch system were addressed, enabling accurate recommendations between crew members and ships and improving the accuracy and robustness of the recommendation system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-17
- Publication Date
- 2026-04-07
AI Technical Summary
Existing crew dispatch systems have limitations in crew skill matching, safety training, and information transparency. In particular, they lack effective semantic fusion mechanisms when dealing with heterogeneous information networks, resulting in limited recommendation accuracy and generalization ability. Furthermore, contrastive learning techniques have not yet effectively solved the problems of data sparsity and cold start.
We construct a knowledge graph covering crew members, skills, ships, ports, and job positions. We adopt a multi-source data fusion strategy and a variational heterogeneous graph autoencoder, design a breadth-depth dual-path model and a user-relationship-entity three-dimensional comparative learning framework, and achieve accurate recommendations for crew members and ships through graph neural networks and Transformer models.
It achieves precise matching of crew members and ships, improves the accuracy and generalization ability of the recommendation system, solves the problems of data sparsity and cold start, and enhances the robustness and feature representation ability of the model.
Smart Images

Figure CN121807974A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of crew dispatch technology, and more particularly to a personalized ship recommendation method for crew members empowered by graph neural networks and Transformers. Background Technology
[0002] The development of crew dispatch systems has evolved from purely manual to digital and intelligent methods. Early crew management relied primarily on paper forms, independent databases, and manual memorization, a method that was inefficient and prone to errors. With the introduction of computer technology, crew management gradually moved towards digitalization. For example, the crew communication system software launched by Xinde Maritime Network in 2007 initially realized the digitalization of ship-shore communication. However, traditional crew dispatch systems still have many limitations, particularly in crew skill matching, safety training, and information transparency. The rapid development of modern shipping technology, such as the emergence of automated and intelligent vessels, further highlights the shortcomings of traditional crew management systems, making the matching of crew skills with vessel needs increasingly prominent.
[0003] In recent years, the application of artificial intelligence and big data technologies in the field of seafarer recruitment has provided new solutions to the aforementioned problems. For example, the AI-Sailing IBuilder Nexus Agent platform integrates multi-dimensional data such as routes, ship types, and job requirements to achieve intelligent matching of seafarers and ships. The SeaPlatformJob platform uses intelligent algorithms to aggregate maritime job information, significantly reducing recruitment error rates. Although these technologies have improved matching efficiency to some extent, problems such as data sparsity, cold start, and insufficient interpretability still exist. The introduction of knowledge graph and graph neural network technologies has provided new technical paths for seafarer and ship recommendation. For example, a knowledge graph-based maritime information recommendation system can achieve personalized information delivery throughout the entire process. However, existing technologies often ignore the interaction information between users and projects when processing heterogeneous information networks and lack effective semantic fusion mechanisms, resulting in limited recommendation accuracy and generalization ability. In addition, although the application of contrastive learning technology in recommendation systems has made some progress, how to effectively utilize contrastive learning to solve the problems of data sparsity and cold start in the seafarer and ship recommendation scenario still needs further exploration. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides a personalized ship recommendation method for crew members powered by graph neural networks and Transformers. First, it constructs a maritime-specific knowledge graph using structured data to provide semantic support for the recommendation task. Then, to address the challenge of fusing multi-source heterogeneous data, it designs a variational heterogeneous graph autoencoder to achieve unified feature representation. Next, to address the insufficient capture of long-distance relationships, it proposes a breadth-depth dual-path model to mine global and local associations. Finally, it enhances the discriminative power of the embedded representation through three-dimensional contrastive learning, ultimately outputting accurate ship recommendation results.
[0005] The technical means employed in this invention are as follows: A personalized ship recommendation method for crew members empowered by graph neural networks and Transformers includes: S1. Construct a knowledge graph covering multiple entity types such as crew members, skills, ships, ports, and job positions to transform scattered maritime data into a structured semantic relationship network; S2. A multi-source data fusion strategy is adopted to collect maritime data, and the collected maritime data is preprocessed to obtain a triplet dataset that can be directly used for model training. S3. Design a variational heterogeneous graph autoencoder for crew feature encoding. Through a three-layer architecture of heterogeneous graph construction, type-aware attention aggregation, and variational inference, it realizes unified representation and potential association modeling of multi-source heterogeneous data. S4. Construct a breadth-depth dual-path knowledge graph aggregation model, including a breadth path, a depth path, and a dual-path self-attention fusion module. The breadth path is based on a graph attention network to achieve multi-layer neighbor aggregation, covering the global topology of the knowledge graph and capturing short-distance relationships between entities. The depth path is based on a Transformer encoder to achieve long-path sampling and encoding, mining multi-step indirect relationships between entities. The dual-path self-attention fusion module is used to dynamically integrate the breadth path and the depth path to form an entity representation that takes into account both global and local, short-range and long-range relationships. S5. Design a three-dimensional joint comparative learning framework for users, relationships, and entities. With users, relationships, and entities as the core dimensions, construct multi-type sample pairs and a joint loss function to strengthen semantic boundaries in the embedding space. This brings semantically similar entity representations closer together and pushes semantically unrelated entity representations further apart, ultimately outputting accurate ship recommendation results.
[0006] Furthermore, in step S1, the core elements of the knowledge graph include an entity set, a relation set, and a triple set, wherein: The entity set encompasses five core entities, including crew entities, skill entities, ship entities, port entities, and job entity entities; The relation set defines seven core semantic relations, including crew member-skills, crew member-job position, crew member-veteran ship, ship-required job position, ship-required skills, ship-port of call, and job position-related skills; Triple sets store the relationships between entities in the form of head entity-relationship-tail entity, forming a structured semantic relationship network.
[0007] Further, step S2 includes: S21. Obtain basic crew information and vessel registration data from the maritime management platform. The basic crew information includes age, nationality, occupation, and skill certificates; the vessel registration data includes tonnage, vessel type, speed, and port of call. S22. Collect historical interaction records between crew members and vessels from the shipping company's operating system, including the start and end times of crew members' service on vessels and their work evaluations; S23. Supplement publicly available port data and vessel route data using web crawling technology. The publicly available port data includes berth capacity and berthing vessel types; the vessel route data includes regular routes and navigation areas. S24. Perform data cleaning on the collected maritime data, including: For missing values related to crew member age, the average age of crew members in the same occupation and of the same nationality was used to fill the gaps. For outlier ship tonnage values, the 3σ criterion is used for filtering. For duplicate entries in crew-ship interaction logs, retain the earliest valid record; To address the issue of inconsistent skill certificate number formats, the unified format is now "letter prefix - 6 digits"; S25. Transform unstructured and discretized features into vector representations that the model can process, achieving feature encoding, including: For discrete features, including crew job positions, ship type and port region, an embedding layer encoding is used. The low-dimensional dense vector of the discrete feature is obtained through learning. That is, for a certain discrete feature category, it is first transformed into a one-hot vector, and then multiplied with the embedding matrix to obtain the final encoded vector. The dimension of the embedding matrix is adaptively adjusted according to the number of feature categories. For continuous features, including crew age, ship tonnage and sailing time, a multilayer perceptron is used for normalization encoding. The continuous values are mapped to vectors in the range [-1,1] through linear transformation and ReLU activation function to avoid model training bias caused by differences in numerical range. S26. Import the preprocessed entity and relation data into the Neo4j graph database to construct a visualized knowledge graph of the shipbuilding domain, supporting semantic association retrieval through node queries and relation queries. At the same time, extract all valid triples from the graph database, map entities and relations with unique IDs respectively, and form a triple dataset that can be directly used for model training.
[0008] Further, step S3 includes: S31. Construct a heterogeneous graph in the maritime domain, using preprocessed entities as nodes and the seven defined types of relationships as edges, to form a heterogeneous graph structure containing different node types and edge types. S32. Design a heterogeneous graph perception and attention layer, and adopt differentiated attention calculation strategies for different types of nodes and edges; S33. To model the uncertain relationships between entities, a variational inference module is introduced on the basis of the heterogeneous graph perception attention layer. The aggregation features of nodes are mapped to the latent probability distribution space, and robust latent node representations are generated through sampling.
[0009] Further, step S32 includes: S321. For any two adjacent nodes in a heterogeneous graph, firstly, assign dedicated weight matrices according to the node type and edge type respectively, and perform linear transformation on the node features to ensure that the features of different types of nodes are mapped to the same semantic space; then, concatenate the transformed node features with the edge type embedding vector, and calculate the attention score through the LeakyReLU activation function to measure the information contribution of the neighboring nodes to the current node. S322. To avoid the neighbor nodes of a certain type of edge from excessively dominating information aggregation, attention coefficients are normalized only for the neighbor nodes of the same type of edge. S323. Based on the normalized attention coefficients, the neighbor node information of different types of edges is aggregated separately, and then the aggregation results of all types of edges are concatenated. The aggregation features of the current node are obtained by using the Sigmoid activation function.
[0010] Further, step S33 includes: S331. The mean and variance of the latent distribution are predicted using two independent multilayer perceptrons. The mean multilayer perceptron maps the aggregated features output from the heterogeneous map perception attention layer to the mean vector of the latent distribution. The variance multilayer perceptron, through... The activation function maps aggregated features to a variance vector; S332. To solve the problem of non-differentiability of latent variables, a reparameterization technique is adopted to sample a noise vector from the standard normal distribution and generate the latent representation of the node through the mean vector and the variance vector. S333. Construct the loss function of the variational heterogeneous graph autoencoder, including reconstruction loss and KL divergence. The reconstruction loss ensures that the latent representation can recover the original structure of the heterogeneous graph, while the KL divergence constrains the latent distribution to be close to the standard normal distribution, thus avoiding model overfitting.
[0011] Further, step S4 includes: S41. Constructing a broad path: The core objective of a broad path is to capture the global topological structure of the knowledge graph and aggregate multi-step neighbor information through a multi-layer, multi-head GAT to cover short-distance relationships between entities. S42. Construct deep paths. The core objective of deep paths is to mine long-range indirect relationships between entities. This is achieved through path sampling and Transformer encoders to semantically encode multi-step long paths, covering long-distance associations between entities. S43. To achieve dynamic integration of breadth-based and depth-based representations, a self-attention fusion module is designed to adaptively adjust the weights of the two representations based on the information importance in different scenarios; using breadth-based aggregation representation... For the query vector, deep aggregation representation Given key and value vectors, the fusion weights are calculated using a self-attention mechanism.
[0012] Further, step S41 includes: S411. To avoid the bias of a single attention head, multi-head attention is used to aggregate neighbor information in parallel. S412. A three-layer Gaussian Attraction Amplifier (GAT) is used to achieve multi-step neighbor aggregation. The first layer aggregates 1-step neighbors, the second layer aggregates 2-step neighbors, and the third layer aggregates 3-step neighbors. Simultaneously, to avoid feature dimensionality expansion caused by multiple layers of aggregation, a batch normalization layer is added after each GAT layer to stabilize the training process. Finally, the output features of the multi-head attention parallel aggregation are concatenated and mapped to the same dimension as the output of the variational heterogeneous graph autoencoder through a linear compression layer to obtain the breadth-based aggregated representation of the entities. This indicates that the entity contains global topological association information in the knowledge graph.
[0013] Further, step S42 includes: S421. A random path sampling method based on Markov chains, which takes the target entity as the starting point and samples multi-step long paths according to relational probabilities; S422. For the sampled long path, use the Transformer encoder to perform semantic encoding to capture the multi-step long dependency relationship in the path; S423. Employ multi-head attention to calculate the attention weight of each element in the path to other elements and capture the dependencies between elements. S424. Perform linear transformation and nonlinear activation on the output of multi-head self-attention to enhance the model's expressive power. The calculation method of FFN is as follows: ,in , This is the weight matrix. , As a bias term, nonlinearity is introduced through the ReLU activation function, and then the output dimension is restored through linear transformation; S425. For the output sequence of the Transformer encoder, take the output vector corresponding to the target entity as the depth aggregation representation of the entity.
[0014] Further, step S5 includes: S51. Based on the knowledge graph of the shipping domain and crew-ship interaction records, construct positive sample pairs, similar positive sample pairs, and negative sample pairs with maritime scenario characteristics to ensure that the sample pairs can cover multi-dimensional associations of matching-non-matching and direct-indirect relationships, wherein: Positive sample pairs include direct positive samples and indirect positive samples; direct positive samples are constructed based on direct crew-ship interaction records, i.e., if the crew... Previously served on ships Interaction matrix Then construct positive sample pairs Indirect positive samples are constructed based on indirect associations in a knowledge graph, i.e., if the crew members Skills mastered With ships Required skills A perfect match, regardless of the crew Have you ever served on a ship? All construct positive sample pairs ; Similar positive sample pairs are constructed based on the similarity of crew members, i.e., if the crew members and Skill similarity exceeds threshold Then positive sample pairs Transform into Similar positive sample pairs ; Negative sample pairs include random negative samples and conflicting negative samples, avoiding noise interference from traditional random negative samples; random negative samples are constructed based on unrelated records, i.e., if crew members... With ships If there are no direct interaction records and no indirect related paths, then construct random negative sample pairs. ; Conflict negative samples are constructed based on semantic conflict, that is, if the crew skills and ships If the requirements conflict, then construct conflicting negative sample pairs. ; S52. By jointly optimizing the contrastive loss and the ranking loss, the semantic boundaries of the embedding space are strengthened, including: The core objective of contrastive loss is to narrow the representation distance between positive sample pairs and widen the representation distance between negative sample pairs; for each positive sample pair... Calculate their cosine similarity in the embedding space. Then with the crew member All negative sample pairs The similarity is compared, and the loss is calculated using the softmax function; The core objective of ranking loss is to ensure that the matching score of positive sample pairs is higher than that of negative sample pairs, which aligns with the preference ranking logic of the recommendation scenario; for each crew member Randomly select a positive sample With a negative sample Calculate the difference in matching scores between the two. Matching score The score difference is mapped to the [0,1] interval by using the Sigmoid function, and then the negative logarithm is taken as the loss. The contrastive loss and ranking loss are fused by weights, and combined with the loss from the variational heterogeneous graph autoencoder to form the model's total loss function. By minimizing the total loss, the discriminative power of the embedded representation is improved, and the overall model performance is optimized, resulting in a highly discriminative optimized representation for crew members and ships. and ; S53. At the recommendation decision level, optimize the representation based on high distinguishability between crew members and ships. and The matching degree between crew members and ships is calculated using the vector inner product, and the formula is as follows:
[0015] The range of values for the inner product is related to the dimension of the embedding representation. Through the previous normalization process, the score range is ensured to be in the range of [0, 1]. The higher the score, the higher the matching degree between the crew and the ship. For each crew member First, filter out the ships that have served in the past, and then score all remaining ships according to their matching history. Sort by highest to lowest, and take the top few. Each vessel is used as a personalized recommendation result; S54. For cold start scenarios involving newly recruited crew members and newly commissioned vessels, recommendations are generated using the following strategies: For new crew members without interaction records, an initial representation is generated by encoding their basic features using a variational heterogeneous graph autoencoder. Then, the neighbor information of its skill node is aggregated through the dual-path aggregation module to generate an optimized representation. Finally, a recommendation list is generated based on the matching score, without relying on historical interaction data; For new vessels without crew affiliation, an initial representation is generated by encoding their technical parameters and requirements information using a variational heterogeneous graph autoencoder. Then, the neighbor information of the required job node is aggregated through the dual-path aggregation module to generate an optimized representation. Finally, all crew members are sorted by their matching scores, and the most suitable crew members are recommended.
[0016] Compared with the prior art, the present invention has the following advantages: 1. This invention addresses the problem of heterogeneous and difficult fusion of multi-source crew data and the potential relationships between various features. It proposes a variational heterogeneous graph autoencoder, which constructs a heterogeneous graph containing multiple types of nodes such as crew members, skills, and ships, and multiple relationships. It designs dedicated codes for different node types, aggregates neighbor information hierarchically through a heterogeneous graph attention neural network, and combines variational inference. This achieves the effect of unifying the representation of multi-source heterogeneous features, preserving the unique semantics of each feature, and improving the encoding capability of crew information.
[0017] 2. This invention addresses the problems of sparse relationships, difficulty in capturing long-distance complex relationships, and easy path-side information blockage in ship knowledge graphs. It proposes a breadth-depth dual-path embedding knowledge graph information aggregation model, which has a dual-path structure of breadth-depth path (GAT), depth-depth path (Transformer), and self-attention fusion module. The breadth-depth path captures global information through layer-by-layer attention message aggregation, while the depth-depth path captures long-range dependencies through path sampling and Transformer. This approach balances local neighborhood associations and long-range semantic information, effectively alleviating path-side information blockage.
[0018] 3. To address the issue of low discriminative power in model embedding representations affecting the accuracy of crew-ship matching, a three-dimensional joint comparison learning framework of user-relationship-entity is proposed. This framework features the construction of multi-type interactive sample pairs of "crew-entity-ship" and the joint optimization of comparison loss and ranking loss. It effectively narrows the embedding distance of recommended relation samples and widens the embedding distance of non-recommended relation samples, thereby strengthening semantic boundaries and improving the accuracy of crew-ship matching. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a diagram illustrating the overall architecture of the method of the present invention.
[0021] Figure 2 This is a schematic diagram of the breadth-depth dual-pathway knowledge graph aggregation model of the present invention.
[0022] Figure 3 This is a schematic diagram of the user-relationship-entity three-dimensional joint comparison learning framework of the present invention.
[0023] Figure 4 The figure shows the comparative experimental results of the Top-5 recommendations provided in the embodiments of the present invention.
[0024] Figure 5 The figure shows the comparative experimental results under the Top-4 recommendations provided in the embodiments of the present invention.
[0025] Figure 6 The figure shows the comparative experimental results under the Top-3 recommendations provided in the embodiments of the present invention.
[0026] Figure 7 The figure shows the ablation experiment results provided in the embodiments of the present invention. Detailed Implementation
[0027] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "comprising" and "having" and any variations thereof in the specification, claims and accompanying drawings of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such processes, methods, products or devices.
[0029] like Figure 1As shown, this invention provides a personalized ship recommendation method for crew members empowered by graph neural networks and Transformers, including: S1. Construct a knowledge graph covering multiple entity types such as crew members, skills, ships, ports, and job positions to transform scattered maritime data into a structured semantic relationship network; S2. A multi-source data fusion strategy is adopted to collect maritime data, and the collected maritime data is preprocessed to obtain a triplet dataset that can be directly used for model training. S3. The multi-source heterogeneous nature of crew and ship-related data is a core bottleneck of traditional recommendation methods: Crew data includes continuous age, discrete occupational positions, and multimodal skill certificate information, while ship data covers different dimensions such as technical parameters, operational information, and demand information. These data type differences prevent traditional feature concatenation methods from effectively preserving semantic relationships (e.g., directly concatenating age and occupational position will lose the potential relationship that "crew members of a certain age group are more suitable for a certain type of occupation"). Simultaneously, maritime data contains numerous potential relationships (e.g., "crew members with ocean-going navigation skills are more likely to serve on ocean-going cargo ships"), which traditional graph models cannot model. To address this, this invention designs a variational heterogeneous graph autoencoder for crew feature encoding. Through a three-layer architecture of heterogeneous graph construction, type-aware attention aggregation, and variational inference, it achieves a unified representation of multi-source heterogeneous data and models potential relationships. In this embodiment, the heterogeneous graph is used to characterize the semantic differences between different types of entities and relationships; type-aware attention solves the information aggregation bias problem of different types of nodes; and variational inference captures the uncertain relationships between entities by modeling potential distributions, providing a more robust feature representation for subsequent recommendations.
[0030] S4. Construct a breadth-depth dual-path knowledge graph aggregation model, including a breadth path, a depth path, and a dual-path self-attention fusion module. The breadth path is based on a graph attention network (GAT) to achieve multi-layer neighbor aggregation, covering the global topology of the knowledge graph and capturing short-distance relationships between entities. The depth path is based on a Transformer encoder to achieve long-path sampling and encoding, mining multi-step indirect relationships between entities. The dual-path self-attention fusion module is used to dynamically integrate the breadth path and the depth path to form an entity representation that takes into account both global and local, short-range and long-range relationships. S5. Design a three-dimensional joint comparative learning framework of user-relationship-entity, with user (crew)-relationship (match / mismatch)-entity (ship) as the core dimension. By constructing multi-type sample pairs and joint loss functions, the semantic boundary is strengthened in the embedding space, so that the distance between semantically similar entity representations is shortened and the distance between semantically unrelated entity representations is pushed away, and finally the accurate ship recommendation results are output.
[0031] In specific implementation, as a preferred embodiment of this invention, there is currently no publicly available standardized ship-crew knowledge graph in the maritime field, resulting in the ineffective utilization of potential connections between crew members and ships (such as the matching of crew members' ocean-going navigation skills with the needs of ships on transoceanic routes). Therefore, this invention first constructs a knowledge graph covering multiple entity types including crew members, skills, ships, ports, and job positions, transforming scattered maritime data into a structured semantic relationship network, providing a data foundation for subsequent graph neural network models. Specifically, in step S1, the core elements of the knowledge graph include an entity set, a relationship set, and a triplet set, wherein: The entity set encompasses five core entities, including crew entities (recording attributes such as crew ID, age, nationality, job title, and skill certificate number), skill entities (such as specific skill types like ocean voyage, ship electrical maintenance, and cargo handling management, including attributes such as skill level and applicable ship type), ship entities (including attributes such as ship ID, tonnage, ship type, speed, maximum range, list of ports of call, required crew positions and skill requirements), port entities (including attributes such as port ID, country / region of origin, number of berths, and ship types that can be berthed), and job title entities (such as captain, chief engineer, and seaman, including attributes such as job responsibilities and required skill certificates). The relation set defines seven core semantic relations, including: Crew - Skills (describing what skill certificates and skill levels the crew holds), Crew - Position (describing the current or past professional position held by the crew), Crew - Vessels Worked On (describing the vessels the crew has served on and the duration of their service), Vessel - Required Positions (describing the number and requirements of professional positions required for vessel operation), Vessel - Required Skills (describing the skill requirements of the vessel for the crew, such as oil tankers requiring crew members to have crude oil loading and unloading skills), Vessel - Ports Called (describing the ports the vessel regularly calls on and the frequency of calls), and Position - Associated Skills (describing the skills required for a specific professional position, such as the chief engineer needing to have ship propulsion system maintenance skills). Triple sets store the relationships between entities in the form of head entity-relationship-tail entity, such as (crew member ID: 001, skills mastered, skill ID: E05), (ship ID: S12, required skills, skill ID: E05), (ship ID: S12, port of call, port ID: P03), etc., forming a structured semantic relationship network.
[0032] In a specific implementation, as a preferred embodiment of the present invention, step S2 includes: S21. Obtain basic crew information and vessel registration data from the maritime management platform. The basic crew information includes age, nationality, occupation, and skill certificates; the vessel registration data includes tonnage, vessel type, speed, and port of call. S22. Collect historical interaction records between crew members and vessels from the shipping company's operating system, including the start and end times of crew members' service on vessels and their work evaluations; S23. Supplement publicly available port data and vessel route data using web crawling technology. The publicly available port data includes berth capacity and berthing vessel types; the vessel route data includes regular routes and navigation areas. S24. Perform data cleaning on the collected maritime data, including: For missing values related to crew member age, the average age of crew members in the same occupation and of the same nationality was used to fill the gaps. For abnormal ship tonnage values (such as extreme values exceeding 3 times the tonnage of the same ship type), the 3σ criterion is used for filtering. For duplicate entries in the crew-ship interaction log (such as the same crew member repeatedly recording services for a certain ship within the same time period), the earliest valid record is retained; To address the issue of inconsistent skill certificate number formats (such as some records containing letter prefixes while others contain only numbers), the unified format is "letter prefix - 6 digits" (e.g., "E-000005"). S25. Transform unstructured and discretized features into vector representations that the model can process, achieving feature encoding, including: For discrete features, including crew job positions, ship type, and port region, an embedding layer encoding is used. By learning, a low-dimensional dense vector of discrete features is obtained. That is, for a certain discrete feature category, it is first transformed into a one-hot vector, and then multiplied with the embedding matrix to obtain the final encoded vector. The dimension of the embedding matrix is adaptively adjusted according to the number of feature categories (e.g., if there are 12 job positions, the dimension of the embedding matrix is set to 64×12, and a 64-dimensional feature vector is output). For continuous features, including crew age, ship tonnage, and sailing time, a multilayer perceptron (MLP) is used for normalization encoding. Through linear transformation and ReLU activation function, continuous values are mapped to vectors in the range [-1,1] to avoid model training bias caused by differences in numerical range. For example, when the crew age is input into the multilayer perceptron, after linear calculation of the weight matrix and bias term, a vector with the same dimension as the discrete feature encoding is obtained through ReLU activation, ensuring the compatibility of subsequent feature fusion. S26. Import the preprocessed entity and relation data into the Neo4j graph database to construct a visualized knowledge graph of the shipbuilding domain. This graph supports semantic association retrieval through node queries (e.g., querying all ships associated with a crew member) and relation queries (e.g., querying all skills required by a ship). Simultaneously, extract all valid triples from the graph database and perform unique ID mapping on entities and relations (e.g., crew member entity IDs start from 0 and increment, relation IDs start from 0 and increment), forming a triple dataset that can be directly used for model training. This dataset is then divided into training, validation, and test sets in an 8:1:1 ratio for subsequent training and performance verification of the graph neural network model.
[0033] In a specific implementation, as a preferred embodiment of the present invention, step S3 includes: S31. Construct a heterogeneous graph in the maritime domain, using preprocessed entities (crew members, skills, ships, ports, and positions) as nodes and seven defined types of relationships as edges to form a heterogeneous graph structure containing different node and edge types. In the heterogeneous graph, the semantic features of different types of nodes are significantly different (e.g., the age feature of crew members is completely different from the tonnage feature of ships). Traditional graph attention networks (GAT) use a unified attention calculation method, which will lead to distortion in the aggregation of information of different types of nodes.
[0034] S32. Design a heterogeneous graph perception and attention layer, and adopt differentiated attention calculation strategies for different types of nodes and edges; S33. To model the uncertain relationships between entities (e.g., a crew member may serve a certain type of ship, but there is no clear historical record), a variational inference module is introduced on the basis of the heterogeneous graph perception attention layer. The aggregated features of nodes are mapped to the latent probability distribution space, and robust latent representations of nodes are generated through sampling.
[0035] In a specific implementation, as a preferred embodiment of the present invention, step S32 includes: S321. For any two adjacent nodes in a heterogeneous graph (such as crew member nodes) With skill nodes (Edge type: Skill Mastery) First, dedicated weight matrices are assigned according to node type and edge type, and the node features are linearly transformed to ensure that the features of different types of nodes are mapped to the same semantic space. Then, the transformed node features are concatenated with the edge type embedding vector, and the attention score is calculated using the LeakyReLU activation function to measure the information contribution of neighboring nodes to the current node. In this embodiment, specifically, let's say a crew member node... The characteristics are Skill Nodes The characteristics are The embedding vector of the edge type skill mastery is Crew node The weight matrix corresponding to the type is ,node The weight matrix corresponding to the type is The attention coefficient vector is The attention score is calculated using the LeakyReLU activation function. and and The splicing result and (the transpose of the product), where the negative slope of the LeakyReLU activation function is set to 0.2 to avoid the gradient vanishing problem; S322. To avoid neighboring nodes of a certain type of edge excessively dominating information aggregation, attention coefficients are normalized only for neighboring nodes of the same type of edge; for example, crew member nodes. The neighbors include skill nodes connected by the skill mastery edge and job position nodes connected by the job position edge. During normalization, softmax is calculated separately for all neighbor nodes of the skill mastery edge and for all neighbor nodes of the job position edge, ensuring that the information aggregation weights of different types of edges are independent and reasonable. Specifically, for crew member nodes... a certain type of edge All its neighboring nodes Forming a neighbor set Then the node right The normalized attention coefficient is exp(attention score) divided by all neighboring nodes. The sum of exp(attention score) under this edge type.
[0036] S323. Based on the normalized attention coefficients, aggregate the neighbor node information of different types of edges separately, then concatenate the aggregation results of all types of edges, and obtain the aggregated features of the current node through the Sigmoid activation function. For example, a crew member node. The aggregation feature is formed by concatenating the aggregation results of skill node information from the skill-possessing edge and job node information from the job position edge, ensuring that the semantic information of different types of neighbors is fully preserved. Specifically, crew node... The aggregation features are processed by the Sigmoid activation function (for each type of edge). All neighboring nodes Normalized attention coefficient and (The sum of the products of the concatenation results), where the Sigmoid activation function maps the aggregated features to the [0,1] interval, enhancing the stability of the features.
[0037] In a specific implementation, as a preferred embodiment of the present invention, step S33 includes: S331. The mean and variance of the latent distribution are predicted using two independent multilayer perceptrons. The mean multilayer perceptron maps the aggregated features output from the heterogeneous map perception attention layer to the mean vector of the latent distribution. The variance multilayer perceptron, through... The activation function maps aggregated features to a variance vector (ensuring the variance is positive); for example, consider the crew node output by the heterogeneous graph perception attention layer. Aggregation features are The weight matrix of the mean multilayer perceptron is: Bias term is The weight matrix of the variance multilayer perceptron is: Bias term is Then the mean vector for variance vector for ,in The function is calculated as follows: To avoid negative variance values.
[0038] S332. To solve the problem of non-differentiability of latent variables, a reparameterization technique is used to sample a noise vector from the standard normal distribution. The latent representation of a node is generated using the mean vector and variance vector. ,Right now ⊙ represents the Hadamard product; this method transfers the randomness of the sampling process to the noise vector. Above, ensure potential representation Gradient updates are performed through backpropagation, thereby enabling end-to-end training of the model; S333. Construct the loss function for the variational heterogeneous graph autoencoder, including reconstruction loss and KL divergence. The reconstruction loss ensures that the latent representation can recover the original structure of the heterogeneous graph, while the KL divergence constrains the latent distribution to approximate a standard normal distribution, avoiding model overfitting. In this embodiment, the reconstruction loss uses cross-entropy loss, predicting the existence probability of edges in the heterogeneous graph through the latent representation, i.e., for each edge in the heterogeneous graph... Calculate the probability of edge existence. ,in edge type A dedicated weight matrix, The Sigmoid function is used, and the cross-entropy loss measures the difference between the predicted probability and the actual edge presence label (1 for presence, 0 for absence); the KL divergence is used to calculate the latent distribution. , (Node characteristics) and standard normal distribution The difference is calculated specifically for each node. ,calculate The mean, multiplied by the balance coefficient. (Empirical value set to 0.5) to balance the contributions of reconstruction loss and KL divergence. Ultimately, the total loss of the variational heterogeneous graph autoencoder is the sum of the reconstruction loss and... By minimizing the total loss, the sum of KL divergences is multiplied to achieve a unified representation of multi-source heterogeneous features and modeling of potential associations.
[0039] In a specific implementation, as a preferred embodiment of the present invention, step S4 includes: S41. Constructing a broad path: The core objective of a broad path is to capture the global topological structure of the knowledge graph and aggregate multi-step neighbor information through a multi-layer, multi-head GAT to cover short-distance relationships between entities. S42. Construct deep paths. The core objective of deep paths is to mine long-range indirect relationships between entities. By using path sampling and Transformer encoders, semantic encoding of multi-step long paths is achieved, covering long-distance associations of entities (such as 3-5 step neighbors). S43. To achieve dynamic integration of breadth-based and depth-based representations, a self-attention fusion module is designed to adaptively adjust the weights of the two representations based on the information importance in different scenarios; using breadth-based aggregation representation... For query vector ( ), deep aggregation representation For key vectors ( ) and value vector ( The fusion weights are calculated using a self-attention mechanism. Specifically, the attention weights... ,in , This is the weight matrix. (for representing dimensions), the fused representation ,in This is the weight matrix. When a region of the knowledge graph has dense relationships (e.g., many directly related nodes for a particular ship), the global information of the breadth-based pathways becomes more important, and the fusion module will automatically improve this. The weight of deep pathways is considered; when relationships are sparse in a certain region of the knowledge graph (e.g., a new crew member has few direct associated nodes), the long-range information of deep pathways becomes more important, and the fusion module will automatically increase the weight. The weights ensure the fused representation It can retain key information in different scenarios.
[0040] In this embodiment, as Figure 2The diagram illustrates a breadth-depth dual-path knowledge graph aggregation model, visually demonstrating the working modes and collaborative mechanisms of the deep and breadth paths. The deep path, through multi-layer graph convolution operations, progressively propagates information along the relationship paths between entities, deeply mining long-range connections and capturing deep features hidden within complex relationship networks. The breadth path, on the other hand, focuses on the local neighborhood of entities, quickly acquiring short-range connections between entities by aggregating information from neighboring nodes, grasping the direct relationship features of entities. The two paths process in parallel, and finally, the extracted features are fused to generate an optimized representation that combines both depth and breadth. and This effectively improves the richness and accuracy of entity representation.
[0041] In a specific implementation, as a preferred embodiment of the present invention, step S5 includes: S51. Based on the knowledge graph of the shipping domain and crew-ship interaction records, construct positive sample pairs, similar positive sample pairs, and negative sample pairs with maritime scenario characteristics to ensure that the sample pairs can cover multi-dimensional associations of matching-non-matching and direct-indirect relationships, wherein: Positive sample pairs include direct positive samples and indirect positive samples; direct positive samples are constructed based on direct crew-ship interaction records, i.e., if the crew... Previously served on ships Interaction matrix Then construct positive sample pairs Indirect positive samples are constructed based on indirect associations in a knowledge graph, i.e., if the crew members Skills mastered With ships Required skills Full match (crew members present) u - Skills mastered o With ships s Required skills (the path), then regardless of the crew Have you ever served on a ship? All construct positive sample pairs The construction of positive sample pairs ensures that the model learns the matching relationship between crew members and ships (including direct and indirect relationships). Similar positive sample pairs (similarity matching relationships) are constructed based on the similarity of crew members, that is, if the crew members... and Skill similarity exceeds threshold ( The empirical value is set to 0.8, and the similarity is calculated using cosine similarity: Then positive sample pairs Transform into Similar positive sample pairs The construction of these sample pairs aims to leverage the preferences of similar crew members to provide a positive reference for cold-start crew members (those with no interaction records).
[0042] Negative sample pairs (mismatch relationships) include random negative samples and conflicting negative samples, avoiding noise interference from traditional random negative samples; random negative samples are constructed based on unrelated records, i.e., if crew members... With ships There are no direct interaction records, and no indirect related paths (such as " If the "-skills-ships" path does not exist, then construct random negative sample pairs. ; Conflict negative samples are constructed based on semantic conflict, that is, if the crew skills and ships The requirements are conflicting (e.g.) Lacking "crude oil loading and unloading" skills, For oil tankers (requiring crew members to possess this skill), then construct conflict negative sample pairs. The construction of conflict negative samples ensures that the model can clearly distinguish between "mismatch" and "no association", strengthening semantic boundaries; S52. By jointly optimizing the contrastive loss and the ranking loss, the semantic boundaries of the embedding space are strengthened, including: The core objective of contrastive loss (InfoNCE) is to narrow the representation distance between positive sample pairs and widen the representation distance between negative sample pairs; for each positive sample pair... Calculate their cosine similarity in the embedding space. Then with the crew member All negative sample pairs The similarity is compared, and the loss is calculated using the softmax function; specifically, the comparison loss is calculated by taking the negative logarithm of each positive sample pair. Divide by With all negative sample pairs The mean of the sums, where The temperature coefficient (empirically set to 0.1) is used to adjust the discriminative power of similarity. Contrastive loss ensures that positive sample pairs form clusters in the embedding space, while negative sample pairs are far from the cluster centers.
[0043] The core objective of ranking loss (BPR) is to ensure that positive sample pairs have higher matching scores than negative sample pairs, which aligns with the preference ranking logic of the recommendation scenario; for each crew member Randomly select a positive sample With a negative sample Calculate the difference in matching scores between the two. Matching score (i.e., the inner product of the crew and ship representation vectors), the rating difference is mapped to the interval [0, 1] using the Sigmoid function, and then the negative logarithm is taken as the loss; specifically, the ranking loss is calculated by applying the negative logarithm to all sample pairs. Take the negative logarithm The mean, of which This is the Sigmoid function. The ranking loss ensures the model sorts recommendations from highest to lowest match, improving the accuracy of the recommendation list.
[0044] The contrastive loss and ranking loss are fused together by weights, and combined with the loss from the variational heterogeneous graph autoencoder, to form the model's total loss function. Here, the weights of the contrastive loss are... Set to 0.4, the weight of the sorting loss. Set to 0.4, the loss weight of the variational heterogeneous graph autoencoder. Set to 0.2 (determined through cross-validation), the total loss is Comparative loss Ranking loss Variational heterogeneous graph autoencoder loss. By minimizing the total loss, the discriminative power of the embedded representation is improved, and the overall model performance is optimized, resulting in highly discriminative optimized representations for crew members and ships. and ; S53. At the recommendation decision level, optimize the representation based on high distinguishability between crew members and ships. and The matching degree between crew members and ships is calculated using the vector inner product, and the formula is as follows:
[0045] The range of values for the inner product is related to the dimension of the embedded representation. Through the previous normalization process (such as L2 normalization), the scoring range is ensured to be in the range of [0, 1]. The higher the score, the higher the matching degree between the crew and the ship. For each crew member First, filter out ships that have been previously served (to avoid duplicate recommendations), then score all remaining ships based on their matching performance. Sort by highest to lowest, and take the top few. One ship ( This can be adjusted according to the shipping company's needs; the default setting is 10) as a personalized recommendation result; for example, crew members. The recommended list is ,in The highest matching score was achieved. The match score was the lowest.
[0046] S54. For cold start scenarios involving newly recruited crew members (without interaction history) and newly commissioned vessels (without crew association), recommendations are generated using the following strategies: For new crew members without interaction records, an initial representation is generated by encoding their basic features (age, nationality, occupation, and skill certificates) using a variational heterogeneous graph autoencoder. Then, the neighbor information of its skill node (such as the ship node associated with the skill) is aggregated through the dual-path aggregation module to generate an optimized representation. Finally, a recommendation list is generated based on the matching score, without relying on historical interaction data; For new vessels without crew members, an initial representation is generated by encoding their technical parameters (tonnage, ship type) and requirement information (required positions, skills) using a variational heterogeneous graph autoencoder. Then, the dual-path aggregation module aggregates the neighbor information of the required job node (such as the crew nodes associated with the job) to generate an optimized representation. Finally, all crew members are sorted by matching score, and the most suitable crew members are recommended (reverse recommendation, which can be used for ship recruitment).
[0047] In this embodiment, as Figure 3 As shown, a schematic diagram of a three-dimensional joint contrastive learning framework for users, relationships, and entities is provided, clearly illustrating the core components and operational process of the framework. The framework revolves around three dimensions: users, relationships, and entities. It strengthens semantic boundaries in the embedding space by constructing multiple types of sample pairs, such as positive sample pairs (including direct and indirect positive pairs), similar positive sample pairs, and negative sample pairs (covering random and conflicting negative samples). During training, contrastive loss (InfoNCE) is used to shorten the representation distance of positive sample pairs and widen the representation distance of negative sample pairs, ensuring that positive sample pairs form clusters and negative sample pairs are far from the cluster centers. Simultaneously, ranking loss (BPR) is used to ensure that the matching score of positive sample pairs is higher than that of negative sample pairs, conforming to the preference ranking logic of recommendation scenarios. Finally, the contrastive loss and ranking loss are fused with certain weights and combined with the loss of the variational heterogeneous graph autoencoder to form a total loss function. By minimizing the total loss, the discriminativeness of the embedding representation is improved and the overall performance of the model is optimized, providing high-quality embedding representations for the subsequent recommendation decision layer.
[0048] Example 1 (Control Experiment) The experimental setup is as follows: The experimental data originated from real business data of a large shipping company, covering the following: crew information (15,000 records in total), basic information (age range 18-65 years old, nationalities from more than 30 countries), qualification information (certificate levels are divided into four categories: A, B, C, and D, with more than 200 skill tags, and years of work experience ranging from 1 to 40 years), historical records (an average of 2.3 historical matching records per crew member), vessel information (3,000 records in total), basic attributes (bulk carriers account for 40%, container ships for 35%, tankers for 15%, and other types for 10%), and technical parameters (tonnage range between 5,000 and 300,000 tons, and vessel age from 1 to 30 years). The data included: route complexity levels 1-5; crew requirements (an average of 12 crew members per vessel, including 6 main positions); interaction data (80,000 records in total); and matching results (72,000 successful matches, accounting for 90%, and 8,000 failed matches, accounting for 10%). The recommendation model adopted a Top-k approach, where the model generated k recommended vessels for each crew member. A recommendation was considered successful if the vessel interacting with the crew in the test set appeared among the k recommended vessels. k was selected as 3, 4, and 5.
[0049] The following mainstream recommendation models were selected as benchmarks for comparison: Hotspot matching: Recommending popular vessels based on historical transaction data. KGCN: Knowledge Graph Convolutional Networks, a knowledge graph recommendation model based on graph convolution.
[0050] KGAT: Knowledge Graph Attention Network, a knowledge graph recommendation model that introduces an attention mechanism.
[0051] LightGCN: A simplified graph convolutional network that retains only the neighborhood aggregation component.
[0052] NGCF: Neural Graph Collaborative Filtering, a neural collaborative filtering model that integrates graph structures.
[0053] DeepFM: A recommendation model that combines factorization machines and deep learning.
[0054] The following multi-dimensional evaluation metrics are used to comprehensively measure system performance: Key metrics: F1-socre: The harmonic mean of precision and recall of the recommendation results.
[0055] AUC: Area under the ROC curve, used to measure the model's discriminative power.
[0056] MAP: Mean Average Precision, used to evaluate the overall performance of multiple user recommendation lists.
[0057] Ranking metrics: Precision: The proportion of relevance in the recommendation results.
[0058] Recall: The percentage of vessels recommended.
[0059] The experimental results are as follows: like Figure 4 As shown, a comparative experimental result graph is provided under the Top-5 recommendation, from... Figure 4 As can be seen, the model proposed in this invention significantly outperforms other comparative models in core metrics such as F1-score, AUC, and MAP. Specifically, in terms of F1-score, the model of this invention achieves 0.85, nearly 10 percentage points higher than the second-best KGAT model, demonstrating superior performance in balancing precision and recall. In terms of AUC, the model of this invention leads with a score of 0.92, indicating its stronger ability to distinguish between matching and non-matching relationships. Regarding MAP, the model of this invention also performs exceptionally well, reaching 0.88, validating its advantage in the comprehensive evaluation of multiple user recommendation lists. Furthermore, the model of this invention also achieves leading scores in the ranking metrics Precision and Recall, further demonstrating its effectiveness and practicality in real-world recommendation scenarios.
[0060] like Figure 5 As shown, a comparative experimental result graph is provided under the Top-4 recommendations, from... Figure 5 As can be seen, the advantages of the model in this invention remain significant across various metrics. In the F1-score, the model achieves 0.83, an 8-percentage-point improvement over other models such as LightGCN (0.75), further validating its excellent ability to balance precision and recall. In the AUC metric, the model continues to lead with a score of 0.91, demonstrating stronger discriminative power compared to the NGCF model's 0.84. Regarding the MAP metric, the model achieves 0.86, a 7-percentage-point improvement over the DeepFM model's 0.79, further proving its advantage in the comprehensive evaluation of multiple user recommendation lists. In the ranking metrics of Precision and Recall, the model also performs excellently, with Precision reaching 0.82 and Recall reaching 0.80, both outperforming other comparative models, reflecting its efficiency and practicality in real-world recommendation scenarios.
[0061] like Figure 6As shown, a comparative experimental result graph is provided under the Top-3 recommendations, from... Figure 6 As can be seen, the model of this invention continues to demonstrate a leading advantage in core and ranking metrics. In the F1-score, the model achieves 0.81, an 8 percentage point improvement over the KGCN model's 0.73, further highlighting its superior ability to balance precision and recall. Regarding the AUC, the model maintains its lead with a score of 0.90, demonstrating a stronger ability to distinguish between matching and non-matching relationships compared to the hotspot matching model's 0.82. In the MAP metric, the model achieves 0.84, a 7 percentage point improvement over the LightGCN model's 0.77, further validating its advantage in the comprehensive evaluation of multiple user recommendation lists. In the ranking metrics Precision and Recall, the model of this invention also performs outstandingly, with Precision reaching 0.80 and Recall reaching 0.78, both leading other comparative models, fully demonstrating its efficiency and practicality in real-world recommendation scenarios.
[0062] Example 2 (Ablation Experiment) like Figure 7 As shown, the ablation experiment results are presented, revealing the contribution of each key component in the model to the overall performance. The experiment verified the effectiveness of each component by progressively removing specific components from the model (such as the breadth-depth dual-path knowledge graph aggregation model and the user-relationship-entity three-dimensional joint comparative learning framework). The results show that after removing the breadth-depth dual-path knowledge graph aggregation model, the model exhibits significant decreases in core metrics such as F1-score, AUC, and MAP. The F1-score drops from 0.85 to 0.78, the AUC from 0.92 to 0.87, and the MAP from 0.88 to 0.82, indicating that the breadth-depth dual-path knowledge graph aggregation model plays a crucial role in capturing long-range and short-range relationships between entities and generating optimized representations. Similarly, removing the user-relationship-entity 3D joint contrastive learning framework significantly reduced model performance, with the F1-score dropping to 0.79, AUC to 0.88, and MAP to 0.83. This further demonstrates the importance of this framework in strengthening the semantic boundaries of the embedding space and improving the discriminative power of the embedding representation. Furthermore, the experiments revealed that removing either the contrastive loss or the ranking loss individually resulted in a decrease in model performance, but the decrease was less than that when the entire framework was removed. This indicates that the contrastive loss and ranking loss work synergistically after fusion to jointly optimize model performance.
[0063] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A personalized ship recommendation method for crew members empowered by graph neural networks and Transformers, characterized in that, include: S1. Construct a knowledge graph covering multiple entity types such as crew members, skills, ships, ports, and job positions to transform scattered maritime data into a structured semantic relationship network; S2. A multi-source data fusion strategy is adopted to collect maritime data, and the collected maritime data is preprocessed to obtain a triplet dataset that can be directly used for model training. S3. Design a variational heterogeneous graph autoencoder for crew feature encoding. Through a three-layer architecture of heterogeneous graph construction, type-aware attention aggregation, and variational inference, it realizes unified representation and potential association modeling of multi-source heterogeneous data. S4. Construct a breadth-depth dual-path knowledge graph aggregation model, including a breadth path, a depth path, and a dual-path self-attention fusion module. The breadth path is based on a graph attention network to achieve multi-layer neighbor aggregation, covering the global topology of the knowledge graph and capturing short-distance relationships between entities. The depth path is based on a Transformer encoder to achieve long-path sampling and encoding, mining multi-step indirect relationships between entities. The dual-path self-attention fusion module is used to dynamically integrate the breadth path and the depth path to form an entity representation that takes into account both global and local, short-range and long-range relationships. S5. Design a three-dimensional joint comparative learning framework for users, relationships, and entities. With users, relationships, and entities as the core dimensions, construct multi-type sample pairs and a joint loss function to strengthen semantic boundaries in the embedding space. This brings semantically similar entity representations closer together and pushes semantically unrelated entity representations further apart, ultimately outputting accurate ship recommendation results.
2. The method for personalized ship recommendation for crew members empowered by graph neural networks and Transformers according to claim 1, characterized in that, In step S1, the core elements of the knowledge graph include an entity set, a relation set, and a triple set, wherein: The entity set encompasses five core entities, including crew entities, skill entities, ship entities, port entities, and job entity entities; The relation set defines seven core semantic relations, including crew member-skills, crew member-job position, crew member-veteran ship, ship-required job position, ship-required skills, ship-port of call, and job position-related skills; Triple sets store the relationships between entities in the form of head entity-relationship-tail entity, forming a structured semantic relationship network.
3. The method for personalized ship recommendation for crew members empowered by graph neural networks and Transformers according to claim 1, characterized in that, Step S2 includes: S21. Obtain basic crew information and vessel registration data from the maritime management platform. The basic crew information includes age, nationality, occupation, and skill certificates; the vessel registration data includes tonnage, vessel type, speed, and port of call. S22. Collect historical interaction records between crew members and vessels from the shipping company's operating system, including the start and end times of crew members' service on vessels and their work evaluations; S23. Supplement publicly available port data and vessel route data using web crawling technology. The publicly available port data includes berth capacity and berthing vessel types; the vessel route data includes regular routes and navigation areas. S24. Perform data cleaning on the collected maritime data, including: For missing values related to crew member age, the average age of crew members in the same occupation and of the same nationality was used to fill the gaps. For outlier ship tonnage values, the 3σ criterion is used for filtering. For duplicate entries in crew-ship interaction logs, retain the earliest valid record; To address the issue of inconsistent skill certificate number formats, the unified format is "letter prefix - 6 digits"; S25. Transform unstructured and discretized features into vector representations that the model can process, achieving feature encoding, including: For discrete features, including crew job positions, ship type and port region, an embedding layer encoding is used. The low-dimensional dense vector of the discrete feature is obtained through learning. That is, for a certain discrete feature category, it is first transformed into a one-hot vector, and then multiplied with the embedding matrix to obtain the final encoded vector. The dimension of the embedding matrix is adaptively adjusted according to the number of feature categories. For continuous features, including crew age, ship tonnage and sailing time, a multilayer perceptron is used for normalization encoding. The continuous values are mapped to vectors in the range [-1,1] through linear transformation and ReLU activation function to avoid model training bias caused by differences in numerical range. S26. Import the preprocessed entity and relation data into the Neo4j graph database to construct a visualized knowledge graph of the shipbuilding domain, supporting semantic association retrieval through node queries and relation queries. At the same time, extract all valid triples from the graph database, map entities and relations with unique IDs respectively, and form a triple dataset that can be directly used for model training.
4. The method for personalized ship recommendation for crew members empowered by graph neural networks and Transformers according to claim 1, characterized in that, Step S3 includes: S31. Construct a heterogeneous graph in the maritime domain, using preprocessed entities as nodes and the seven defined types of relationships as edges, to form a heterogeneous graph structure containing different node types and edge types. S32. Design a heterogeneous graph perception and attention layer, and adopt differentiated attention calculation strategies for different types of nodes and edges; S33. To model the uncertain relationships between entities, a variational inference module is introduced on the basis of the heterogeneous graph perception attention layer. The aggregation features of nodes are mapped to the latent probability distribution space, and robust latent node representations are generated through sampling.
5. The method for personalized ship recommendation for crew members empowered by graph neural networks and Transformers according to claim 4, characterized in that, Step S32 includes: S321. For any two adjacent nodes in a heterogeneous graph, firstly, assign dedicated weight matrices according to the node type and edge type respectively, and perform linear transformation on the node features to ensure that the features of different types of nodes are mapped to the same semantic space; then, concatenate the transformed node features with the edge type embedding vector, and calculate the attention score through the LeakyReLU activation function to measure the information contribution of the neighboring nodes to the current node. S322. To avoid the neighbor nodes of a certain type of edge from excessively dominating information aggregation, attention coefficients are normalized only for the neighbor nodes of the same type of edge. S323. Based on the normalized attention coefficients, the neighbor node information of different types of edges is aggregated separately, and then the aggregation results of all types of edges are concatenated. The aggregation features of the current node are obtained by using the Sigmoid activation function.
6. The method for personalized ship recommendation for crew members empowered by graph neural networks and Transformers according to claim 4, characterized in that, Step S33 includes: S331. The mean and variance of the latent distribution are predicted using two independent multilayer perceptrons. The mean multilayer perceptron maps the aggregated features output from the heterogeneous map perception attention layer to the mean vector of the latent distribution. The variance multilayer perceptron, through... The activation function maps aggregated features to a variance vector; S332. To solve the problem of non-differentiability of latent variables, a reparameterization technique is adopted to sample a noise vector from the standard normal distribution and generate the latent representation of the node through the mean vector and the variance vector. S333. Construct the loss function of the variational heterogeneous graph autoencoder, including reconstruction loss and KL divergence. The reconstruction loss ensures that the latent representation can recover the original structure of the heterogeneous graph, while the KL divergence constrains the latent distribution to be close to the standard normal distribution, thus avoiding model overfitting.
7. The method for personalized ship recommendation for crew members empowered by graph neural networks and Transformers according to claim 1, characterized in that, Step S4 includes: S41. Constructing a broad path: The core objective of a broad path is to capture the global topological structure of the knowledge graph and aggregate multi-step neighbor information through a multi-layer, multi-head GAT to cover short-distance relationships between entities. S42. Construct deep paths. The core objective of deep paths is to mine long-range indirect relationships between entities. This is achieved through path sampling and Transformer encoders to semantically encode multi-step long paths, covering long-distance associations between entities. S43. To achieve dynamic integration of breadth-based and depth-based representations, a self-attention fusion module is designed to adaptively adjust the weights of the two representations based on the information importance in different scenarios; using breadth-based aggregation representation... For the query vector, deep aggregation representation Given key and value vectors, the fusion weights are calculated using a self-attention mechanism.
8. The method for personalized ship recommendation for crew members empowered by graph neural networks and Transformers according to claim 1, characterized in that, Step S41 includes: S411. To avoid the bias of a single attention head, multi-head attention is used to aggregate neighbor information in parallel. S412. A three-layer Gaussian Attraction Amplifier (GAT) is used to achieve multi-step neighbor aggregation. The first layer aggregates 1-step neighbors, the second layer aggregates 2-step neighbors, and the third layer aggregates 3-step neighbors. Simultaneously, to avoid feature dimensionality expansion caused by multiple layers of aggregation, a batch normalization layer is added after each GAT layer to stabilize the training process. Finally, the output features of the multi-head attention parallel aggregation are concatenated and mapped to the same dimension as the output of the variational heterogeneous graph autoencoder through a linear compression layer to obtain the breadth-based aggregated representation of the entities. This indicates that the entity contains global topological association information in the knowledge graph.
9. The method for personalized ship recommendation for crew members empowered by graph neural networks and Transformers according to claim 1, characterized in that, Step S42 includes: S421. A random path sampling method based on Markov chains, which takes the target entity as the starting point and samples multi-step long paths according to relational probabilities; S422. For the sampled long path, use the Transformer encoder to perform semantic encoding to capture the multi-step long dependency relationship in the path; S423. Employ multi-head attention to calculate the attention weight of each element in the path to other elements and capture the dependencies between elements. S424. Perform linear transformation and nonlinear activation on the output of multi-head self-attention to enhance the model's expressive power. The calculation method of FFN is as follows: ,in , This is the weight matrix. , As a bias term, nonlinearity is introduced through the ReLU activation function, and then the output dimension is restored through linear transformation; S425. For the output sequence of the Transformer encoder, take the output vector corresponding to the target entity as the depth aggregation representation of the entity.
10. The method for personalized ship recommendation for crew members empowered by graph neural networks and Transformers according to claim 1, characterized in that, Step S5 includes: S51. Based on the knowledge graph of the shipping domain and crew-ship interaction records, construct positive sample pairs, similar positive sample pairs, and negative sample pairs with maritime scenario characteristics to ensure that the sample pairs can cover multi-dimensional associations of matching-non-matching and direct-indirect relationships, wherein: Positive sample pairs include direct positive samples and indirect positive samples; direct positive samples are constructed based on direct crew-ship interaction records, i.e., if the crew... Previously served on ships Interaction matrix Then construct positive sample pairs Indirect positive samples are constructed based on indirect associations in a knowledge graph, i.e., if the crew members Skills mastered With ships Required skills A perfect match means regardless of the crew. Have you ever served on a ship? All construct positive sample pairs ; Similar positive sample pairs (similarity matching relationships) are constructed based on the similarity of crew members, that is, if the crew members... and Skill similarity exceeds threshold ( The empirical value is set to 0.8, and the similarity is calculated using cosine similarity: Then positive sample pairs Transform into Similar positive sample pairs ; Negative sample pairs include random negative samples and conflicting negative samples, avoiding noise interference from traditional random negative samples; random negative samples are constructed based on unrelated records, i.e., if crew members... With ships If there are no direct interaction records and no indirect related paths, then construct random negative sample pairs. ; Conflict negative samples are constructed based on semantic conflict, that is, if the crew skills and ships If the requirements conflict, then construct conflicting negative sample pairs. ; S52. By jointly optimizing the contrastive loss and the ranking loss, the semantic boundaries of the embedding space are strengthened, including: The core objective of contrastive loss is to narrow the representation distance between positive sample pairs and widen the representation distance between negative sample pairs; for each positive sample pair... Calculate their cosine similarity in the embedding space. Then with the crew member All negative sample pairs The similarity is compared, and the loss is calculated using the softmax function; The core objective of ranking loss is to ensure that the matching score of positive sample pairs is higher than that of negative sample pairs, which aligns with the preference ranking logic of the recommendation scenario; for each crew member Randomly select a positive sample With a negative sample Calculate the difference in matching scores between the two. Matching score The score difference is mapped to the [0, 1] interval by using the Sigmoid function, and then the negative logarithm is taken as the loss. The contrastive loss and ranking loss are fused by weights, and combined with the loss from the variational heterogeneous graph autoencoder to form the model's total loss function. By minimizing the total loss, the discriminative power of the embedded representation is improved, and the overall model performance is optimized, resulting in a highly discriminative optimized representation for crew members and ships. and ; S53. At the recommendation decision level, optimize the representation based on high distinguishability between crew members and ships. and The matching degree between crew members and ships is calculated using the vector inner product, and the formula is as follows: The range of values for the inner product is related to the dimension of the embedding representation. Through the previous normalization process, the score range is ensured to be in the range of [0, 1]. The higher the score, the higher the matching degree between the crew and the ship. For each crew member First, filter out the ships that have served in the past, and then score all remaining ships according to their matching history. Sort by highest to lowest, and take the top few. Each vessel is used as a personalized recommendation result; S54. For cold start scenarios involving newly recruited crew members and newly commissioned vessels, recommendations are generated using the following strategies: For new crew members without interaction records, an initial representation is generated by encoding their basic features using a variational heterogeneous graph autoencoder. Then, the neighbor information of its skill node is aggregated through the dual-path aggregation module to generate an optimized representation. Finally, a recommendation list is generated based on the matching score, without relying on historical interaction data; For new vessels without crew affiliation, an initial representation is generated by encoding their technical parameters and requirements information using a variational heterogeneous graph autoencoder. Then, the neighbor information of the required job node is aggregated through the dual-path aggregation module to generate an optimized representation. Finally, all crew members are sorted by their matching scores, and the most suitable crew members are recommended.