Method for predicting number of airport terminal security check passengers based on improved PatchTST

By improving the PatchTST algorithm, combining sparse attention and cross attention mechanism, a model that can effectively predict the number of passengers checked at airport security was constructed, solving the shortcomings of the existing model in capturing nonlinear features and adapting to non-periodic events, and achieving higher prediction accuracy and robustness.

CN119646392APending Publication Date: 2025-03-18重庆机场集团有限公司 +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411542685.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

The existing airport security passenger count prediction model is difficult to capture nonlinear features in the data, has poor ability to adapt to non-periodic events, has high computational complexity, poor model interpretability, and a single model cannot capture all data features.

Method used

Using a method based on improved PatchTST, a prediction model including encoder and decoder is constructed by obtaining historical feature data and terminal security passenger count, preprocessing and data alignment. The encoder uses a sparse attention mechanism, and the decoder introduces a two-stage attention layer to capture the cross-time and cross-dimensional dependencies of the data.

Benefits of technology

It improves the accuracy of the prediction results, reduces the complexity of the model, enhances the interaction ability of multi-dimensional feature data, and is better than other airport passenger security data prediction algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119646392A_ABST
    Figure CN119646392A_ABST
Patent Text Reader

Abstract

The invention discloses a terminal security check passenger quantity prediction method based on improved PatchTST, and the method comprises the following steps: 1) preprocessing historical feature data and terminal security check passenger data, and combining the historical feature data and the terminal security check passenger data into a passenger security check quantity prediction data set; 2) constructing a security check passenger number prediction model based on the improved PatchTST; 3) training the security check passenger number prediction model by using a training set in the passenger security check number prediction data set; performing verification and parameter adjustment on the security check passenger number prediction model by using the verification set; and 4) inputting the passenger security check number prediction data set into the security check passenger number prediction model to obtain a security check passenger number prediction result of the airport terminal in the future n3 days. According to the method, a sparse attention mechanism is used, the complexity of the model is reduced, the periodicity and long-term dependence of passenger security check data are captured, interaction before multi-dimensional feature data is realized by using a cross attention mechanism, and the accuracy and robustness of the model are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of terminal security inspection passenger quantity prediction, and in particular to a terminal security inspection passenger quantity prediction method based on improved PatchTST. Background Art

[0002] The intelligent development of airports has become an inevitable trend in the development of the global aviation industry, and the optimization of ground service processes is an important part of it. The ground service process is a series of activities that passengers experience from the time they arrive at the airport to the time they leave the airport. It is an important part of the airport's ground operation management and directly affects the safety and normal operation of the airport. The survey results of existing studies show that the waiting time for check-in and security check queues accounts for more than 99% of the total waiting time of passengers in the terminal. Passengers will feel irritated when queuing for a long time, and their satisfaction with the terminal service level will decrease. If the queuing time is too long, it is more likely to cause congestion and chaos in the departure hall of the terminal. The reason for the long queuing time is that most of the time it is not due to the insufficient number of resources such as check-in counters and security check channels, but because the number of arriving passengers fluctuates greatly over time, and the resources and staff of check-in, security check, etc. are not reasonably scheduled. Therefore, accurate prediction of the number of airport security check passengers is very important for current airport operation decisions.

[0003] For the prediction of the number of passengers undergoing airport security checks, many traditional models are currently based on linear assumptions, which makes it difficult to capture nonlinear features in the data, and have poor adaptability to non-periodic events, and cannot meet actual needs. Ordinary machine learning models also have significant shortcomings such as high computational complexity, poor model interpretability, and difficulty in hyperparameter tuning. In addition, a single model tends to focus on one feature when predicting time series and cannot capture the full range of data features. Summary of the invention

[0004] The purpose of the present invention is to provide a method for predicting the number of passengers undergoing terminal security inspection based on an improved PatchTST, comprising the following steps:

[0005] 1) Obtain historical characteristic data that affects the number of passengers undergoing security checks at the terminal, as well as the number of passengers undergoing security checks at the terminal during the corresponding period, with a total time length of n;

[0006] 2) Preprocess the historical feature data and terminal security check passenger data, and then align them in time to form a passenger security check quantity prediction data set, and divide the passenger security check quantity prediction data set into a training set and a validation set in chronological order; the time length of the training set is n1, and the time length of the validation set is n2;

[0007] 3) Construct a security check passenger number prediction model based on the improved PatchTST;

[0008] 4) Using the training set in the passenger security check number prediction data set to train the security check passenger number prediction model;

[0009] Use the validation set to verify the security check passenger number prediction model and adjust the parameters; the adjustment parameters include learning rate, scheduling strategy and regularization parameter;

[0010] 5) Input the passenger security check number prediction data set into the security check passenger number prediction model to obtain the terminal security check passenger number prediction results for the next n3 days.

[0011] Furthermore, the characteristic data include time characteristics, airport operation characteristics, and weather characteristics;

[0012] The airport operation characteristics include hourly historical check-in data, boarding data, planned flight data, actual flight data, and delayed flight data;

[0013] The time characteristics include daily mode, weekly mode, and holidays;

[0014] The weather characteristics include hourly historical weather, temperature, wind speed, and precipitation.

[0015] Furthermore, the preprocessing includes data alignment, missing value processing, and LOF exception processing.

[0016] Further, the security check passenger number prediction model includes an encoder and a decoder;

