Abstract
Identification of railway safety risk (IRSR) aims to discover safety hazards in advance to ensure the safe operation of railway transportation systems. However, most existing models fail to fully explore the interconnection of safety risk factors, usually taking them as independent factors. In addition, the severe lack of domain semantics makes it hard for these models to represent domain data, which directly impairs the final performance. To solve these challenging problems, we introduce the triple knowledge of knowledge graph to model the railway safety risk and recast the IRSR as a relation extraction task. Afterwards, we propose a novel and effective Domain-Adaptive Relation Extraction (DARE) model to extract the triple knowledge from railway text data. Specifically, a domain-adaptive two-stream self-attention mechanism is designed to bridge the serious gap between universal semantics and domain semantics, and thus enhance the representations of railway text data. We further integrate piecewise convolutional networks to capture fine-grained features contained in the structure of triple knowledge. With the above mechanisms, our DARE can automatically adapt to the Chinese railway corpus and guarantee satisfactory results. Finally, experimental results on two real-world railway safety datasets demonstrate the effectiveness of the proposed DARE model.
1. Introduction
The identification of railway safety risk (IRSR) is significant to ensure people’s safety and the efficient goods transportation of intelligent transportation systems under Industry 4.0 [1]. During the past 10 years, the high-speed railway of China alone has achieved more than two-thirds of the world’s total transportation volume. Despite their critical importance, railway networks remain vulnerable to accidents, derailments, natural disasters, and deliberate damage, all of which can severely disrupt railway operations. From 2017 to 2021, though China Railway has experienced few serious and unfortunate accidents, it has still induced about 589 deaths (http://www.gov.cn/xinwen/2018-04/01/content_5278997.htm (accessed on 20 October 2022), http://www.nra.gov.cn/xwzx/xwxx/gdxw/202204/t20220405_279264.shtml (accessed on 9 September 2023), http://www.nra.gov.cn/xwzx/xwxx/gdxw/202204/t20220405_279263.shtml (accessed on 15 September 2023), https://www.mot.gov.cn/shuju/tongjishuju/tielu/202512/t20251227_4191761.html (accessed on 30 November 2026), http://www.nra.gov.cn/xwzx/xwxx/xwlb/202204/t20220428_326348.shtml (accessed on 7 October 2023)). To mitigate the probability of accidents, China Railway has developed the safety supervision system, which deploys tens of thousands of sensors and on-board equipment along the railway line to track the safety status of humans and infrastructure. Meanwhile, a large number of machine learning-based models [2,3] are proposed for the IRSR task, aiming to discover latent safety hazards as early as possible. However, these existing models still suffer from two challenging issues, as follows:
Neglecting the interconnection of safety risk: existing models, such as the Human Factors Analysis and Classification System, usually take human safety risk as an independent term, ignoring its relation with management or environmental safety risk. Actually, interconnections between safety risk are important for accident/incident inference and prediction. Furthermore, these models always need extra prior experiences or knowledge to conduct subjective judgments, leading to deviation from the truth.
Lacking domain adaptivity: almost all these models directly use pre-trained language models to represent text data. However, the representations severely lack domain semantics, which hinders the model’s comprehension of domain-specific data, particularly for low-resource text data. This is due to the fact that pre-trained language models are trained on news articles, web content, literary works, etc., lacking domain-specific information, such as “top iron”—a significant and high-frequency phrase in the railway safety supervision log but a scarce phrase in the pre-trained corpus. Therefore, directly using representations to perform the IRSR will impair the final performance. It indicates that automatically adapting to domain-specific data is paramount for the IRSR task.
To our knowledge, few models are proposed to address the aforementioned first challenge. For the second challenge above, several domain pre-trained models are proposed to solve the domain adaptivity problem. For instance, Lee et al. [4] propose a pre-trained model BioBERT for biomedical text mining, which yields satisfactory word distribution results for understanding the biomedical corpus. However, these models cannot be used to address the domain adaptivity problem in the railway field.
In this paper, we introduce the triple knowledge of knowledge graph to model railway safety risk, and recast the IRSR as a relation extraction task (the relation extraction task aims to comprehensively semantics of unstructured text to extract structure knowledge, and has been used in many practical fields, such as intelligent manufacturing and biomedical information extraction). Specifically, and respectively express the subject (or head entity) and object (or tail entity) of the railway safety risk, and r means the semantic relation between and . The triple knowledge projects railway safety risk into a knowledge-connected space serving for accident/incident inference and prediction, as Figure 1b shows. For example, in the case of the gutter fire accident, we can search the gutter node and its directly connected nodes in the knowledge graph. Through the triple knowledge , one of the fire causes is found to be dead branches and leaves. Another cause is the cigarette butts, which guides us to locate the node smoke, where the triple knowledge helps us find who induced the fire. Further searching the node Mr. Zhang, the triple knowledge shows the final reason, which means that the operator has not strictly complied with construction regulations. On the contrary, forward searching the knowledge graph can predict safety risk, which provides knowledge for decision-makers.
Figure 1.
Challenging issues in existing models and our solution to perform the IRSR by relation extraction. (a) Existing safety risk identification methods suffer from insufficient interconnection modeling and limited domain adaptability. (b) Deep learning-based knowledge graph construction from massive railway texts for accident/incident inference and prediction.
Afterwards, we propose a novel and effective Domain-Adaptive Relation Extraction (DARE) model. This model aims to extract the triple knowledge through a profound comprehension of railway text data. Specifically, we design a domain-adaptive two-stream self-attention (DATA) mechanism based on a domain-adaptive continued pre-training strategy. This mechanism integrates sufficient railway semantics with universal semantics, and thereby enhances the representations of railway text data. Furthermore, since the triple knowledge divides an input sentence into three segments, with each segment significantly contributing to the nearest entity, we introduce piecewise convolutional networks to effectively capture the fine-grained features contained within the triple knowledge structure. With the above mechanisms, our DARE can well adapt to the Chinese railway text data and guarantee satisfactory relation extraction results.
The key contributions are summarized as follows:
- We formulate railway safety risk factor relation extraction (IRSR) as a knowledge-oriented task and investigate the representation of railway safety risks in an interconnected knowledge space, providing structured semantic information for railway safety risk analysis and assessment.
- A novel and effective DARE model is proposed to extract triple knowledge from railway text data, where a domain-adaptive two-stream self-attention mechanism is designed to capture sufficient railway semantics, thus bridging the severe semantic gap between universal and domain data.
- Extensive experiments conducted on two real-world datasets demonstrate the superiority and effectiveness of the proposed DARE model. The proposed model has the potential to support knowledge-driven railway safety risk management by facilitating the structured extraction and representation of safety risk information.
2. Related Work
2.1. The Identification of Railway Safety Risk
The identification of railway safety risk is important for railway operation; it serves as the important lifeline and thread, and is mainly analyzed by deep learning in the era of big data [5]. Han et al. [6] integrated LSTM and Transformer architectures into a unified framework for risky driving behavior prediction. To enhance the sustainability and efficiency of urban transport networks, previous work [5] proposed a hybrid renewable energy system integrated with a battery–supercapacitor hybrid energy storage system. Recently, Liu et al. [2] utilized deep learning to forecast human trajectory, owing to its real-world applications, such as evacuation situation analysis, deployment of intelligent transportation systems, etc. To facilitate safety risk assessment and intelligent driver assistance, Chang et al. [7] proposed a clustering-based model for identifying driving behavior patterns in large-scale vehicular data. In the context of rail defect severity assessment, Liu et al. [3] proposed a mask-decoupling framework for vision-based rail surface detection. However, most of these models fail to fully exploit the interconnection of safety risk factors, and the enormous values hidden in textual data.
2.2. The Application of Relation Extraction
Relation Extraction aims to obtain the triple knowledge from unstructured textual data, and has been widely used in many fields to solve practical problems [8,9]. Wang et al. [10] aimed to extract structured knowledge from the unstructured biomedical literature and clinical narratives, since the triple knowledge is significant for knowledge discovery and management. Similarly, Lu et al. [11] proposed a symmetrical contrastive pre-training framework of biomedical triple knowledge in few-shot settings. An interesting work [12] leveraged relation extraction as an automated tool to assist polymer scientists in identifying and annotating polymer-related entities and the relationships among them. Li et al. [13] proposed a latent relation-aware model for extracting financial insights from unstructured text. Qi et al. [14] employed a relation extraction model to conduct threat intelligence analysis in complex advanced persistent threat attack scenarios. In the field of legal AI, Cai et al. [15] proposed LexRel, a model designed to identify civil legal relationships to support dispute resolution in civil cases. These models primarily focus on contextual encoding but fail to adequately capture the distinctive characteristics of Chinese railway datasets.
2.3. A Brief Review
Existing studies primarily focus on safety risk classification while overlooking the underlying relationships among different risks, making it challenging to effectively capture their interconnections. Even though a relation extraction task has been implemented in many domain fields, such as fault diagnosis and biomedical information extraction, it still suffers from the problem of lacking domain adaptivity, which directly degrades the final results. Therefore, this paper aims to model railway safety risks through knowledge triples, enabling a comprehensive exploration of the causal relationships among different safety risks. In addition, we aim to perform the IRSR task through a relation extraction model based on adaptive comprehension of railway semantics.
3. Materials and Methods
The proposed DARE model comprises two main components: railway safety risk modeling and relation extraction. Specifically, railway safety risks are structured based on the human–machine–environment–management framework, with head and tail entities representing the subjects and objects involved in safety risk relationships, respectively. To enhance the understanding of domain-specific semantics, DARE adopts a simple yet effective strategy of continued pre-training on railway-specific textual data, thereby improving relation extraction performance. The effectiveness of the proposed model is validated on real-world railway safety supervision datasets collected from rolling stock depots and infrastructure maintenance sections.
3.1. The Entity and Relation Design
In this paper, we focus on performing the IRSR by a relation extraction task. The railway safety risk can be defined as the triple knowledge , where represents the semantic relation (or subject–object logic relation) between and . Specifically, let be the ontology set of safety risk factors that express the subject of railway safety risk, in which the following apply:
- is an entity that represents the subject of the human factor.} refers to operators in railway operation systems, e.g., guards or yardmen.
- is an entity that represents the infrastructure factor.} refers to the key monitoring infrastructure related to the safety of train operation, e.g., bogies or turnout.
- is an entity that represents the environmental factor.} refers to the natural environment which affects the normal railway operation, e.g., strong wind or mudslides.
- is an entity that represents the management factor.} refers to the management strategy of the railway system, e.g., rules and regulations.
Let be the ontology set of the safety risk factor that expresses the object of railway safety risk, in which the following apply:
- is the unsafe behavior of humans.} refers to operators’ behaviors which would induce risk, e.g., not wearing seat belts or walking on rails.
- is the unsafe status of infrastructure.} refers to initial unsafe symptoms of facilities along with time, e.g., cracking or aging.
- is the unsafe status induced by environmental factors.} refers to the unsafe status of people or facilities, impacted by environmental factors, e.g., icing of catenary equipment or water accumulation in the culvert.
- is the people who violate the corresponding regulation.} refers to an operator who does not implement regulations issued from the higher-level departments.
Let be a set that includes four types of semantic relation, which are defined as follows:
- represents the semantic relation of human safety risk between and .
- represents the semantic relation of infrastructure safety risk between and .
- represents the semantic relation of environmental safety risk between and .
- represents the semantic relation of management safety risk between and .
In this paper, the identification of railway safety risk is recast as a relation extraction task, which extracts the triple knowledge from railway textual data by automatically adapting the railway semantics. Given an input sentence and a predefined entity pair , the proposed DARE model aims to identify the semantic relationship between the given entities by integrating railway-specific semantics with general-purpose semantic representations, without performing entity recognition.
3.2. Domain-Adaptive Relation Extraction Model
The proposed DARE can automatically adapt to the railway corpus by the domain-adaptive two-stream self-attention mechanism. Afterwards, the piecewise convolutional networks are introduced to capture fine-grained features contained in the structure of triple knowledge. The overall framework of DARE is demonstrated in Figure 2. There are two important concepts in our model that are defined as follows.
Figure 2.
An illustration of DARE model architecture. The DARE can integrate domain semantics to complement the insufficiency of universal semantics, which makes the model automatically adapt to the Chinese railway corpus.
Definition 1
(Universal Semantics). It describes the universal language characteristics of the input sentence, such as syntactic features, long-distance dependencies, semantic features, etc. These features help to understand the framework of universal language that serves for downstream tasks (e.g., relation extraction).
To explore the universal semantics, we use long-distance dependencies and the semantic features of the input sentence, which has been popular in recent years. In this paper, we introduce the two-stream self-attention mechanism to learn universal semantics. Specifically, ( means universal corpus), the two-stream self-attention mechanism includes a content stream attention and a query stream attention, where the content stream attention is the same as the traditional self-attention mechanism and the query stream attention only considers the contextual features and its position . The update of the two-stream attention mechanism can be expressed as follows:
where and respectively mean the query stream and the content stream, and m means the mth layer of the overall two-stream attention networks.
The prediction of universal semantics is formulated as follows:
The objective fucntion of universal semantics learning can be represented as follows:
where is a set of all permutations of the length-T index sequence, which uses the permutation operation to address the data corruption issues (details in the previous work [16]). To simplify, we utilize to stand for the two-stream self-attention networks.
Definition 2
(Domain Semantics). It describes the domain characteristics of the input sentence, such as domain semantics and domain syntactic features. These features are closely related to a specific field (e.g., Chinese railway), and are usually a long tail or absent features in universal semantics.
In this paper, we use the in-domain language features of the railway field to explore the domain semantics. Specifically, ( means domain corpus, e.g., the Chinese railway corpus), we also utilize the two-stream self-attention mechanism to encode S, and meanwhile, we obtain the objective function of domain semantics learning defined as , which is similar to . With the operation , the domain semantics can be captured, which complements the insufficiency of universal semantics for the relation extraction.
It is observed in Figure 2 that we design a DATA mechanism that aims to automatically integrate domain semantics with universal semantics, whose objective function is formulated as follows:
Though the output of the DATA mechanism is important for relation extraction, we still need to consider features of the knowledge structure. Following previous studies [17,18], we introduce piecewise convolutional neural networks to capture the fine-grained features and demonstrate the i-th convolutional operation as follows:
where is weight matrix, is the concatenation of the sliding window, is the bias vector, means the max pooling operation, and expresses the segment split by entity pair.
We use to express the final output of piecewise convolutional neural networks, which corresponds to the scores of the relation types. The conditional probability of can be defined by the following:
where means the number of relation types. Then, we use cross-entropy as the objective of piecewise convolutional neural networks, which is expressed as follows:
where is the number of input sentences.
The proposed model aims to explore and employ the domain-adaptive semantics by automatically integrating domain semantics with universal semantics, in which the overall objective function is formulated as follows:
Algorithm 1 summarizes the complete model for our proposed DARE.
| Algorithm 1 The Domain-Adaptive Relation Extraction Model |
|
There are three major advantages in this paper:
- This paper opens a new dimension for the IRSR task through the relation extraction. The triple knowledge interconnects all possible risk factors, which shows its potential to be a convenient and intelligent assistant for a decision-maker.
- We explore a new and uncultivated area that is to automatically learn Chinese railway semantics. Our proposed model DARE can be seen as a domain-adaptive version of semantics learning, which integrates domain semantics to complement the insufficiency of universal semantics.
- Our DARE can effectively process a dataset with complicated and diversified railway scenes, such as the RVSR dataset from the railway rolling stock scene and the RMSR dataset from the track maintenance scene.
4. Results
4.1. Experimental Settings
Datasets: to comprehensively evaluate the performance of DARE, we construct an unsupervised corpus RDC (Railway Domain Corpus) and two real-world railway supervised datasets. One of the railway supervised datasets is the RVSR (Railway Vehicle Safety Risk) dataset and another is the RMSR (Railway Maintenance Safety Risk) dataset.
- RDC: it is a railway unsupervised corpus, which includes official documents from one bureau of the China Railway System and public online documents related to railway safety risk. The former mainly includes railway accident reports, the emergency guide books of high/normal-speed trains and the regulations of the railway departments. The latter mainly includes dissertations related to railway safety risk and news derived from the official websites of 18 bureaus of the China Railway. This raw text composes an unlabeled corpus for domain semantics learning, which aims to complement the insufficiency of universal semantics. The RDC contains almost 160,000 KB of Chinese textual data and the specific scale is shown in Table 1.
- RVSR: the first relation extraction dataset is originally from the safety supervision system of the south zone of the China Railway. It mainly refers to the unsafe production status of railway rolling stock that is recorded by the safety inspector. This dataset includes 9085 short textual records.
- RMSR: the second relation extraction dataset is also from the same system as RVSR. The RMSR mainly depicts the unsafe production status of track maintenance recorded by the safety inspector. This dataset includes 23,414 short textual records.
The RVSR and RMSR datasets were manually annotated with relation labels over a period of six months, with each sentence annotated by three master’s student volunteers. To assess the reliability of the relation annotations, inter-annotator agreement was measured using Fleiss’s Kappa, yielding agreement scores of 0.74 and 0.82 for RVSR and RMSR, respectively. The distributions of different relation categories were analyzed and are reported in Table 2. To prevent data leakage, the RDC corpus used for domain-adaptive pre-training was collected from academic publications, whereas the RVSR and RMSR datasets were independently obtained from railway safety supervision logs. Furthermore, the RVSR and RMSR datasets were separately partitioned into training and test sets to ensure a reliable evaluation of the proposed model.
Table 1.
Statistics of the RDC dataset.
Table 2.
Statistics of RVSR and RMSR datasets.
Evaluation metrics: similar to previous work [19], we adopt the held-out evaluation to verify the performance of the proposed model. Specifically, for each of the experimental datasets, we randomly select 80% of the dataset as a train set and the rest as a test set. The held-out evaluation provides a precision measure in the test set without time-consuming human evaluation. In our experiments, we use the Precision@N (P@N), AUC, F1-score and aggregate precision/recall curves to assess the extracted triple knowledge. Also, we use the cosine function to evaluate the semantic similarity and visualize the results by heatmap.
Precision@N (P@N) evaluates the precision of the top N relation predictions ranked by confidence scores. It is calculated as the ratio of true positive predictions (TP@N) to the total number of true positive and false positive predictions (TP@N + FP@N) among the top N results. Here, TP, FP, and FN denote the numbers of true positives, false positives, and false negatives, respectively.
where denotes the number of correctly predicted relations (true positives) among the top N predictions, denotes the number of incorrectly predicted relations (false positives) among the top N predictions, and represents the total number of top-ranked relation predictions selected in descending order of confidence scores.
PR-AUC is employed to evaluate relation extraction performance by measuring the area under the precision–recall curve. Specifically, predictions are ranked according to their confidence scores, and precision and recall are calculated at different positions in the ranked list. The PR-AUC is then computed by applying the trapezoidal rule to the resulting precision–recall curve. A higher PR-AUC indicates better precision–recall performance across different ranking thresholds.
The F1-score is the harmonic mean of precision (P) and recall (R), providing a balanced evaluation of relation extraction performance. In this study, we adopt the micro-averaged F1-score (Micro-F1) to evaluate the overall performance of the proposed model in the multiclass relation extraction task. Specifically, Micro-F1 is calculated by aggregating true positives (TPs), false positives (FPs), and false negatives (FNs) across all evaluated relation classes before computing the F1-score, as follows:
By aggregating predictions across the evaluated relation classes, Micro-F1 provides an overall assessment of relation extraction performance, with a greater contribution from frequently occurring classes. A higher Micro-F1 indicates better overall performance across the evaluated relation instances.
Baselines: in our experiments, we compare DARE with models based on different kinds of dynamic language representations to validate the effectiveness of domain-adaptive semantics. Meanwhile, we integrate these representations with different classical neural networks to verify the advantages of piecewise CNN on Chinese railway datasets.
Language models (LMs):
- BERT: this is a state-of-the-art mask language model that is proposed in [20]. It uses the bidirectional variant of the Transformer networks to model masked language from context.
- GPT: this is a state-of-the-art language model for unsupervised multitask learning [21]. GPT is capable of capturing the long-distance dependency by attention architecture.
- XLNet: this is a state-of-the-art autoregressive language model provided in [16]. This model leverages the benefits of both an autoregressive encoder and an autoencoder to enhance the representation ability.
Classical neural networks:
- BiLSTM: this model is proposed in [22]; it uses bidirectional recurrent neural networks to extract the temporal features of the context. Through the memory unit, it stores the features of the triple knowledge structure.
- CNN: this model is proposed in [23]; it uses convolutional neural networks to extract the semantic relation between entity pairs. Through the convolution operation, it obtains the semantic relevance of triple knowledge.
- PCNN: this model is proposed in [24]; it divides the pooling layer of convolutional neural networks into three pieces. This operation captures the fine-grained features of the knowledge structure.
In this paper, we mainly explore the effectiveness of domain semantics and no longer compare models based on well-designed syntactic features [25]. We also do not compare specific domain models, since they cannot migrate to the Chinese railway dataset. To verify the importance of domain semantics, we further pre-train BERT and GPT on the RDC dataset and denote the resulting models as DBERT, DGPT and DXLNet. Then, we integrate these language models with classical neural networks.
Hyperparameter settings: to make comparison more fair, this paper implements the DARE model using TensorFlow following the recent trend in the NLP community. During the domain-adaptive semantic learning stage, the DATA module is initialized from a publicly released Chinese XLNet-large checkpoint rather than being trained from scratch. The model consists of 12 Transformer layers with a hidden size of 768, 12 attention heads, and an attention head dimension of 64. To enhance railway-specific semantic representations, we perform continued pre-training on the RDC corpus for more than 10,000 steps. The trade-off parameter is tuned from 0 to 1 in increments of 0.1. For the stage of extracting knowledge structure features, we adopt a single convolution layer, following the original paper [24]. The learning rate is tuned from . We show the optimal hyperparameters in Table 3 and Table 4. All experiments are conducted on a server equipped with an Intel(R) Xeon(R) Silver 4216 CPU @ 2.10 GHz on a 4 NVIDIA Tesla V100 GPU (32 GB for each) and an Ubuntu 14.04 operating system.
Table 3.
Hyperparameter settings for domain-adaptive pre-training of XLNet.
Table 4.
Hyperparameter settings for the DARE relation extraction model.
4.2. Performance Analysis
To evaluate the performance of DARE, we compare it with competitive models on two railway datasets and show the results in Table 5. Some comparisons are marked to better demonstrate the superiority of our proposed model. Observing these results, we have some interesting findings, as follows:
Table 5.
The experimental results of different models on two real-world datasets. The best results are highlighted in bold.
- On both of the two railway datasets, the proposed DARE model achieves competitive performance compared with existing LM-based models. In terms of F1-score, our DARE is , and higher than the best LM-based models on the RMSR dataset.
- The twice-pre-trained models outperform LM-based models on several evaluation metrics, although this improvement is not consistently observed across all models and datasets. For example, the DBERT+PCNN model and DGPT+PCNN model are and higher than the BERT+PCNN and GPT+PCNN model on the RMSR dataset in terms of AUC. It verifies our hypothesis that complementing domain semantics can help the model better understand the Chinese railway corpus.
- The DARE model outperforms XLNet-based models on certain evaluation metrics. For instance, DARE is and higher than the XLNet+PCNN model in terms of mean precision and AUC, respectively, on the RMSR dataset. This result indicates that the strategy of adapting the railway corpus can effectively improve the performance of relation extraction.
- On the RVSR dataset that describes the scenes unique to the railway, our DARE is superior to all the compared models in terms of AUC. This is because the proposed DATA mechanism can learn semantics by permutation factorization order instead of mask mode (i.e., BERT and DBERT). For instance, DARE is and higher than BERT+PCNN and DBERT+PCNN in terms of AUC, respectively, on the RVSR dataset. Even though the DBERT module complements railway semantics, the performance of DBERT+PCNN is still inferior to our DARE, as the mask mode leads to a data corruption issue.
- The proposed DARE model performs better than BiLSTM- and CNN-based models, by an especially large margin on the RMSR dataset in terms of AUC and F1-score. Although these compared models capture contextual features, they still fail to capture better features related to the entity pair, thus leading to unsatisfactory relation extraction results. This phenomenon implies that our DARE can capture fine-grained features contained in the knowledge structure.
It is worth noting that the P@N values on the RMSR dataset are relatively high (approximately 96%), whereas the corresponding PR-AUC and Micro-F1-scores are considerably lower. This discrepancy can be explained by the different evaluation perspectives of these metrics. P@N focuses on the correctness of the top-N highest-confidence predictions, whereas PR-AUC considers the precision–recall trade-off across the ranked predictions, and Micro-F1 evaluates overall relation extraction performance. Consequently, high precision among top-ranked predictions does not necessarily translate into equally strong performance across all relation instances. Moreover, the imbalanced class distribution in RMSR, where R4 accounts for more than half of the samples, may further influence the evaluation results.
Furthermore, to make it more intuitive, we utilize aggregate precision/recall curves to compare the impact of universal semantics and domain-adaptive semantics on the RVSR and RMSR datasets and thus show them in Figure 3 and Figure 4. As illustrated in the figures, domain-adaptive pre-training can improve model performance on certain evaluation metrics, particularly on the RMSR dataset. Unlike the original XLNet, which primarily captures general-purpose semantics from large-scale corpora, the proposed DATA module further adapts semantic representations to railway-specific textual data through continued pre-training. Moreover, conventional PCNN-based methods typically employ static word embeddings, such as Word2Vec, for distantly supervised relation extraction, whereas our DARE model integrates domain-adaptive semantic representations with PCNN for supervised railway safety risk relation extraction. As shown by the bottom curves in the figures, DATA-based models achieve better performance than their original XLNet-based counterparts on both datasets. Furthermore, DATA-based models achieve modest improvements over their DXLNet-based counterparts on certain evaluation metrics. Although these gains are relatively limited, they provide preliminary evidence of the potential benefits of integrating universal and domain semantic representations. This suggests that the DATA mechanism offers a promising direction for enhancing Domain-Adaptive Relation Extraction, while leaving room for further improvements in representation fusion. These findings suggest that incorporating railway-specific semantics can complement general-purpose representations and improve relation extraction performance without requiring a substantially more complex classification architecture.
Figure 3.
Performance comparison of domain adaptation on RVSR.
Figure 4.
Performance comparison of domain adaptation on RMSR.
4.3. Comparison with Deep Network Architectures
To further evaluate the effectiveness of the proposed DARE model, we conduct a comparative analysis against seven recently developed deep learning models, namely, RoBERTa-wwm [26], ERNIE [27], MacBERT [28], BERT-wwm [29], CRE-LLM (arXiv’24) [30], R1-RE (ACL’26) [31] and MCKE (TCCB’26) [32], as shown in Figure 5. RoBERTa-wwm, ERNIE, MacBERT, and BERT-wwm provide strong general-purpose contextual representations, but their limited adaptation to railway-specific terminology and semantic relationships may constrain their effectiveness in railway fields. Although CRE-LLM and R1-RE leverage large language models for relation extraction, their performance suggests that general-purpose language understanding does not necessarily translate into superior results on railway safety datasets. Similarly, MCKE incorporates knowledge-enhanced representations, but its effectiveness may be limited when transferred to a domain with different terminology and relation characteristics. In comparison, DARE explicitly integrates universal and domain semantic representations through domain-adaptive pre-training, achieving competitive performance across the evaluated datasets. These observations highlight the potential value of domain semantic adaptation for railway safety risk relation extraction.
Figure 5.
F1-score comparison of DARE and recent relation extraction models.
4.4. Parameter Sensitivity Analysis
To investigate the sensitivity and stability of the proposed DARE model, we analyze the influence of the fusion parameter and evaluate model performance under different random seeds. Specifically, 10% of the original training data is randomly selected as an independent validation set for hyperparameter optimization, while the test set remains unchanged. As illustrated in Figure 6, the model achieves the highest validation F1-scores when is set to 0.7 for RVSR and 0.8 for RMSR. These results indicate that the optimal contribution of domain semantic representations varies across datasets, highlighting the importance of appropriately balancing general and domain semantic information. Furthermore, to investigate the stability of the proposed model, we conduct experiments using four different random seeds (42, 123, 2026, and 3579). As reported in Table 6, DARE achieves average F1-scores of 59.05% ± 0.58% and 75.27% ± 0.45% on RVSR and RMSR, respectively. The relatively small standard deviations suggest that the model exhibits reasonably stable performance across different random initializations. Overall, these observations demonstrate the importance of selecting an appropriate fusion parameter and provide evidence of the stability of DARE across multiple experimental runs.
Figure 6.
Parameter sensitivity analysis of the proposed DARE model based on the RVSR and RMSR validation sets.
Table 6.
Performance of the proposed DARE model across multiple random seeds on the RVSR and RMSR datasets (Mean ± SD).
4.5. Case Study
The main advantage of DARE is its ability to adapt to the Chinese railway corpus. To verify this, we report some micro-level case studies in Table 7, and show the visualized semantics in Figure 7 and Figure 8 for comparison. Specifically, we randomly select four positive samples from the test datasets of RVSR and RMSR, respectively, which show sentences in column 1 and the triple knowledge in column 2. Inspecting these cases, we notice that the semantics varied after the training of the DATA mechanism. This phenomenon confirms that the domain semantics is closely related with the final results of relation extraction. To demonstrate the rationality of integrating domain semantics, we further study the semantic features of these sentences. From the real railway textual data, we have the following observations: (1) After the training of the DATA mechanism, the cells of the sentence in the bottom of the two thermal maps are much darker than the top. This indicates that the DATA can integrate domain semantics with universal semantics to enhance the representations of railway textual data. With these enhanced representations, our DARE is prone to extract the triple knowledge, which meets our expectation. (2) The cells of entity pairs in the bottom of the two thermal maps are darker than those in the top. Based on the sufficient semantics, the features of the entity pair are more obvious, helping to understand the fine-grained features of the knowledge structure. This provides evidence that our model is capable of adapting well to the Chinese railway corpus and performing the IRSR by relation extraction.
Table 7.
Case study on RVSR and RMSR. Here, different entities of the triples are shown in different colors. The first four sentences are from RVSR and the last four sentences are from RMSR.
Figure 7.
Semantics representation comparison on RVSR. Top: semantics are learned by the XLNet. Bottom: semantics are learned by the DATA.
Figure 8.
Semantics representation comparison on RMSR. Top: semantics are learned by the XLNet. Bottom: semantics are learned by the DATA.
5. Discussion
To further explore the practical significance of the proposed DARE model, we present a railway derailment case study to qualitatively illustrate its potential application in railway safety risk analysis, as shown in Figure 9. By extracting relationships among safety risks, DARE can provide structured relational knowledge that may help identify potential contributing factors and better understand the interactions among different risks. However, this case study serves as an illustrative example rather than a systematic evaluation of accident prediction capabilities. Although the experimental results on the RVSR and RMSR datasets demonstrate the effectiveness of DARE in railway safety risk relation extraction, its performance in accident prediction and real-world operational environments has not yet been quantitatively evaluated. Therefore, further investigations are needed to assess its practical applicability to railway accident analysis and prediction.
Figure 9.
The visualization of knowledge graph to infer the real case of train derailment. (a) Knowledge graph built upon structured knowledge extracted from the railway corpus. (b) Photographs of train derailment scenes. (c) Schematic illustration of knowledge reasoning for train derailments.
We propose a novel method to perform the IRSR task, and explore automatically adapting it to railway text. However, we only take advantage of unimodal data (i.e., text data) to enhance the representation of the railway dataset, without considering the semantics contained in the multi-modal dataset, such as image data and video data. In the future, we intend to introduce multi-modal semantics to facilitate the representation of Chinese railway text data, since multi-modal semantic features are more intuitive and less ambiguous. Furthermore, how to mine causal logic rules is challenging for risk evolution analysis under Industry 4.0. We will focus on these difficult deep relation extraction problems to enrich the application scenarios, such as fault diagnosis and question answering systems with real-time responses.
6. Conclusions
The IRSR is one of the significant aspects of safety risk management for railway transportation, and it can be proved to be vital to guarantee safe operation and minimize the likelihood of accidents/incidents. In this paper, we introduce the triple knowledge to model railway safety risk, fully exploring the interconnection of safety risk. We recast the IRSR as the relation extraction task and propose a DARE model to extract the triple knowledge, which opens a novel dimension for performing the IRSR task and studies from different aspects. The DARE can well address the issue of lacking domain adaptivity by integrating domain semantics and universal semantics. The proposed model has potential applications in railway safety management, particularly in the southern region of the China Railway.
In the future, we will continue to study the representation of Chinese railway text data by introducing multi-modal semantics, which helps the model to comprehend domain text data without ambiguity. Additionally, using knowledge inference to perform retrospective analysis and predictive analysis of railway hazards is valuable research. We will also concentrate on timely fault diagnosis responses and solutions by the knowledge-based question answering systems.
Author Contributions
Conceptualization, D.W.; methodology, D.W. and Z.T.; software, D.W. and G.W.; validation, Z.T.; formal analysis, Z.T.; investigation, G.W.; resources, W.S.; data curation, G.W.; writing—original draft preparation, D.W.; writing—review and editing, G.W.; visualization, G.W.; supervision, Z.T. and W.S.; project administration, W.S.; funding acquisition, D.W. All authors have read and agreed to the published version of the manuscript.
Funding
This work was financially supported by Henan Provincial Department of Science and Technology Research Project under Grant No. 26B880003 and the Henan Province Key Research Project Plan for Higher Education Institutions under Grant No. 262102210152.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
The datasets used in this study are available from the corresponding author upon reasonable request. The source code of the proposed DARE model is available at https://github.com/SWT-AITeam/dare (accessed on 30 November 2026).
Conflicts of Interest
The authors declare no conflicts of interest.
References
- Zhao, S. CMF-Net: A novel deep learning framework for high-precision and robust detection of foreign objects on railway tracks. Technologies 2026, 14, 322. [Google Scholar] [CrossRef] [Scilit]
- Liu, Z.; Zhang, D.; Zhao, X.; Xu, W.; Cui, Z.; Song, Y. GuidDiff: Map-adaptive human trajectory forecasting with heatmap-guided diffusion. IEEE Internet Things J. 2026, 13, 41957–41970. [Google Scholar] [CrossRef] [Scilit]
- Liu, J.; Qiu, Y.; Ni, X.; Li, Y.; Liu, H. Mask decoupling framework for rail surface defect pixel-level detection. Adv. Eng. Inform. 2026, 76, 104875. [Google Scholar] [CrossRef] [Scilit]
- Lee, J.; Yoon, W.; Kim, S.; Kim, D.; Kim, S.; So, C.H.; Kang, J. BioBERT: A pre-trained biomedical language representation model for biomedical text mining. Bioinformatics 2020, 36, 1234–1240. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Hacini, I.; Belaid, S.L.; Idjdarene, K.; Abderazek, H.; Berabez, K. Fuzzy logic-based energy management strategy for hybrid renewable system with dual storage dedicated to railway application. Technologies 2025, 13, 334. [Google Scholar] [CrossRef] [Scilit]
- Han, L.; Abdel-Aty, M.A.; Yu, R.; Wang, C. LSTM + Transformer real-time crash risk evaluation using traffic flow and risky driving behavior data. IEEE Trans. Intell. Transp. Syst. 2024, 25, 18383–18395. [Google Scholar] [CrossRef] [Scilit]
- Chang, Y.; Li, Y.; Luan, T.H.; Wang, Y.; Zheng, J.; Su, Z. Privacy-preserving K-Means clustering for vehicular driving behavior analysis. IEEE Trans. Netw. Sci. Eng. 2026, 13, 4930–4945. [Google Scholar] [CrossRef] [Scilit]
- Tian, Z.; Zhao, X.; Li, X.; Ma, X.; Li, Y.; Wang, Y. Multi-modal semantics fusion model for domain relation extraction via information bottleneck. Expert Syst. Appl. 2024, 244, 122918. [Google Scholar] [CrossRef] [Scilit]
- Chen, F.; Guo, B.; Shen, Y.; Xu, J.; Xu, M.; Chen, X.; Xin, J. Adaptive modality routing for temporal knowledge graph forecasting with heterogeneous mixture-of-experts. Technologies 2026, 14, 633. [Google Scholar] [CrossRef] [Scilit]
- Wang, Y.; Cao, P.; Fang, H.; Ye, Y. Span-aware pre-trained network with deep information bottleneck for scientific entity relation extraction. Neural Netw. 2025, 186, 107250. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Lu, H.; Zhang, Q.; Niu, J.; Xu, X.; Zhu, B.; Ren, Y. Adaptive balancer-based symmetrical contrastive pre-training for biomedical few-shot entity relation extraction. Biomed. Signal Process. Control. 2026, 122, 110493. [Google Scholar] [CrossRef] [Scilit]
- Rambow, O.; Wanner, L.; Apidianaki, M.; Al-Khalifa, H.; Eugenio, B.D.; Schockaert, S.; Mather, B.; Dras, M. PolyMinder: A Support system for entity annotation and relation extraction in polymer science documents. In Proceedings of the 31st International Conference on Computational Linguistics, Abu Dhabi, United Arab Emirates, 19–24 January 2025; pp. 1–8. [Google Scholar]
- Li, S.; Xue, X.; Tian, S.; Pan, Y.; Ren, T. Latent relation-aware graph framework for document-level Chinese financial event extraction. Inf. Process. Manag. 2027, 64, 104986. [Google Scholar] [CrossRef] [Scilit]
- Qi, R.; Xiang, G.; Sun, L.; Tan, Z.; Cao, J.; Yang, Q.; Cheng, M. Joint entities and relations extraction method for complex scenarios of APT attack threat intelligence analysis. Comput. Secur. 2026, 168, 104960. [Google Scholar] [CrossRef] [Scilit]
- Cai, Y.; Hu, R.; Xie, H.; Li, C.; Liu, Y.; Ye, Y.; Liu, Z.; Shen, W.; Liu, Z. LexRel: Benchmarking legal relation extraction for Chinese civil cases. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics, ACL, San Diego, CA, USA, 2–7 July 2026; pp. 21440–21456. [Google Scholar]
- Yang, Z.; Dai, Z.; Yang, Y.; Carbonell, J.G.; Salakhutdinov, R.; Le, Q.V. XLNet: Generalized autoregressive pretraining for language understanding. In Proceedings of the 32th Advances in Neural Information Processing Systems, Vancouver, BC, Canada, 8–14 December 2019; pp. 5754–5764. [Google Scholar]
- Lin, Y.; Shen, S.; Liu, Z.; Luan, H.; Sun, M. Neural relation extraction with selective attention over instances. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, Berlin, Germany, 7–12 August 2016; pp. 1–10. [Google Scholar]
- Liang, T.; Liu, Y.; Liu, X.; Sharma, G.; Guo, M. Distantly-supervised long-tailed relation extraction using constraint graphs. IEEE Trans. Knowl. Data Eng. 2022, 35, 6852–6865. [Google Scholar] [CrossRef] [Scilit]
- Zhang, J.; Cao, M. Distant supervision for relation extraction with hierarchical attention-based networks. Expert Syst. Appl. 2023, 220, 119727. [Google Scholar] [CrossRef] [Scilit]
- Devlin, J.; Chang, M.; Lee, K.; Toutanova, K. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Minneapolis, MN, USA, 2–7 June 2019; pp. 4171–4186. [Google Scholar]
- Radford, A.; Narasimhan, K.; Salimans, T.; Sutskever, I. Improving language understanding by generative pre-training. OpenAI 2018, pp. 1–12. [Google Scholar]
- Xiao, M.; Liu, C. Semantic relation classification via hierarchical recurrent neural network with attention. In Proceedings of the 26th International Conference on Computational Linguistics, Osaka, Japan, 11–16 December 2016; pp. 1254–1263. [Google Scholar]
- Zeng, D.; Liu, K.; Lai, S.; Zhou, G.; Zhao, J. Relation classification via convolutional deep neural network. In Proceedings of the 25th International Conference on Computational Linguistics, Dublin, Ireland, 23–29 August 2014; pp. 2335–2344. [Google Scholar]
- Zeng, D.; Liu, K.; Chen, Y.; Zhao, J. Distant supervision for relation extraction via piecewise convolutional neural networks. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, Lisbon, Portugal, 17–21 September 2015; pp. 1753–1762. [Google Scholar]
- Shang, Y.; Huang, H.; Mao, X. OneRel: Joint entity and relation extraction with one module in one step. In Proceedings of the 36th AAAI Conference on Artificial Intelligence, virtual, 22 February–1 March 2022; pp. 11285–11293. [Google Scholar]
- Liu, Y.; Ott, M.; Goyal, N.; Du, J.; Joshi, M.; Chen, D.; Levy, O.; Lewis, M.; Zettlemoyer, L.; Stoyanov, V. RoBERTa: A Robustly Optimized BERT Pretraining Approach. arXiv 2019, arXiv:1907.11692. [Google Scholar] [CrossRef] [Scilit]
- Sun, Y.; Wang, S.; Li, Y.; Feng, S.; Chen, X.; Zhang, H.; Tian, X.; Zhu, D.; Tian, H.; Wu, H. ERNIE: Enhanced Representation through Knowledge Integration. arXiv 2019, arXiv:1904.09223. [Google Scholar] [CrossRef] [Scilit]
- Cui, Y.; Che, W.; Liu, T.; Qin, B.; Wang, S.; Hu, G. Revisiting Pre-Trained Models for Chinese Natural Language Processing. In Proceedings of the Findings of the Association for Computational Linguistics: EMNLP 2020, Online Event, 16–20 November 2020; ACL: Kerrville, TX, USA, 2020; pp. 657–668. [Google Scholar]
- Cui, Y.; Che, W.; Liu, T.; Qin, B.; Yang, Z. Pre-Training with Whole Word Masking for Chinese BERT. IEEE ACM Trans. Audio Speech Lang. Process. 2021, 29, 3504–3514. [Google Scholar] [CrossRef] [Scilit]
- Shi, Z.; Luo, H. CRE-LLM: A Domain-Specific Chinese Relation Extraction Framework with Fine-tuned Large Language Model. arXiv 2024, arXiv:2404.18085. [Google Scholar] [CrossRef] [Scilit]
- Dai, R.; Zheng, T.; Yang, R.; Yu, K.; Zhu, H. R1-RE: Cross-Domain Relation Extraction with RLVR. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics; ACL: Kerrville, TX, USA, 2026; pp. 34387–34401. [Google Scholar]
- Lu, H.; Li, L.; Tang, J. A Multi-Channel Knowledge-Enhanced Model for Biomedical Relation Extraction. IEEE Trans. Comput. Biol. Bioinform. 2026, 23, 1440–1450. [Google Scholar] [CrossRef] [Scilit] [PubMed]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.








