Uncertain train arrival delay prediction method based on quantile regression and its application
Through a neural network method based on quantile regression, combined with CNN and Transformer to extract the spatiotemporal characteristics of the train, the problem of single-point prediction uncertainty is solved, and the prediction interval for the train to arrive at a late point is provided, which improves the reliability of prediction and the scientific nature of decision-making.
Patent Information
- Application Number
- CN202510047691.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-13
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-01-13
AI Technical Summary
In the prior art, the prediction method for predicting the arrival of a single-point train based on neural network is highly uncertain, which is difficult to ensure reliability, and affects the quality of decision-making for scheduling adjustment.
Using a neural network method based on quantile regression, the spatiotemporal features in train operation information are extracted through the combination of CNN and Transformer, and the quantile loss function is designed to construct the prediction interval for train arrival late.
The predicted values under different quantile conditions are provided, and the probability distribution of late points is demonstrated, which helps dispatchers make more robust and reasonable decisions and improves the reliability of late points prediction.
Smart Images

Figure CN119476646B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of high-speed rail delay prediction, and relates to an uncertain train arrival delay prediction method based on quantile regression and an application thereof. Background Art
[0002] High-speed railways are characterized by high speed, high punctuality and long operating mileage. By the end of 2024, the operating mileage of my country's high-speed railways will have reached 48,000 kilometers, with a maximum operating speed of 350 kilometers per hour and a minimum departure interval of 3 minutes. In order to achieve high-quality development of railways and meet the growing travel needs of passengers, the CR450 scientific and technological innovation project led by the National Railway Group is progressing steadily to continuously improve the quality of railway travel. With the continuous increase in train speed and passenger demand, the railway operation density is increasing, the line buffer time is shortening, and the train emergency response time is reduced. This requires a more intelligent railway traffic dispatching and command system to improve decision-making efficiency.
[0003] Random disturbances such as equipment failures and bad weather that may occur during the operation of high-speed railways will affect the on-time operation of trains. Dispatchers need to formulate adjustment strategies based on the impact of random disturbances. Accurate and reliable train delay prediction information is crucial to the decision-making process of train scheduling adjustments. Traditional point prediction can only give a prediction value, while the uncertainty-based delay interval prediction can give prediction values at various quantile levels, thereby obtaining rich decision-making information, which can enhance the comprehensiveness of the decision-making plan and play an important role in achieving reliable delay prediction.
[0004] The current train delay prediction method is mainly based on data-driven neural network short-term point prediction, which can only give a prediction value. However, due to the uncertainty of random disturbances and the lack of interpretability of the black box model of the neural network, the reliability of this data-driven neural network single-point prediction method is difficult to guarantee. Overly optimistic or overly pessimistic estimates will affect the quality of the adjustment plan. The neural network based on quantile regression can provide the range information of train delay prediction and show the probability distribution of delay under different quantile conditions, so that dispatchers can make more robust and reasonable decisions based on different scenario conditions and delay prediction range. Summary of the invention
[0005] The present invention proposes an uncertain train arrival delay prediction method based on quantile regression to solve the problem of insufficient reliability caused by strong uncertainty of single-point prediction under random disturbance. The present invention is implemented by the following technical solutions:
[0006] Step S100: determine the research route and collect historical train operation data for model training.
[0007] Step S200: constructing a quantile regression delay prediction network model.
[0008] Step S300: Use the constructed neural network and historical data to perform model training.
[0009] Step S400: Construct uncertainty evaluation index to evaluate model performance.
[0010] Furthermore, the step S100 includes:
[0011] Step S110: Determine the starting and ending points of the line, collect historical information of the trains, and select relevant trains with a high frequency of delays and stations with more passenger operations as objects of delay prediction based on delay statistics.
[0012] Step S120: Determine characteristic information related to the delay, including the planned arrival and departure time of the train at each station, the actual arrival and departure time, the delay time of adjacent trains, weather conditions and other information.
[0013] Step S130: perform data preprocessing, filter historical train data, and only retain data where trains are delayed at the target station. Delete data where only a certain station has sudden delays, and perform mean normalization on the included data.
[0014] Furthermore, the step S200 includes:
[0015] Step S210: Convolutional Neural Networks (CNN) and self-attention mechanism (Transformer) are integrated to build a neural network model for the main structure of train delay interval prediction, and the spatiotemporal features related to train operation information and delays are extracted.
[0016] Step S220: Set the input layer according to the selected number of features, batch size and time step.
[0017] Step S230: Select a quantile set of the target and design a quantile loss function.
[0018] Furthermore, the step S300 includes:
[0019] Step S310: Select the Adam optimizer for optimization.
[0020] Step S320: Divide the data into training set, validation set and test set. Randomly select 15% of the original data as the test set, and use the other 85% of the data as the training set and validation set for model training, where the ratio of the training set to the validation set is 4:1.
[0021] Step S330: Adjust the parameters of the model, setting the learning rate, number of iterations, and dropout rate.
[0022] Furthermore, the step S400 includes:
[0023] Step S410: Select the uncertainty evaluation indicator Winkler Score (WS) to measure the width and coverage of the prediction interval.
[0024] Step S420: Select the uncertain evaluation indicator Quantile Score (QS) to measure the accuracy of the quantile. Beneficial Effects
[0025] A neural network combining CNN and Transformer is used to extract train historical information and spatiotemporal feature information related to delays. A quantile regression loss function is designed for regression prediction to obtain predicted delay values under different quantile conditions, thereby obtaining the range of arrival delays and their probability distribution, providing dispatchers with richer decision-making information for delay adjustments and better coping with the formulation of adjustment plans in different application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is a processing flow chart of a train arrival delay prediction method based on quantile regression provided by the present invention;
[0027] Figure 2 This is a graph of the experimental results of the uncertain delay prediction provided by the present invention. DETAILED DESCRIPTION
[0028] The present invention proposes a train arrival delay prediction method based on quantile regression, such as Figure 1 As shown in the figure, CNN and Transformer are mainly used to extract train history information and feature information related to delays, and then the quantile loss function is constructed to predict uncertain train delays. The specific steps include:
[0029] Step S100: determine the research route and collect historical train operation data for model training.
[0030] Step S110: Determine the starting and ending points of the line, collect historical information of the trains, and select relevant trains with a high frequency of delays and stations with more passenger operations as objects of delay prediction based on delay statistics.
[0031] Step S120: determining characteristic information related to the delay, including the planned arrival and departure time of the train at each station, the actual arrival and departure time, the delay time of adjacent trains, weather conditions, etc.;
[0032] Step S130: perform data preprocessing, filter historical train data, and only retain data where trains are delayed at the target station. Delete data where only a certain station has sudden delays, and perform mean normalization on the included data.
[0033] Among them, the formula for the mean standardization method is as follows:
[0034] (14)
[0035] in, is the data after mean normalization, is the data before mean normalization, is the mean of the data, is the standard deviation of the mean.
[0036] Step S200: constructing a quantile regression delay prediction network model.
[0037] Step S210: Integrate CNN and Transformer to build a neural network model for the main structure of train delay interval prediction, and extract the spatiotemporal features related to train operation information and delays.
[0038] CNN is used to extract the main feature information related to train delays from train operation data. This is achieved through multi-layer convolutional networks and pooling layers. The principle of the convolution operation is shown in the following formula:
[0039] (15)
[0040] in, and They are Layer and The feature map of It is The weight matrix of the convolution kernel of the layer, It is Bias matrix for the convolution kernel of the layer.
[0041] Transformer uses the self-attention mechanism to capture global dependencies in input data, especially capturing long-term temporal correlations in long time series data. For train delay prediction, Transformer can analyze the correlation of train feature information from a global perspective, especially the long-term dependencies between different time steps.
[0042] The structure of the Transformer model consists of two parts: encoder and decoder. Each layer of the encoder and decoder contains components such as self-attention mechanism, feedforward neural network, residual connection and layer normalization. Transformer processes data in the following steps:
[0043] 1. Position coding: For a train delay sequence, the delay information of a train at each station is a position in the sequence, and the length of the sequence is the number of historical stations of the train. First, the position information of the input sequence must be added through position coding. The position coding is a vector with the same length as the input sequence, indicating the relative or absolute position of each position. Sine and cosine functions are usually used to generate position coding:
[0044] (16)
[0045] (17)
[0046] in, Indicates In the encoding vector of the position, the dimension The value of Indicates In the encoding vector of the position, the dimension The value of Indicates that the position is the index of an element in the input sequence; Represents the dimension index in the position encoding, for each position , the position encoding vector has multiple dimensions; is the total dimension of the positional encoding.
[0047] 2. Self-attention mechanism: The self-attention mechanism is the core of Transformer, which can calculate the relationship between each position in the input sequence and all other positions, so that the information of other positions can be considered when generating the representation of each position.
[0048] The input train delay information sequence is ,in It is The input vector at position For each input , the self-attention mechanism computes its relationship with all other positions and updates its representation by the following steps:
[0049] (5) Each input vector Through three different weight matrices , and Transformed into three new vectors: query vector Q, key vector K and value vector V, which are obtained by the following linear transformation:
[0050] (18)
[0051] (19)
[0052] (20)
[0053] Among them, Q is a vector used to find relevant information, indicating that each station queries the information of other stations. K is a vector used to match Q, indicating the associated characteristics of each station's delay information on other stations. V is the stored information, indicating the intensity of the delay impact of a station on other stations, which will eventually be weighted and summed according to the matching degree.
[0054] (6) Calculate the attention weight: The attention weight of each position is obtained by calculating the similarity between the query vector Q and all key vectors K, which indicates the degree to which the information of a certain station is affected by other stations. The specific calculation formula is as follows:
[0055] (twenty one)
[0056] in, is the dimension of Q and K, usually used Scaling is done to avoid dot product values being too large.
[0057] (7) Convert the attention scores into weights through the Softmax function and ensure that the sum of all weights is 1:
[0058] (twenty two)
[0059] in, Indicates The query vector and The attention weights of the key vectors.
[0060] (8) Weighted summation: sum the attention weights with the corresponding value vector Multiply them together to get the weighted output representation information.
[0061] (twenty three)
[0062] in, It's location The output representation obtained by weighted combination of all location information indicates the dependency strength between sites, and each location can dynamically adjust its representation based on its relationship with other locations.
[0063] 3. Multi-head self-attention mechanism: In order to focus on different parts of the input from multiple angles at the same time and capture richer semantic information, different heads can learn various influencing relationships during the operation of the train. For example, the first head will model the local dependency between adjacent stations, and the second head will model the global dependency between distant stations. The independent query, key, and value matrices of multiple different attention heads are calculated in parallel, and the results are concatenated after the calculation. The formula is as follows:
[0064] (twenty four)
[0065] Output all headers through the Concat function spliced together to form a new vector representation, which contains the relationship information between sites captured from multiple perspectives. A linear transformation is performed to map the concatenated vector to the final output dimension, which is the comprehensive relationship information of each site. The concatenated vector will be richer because each head can capture different aspects of the input data. The output of each head is The calculation process is:
[0066] (25)
[0067] Attention is the calculation function of the self-attention mechanism. This function uses the query vector and the key vectors, and then use these scores to compare the value vectors We weight them and finally get a weighted representation. In the calculation process, the weight matrix , , The role of is to transform the input query vector through linear transformation , key vector Sum value vector Project to a representation space suitable for the current attention head.
[0068] 4. Feedforward Neural Network: Each attention layer is followed by a position-independent feedforward network, usually consisting of two fully connected layers, to further process the features of each position.
[0069] (26)
[0070] in, is the feature vector of the output of the previous layer, and is the weight matrix, and is a bias term. The output features of the attention layer can be further mapped to a high-dimensional space through the feedforward network to learn a more complex delay model. For example, the delay features of the first station will be combined with the global features of other stations in the feedforward network to generate comprehensive prediction information for the delay of the next station.
[0071] 5. Residual connection and layer normalization: Each attention layer and feedforward network is followed by residual connection and layer normalization. Residual connection helps alleviate the gradient vanishing problem, allows deeper network training, and ensures that the output of the attention layer does not lose the original delay characteristics. Layer normalization ensures that the output of each layer remains stable, avoiding the adverse effects of large delay time stations on model learning.
[0072] Step S220: Set the input layer according to the selected number of features, batch size and time step. The input is a three-dimensional tensor (num_samples, time_steps, num_features), where num_samples is the number of samples in each batch; time_steps is the time step, which is determined by the time range of the delay prediction. If the operation data of the first two stations are to be used to run the next station, the time step is 2; num_features is the number of selected features, including arrival and departure time, operation type, weather conditions, etc.
[0073] Step S230: Select a quantile set of the target and design a quantile loss function.
[0074] Given a predicted value , true value , and the target quantile , then the quantile loss function is defined as:
[0075] (27)
[0076] Since the goal of the quantile loss function is to make the predicted value Meet target quantile ,Right now
[0077] (28)
[0078] when When the optimization goal is to make the predicted value becomes the 10th percentile, which means the true value There is a 10% probability that the value is less than or equal to the predicted value , and there is a 90% probability that it is greater than the predicted value .for : When the predicted value is underestimated, the loss weight is 0.1, which is a light penalty. When the predicted value is overestimated, the loss weight is 0.90, which is a heavy penalty. This asymmetric weight will guide the model to tend to generate lower predicted values, making Close to the 10th percentile.
[0079] By selecting the target quantile set [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9], we can obtain the prediction values at different quantile levels, thus forming the entire delay prediction interval.
[0080] Step S300: Use the constructed neural network and historical data to perform model training. Step S310: Select the Adam optimizer for optimization.
[0081] Step S310: Select the Adam optimizer for optimization;
[0082] Step S320: Divide the data into training set, validation set and test set. Randomly select 15% of the original data as the test set, and use the other 85% of the data as the training set and validation set for model training, where the ratio of the training set to the validation set is 4:1.
[0083] Step S330: Adjust the parameters of the model, setting the learning rate, number of iterations, and dropout size.
[0084] Step S400: Construct uncertainty evaluation index to evaluate model performance:
[0085] Step S410: Select the uncertainty evaluation index Winkler Score (WS) to measure the width and coverage of the prediction interval. The calculation formula of WS is as follows:
[0086] (29)
[0087] in, is the lower limit of the prediction interval (the predicted value at a low quantile, such as the 10th percentile); is the upper limit of the prediction interval (the predicted value at a high quantile, such as the 90th percentile); is the actual delay value; Is the significance level of the prediction interval, indicating the probability that the prediction interval fails to cover the true value. The smaller WS is, the narrower the prediction interval is and the stronger its ability to cover the true value is.
[0088] Step S420: Select the uncertainty evaluation index Quantile Score (QS) to measure the accuracy of the quantile. Each quantile corresponds to a different QS, which is calculated based on the quantile loss function. The predicted delay value and the later true value , the calculation formula of its quantile QS is as follows:
[0089] (30)
[0090] This formula quantifies the delay prediction value Compared to the true value The quantile score dynamically adjusts the overestimate and underestimate biases through weights to ensure that errors in different scenarios are appropriately penalized. The prediction under this condition emphasizes the cost of underestimating the delay when the predicted delay value is smaller than the actual delay value; for smaller quantiles The prediction under , then emphasizes the cost of the predicted delay value being greater than the actual delay value.
[0091] Since the prediction interval is formed based on the prediction values obtained from each quantile in the present invention, it is necessary to calculate the mean of the quantile QS of all samples in the entire late-point data set. For a late-point data set with m samples, each sample Corresponding to the actual value of the delay , select a set of n quantiles , quantile The predicted value set under , then the mean The calculation formula is as follows:
[0092] (31)
[0093] The smaller it is, the smaller the deviation of the predicted value is and the better the late prediction performance of the model is.
[0094] Example
[0095] The present invention also provides an embodiment for exemplarily showing the process and results of delay prediction using the method provided by the present invention. The specific steps are as follows:
[0096] Step S100: determine the research route and collect historical train operation data for model training.
[0097] Step S110: Determine the starting and ending points of the line, collect historical information of the trains, and select relevant trains with a high frequency of delays and stations with more passenger operations as objects of delay prediction based on delay statistics.
[0098] We selected the high-speed rail line from Beijing South to Tianjin to collect data, and selected the train data with significantly higher frequency of delays as network training data according to the frequency of arrival delays. There are six stations along the line, and only the two stations in the middle, Wuqing and Tianjin South, have passengers handling operations, so we selected these two stations as the target stations for delay prediction.
[0099] Step S120: Determine characteristic information related to the delay, including the planned arrival and departure time of the train at each station, the actual arrival and departure time, the delay time of adjacent trains, weather conditions and other information.
[0100] Step S130: perform data preprocessing, filter historical train data, retain only the data where the target train is delayed at the target station, delete the data where only a certain station has a sudden delay, and perform mean normalization on the included data.
[0101] Step S200: constructing a quantile regression delay prediction network model.
[0102] Step S210: Integrate CNN and Transformer to build a neural network model for the main structure of train delay interval prediction, and extract the spatiotemporal features related to train operation information and delays.
[0103] CNN consists of two convolutional layers and one pooling layer. The number of convolution kernels in the first convolution layer is set to 64, and the convolution kernel size is set to 3. The convolution kernel size in the second layer is set to 128, and the convolution kernel size is set to 3. The pooling window size of the pooling layer is 2.
[0104] The core components of Transformer include multi-head attention mechanism, feedforward network, residual connection and layer normalization. In the multi-head attention mechanism structure, 4 attention heads are used, and the dimension of each attention head is 128; the feedforward neural network consists of two fully connected layers. The first layer sets the input dimension to 256 and uses the ReLU activation function to introduce nonlinearity. The output dimension of the second layer is 128, and the output of the first layer is mapped to a smaller dimension through linear transformation.
[0105] Step S220: Set the input layer according to the selected number of features, batch size and time step.
[0106] The selected features are the arrival delay and departure delay time, operation type and weather conditions of the target train at the first two stations, and the operation type and weather conditions at the target station. Therefore, the number of input features is 10. At the same time, the information of the adjacent previous train is considered, so the time step is 2, and the batch size is set to 256.
[0107] Step S230: Select a quantile set of the target and design a quantile loss function.
[0108] Select the quantile set [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9], and train them into the quantile loss function to calculate the loss. Finally, the loss of each quantile is summed and the mean loss is calculated as the total loss of the late range prediction.
[0109] Step S300: Use the constructed neural network and historical data to perform model training.
[0110] Step S310: Select the Adam optimizer for optimization.
[0111] Step S320: Divide the data into training set, validation set and test set. The original data has 1700 samples in total. 15% of the original data is randomly selected to obtain 255 samples as the test set. The other 85% of the data, a total of 1445 samples, are used as training set and validation set for model training. The ratio of training set to validation set is 4:1.
[0112] Step S330: Adjust the parameters of the model. Set the learning rate, number of iterations and dropout size. The learning rate is set to 0.0001 and the number of training rounds is set to 500. After training, 255 samples of the test set are used to predict the delay range, and the results are plotted as a comparison chart of the true value, median prediction value and uncertainty range, where the solid line is the true delay value, the dotted line is the median prediction value, and the uncertainty range is the shaded part of the range formed by the upper limit of the prediction value obtained by the maximum quantile 90th percentile prediction and the lower limit of the prediction value obtained by the minimum quantile 10th percentile prediction, as shown in the figure below. Figure 2 shown.
[0113] Step S400: Construct uncertainty evaluation index to evaluate model performance.
[0114] Step S410: Select the uncertainty evaluation index Winkler Score (WS) to measure the width and coverage of the prediction interval. For 255 samples, the WS calculation result is 1.638 min.
[0115] Step S420: Select the uncertainty evaluation index Quantile Score (QS) to measure the accuracy of the quantile. For 255 samples, the QS calculation result is 0.917 min.
[0116] In summary, the present invention proposes a method for predicting train arrival delays with uncertainty based on quantile regression. The method first constructs a neural network based on CNN and Transformer to extract feature information related to train delays. The network can extract relevant information in time and space from the train information sequence, and can more comprehensively grasp the deep characteristics of the delays. The neural network is then fused with the quantile loss function, and different quantile training models are combined to obtain prediction results at each quantile level, thereby constructing a prediction interval for train delays, and using uncertainty evaluation indicators WS and QS to evaluate the width of the prediction interval, the ability to cover the true value, and the accuracy of the prediction value. This method for predicting uncertain delays can obtain a prediction range for delays compared to traditional point prediction methods, and can provide dispatchers with richer decision-making information, enabling them to better respond to different adjustment needs in various scenarios and formulate more scientific and reasonable scheduling plans.
[0117] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions only describe the principles of the present invention. The present invention may be subject to various changes and improvements without departing from the spirit and scope of the present invention. These changes and improvements fall within the scope of the present invention. The scope of protection claimed by the present invention is defined by the attached claims and their equivalents.
Claims
1. A method for predicting train arrival delays under uncertainty based on quantile regression, characterized by: Step S100: determine the research line and collect historical train operation data for model training; Step S110: determine the starting and ending points of the line, collect historical information of the trains, and select the trains with a high frequency of delays and the stations with a large number of passenger operations as objects of delay prediction according to the delay statistics; Step S120: determining characteristic information related to the delay, including the planned arrival and departure time of the train at each station, the actual arrival and departure time, the delay time of adjacent trains, and weather condition information; Step S130: perform data preprocessing, filter historical train data, retain only data where trains are delayed at the target station, delete data where only a certain station has sudden delays, and perform mean normalization on the data; Among them, the formula for the mean standardization method is as follows: (1) in, is the data after mean normalization, is the data before mean normalization, is the mean of the data, is the standard deviation of the mean; Step S200: construct a quantile regression delay prediction network model, integrate the convolutional neural network CNN and the self-attention mechanism Transformer to extract the spatiotemporal features of train operation data, and design a quantile loss function for model training; Step S210: A neural network model is constructed by integrating the convolutional neural network CNN and the self-attention mechanism Transformer to form the main structure of the train delay interval prediction, and the spatiotemporal features related to the train operation information and the delay are extracted; The CNN is used to extract the main feature information related to the train operation data, which is achieved through a multi-layer convolutional network and a pooling layer. The principle of the convolution operation is shown in the following formula: (2) in, and They are Layer and The feature map of It is The weight matrix of the convolution kernel of the layer, It is The bias matrix of the layer convolution kernel; The Transformer processes data including: Position encoding: First, position information of the input sequence is added through position encoding; the position encoding is a vector with the same length as the input sequence, indicating the relative or absolute position of each position; sine and cosine functions are used to generate position encoding: (3) (4) in, Indicates In the encoding vector of the position, the dimension The value of Indicates In the encoding vector of the position, the dimension The value of Indicates that the position is the index of an element in the input sequence; Represents the dimension index in the position encoding, for each position , the position encoding vector has multiple dimensions; is the total dimension of the position encoding; Self-attention mechanism: The self-attention mechanism is the core of Transformer, which can calculate the relationship between each position in the input sequence and all other positions, so that the information of other positions can be considered when generating the representation of each position; Assume that the input sequence is ,in It is The input vector of positions; for each input , the self-attention mechanism computes its relationship with all other positions and updates its representation by the following steps: Each input vector Through three different weight matrices , and Transformed into three new vectors: query vector Q, key vector K and value vector V, which are obtained by the following linear transformation: (5) (6) (7) Among them, Q is the vector used to find relevant information, K is the vector used to match Q; V is the stored information, which will eventually be weighted and summed according to the matching degree; Step S220: setting the input layer according to the selected number of features, batch size and time step; Step S230: Select a quantile set of the target and design a quantile loss function; Given a predicted value , true value , and the target quantile , then the quantile loss function is defined as: (27) Since the goal of the quantile loss function is to make the predicted value Meet target quantile ,Right now (28) Selecting the target quantile set [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9], we can get the prediction values at different quantile levels, thus forming the entire delay prediction interval; Step S300: using the constructed network model and historical data to perform model training, and predicting the delay intervals under different quantiles through a quantile regression model; Step S320: Divide the data into training set, validation set and test set; randomly select 15% of the original data as the test set, and use the other 85% of the data as the training set and validation set for model training, where the ratio of the training set to the validation set is 4:1; Step S330: adjust the parameters of the model; set the learning rate, number of iterations and dropout size; Step S400: Select the uncertainty evaluation index Winkler Score to measure the width and coverage of the prediction interval and select the uncertainty evaluation index Quantile Score to measure the accuracy of the quantile, and construct an uncertainty evaluation index evaluation to evaluate the model performance; Step S410: Select the uncertainty evaluation index WS to measure the width and coverage of the prediction interval; the calculation formula of WS is as follows: (29) in, is the lower limit of the prediction interval; is the predicted value at the upper quantile of the prediction interval; is the actual delay value; It is the significance level of the prediction interval, indicating the probability that the prediction interval fails to cover the true value. The smaller the WS is, the narrower the prediction interval is and the stronger the ability to cover the true value is. Step S420: Select an uncertain evaluation index QS to measure the accuracy of the quantile; each quantile corresponds to a different QS, which is calculated based on the quantile loss function. The predicted delay value and the later true value , the calculation formula of its quantile QS is as follows: (30) This formula quantifies the delay prediction value Compared to the true value The deviation is weighted according to the value of the quantile; the quantile score dynamically adjusts the overestimated and underestimated deviations through the weights to ensure that the errors in different scenarios are appropriately punished; for larger quantiles The prediction under this condition emphasizes the cost of underestimating the delay when the predicted delay value is smaller than the actual delay value; for smaller quantiles The prediction under , then emphasizes the cost of the predicted delay value being greater than the actual delay value.
2. The uncertain train arrival delay prediction method based on quantile regression according to claim 1 is characterized by: Calculate the attention weight: The attention weight of each position is obtained by calculating the similarity between the query vector Q and all key vectors K. The specific calculation formula is as follows: (8) in, is the dimension of Q and K, usually used Scaling is performed to avoid dot product values being too large; The attention scores are converted into weights through the Softmax function, and all weights are ensured to sum to 1: (9) in, Indicates The query vector and The attention weights of the key vectors; Weighted sum: sum the attention weights with the corresponding value vector Multiply them together to get the weighted output representation information; (10) in, It's location The output representation is obtained by weighted combination of all position information, and each position can dynamically adjust its representation based on its relationship with other positions; Multi-head self-attention mechanism: In order to focus on different parts of the input from multiple angles at the same time and capture richer semantic information, the query, key, and value matrices of multiple different attention heads are calculated in parallel, and the results are concatenated after calculation. The formula is as follows: (11) Output all headers through the Concat function spliced together to form a new vector representation; through the weight matrix Perform a linear transformation to map the concatenated vector to the final output dimension; the output of each head The calculation process is: (12) Attention is the calculation function of the self-attention mechanism; this function uses the query vector and the key vectors, and then use these scores to compare the value vectors Weighted, and finally get a weighted representation; in the calculation process, the weight matrix , , The role of is to transform the input query vector through linear transformation , key vector Sum value vector Project to a representation space suitable for the current attention head; Feedforward neural network: Each attention layer is followed by a position-independent feedforward network, usually consisting of two fully connected layers, to further process the features of each position; (13) in, is the feature vector of the output of the previous layer, and is the weight matrix, and is the bias term; Residual connections and layer normalization: Each attention layer and feed-forward network is followed by residual connections and layer normalization; residual connections help alleviate the gradient vanishing problem and allow deeper network training; layer normalization ensures that the output of each layer remains stable.
3. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute the method according to claim 1.
4. A high-speed rail operation system, characterized in that: The system comprises a processor and a memory; the memory stores computer-readable instructions, and the processor is used to execute the computer-readable instructions, wherein the method according to claim 1 is executed when the computer-readable instructions are executed.
Citation Information
Patent Citations
Knowledge data collaborative driving-based train arrival delay prediction method and application thereof
CN118536681A