[0017] The encoder includes N layers of Encoder;

[0018] The encoder uses a sparse attention mechanism and introduces probability distribution to calculate attention weights;

[0019] The decoder includes N+1 groups of Decoder representations;

[0020] The decoder introduces a two-stage attention layer to capture the dependencies of data across time and dimensions.

[0021] Furthermore, when using the training set in the passenger security check number prediction data set to train the security check passenger number prediction model, the passenger security check number prediction data set is split into a univariate time series x (i) , and transform the univariate time series x (i) Divide into overlapping or non-overlapping patches to generate a sequence of patches The patch sequence is used as the input of the encoder; P is the patch length; N is the number of patches; S is the area of ​​the non-overlapping region between two consecutive patches; L is the length of the univariate time series.

[0022] Further, after generating the patch sequence, the last value The S repetitions of are padded to the end of the original sequence before the partition to ensure that the sequence length adapts to the patch partition and ensure the consistency of the model input.

[0023] Further, the encoder expression looks like this:

[0024]

[0025]

[0026] In the formula, Z enc,l is the output of the Encoder at layer l; H is the DSW segment embedding output at layer l; M∈R dim*2dim is a learnable matrix for segment fusion; [·] represents the concatenation operation; L l Indicates the number of segments in the Encoder at layer l. If L l If L is singular, l Perform padding operation to make it an even number; It represents the result after segment fusion at the lth layer. PSA refers to the sparse attention mechanism. d is the temporal dimension, i is the time step, and D is the total temporal dimension. It is the output of the l-1th layer Encoder corresponding to time steps 2i-1, 2i.

[0027] Furthermore, the working process of the sparse attention mechanism is: calculate the probability distribution of each query vector Query, then calculate the KL divergence between the probability distribution and the uniform distribution, and use the KL divergence to represent the importance of the query vector Query;

[0028] The discrete KL divergence D(P||Q) is shown below:

[0029]

[0030] Where x represents the set of all possible values ​​of the random variable i, and P(i) and Q(i) represent the probability values ​​of the probability distributions P and Q at a discrete point i.

[0031] The steps to construct the sparse attention mechanism are as follows:

[0032] a1) Construct the attention mechanism expression:

[0033]

[0034] Among them, q i is the i-th query vector, k j and k l are the ith and lth key vectors, respectively, v j is the j-th value vector. k(q i ,kj ) for use The calculated query vector q i and key vector k j The similarity between is the scaling factor and d is the dimension of the key or query vector. l (q i ,k l ) represents all query vectors q i and key vector set k l The normalization factor of the similarity represents the attention weight. A(q i ,K,V) is the attention vector;

[0035] a2) Construct the uniform distribution q(k) of the attention mechanism j |q i ),Right now:

[0036]

[0037] Where L k is the total number of key vectors k.

[0038] a3) Substituting the uniform distribution of the attention mechanism into the KL divergence formula, we get:

[0039]

[0040] Where KL(q||p) is the KL divergence;

[0041] a4) Remove the constant in the KL divergence formula and measure the sparsity of the i-th query Defined as:

[0042]

[0043] a5) Simplify formula (8) to obtain:

[0044]

[0045] a6) Take sparse metrics The top n query vectors are used to construct a sparse matrix The sparse attention mechanism expression is obtained, namely:

[0046]

[0047] in, is a sparse matrix. K is the key matrix, V is the value matrix, and softmax is the normalization function.

[0048] Furthermore, each group of decoders is represented as follows:

[0049]

[0050]

[0051]

[0052]

[0053] in It is the position code generated after the output length is segmented. is the output of the TSA layer in the Decoder, is the output of the multi-head attention layer, is the output after the first Add&Norm operation, Z dec,l It is the final output after the feedforward neural network and Add&Norm operation. TSA stands for Cross-dimensional Attention Mechanism.

[0054] Furthermore, the decoder's cross-dimensional attention mechanism works as follows:

[0055] b1) Based on each set of Decoder representations, generate an embedded representation set Z∈R N*D*dim ; Among them, Z i,: to represent the segment embedding of the same time step i in all dimensions, Z :,d Represents the embedding of all fragments of the d-th dimension time series;

[0056] b2) For elements at different time steps, a sparse attention mechanism is used to obtain the temporal fragment embedding Z of each dimension time ,Right now:

[0057]

[0058]

[0059] Among them, PSA represents the ProbSparse Self-attention layer, MLP represents the feedforward neural network layer. Addition and LayerNorm correspond to the Add&Norm operation of Transformer; Embeddings of temporal segments representing different time steps;

[0060] b3) Embed Z for the time series segments of each dimension time , using the same learnable routing vector Pay attention to the embedding of each channel, and then pass another layer of attention to let the embedding of each channel pay attention to the content of each abstract unit and form the output of the decoder, that is:

[0061]

[0062]

[0063]

[0064]

[0065] In the formula, Z dim is the output of the decoder. i,: is the output of the ProbSparse Self-attention layer; R i,: is the learnable routing vector corresponding to different time steps.

[0066] The technical effect of the present invention is undoubted, and the beneficial effects of the present invention are as follows:

[0067] The present invention proposes an improved PatchTST algorithm, which aims at the characteristics of airport security data and effectively improves the accuracy of prediction results by constructing sparse attention and cross attention.

[0068] The proposed algorithm is evaluated on real airport security data, and the test results are compared with the state-of-the-art methods for different performance indicators, which confirms the effectiveness and superiority of the proposed method.

[0069] In summary, the present invention proposes an airport passenger security data prediction algorithm based on improved PatchTST. On the one hand, a sparse attention mechanism is used to reduce the complexity of the model while capturing the periodicity and long-term dependence of passenger security data. On the other hand, a cross-attention mechanism is used to realize the interaction between multi-dimensional feature data, thereby improving the accuracy and robustness of the model. The performance of the present invention is better than other algorithms for predicting airport passenger security data, and it can be used in actual airport big data platforms, providing a certain basis for the deployment of ground service personnel the next day. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] Figure 1 It is the overall framework of the present invention;

[0071] Figure 2 The graphs are a comparison of the prediction results of the present invention and those of other methods. DETAILED DESCRIPTION

[0072] The present invention is further described below in conjunction with the embodiments, but it should not be understood that the above subject matter of the present invention is limited to the following embodiments. Without departing from the above technical ideas of the present invention, various substitutions and changes are made according to the common technical knowledge and customary means in the art, which should all be included in the protection scope of the present invention.

[0073] Embodiment 1:

[0074] See also Figure 1 to Figure 2 , a terminal security check passenger number prediction method based on improved PatchTST, including the following steps:

[0075] 1) Obtain historical characteristic data that affects the number of passengers undergoing security checks at the terminal, as well as the number of passengers undergoing security checks at the terminal during the corresponding period, with a total time length of n;

[0076] 2) Preprocess the historical feature data and terminal security check passenger data, and then align them in time to form a passenger security check quantity prediction data set, and divide the passenger security check quantity prediction data set into a training set and a validation set in chronological order; the time length of the training set is n1, and the time length of the validation set is n2;

[0077] 3) Construct a security check passenger number prediction model based on the improved PatchTST;

[0078] 4) Using the training set in the passenger security check number prediction data set to train the security check passenger number prediction model;

[0079] Use the validation set to verify the security check passenger number prediction model and adjust the parameters; the adjustment parameters include learning rate, scheduling strategy and regularization parameter;

[0080] 5) Input the passenger security check number prediction data set into the security check passenger number prediction model to obtain the terminal security check passenger number prediction results for the next n3 days.

[0081] For example, the passenger security check number prediction data set is divided into three parts, of which the first 200 days are used for training the security check passenger number prediction model, the middle 70 days are used for verification and parameter adjustment, and the last 22 days are used for testing.

[0082] The first 270 days of the passenger security check number prediction data set are input into the security check passenger number prediction model to obtain the terminal security check passenger number prediction results for the last 22 days of the passenger security check number prediction data set.

[0083] The characteristic data include time characteristics, airport operation characteristics, and weather characteristics;

[0084] The airport operation characteristics include hourly historical check-in data, boarding data, planned flight data, actual flight data, and delayed flight data;

[0085] The time characteristics include daily mode, weekly mode, and holidays;

[0086] The weather characteristics include hourly historical weather, temperature, wind speed, and precipitation.

[0087] The preprocessing includes data alignment, missing value processing, and LOF exception processing.

[0088] The security check passenger quantity prediction model includes an encoder and a decoder;

[0089] The encoder includes N layers of Encoder;

[0090] The encoder uses a sparse attention mechanism and introduces probability distribution to calculate attention weights;

[0091] The decoder includes N+1 groups of Decoder representations;

[0092] The decoder introduces a two-stage attention layer to capture the dependencies of data across time and dimensions.

[0093] When using the training set in the passenger security check number prediction data set to train the security check passenger number prediction model, the passenger security check number prediction data set is split into a univariate time series x (i) , and transform the univariate time series x (i) Divide into overlapping or non-overlapping patches to generate a sequence of patches The patch sequence is used as the input of the encoder; P is the patch length; N is the number of patches; S is the area of ​​the non-overlapping region between two consecutive patches; L is the length of the univariate time series.

[0094] After generating the patch sequence, the last value The S repetitions of are padded to the end of the original sequence before the partition to ensure that the sequence length adapts to the patch partition and ensure the consistency of the model input.

[0095] The encoder expression looks like this:

[0096]

[0097]

[0098] In the formula, Z enc,l is the output of the Encoder at layer l; H is the DSW segment embedding output at layer l; M∈R dim*2dim is a learnable matrix for segment fusion; [·] represents the concatenation operation; L l Indicates the number of segments in the Encoder at layer l. If L l If L is singular, l Perform padding operation to make it an even number; It represents the result after segment fusion at the lth layer. PSA refers to the sparse attention mechanism. d is the temporal dimension, i is the time step, and D is the total temporal dimension. It is the output of the l-1th layer Encoder corresponding to time steps 2i-1, 2i.

[0099] The working process of the sparse attention mechanism is: calculate the probability distribution of each query vector Query, then calculate the KL divergence between the probability distribution and the uniform distribution, and use the KL divergence to represent the importance of the query vector Query;

[0100] The discrete KL divergence D(P||Q) is shown below:

[0101]

[0102] Where x represents the set of all possible values ​​of the random variable i, and P(i) and Q(i) represent the probability values ​​of the probability distributions P and Q at a discrete point i.

[0103] The steps to construct the sparse attention mechanism are as follows:

[0104] a1) Construct the attention mechanism expression:

[0105]

[0106] Among them, q i is the i-th query vector, k j and k l are the ith and lth key vectors, respectively, v j is the j-th value vector. k(q i ,k j ) for use The calculated query vector q i and key vector k j The similarity between is the scaling factor and d is the dimension of the key or query vector. l (q i ,k l ) represents all query vectors q i and key vector set k l The normalization factor of the similarity. represents the attention weight. A(q i ,K,V) is the attention vector;

[0107] a2) Construct the uniform distribution q(k) of the attention mechanism j |q i ),Right now:

[0108]

[0109] Where L k is the total number of key vectors k.

[0110] a3) Substituting the uniform distribution of the attention mechanism into the KL divergence formula, we get:

[0111]

[0112] Where KL(q||p) is the KL divergence;

[0113] a4) Remove the constant in the KL divergence formula and measure the sparsity of the i-th query Defined as:

[0114]

[0115] a5) Simplify formula (8) to obtain:

[0116]

[0117] a6) Take sparse metrics The top n query vectors are used to construct a sparse matrix The sparse attention mechanism expression is obtained, namely:

[0118]

[0119] in, is a sparse matrix. K is the key matrix, V is the value matrix, and softmax is the normalization function.

[0120] The decoder representations for each group are as follows:

[0121]

[0122]

[0123]

[0124]

[0125] in It is the position code generated after the output length is segmented. is the output of the TSA layer in the Decoder, is the output of the multi-head attention layer, is the output after the first Add&Norm operation, Z dec,l It is the final output after the feedforward neural network and Add&Norm operation. TSA stands for Cross-dimensional Attention Mechanism.

[0126] The decoder's cross-dimensional attention mechanism works as follows:

[0127] b1) Based on each set of Decoder representations, generate an embedded representation set Z∈R N*D*dim ; Among them, Z i,: to represent the segment embedding of the same time step i in all dimensions, Z :,d Represents the embedding of all fragments of the d-th dimension time series;

[0128] b2) For elements at different time steps, a sparse attention mechanism is used to obtain the temporal fragment embedding Z of each dimension time ,Right now:

[0129]

[0130]

[0131] Among them, PSA represents the ProbSparse Self-attention layer, MLP represents the feedforward neural network layer. Addition and LayerNorm correspond to the Add&Norm operation of Transformer; Embeddings of temporal segments representing different time steps;

[0132] b3) Embed Z for the time series segments of each dimension time , using the same learnable routing vector Pay attention to the embedding of each channel, and then pass another layer of attention to let the embedding of each channel pay attention to the content of each abstract unit and form the output of the decoder, that is:

[0133]

[0134]

[0135]

[0136]

[0137] In the formula, Z dim is the output of the decoder. i,: is the output of the ProbSparse Self-attention layer; R i,: is the learnable routing vector corresponding to different time steps.

[0138] Embodiment 2:

[0139] A method for predicting the number of passengers undergoing terminal security screening based on improved PatchTST includes the following steps:

[0140] 1) Obtain historical characteristic data that affects the number of passengers undergoing security checks at the terminal, as well as the number of passengers undergoing security checks at the terminal during the corresponding period, with a total time length of n;

[0141] 2) Preprocess the historical feature data and terminal security check passenger data, and then align them in time to form a passenger security check quantity prediction data set, and divide the passenger security check quantity prediction data set into a training set and a validation set in chronological order; the time length of the training set is n1, and the time length of the validation set is n2;

[0142] 3) Construct a security check passenger number prediction model based on the improved PatchTST;

[0143] 4) Using the training set in the passenger security check number prediction data set to train the security check passenger number prediction model;

[0144] Use the validation set to verify and adjust the security check passenger number prediction model;

[0145] 5) Input the passenger security check number prediction data set into the security check passenger number prediction model to obtain the terminal security check passenger number prediction results for the next n3 days.

[0146] Embodiment 3:

[0147] A method for predicting the number of passengers undergoing terminal security screening based on improved PatchTST, the technical content of which is the same as that of Example 2, and further, the characteristic data includes time characteristics, airport operation characteristics, and weather characteristics;

[0148] The airport operation characteristics include hourly historical check-in data, boarding data, planned flight data, actual flight data, and delayed flight data;

[0149] The time characteristics include daily mode, weekly mode, and holidays;

[0150] The weather characteristics include hourly historical weather, temperature, wind speed, and precipitation.

[0151] Embodiment 4:

[0152] A method for predicting the number of passengers undergoing terminal security checks based on improved PatchTST, the technical content of which is the same as any one of Examples 2-3, and further, the preprocessing includes data alignment, missing value processing, and LOF anomaly processing.

[0153] Embodiment 5:

[0154] A method for predicting the number of passengers undergoing security checks at a terminal based on an improved PatchTST, the technical content of which is the same as any one of Embodiments 2-4, and further, the passenger number prediction model for security checks includes an encoder and a decoder;

[0155] The encoder includes N layers of Encoder;

[0156] The encoder uses a sparse attention mechanism and introduces probability distribution to calculate attention weights;

[0157] The decoder includes N+1 groups of Decoder representations;

[0158] The decoder introduces a two-stage attention layer to capture the dependencies of data across time and dimensions.

[0159] Embodiment 6:

[0160] A method for predicting the number of passengers undergoing security checks at a terminal based on an improved PatchTST, the technical content of which is the same as any one of Embodiments 2-5. Further, when a training set in a passenger security check number prediction data set is used to train a passenger security check number prediction model, the passenger security check number prediction data set is split into a univariate time series x (i) , and transform the univariate time series x (i) Divide into overlapping or non-overlapping patches to generate a sequence of patches The patch sequence is used as the input of the encoder; P is the patch length; N is the number of patches; S is the area of ​​the non-overlapping region between two consecutive patches; L is the length of the univariate time series.

[0161] Embodiment 7:

[0162] A method for predicting the number of passengers undergoing terminal security checks based on an improved PatchTST, the technical content of which is the same as any one of Embodiments 2-6, and further, after generating a patch sequence, the last value The S repetitions of are padded to the end of the original sequence before the partition to ensure that the sequence length adapts to the patch partition and ensure the consistency of the model input.

[0163] Embodiment 8:

[0164] A method for predicting the number of passengers undergoing terminal security checks based on improved PatchTST, the technical content of which is the same as any one of Embodiments 2-7, and further, the encoder expression is as follows:

[0165]

[0166]

[0167] In the formula, Z enc,l is the output of the Encoder at layer l; H is the DSW segment embedding output at layer l; M∈R dim*2dim is a learnable matrix for segment fusion; [·] represents the concatenation operation; L l Indicates the number of segments in the Encoder at layer l. If L l If L is singular, lPerform padding operation to make it an even number; It represents the result after segmented fusion at the lth layer. PSA refers to the sparse attention mechanism. d is the temporal dimension, i is the time step, and D is the total temporal dimension.

[0168] Embodiment 9:

[0169] A method for predicting the number of passengers undergoing terminal security checks based on an improved PatchTST, the technical content of which is the same as any one of Embodiments 2-8, and further, the working process of the sparse attention mechanism is: calculating the probability distribution of each query vector Query, and then calculating the KL divergence between the probability distribution and the uniform distribution, and using the KL divergence to characterize the importance of the query vector Query;

[0170] The KL divergence is shown below:

[0171]

[0172] Where x represents the set of all possible values ​​of the random variable i, and P(i) and Q(i) represent the probability values ​​of the probability distributions P and Q at a discrete point i.

[0173] The steps to construct the sparse attention mechanism are as follows:

[0174] a1) Construct the attention mechanism expression:

[0175]

[0176] Among them, q i is the i-th query vector, k j and k l are the ith and lth key vectors, respectively, v j is the j-th value vector. k(q i ,k j ) for use The calculated query vector q i and key vector k j The similarity between is the scaling factor and d is the dimension of the key or query vector. l (q i ,k l ) represents all query vectors q i and key vector set k l The normalization factor of the similarity. represents the attention weight.

[0177] a2) Construct a uniform distribution of attention mechanism, namely:

[0178]

[0179] Where Lk is the total number of key vectors k.

[0180] a3) Substituting the uniform distribution of the attention mechanism into the KL divergence formula, we get:

[0181]

[0182] a4) Remove the constant in the KL divergence formula and define the sparsity measure of the i-th query as:

[0183]

[0184] a5) Simplify formula (8) to obtain:

[0185]

[0186] a6) Take sparse metrics The top n query vectors are used to construct a sparse matrix , we get the sparse attention mechanism expression, namely:

[0187]

[0188] in, is a sparse matrix. K is the key matrix, V is the value matrix, and softmax is the normalization function.

[0189] Embodiment 10:

[0190] A method for predicting the number of passengers undergoing terminal security checks based on improved PatchTST, the technical content of which is the same as any one of Embodiments 2-9, and further, each group of decoders is represented as follows:

[0191]

[0192]

[0193]

[0194]

[0195] in It is the position code generated after the output length is segmented. is the output of the TSA layer in the Decoder, is the output of the multi-head attention layer, is the output after the first Add&Norm operation, Z dec,l It is the final output after the feedforward neural network and Add&Norm operation. TSA stands for Cross-dimensional Attention Mechanism.

[0196] Embodiment 11:

[0197] A method for predicting the number of passengers undergoing terminal security checks based on improved PatchTST, the technical content of which is the same as any one of Embodiments 2-10, and further, the working process of the cross-dimensional attention mechanism of the decoder includes:

[0198] b1) Based on each set of Decoder representations, generate an embedded representation set Z∈R N*D*dim Among them, Z i,: to represent the segment embedding of the same time step i in all dimensions, Z :,d Represents the embedding of all fragments of the d-th dimension time series;

[0199] b2) For elements at different time steps, a sparse attention mechanism is used to obtain the temporal fragment embedding Z of each dimension time ,Right now:

[0200]

[0201]

[0202] Among them, PSA represents the ProbSparse Self-attention layer, MLP represents the feedforward neural network layer. Addition and LayerNorm correspond to the Add&Norm operation of Transformer;

[0203] b3) Embed Z for the time series segments of each dimension time , using the same learnable routing vector Pay attention to the embedding of each channel, and then pass another layer of attention to let the embedding of each channel pay attention to the content of each abstract unit and form the output of the decoder, that is:

[0204]

[0205]

[0206]

[0207]

[0208] In the formula, Z dim is the output of the decoder.

[0209] Embodiment 12:

[0210] A verification of the terminal security check passenger number prediction method based on the improved PatchTST is as follows:

[0211] This paper conducts an empirical analysis based on the number of security check passengers at Terminal T3A of Chongqing Jiangbei International Airport collected from February 23 to December 12, 2023 for a total of 292 days. Data prediction based on the improved PatchTST is performed to provide technical support for the deployment of security check ground service personnel at the airport terminal the next day. The specific steps include:

[0212] S100: Definition of prediction target. Obtain the historical passenger security inspection data of Terminal T3A of Chongqing Jiangbei International Airport for 292 days from February 23 to December 12, 2023. It is observed that the number of security inspection passengers during 0:00-4:00 is sparse, and a small number of ground service personnel can meet the actual service needs. Therefore, the prediction target is defined as: predicting the number of security inspection passengers hour by hour from 5:00-23:00 (a total of 19 hours) the next day;

[0213] S200: Feature data acquisition. Obtain the time features, airport operation features, and weather features of 292 days from February 23 to December 12, 2023 as a feature set to help the model identify the long-term trend and periodicity of passenger security inspection data and enhance the model's prediction ability;

[0214] S300: Data preprocessing. After data alignment, missing value processing, and LOF anomaly processing, the security check passenger data and feature sets are combined into a passenger security check quantity prediction data set;

[0215] S400: Model construction. We built an effective MISO (multiple input single output) security check passenger number prediction model based on the improved PatchTST. In the Encoder part, a sampling-based attention mechanism is used, and a probability distribution is introduced to calculate the attention weight. In the Decoder part, a two-stage attention layer (TSA) is introduced to capture the dependencies of data across time and dimensions;

[0216] S500: Use the prediction model to predict the number of security check passengers. The passenger security check data set is input into the prediction model constructed in S400, of which 200 days are used as the training set, 70 days are used as the validation set, and 22 days are used as the test set.

[0217] S201: Collect hourly historical check-in data, boarding data, planned flight data, actual flight data, and delayed flight data of Terminal T3A of Chongqing Jiangbei International Airport as airport operation characteristics;

[0218] S202: According to the characteristics of passenger security inspection data, the daily mode (i.e., the time period of the day), weekly mode (i.e., mid-week or weekend), and holiday (i.e., whether it is a holiday) are introduced as time features;

[0219] S203: Use the API provided by Open-Meteo to obtain hourly historical weather, temperature, wind speed, and precipitation at the airport location as weather features.

[0220] S401: Split the passenger security check quantity prediction data set into a univariate time series x (i) , where i refers to the i-th row.

[0221] S402: x (i) is divided into overlapping or non-overlapping patches. The patch length is denoted as P, the non-overlapping area between two consecutive patches is denoted as S, and the resulting patch sequence is denoted as where N is the number of patches, At the same time, the last value The number of S repetitions is filled to the end of the original sequence before the partition. This is used to ensure that the sequence length adapts to the patch partition and ensure the consistency of the model input.

[0222] S403: Then, the patch is input into the Encoder. The formula of the Encoder part is as follows.

[0223]

[0224]

[0225] The output of each layer of Encoder is recorded as Z enc,l , where l is the number of layers of the current Encoder, H is the DSW segment embedding output of the lth layer, M∈R dim*2dim is a learnable matrix for segment fusion, [·] represents the concatenation operation, L l Indicates the number of segments in the Encoder at layer l (if it is an odd number, it needs to be padded to an even number). It represents the result after segment fusion at layer l, and PSA refers to the sparse attention mechanism.

[0226] S404: Sparse attention mechanism refers to the KL divergence between the probability distribution of each query (query vector) and the uniform distribution, which is used to evaluate the importance of the query. The discrete KL divergence is defined as follows:

[0227]

[0228] Where x represents the set of all possible values ​​of the random variable i, and P(i) and Q(i) represent the probability values ​​of the probability distributions P and Q at a discrete point i.

[0229] The traditional attention mechanism can be expressed as follows:

[0230]

[0231] where q i is the i-th query vector, k j and k l are the ith and lth key vectors, respectively, v j is the j-th value vector. k(q i ,k j ) for use The calculated query vector q i and key vector k j The similarity between is the scaling factor and d is the dimension of the key or query vector. l (q i ,k l ) represents all query vectors q i and key vector set k l The normalization factor of the similarity. represents the attention weight.

[0232] The uniform distribution can be expressed as:

[0233]

[0234] Where L k is the total number of key vectors k.

[0235] Substituting it into the KL divergence formula, we get:

[0236]

[0237] Removing the constant, the sparsity measure for the i-th query is defined as:

[0238]

[0239] Simplified to:

[0240]

[0241] Finally, the calculation formula of the sparse attention mechanism is:

[0242]

[0243] in is a sparse matrix, which contains only sparse metrics The top 25 query vectors are obtained. K is the key matrix, V is the value matrix, and softmax is a normalization function.

[0244] S405: The Encoder part is set with N layers. Considering the initial embedding and the output of each layer, we set N+1 sets of Decoder representations, where the initial embedding and the Encoder output of the l=1th layer are of the same dimension. The specific process of each layer is as follows:

[0245]

[0246]

[0247]

[0248]

[0249] in It is the position code generated after the output length is segmented. is the output of the TSA layer in the Decoder, is the output of the multi-head attention layer, is the output after the first Add&Norm operation, Z dec,l It is the final output after the feedforward neural network and Add&Norm operation. TSA stands for Cross-dimensional Attention Mechanism.

[0250] S406: Cross-dimensional attention mechanism. After segmentation, we get the embedding representation: Z∈R N*D*dim , which is the set of embedded representations of each fragment in each dimension. For the convenience of representation, we will use Z i,: To represent the segment embedding of the same time step i in all dimensions, use Z :,d Represents the embedding of all fragments in the d-th dimension time series.

[0251] First, in terms of time dependency, the sparse attention mechanism mentioned above is directly used for elements at different time steps:

[0252]

[0253]

[0254] Among them, PSA represents the ProbSparse Self-attention layer, MLP represents the feedforward neural network layer, and Addition and LayerNorm correspond to the Add&Norm operation of Transformer.

[0255] Next, embed Z into the time series segments of each dimension time (This has already passed through a sparse attention layer that captures temporal dependencies), using the same learnable routing vector Among them, there is an R corresponding to each time stepc*dim Vector.

[0256] The routing vector first pays attention to the embedding of each channel, but only records it with a sequence of c abstract units that is much smaller than D. Then, through another layer of attention, the embedding of each channel pays attention to the content of each abstract unit and forms the final output. The formula is as follows:

[0257]

[0258]

[0259]

[0260]

[0261] This method condenses the information embedded in multiple channels into several different routers in different ways, and each router decides how much of its own information to forward to the embedding of each channel.

[0262] Embodiment 13:

[0263] A verification of the terminal security check passenger number prediction method based on the improved PatchTST is as follows:

[0264] This paper uses the passenger security inspection data of Chongqing Jiangbei Airport T3A Terminal for 292 days as a case for empirical analysis. The data comes from the big data platform of Chongqing Jiangbei International Airport, which contains a total of 7008 records, each of which contains 13 dimensions. These data show certain periodic characteristics, but are also susceptible to interference from many other factors. Therefore, how to effectively reduce the volatility and randomness of security inspection data in periodic changes has become the core challenge to improve prediction accuracy, and it is also a technical difficulty that the present invention urgently needs to solve.

[0265] To ensure the validity of the data and the accuracy of the experimental results, the present invention preprocesses the passenger security inspection data and uses 200 days of the data as a training set, 70 days as a validation set, and 22 days as a test set.

[0266] We use the mean absolute error (MAE), mean square error (MSE), root mean square error (RMSE), mean absolute percentage error (MAPE), and determination coefficient (R 2 ) is used as the evaluation index, and its calculation formula is as follows:

[0267]

[0268]

[0269]

[0270]

[0271]

[0272] Where n represents the total sample size, y i Indicates the actual value of the passenger security data. represents the predicted value of passenger security inspection data, Represents the average value of passenger security screening data.

[0273] In order to demonstrate the effect of the model of the present invention on passenger security inspection data prediction, the present invention uses Transformer, ETSformer, FEDformer, and PatchTST for comparative experiments. The experimental results show that the present invention is superior to other algorithms in five evaluation indicators: MAE, MSE, RMSE, MAPE, and Rsquare, which shows that the method of improving PatchTST for prediction is effective.

[0274] Figure 1 Table 1 and Table 2 are the prediction results of different models and the evaluation index table of different models respectively. It can be seen from Table 1 that the prediction effect of the original Transformer model is the worst. After using different algorithms to improve it, the effect is improved to varying degrees. The values ​​of various error evaluation indicators are greatly reduced, among which PatchTST has the best prediction effect. This shows that the idea of ​​decomposing the original data into patches is correct. After using sparse attention and cross attention to improve the PatchTST algorithm according to the characteristics of airport passenger security data, the effect is the best. Compared with other algorithms, the five indicators of MAE, MSE, RMSE, MAPE, and Rsquare are increased by 6.51%, 3.66%, 3.33%, 7.55%, and 0.29% respectively. Experiments show that the improved PatchTST algorithm can effectively reduce the volatility and randomness of security data in periodic changes, improve the prediction effect, and reduce the prediction error.

[0275] Table 1 Evaluation index table of different models

[0276]

Claims

1. A method for predicting the number of passengers undergoing terminal security inspection based on improved PatchTST, characterized in that: The following steps are involved: 1) Obtain historical characteristic data that affects the number of passengers undergoing security checks at the terminal, as well as the number of passengers undergoing security checks at the terminal during the corresponding period, with a total time length of n; 2) Preprocess the historical feature data and terminal security check passenger data, and then align them in time to form a passenger security check quantity prediction data set, and divide the passenger security check quantity prediction data set into a training set and a validation set in chronological order; the time length of the training set is n1, and the time length of the validation set is n2; 3) Construct a security check passenger number prediction model based on the improved PatchTST; 4) Using the training set in the passenger security check number prediction data set to train the security check passenger number prediction model; Use the validation set to verify the security check passenger number prediction model and adjust the parameters; the adjustment parameters include learning rate, scheduling strategy and regularization parameter; 5) Input the passenger security check number prediction data set into the security check passenger number prediction model to obtain the terminal security check passenger number prediction results for the next n3 days.

2. According to claim 1, a method for predicting the number of passengers undergoing terminal security inspection based on improved PatchTST, characterized in that: The characteristic data include time characteristics, airport operation characteristics, and weather characteristics; The airport operation characteristics include hourly historical check-in data, boarding data, planned flight data, actual flight data, and delayed flight data; The time characteristics include daily mode, weekly mode, and holidays; The weather characteristics include hourly historical weather, temperature, wind speed, and precipitation.

3. According to claim 1, a method for predicting the number of passengers undergoing terminal security inspection based on improved PatchTST, characterized in that: The preprocessing includes data alignment, missing value processing, and LOF exception processing.

4. According to claim 1, a method for predicting the number of passengers undergoing terminal security inspection based on improved PatchTST, characterized in that: The security check passenger quantity prediction model includes an encoder and a decoder; The encoder includes N layers of Encoder; The encoder uses a sparse attention mechanism and introduces probability distribution to calculate attention weights; The decoder includes N+1 groups of Decoder representations; The decoder introduces a two-stage attention layer to capture the dependencies of data across time and dimensions.

5. According to claim 4, a method for predicting the number of passengers undergoing terminal security inspection based on improved PatchTST is characterized in that: When using the training set in the passenger security check number prediction data set to train the security check passenger number prediction model, the passenger security check number prediction data set is split into a univariate time series x (i) , and transform the univariate time series x (i) Divide into overlapping or non-overlapping patches to generate a sequence of patches The patch sequence is used as the input of the encoder; P is the patch length; N is the number of patches; S is the area of ​​the non-overlapping region between two consecutive patches; L is the length of the univariate time series.

6. The method for predicting the number of passengers undergoing terminal security inspection based on improved PatchTST according to claim 5 is characterized in that: After generating the patch sequence, the last value The S repetitions of are padded to the end of the original sequence before the partition to ensure that the sequence length adapts to the patch partition and ensure the consistency of the model input.

7. The method for predicting the number of passengers undergoing terminal security inspection based on improved PatchTST according to claim 5 is characterized in that: The encoder expression looks like this: In the formula, Z enc,l is the output of the Encoder at layer l; H is the DSW segment embedding output at layer l; M∈R dim*2dim is a learnable matrix for segment fusion; [·] represents the concatenation operation; L l Indicates the number of segments in the Encoder at layer l. If L l If L is singular, l Perform padding operation to make it an even number; It represents the result after segment fusion at layer l, and PSA refers to the sparse attention mechanism; d is the time series dimension, i is the time step, and D is the total time series dimension; It is the output of the l-1th layer Encoder corresponding to time steps 2i-1, 2i.

8. The method for predicting the number of passengers undergoing terminal security inspection based on improved PatchTST according to claim 5 is characterized in that: The working process of the sparse attention mechanism is: calculate the probability distribution of each query vector Query, then calculate the KL divergence between the probability distribution and the uniform distribution, and use the KL divergence to represent the importance of the query vector Query; The discrete KL divergence D(P||Q) is shown below: Where x represents the set of all possible values ​​of the random variable i, and P(i) and Q(i) represent the probability values ​​of the probability distributions P and Q at a discrete point i. The steps to construct the sparse attention mechanism are as follows: 1) Construct the attention mechanism expression: Among them, q i is the i-th query vector, k j and k l are the ith and lth key vectors, respectively, v j is the j-th value vector. k(q i ,k j ) for use The calculated query vector q i and key vector k j The similarity between is the scaling factor and d is the dimension of the key or query vector. l (q i ,k l ) represents all query vectors q i and key vector set k l The normalization factor of the similarity. represents the attention weight; A(q i ,K,V) is the attention vector. 2) Constructing the uniform distribution q(k) of the attention mechanism j |q i ),Right now: Among them, L k is the total number of key vectors k. 3) Substituting the uniform distribution of the attention mechanism into the KL divergence formula, we get: Where KL(q||p) is the KL divergence; 4) Remove the constant in the KL divergence formula and measure the sparsity of the i-th query Defined as: 5) Simplify formula (8) to obtain: 6) Take sparse metrics The top n query vectors are used to construct a sparse matrix The sparse attention mechanism expression is obtained, namely: in, is a sparse matrix. K is the key matrix, V is the value matrix, and softmax is the normalization function.

9. The method for predicting the number of passengers undergoing terminal security inspection based on improved PatchTST according to claim 5, characterized in that: The decoder representations for each group are as follows: in It is the position code generated after the output length is segmented. is the output of the TSA layer in the Decoder, is the output of the multi-head attention layer, is the output after the first Add&Norm operation, Z dec ,l It is the final output after the feedforward neural network and Add&Norm operation. TSA stands for Cross-dimensional Attention Mechanism.

10. The method for predicting the number of passengers undergoing terminal security inspection based on improved PatchTST according to claim 5, characterized in that: The decoder's cross-dimensional attention mechanism works as follows: 1) Based on each set of Decoder representations, generate an embedding representation set Z∈R N*D*dim ; Among them, Z i,: represents the segment embedding at the same time step i in all dimensions, Z :,d Represents the embedding of all fragments of the d-th dimension time series; 2) For elements of different time steps, a sparse attention mechanism is used to obtain the temporal fragment embedding Z of each dimension time ,Right now: Among them, PSA represents the ProbSparse Self-attention layer and MLP represents the feedforward neural network layer. Embeddings of temporal segments representing different time steps; 3) Embed Z for the time series segments of each dimension time , using the same learnable routing vector Pay attention to the embedding of each channel, and then pass another layer of attention to let the embedding of each channel pay attention to the content of each abstract unit and form the output of the decoder, that is: In the formula, Z dim is the output of the decoder; B i,: is the output of the ProbSparse Self-attention layer; R i,: is the learnable routing vector corresponding to different time steps.

Citation Information

Cited By

  • Civil aviation passenger demand prediction method and system based on artificial intelligence

    CN120387560A