Flight delay prediction method and system, computer equipment and storage medium

By constructing a deep neural network (DNN) and combining it with the genetic algorithm (GA) and the bacterial foraging algorithm (BFA), the problem of low prediction accuracy in traditional flight delay prediction methods is solved, higher model accuracy and generalization ability are achieved, and the accuracy of flight delay prediction is improved.

CN120612849APending Publication Date: 2025-09-09CIVIL AVIATION UNIV OF CHINA
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510753759.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-06
Publication Date
2025-09-09

AI Technical Summary

Technical Problem

Most of the existing flight delay prediction methods are traditional machine learning methods, which are prone to falling into local optimal solutions of the algorithm, ignoring other influencing factors, and overfitting, resulting in low prediction accuracy.

Method used

Sample data including historical flight data, weather condition data and delay data is constructed. The binary features are converted into a training dataset, and a deep neural network (DNN) is established. The attention mechanism and residual blocks are introduced between its hidden layers. The bacterial foraging algorithm (BFA) is optimized with the genetic algorithm (GA) to find the optimal hyperparameter combination of the DNN model for flight delay prediction.

Benefits of technology

The model accuracy and generalization ability of flight delay prediction are improved, overfitting and underfitting are reduced, the feature expression ability of flight data is enhanced, and the accuracy of prediction is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120612849A_ABST
    Figure CN120612849A_ABST
Patent Text Reader

Abstract

The invention provides a flight delay prediction method and system, computer equipment and a storage medium, and belongs to the technical field of traffic delay prediction.The method comprises the steps that firstly, a bacterial foraging algorithm (BFA) is optimized through a genetic algorithm (GA) so as to improve the global search ability and convergence speed of the algorithm; secondly, optimizing the structure and parameters of a deep neural network DNN by using the optimized BFA algorithm, and constructing a deep neural network model based on double hidden layers; according to the model, an attention mechanism and a residual block are introduced, so that the nonlinear mapping capability and the generalization capability are improved, and model overfitting is effectively prevented. In addition, the flight data and the weather condition data are combined, so that the prediction accuracy is further improved. The performance of the model is evaluated through multiple indexes, the result shows that the method can effectively solve the problem of DNN structure and parameter selection, and the training efficiency and generalization ability of the model are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of traffic delay prediction, and in particular relates to a flight delay prediction method, system, computer equipment and storage medium. Background Art

[0002] With the rapid development of the civil aviation industry, flight delays have become increasingly prominent, causing significant economic losses to airports and airlines and significantly impacting the passenger experience. According to incomplete statistics, approximately 19% of US commercial flights were delayed in 2019, resulting in delay costs exceeding $33 billion. Similarly, in 2018, flights in Europe were delayed for 25.7 million minutes, resulting in a total loss of approximately $4.7 billion. Accurately estimating flight delays is crucial for optimizing airport scheduling and allocating resources. Traditional machine learning methods have limitations when it comes to flight delay prediction.

[0003] Scholars at home and abroad have conducted extensive research on flight delay prediction. For example, Cao Xianbin's team constructed a high-order delay network based on historical flight data to identify delayed flights and their associated airports, mapping the airports into edges (normal or high-order edges) in the network. They then generated a delay projection network, decomposing the high-order edges into normal edges (i.e., edges between two nodes), forming a projection network that reflects the direct delay relationships between airports. Traditional machine learning methods such as support vector machines and random forests have also been applied to flight delay prediction, but their prediction results are less than ideal when dealing with large-scale and complex data. Liu Qing's team used real-time ADS-B flight trajectory data, including historical delay records and airport operation data, as input. They defined agent types (e.g., flights, airports, and air traffic control units), set their behavioral rules (e.g., delay thresholds triggering rerouting and resource reallocation strategies), and ultimately performed predictions and impact analysis. Traditional machine learning methods have shortcomings when tackling flight delay prediction. They often struggle to achieve ideal prediction accuracy when dealing with large datasets and complex features. Huang Cheng et al. proposed a prediction model based on a multi-head self-attention mechanism and a convolutional bidirectional gated recurrent unit (MHSA-C-BiGRU). This model uses a convolutional bidirectional gated recurrent unit (C-BiGRU) to extract local information and temporal information from upstream and downstream data, leveraging the parallel capabilities of the multi-head self-attention mechanism (MHSA) to extract features from different locations within the data. The study used flight and meteorological data from Shanghai Pudong Airport in 2018. Results showed that the prediction model improved prediction accuracy by 4.4% compared to the baseline model, with an 8% improvement in macro-averages and a 5% improvement in weighted averages. To overcome remaining limitations, combining deep learning with optimization algorithms offers a new approach to solving the flight delay prediction problem. Deep learning techniques are gaining traction, with convolutional neural networks and recurrent neural networks being used to capture complex features and time series information in data. To improve model performance, researchers have tried combining various optimization algorithms with neural network optimization. Applications of particle swarm optimization and genetic algorithms for neural network parameter optimization have yielded promising results, but room for improvement remains.

[0004] In summary, most of the current flight delay prediction methods are traditional machine learning methods, which are prone to falling into the local optimal solution of the algorithm, ignoring other influencing factors, causing the method to focus on solving a certain problem while ignoring other factors, and overfitting, that is, the model has too many parameters and the structure is too complex, resulting in the inability to exclude invalid data and noise, and thus unable to accurately reflect the true laws and characteristics of the data, resulting in low prediction accuracy. Summary of the Invention

[0005] In order to solve the above problems, the present invention provides a flight delay prediction method.

[0006] In order to achieve the above object, the present invention provides the following technical solutions: A flight delay prediction method, comprising: Construct sample data containing historical flight data, weather data, landing data, and delay data, convert the sample data into binary features, and use the binary features to form a training dataset; Establish a neural network consisting of an input layer, two hidden layers and an output layer, introduce an attention mechanism and residual blocks between the two hidden layers of the neural network to form a deep neural network DNN; A genetic algorithm (GA) was used to optimize the bacterial foraging algorithm (BFA). The optimized BFA was used to find the optimal hyperparameter combination for the deep neural network (DNN) model. The optimized DNN model was trained using binary features representing historical flight data and weather conditions in the training dataset as input and binary features representing landing data and delay data as output. The real-time flight data and weather condition data are converted into binary features, and the converted binary features are input into the trained DNN model for flight delay prediction, outputting the flight delay results and estimated landing time.

[0007] Preferably, the historical flight data includes flight duration, flight distance, air traffic volume, flight scheduled departure time, air traffic control data, and past flight records at the same airport and during the same period. The flight data acquired in real time includes flight scheduled departure time, air traffic control data, and past flight records at the same airport and during the same period. Weather condition data includes take-off weather condition data and real-time weather condition data.

[0008] Preferably, the first hidden layer of the deep neural network DNN has 128 neurons, the second hidden layer has 64 neurons, the activation functions of the two hidden layers are ReLU, and L2 regularization is added to both; the output layer has 2 neurons, the activation function is Softmax, and is used for binary classification tasks.

[0009] Preferably, the method of finding the optimal hyperparameter combination of the DNN model through the optimized BFA specifically includes the following steps: Use the test set classification loss value as the fitness value to construct the fitness function; At the beginning of each iteration, the hyperparameter combination is assigned to the DNN parameters to be optimized, and then the DNN model is trained using the training data; After training is completed, the model is evaluated using the test data and the classification loss value of the model on the test set is calculated; Before BFA starts searching, the positions of individuals in the population are randomly initialized; During the optimization process of BFA, individuals in the population are sorted; The index value array obtained by sorting is used to sort the bacterial individual positions one by one, and an array of bacterial individual positions is obtained, which is sorted in descending order of fitness value. At the same time, use The function sorts the fitness value array in ascending order and returns the sorted fitness value array, obtaining the fitness value array sorted from small to large and the bacterial individual position array of the corresponding index; Then, the individual with the smallest fitness value is taken as the current optimal bacterial individual, and the current individual's optimal fitness value is compared with the historical global optimal fitness value. The global optimal fitness value is updated based on the minimum fitness value, and the position of the optimal bacterial individual is updated accordingly to obtain the optimal hyperparameter combination of the DNN model.

[0010] Preferably, the fitness function is: Where, For fitness, represents the classification loss on the test set, refers to the test dataset, classification Refers to the classification task, Refers to loss.

[0011] Preferably, the initialization formula for randomly initializing the positions of individuals in the population is: ; in, , j is the population position obtained by initialization, i Indicates the individual number, j Represents dimension; rand (0,1) is a random number between 0 and 1, indicating the initialization starting point; , j and , j Respectively represent the upper and lower limits of each selected optimization parameter.

[0012] Preferably, when sorting individuals in the population, the sorting formula is as follows: ; Where, is the array of bacterial individual positions obtained by sorting by index value; positions is the array of bacterial individual positions before sorting, is a classification indicator.

[0013] The present invention also provides a flight delay prediction system, comprising: A training set construction module is used to construct sample data containing at least historical time, historical weather, and historical delay count features, convert the sample data into binary features, and form a training data set based on the binary features; The model building module is used to build a neural network consisting of an input layer, two hidden layers, and an output layer. The attention mechanism and residual block are introduced between the two hidden layers of the neural network to form a deep neural network (DNN). A model training model is used to optimize the bacterial foraging algorithm (BFA) using a genetic algorithm (GA) and find the optimal hyperparameter combination of a deep neural network (DNN) model through the optimized BFA. The optimized DNN model is trained using binary features representing historical flight data and weather condition data in the training dataset as input and binary features representing landing data and delay data as output to obtain a trained DNN model. The delay prediction module is used to convert the real-time flight data and weather condition data into binary features, and input the converted binary features into the trained DNN model to predict flight delays, and output the flight delay results and estimated landing time.

[0014] The present invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement any one of the steps in the flight delay prediction method.

[0015] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is loaded by a processor, it can execute any one of the steps in the flight delay prediction method.

[0016] The flight delay prediction method provided by the present invention has the following beneficial effects: This paper introduces an attention mechanism and a residual block between two hidden layers of a neural network to construct a new deep neural network (DNN). Based on the structural characteristics of this network, a BFA (Bacterial Foraging Algorithm) is introduced into the parameter optimization of the DNN model. First, a bacterial foraging algorithm (BFA) is optimized using a genetic algorithm (GA). Compared to BFA alone, GA optimization can prevent population diversity from falling into local optima. GA also has parallel computing capabilities, significantly improving search efficiency. Furthermore, GA has relatively low requirements for initial parameter settings and relatively flexible parameter adjustment. The GA-optimized BFA inherits these advantages of GA, reducing dependence on initial parameters. This advantage of the optimized BFA is leveraged to find the optimal hyperparameter combination for the DNN model, improving the model's classification accuracy, generalization, global search capability, and convergence speed. Because the BFA and GA can search for and apply optimal DNN parameters such as the learning rate and number of neurons, the model convergence is more stable and reduces overfitting and underfitting. In addition, since flight delays are affected by many factors, the feature expression of DNN may be less effective, and GA can help DNN enhance its feature expression ability, thereby improving the classification performance of flight data and the accuracy of delay prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] To more clearly illustrate the embodiments of the present invention and its design, the following briefly introduces the drawings required for this embodiment. The drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be derived from these drawings without inventive effort.

[0018] Figure 1 This is a flow chart of the flight delay prediction method according to embodiment 1 of the present invention; Figure 2 It is the structure diagram of the DNN model; Figure 3 Flowchart for GA optimization of BFA; Figure 4 Flowchart for finding the optimal hyperparameter combination of the DNN model for the optimized BFA; Figure 5 This is the training flow chart of the DNN model; Figure 6 This is a line chart comparing the accuracy experimental results of the four methods; Figure 7 The following is a line chart comparing the F1 score experimental results of the four methods. DETAILED DESCRIPTION

[0019] In order to enable those skilled in the art to better understand the technical solution of the present invention and to be able to implement it, the present invention is described in detail below with reference to the accompanying drawings and specific embodiments. The following embodiments are only used to more clearly illustrate the technical solution of the present invention and are not intended to limit the scope of protection of the present invention.

[0020] This invention combines deep learning with optimization algorithms, opening up a new approach to addressing flight delays. By deeply analyzing the factors influencing flight delays and establishing a relationship model between delays and these factors, it proposes a deep neural network prediction method that implements intelligent optimization, thereby improving prediction accuracy and effectively facilitating practical applications.

[0021] First, the algorithm involved in this invention is introduced.

[0022] 1. Genetic Algorithm The genetic algorithm (GA), first proposed by American scholar John Holland in the 1970s, is a search algorithm based on natural selection and genetic mechanisms. It simulates the natural evolutionary process through operations such as selection, crossover, and mutation, continuously optimizing individuals in a population to find the optimal solution to a problem. The algorithm's generation process is as follows:

[0023] (1) A random method is used to generate a set of several individuals, that is, to generate an initial population. In the algorithm, a binary string is used to encode the initial population through the basic genetic algorithm (SGA) to facilitate the subsequent operation of the algorithm.

[0024] (2) Use the fitness function to calculate the relevant function value for the individual. The larger the fitness function value, the better the quality of the individual. It is usually used to find the maximum fitness score. If the minimum value is required, the fitness calculation will invert the original value.

[0025] (3) Perform selection, crossover or recombination, and mutation operations on individuals in the population. Selection operation: Select some individuals from the parent population and pass them on to the next generation. Individuals with high fitness have a high probability of being inherited, while individuals with low fitness have a low probability of being inherited. Crossover or recombination operation: Select two individuals from the parent population and exchange some of their genes in a certain way according to the crossover probability Pc, thereby forming two new individuals. Mutation operation: Change some gene values ​​in the individual code string according to the mutation probability Pm, thereby forming new individuals and maintaining population diversity.

[0026] (4) Perform the above operations on the initial population for a set number of generations and then stop, and a new population with higher adaptability can be obtained.

[0027] 2. Deep Neural Networks Deep Neural Networks (DNNs) are a variant of Multilayer Perceptrons (MLPs) and belong to the category of generalized Artificial Neural Networks (ANNs). They are applied to solve various complex problems by imitating the structure and function of human brain neural networks.

[0028] Traditional DNNs are mainly composed of three parts: the input layer, the hidden layer, and the output layer. Generally speaking, the first layer is the input layer, which receives input data. These data values ​​are forward propagated to the neurons in the middle layer of the neural network, namely the hidden layer. The weighted sum of one or more hidden layers is finally forward propagated to the output layer, presenting the output of the neural network to the user. In order to match brain-inspired terminology with DNN, the output of the neuron is usually called activation, and the synapse, that is, the relationship between the previous and next layers, is usually called weight. In the DNN algorithm, each hidden layer is followed by an activation function for nonlinear transformation, as shown in Equation (1):

[0029] (1) in: Indicates the output response, W Represents the corresponding matrix of the hidden layer and the output layer, X is the input value vector, b is the bias vector (the input layer has no bias vector b ); It represents the Hadamard product operation, which is the multiplication and summation of corresponding elements of the matrix, and is a related operation; Represents the use of activation function for nonlinear transformation.

[0030] 3. Bacterial foraging algorithm The Bacterial Foraging Optimization algorithm (BFA), proposed by KM Passino in 2002, is a type of intelligent optimization algorithm that simulates the behaviors exhibited by bacteria during foraging. Bacteria exhibit three typical behavior patterns during foraging: chemotaxis, reproduction, and elimination-dispersal. This algorithm pursues optimal results using a population-based approach, offering high search efficiency, probabilistic and random behavior, and strong scalability. Its behavior is simulated as follows:

[0031] The bacteria in the initial population will tend to move towards an environment that is conducive to their survival. This is the basic behavior of bacteria foraging. In the algorithm, chemotaxis is achieved by updating the position of individual bacteria: the position of the individual is ( Expressed as bacteria), the bacteria will perform random searches around the current position. This process is represented by adding a random step length to the current position, and the formula is as shown in (5):

[0032] (5) in represents the chemotaxis step, is the step length, is a random direction vector.

[0033] At the same time, the bacteria will compare the fitness of the new position with the fitness of the original position. If the fitness of the new position is better, the bacteria will accept the new position; otherwise, it may accept the worse position with a certain probability.

[0034] Bacteria reproduce based on their energy reserves (fitness). In the algorithm, after a certain number of chemotaxis steps, the fitness of all bacteria is ranked. Bacteria with higher fitness have more opportunities to reproduce, while those with lower fitness may be eliminated. In this invention, 50% of poorly performing individuals are eliminated, and high-performing individuals are reproduced. To optimize the algorithm, a GA algorithm is also introduced. The reproduction process includes operations such as replication, crossover, and mutation, thereby continuously optimizing the individuals in the population.

[0035] In nature, bacteria may migrate to new locations due to sudden changes in the environment (such as water flow or temperature fluctuations). In the algorithm, bacterial migration is simulated with a certain probability. When migration occurs, the bacterial position is randomly reset to a certain location in the search space. This helps the algorithm escape local optimal solutions and increase population diversity.

[0036] By improving the above algorithm, the present invention proposes a flight delay prediction method, specifically a flight delay prediction method based on a deep neural network (DNN) and an optimization algorithm, comprising the following steps: Step 1: Use genetic algorithm GA to optimize bacterial foraging algorithm BFA Compared with a single BFA, after GA optimizes it, the group diversity can avoid falling into the local optimum. And GA has the ability of parallel computing, which can significantly improve the search efficiency. In addition, GA has relatively low requirements for the initial parameter setting of the problem, and its parameter adjustment is relatively flexible. The BFA optimized by GA can inherit this advantage of GA, thereby reducing the dependence on the initial parameters. The original BFA has high requirements for the initial solution and parameter setting, and the parameter setting has a greater impact on the optimization results. The flowchart of GA optimizing BFA is as follows Figure 3 As shown, the following steps are included:

[0037] First, a crossover function is defined. This function exchanges some of the genes of two individuals to generate new individuals. This increases population diversity, broadens the search space, and helps avoid being trapped in local optima. Leveraging this principle, the crossover operation is embedded in the optimization process at each generation. In this way, the BFA population introduces new solutions at each iteration, enhancing global search capabilities.

[0038] After introducing crossover to improve local optimal solutions to a certain extent, a mutation function, or operation, was introduced to further address this issue. Mutation introduces new variants by randomly changing a gene in an individual. This operation further increases population diversity and helps the algorithm escape local optimal solutions. Mutation is also embedded in the BFA optimization process. In each iteration, the mutation operation randomly changes certain dimensions of some individuals, introducing new solutions and further enhancing global search capabilities.

[0039] Through the definition of the fitness function, the weight vector of the neural network is restored to the corresponding weight structure and set into the model to enhance its global search ability, accelerate the convergence speed and improve the optimization accuracy. The loss value is calculated using the validation set as the fitness value. The smaller the loss value, the better the model performance.

[0040] The advantages of the BFA optimization process are: Enhanced global search capability: The crossover and mutation operations of genetic algorithms enable BFA to explore a wider range of search spaces during the optimization process.

[0041] Accelerate convergence speed: By introducing the operation of genetic algorithm, BFA can find better solutions in a shorter time.

[0042] Improved optimization accuracy: Genetic algorithm operations help BFA search the solution space more carefully, thereby improving optimization accuracy. Crossover operations can combine the excellent features of different individuals, and mutation operations can fine-tune the results locally.

[0043] Step 2: Build a deep neural network (DNN) model Construct a neural network consisting of an input layer, two hidden layers, and an output layer. Introduce an attention mechanism and residual blocks between the two hidden layers of the neural network to form a deep neural network (DNN).

[0044] The input layer receives feature vectors. The first hidden layer has 128 neurons, activated by ReLU. The second hidden layer has 64 neurons, also activated by ReLU. Both hidden layers are L2 regularized. The output layer has two neurons, activated by Softmax, for binary classification. Before each use, weight initialization is performed: dummy inputs are created and forward propagated once to explicitly initialize the network weights and avoid errors in subsequent operations.

[0045] In the present invention, the definitions of the ReLU function and the Sigmoid function are as follows: (2) (3) The DNN model of the present invention adopts a double hidden layer. The DNN model structure is shown in the figure below: Figure 2 As shown, the nonlinear mapping function of DNN can be expressed as: (4) Where, Represents the use of activation function for nonlinear transformation, W Represents the corresponding matrix of the hidden layer and the output layer, X is the input value vector, b is the bias vector, represents the Hadamard product operation, is the weight matrix from the input layer to the hidden layer, is the weight matrix from the hidden layer to the output layer.

[0046] In order to optimize the algorithm, the DNN model in this invention introduces an attention mechanism to better capture important features in the input data; a residual block is added between the two hidden layers of the DNN, and residual connections are used to alleviate the problem of vanishing gradients in deep networks, making the model easier to train; and regularization technology is introduced in the two hidden layers to prevent model overfitting and improve generalization ability.

[0047] Among them, the other layers of the deep neural network (DNN) model process the data as follows: (1) Input layer: The input data shape is required to be (batch_size, input_dim), where input_dim is the number of features (X_train.shape[1]), and batch_size is the number of samples input to the model at one time during each training.

[0048] (2) The first fully connected layer (dense1): performs linear transformation + ReLU activation, using the formula: output = relu(W1 * input + b1).

[0049] Where W1 is the weight matrix (shape (input_dim, 128)) and b1 is the bias. Then regularize: L2 regularization (coefficient 0.01) is used to prevent overfitting. The output shape is (batch_size, 128).

[0050] (3) Dropout layer: Randomly discard 50% of neuron outputs (only effective during training). This further prevents overfitting (batch_size, 128) (some values ​​are set to zero).

[0051] (4) Second fully connected layer (dense2): It is still linear transformation + ReLU activation, using the formula output = relu(W2 * input + b2), relu is the activation function, and the shape of W2 is (128, 64).

[0052] (5) Output layer (output_layer): This layer performs a linear transformation and softmax activation, using the formula output = softmax(W3 * input + b3). Softmax is the activation function of the output layer, converting the raw scores into a probability distribution. W3 has a shape of (64, num_classes). The output is a probability distribution for each class (summing to 1), with a shape of (batch_size, num_classes), where num_classes represents the total number of classes in the classification task.

[0053] Step 3: Optimize the parameters of the deep neural network DNN through BFA optimized by GA Traditional machine learning algorithms perform well when processing small sample data, but they suffer from high computational complexity and slow speed when dealing with large-scale, complex flight delay data. While deep learning DNN models possess powerful feature extraction capabilities, DNN hyperparameters, such as the learning rate and number of iterations, have a crucial impact on model performance. Inappropriate hyperparameters can lead to excessively long model training times, a tendency to fall into local optimal solutions, and poor generalization.

[0054] The learning rate determines the step size of the model's parameter updates during training. If the learning rate is too high, the model may skip the optimal solution during training, resulting in non-convergence. If the learning rate is too low, the model will train very slowly, requiring more training time. The number of iterations determines the number of rounds of model training. Too many iterations may lead to overfitting, while too few iterations may prevent the model from fully learning the data characteristics.

[0055] The bacterial foraging algorithm (BFA) boasts global search capabilities, population diversity, and rapid convergence. It can quickly find optimal solutions within the search space and prevent the algorithm from becoming trapped in local optima. Therefore, this paper incorporates BFA into parameter optimization of DNN models, leveraging its advantages to find the optimal hyperparameter combination for the DNN model. This method constructs an optimized DNN model, improving its classification accuracy and generalization capabilities. The parameter settings for the optimization process are shown in Table 1.

[0056] Table 1 Parameter settings The process of using the GA-optimized BFA algorithm to find the optimal hyperparameter combination of the DNN model is as follows: Figure 4 shown.

[0057] Step 31: Construct fitness function In the optimization of DNN model parameters based on BFA, the design of the fitness function is crucial. It is used to evaluate the quality of each bacterial individual (i.e., a set of DNN model hyperparameters).

[0058] This method uses the test set classification loss as the fitness value to construct a fitness function. At the beginning of each iteration, individual bacteria (i.e., hyperparameter combinations) are assigned to the DNN parameters to be optimized, and the DNN model is then trained using the training data. After training, the model is evaluated using the test data, and the classification loss of the model on the test set is calculated. The smaller the classification loss, the better the model's classification performance on the test data, and the more optimal the corresponding hyperparameter combination. The fitness function formula is expressed as follows:

[0059] ; Where, Fitness is used to measure the quality of an individual (such as a set of hyperparameter configurations of a DNN model) in optimization algorithms. The smaller the value, the better the individual performs in the current task. represents the classification loss on the test set. Refers to the test dataset, which is a data set used to evaluate the performance of the model. classification Refers to the classification task, that is, the above requirements. Refers to the loss, which is an indicator of the difference between the predicted results and the true results.

[0060] This fitness function can directly reflect the impact of hyperparameter combinations on the model classification performance, and provides clear guidance for BFA in searching for the optimal hyperparameter combination.

[0061] Step 32: Population initialization Before BFA begins searching, it is necessary to randomly initialize the positions of the individuals in the population. This is because random initialization allows the algorithm to explore more extensively in the search space and avoids the algorithm from falling into a local optimal solution at the beginning. The initialization formula is as follows:

[0062] ; in, , j is the population position obtained by initialization, i Indicates the individual number, j Represents dimension; rand (0,1) is a random number between 0 and 1, indicating the initialization starting point; , j and , j They represent the upper and lower limits of each selected optimization parameter (such as learning rate and number of iterations).

[0063] In this way, each bacterial individual is initialized with a different combination of hyperparameters, providing a diverse starting point for the subsequent optimization process.

[0064] Step 33: Population sorting In the optimization process of BFA, it is necessary to sort the individuals in the population in order to select the best individuals for subsequent operations. in After sorting the fitness value array, the function returns the index of all elements in the array sorted from small to large. The function formula is as follows:

[0065] ; Where, The index value of the array returned after sorting; is the fitness value of each bacterial individual calculated according to the fitness function calculation formula.

[0066] By using the index value array obtained by sorting, the bacterial individual positions are sorted one by one, and an array of bacterial individual positions sorted in ascending order of fitness value can be obtained. When sorting individuals in the population, the sorting formula is as follows:

[0067] ; Where, is the array of bacterial individual positions obtained by sorting by index value; positions is the array of individual bacterial positions before sorting.

[0068] At the same time, use The function sorts the fitness value array in ascending order and returns the sorted fitness value array. The formula for calling the sort function is as follows:

[0069] ; Where, It is the array of fitness values ​​returned after sorting.

[0070] After the population sorting operation, the present invention can clearly obtain an array of fitness values ​​sorted from small to large and an array of bacterial individual positions with corresponding indexes. Then, the individual with the smallest fitness value is selected as the current optimal bacterial individual, and the current individual's optimal fitness value is compared with the historical global optimal fitness value. The global optimal fitness value is updated based on the minimum fitness value, and the optimal bacterial individual position is updated accordingly. The formula is as follows:

[0071] ; ; Where, is the global optimal fitness value after updating; is the current individual's optimal fitness value; is the global optimal individual position after updating; is the current optimal individual position.

[0072] This sorting and updating operation can continuously screen out excellent individuals in the population and guide the algorithm to search in a better direction.

[0073] BFA, due to its ability to simulate bacterial colony behavior with high similarity, is particularly well-suited for scenarios with large aircraft numbers, fluctuating routes, and volatile weather conditions. GA optimization can also mitigate its vulnerability to falling into optimal solutions. By first constructing a BFA model and then improving it with GA, the team then initialized and trained the DNN with increasing iterations, achieving a model with optimized convolutional neural networks and learning rates, which can be used in flight delay prediction research.

[0074] Step 4: Train the deep neural network DNN after parameter optimization Step 41: Data preparation 11) Data Generation and Loading: Generate simulated data containing historical flight characteristics, time (hour), weather conditions (weather), number of landings, and historical delays (delay), totaling 100 samples.

[0075] 12) Feature Engineering: One-hot encode simulated data, such as the categorical variable weather, and convert it into two binary features: sunny and rainy.

[0076] 13) Data standardization: Standardize the numerical features so that their mean is 0 and their variance is 1.

[0077] 14) Dataset partitioning: The dataset is divided into training set and test set in a ratio of 8:2.

[0078] Step 42: Model training phase 15) Set optimal weights According to the weight parameter shape list weightshapes, the one-dimensional best weight vector bestweights is split into weight matrices corresponding to the network layer structure.

[0079] The split weight matrix is ​​set to the corresponding layers of the model in sequence to complete the initialization of the model weights.

[0080] 16) Regular training The optimizer of the configuration model is Adam, the learning rate is 0.001, the loss function is sparse classification cross entropy loss, and the evaluation indicator is accuracy.

[0081] The model is trained using the training set data, with the number of training rounds set to 20 and the number of training samples per batch to 32. The validation set data is then used for validation to monitor the training effect of the model and prevent overfitting.

[0082] Step 5: Model Evaluation 17) Use the test set data to make predictions and obtain the model’s prediction results.

[0083] 18) Calculate the accuracy of the model, that is, the ratio of correctly predicted samples to the total number of samples, which reflects the overall prediction accuracy of the model.

[0084] 19) Calculate the F1 value of the model, which is the harmonic mean of precision and recall. It is particularly suitable for cases of class imbalance and comprehensively measures the precision and recall ability of the model.

[0085] Step 6: Convert the real-time flight data and weather condition data into binary features, and input the converted binary features into the trained DNN model to predict flight delays, and output the flight delay results and estimated landing time.

[0086] For example, if the model input parameters (flight parameters) are: flight duration 4.9 hours, 2 delays this week, distance 2,200 kilometers, traffic flow 0.55, and sunny weather, the prediction result is: 2025.5.25 at 6 pm, the delay probability is 17.62%, and the prediction conclusion is: no delay.

[0087] The model input parameters (flight parameters) are: flight duration 10.5 hours, 58 delays this week, distance 8,000 kilometers, traffic flow 0.97, cloudy weather, and the prediction result is: 3:24 PM on May 24, 2025, with a delay probability of 63.37%. The prediction conclusion is: there will be a delay.

[0088] Below, the flight delay prediction method based on deep neural network (DNN) and optimization algorithm provided by the present invention is experimentally compared with other model-based prediction methods.

[0089] 20. Operating Environment We wrote the experimental program in Python and tested it on Windows 11, an Intel® Core™ i9-14900HX processor, 32GB of RAM, and an RTX 4060 GPU. We did our best to minimize errors caused by system performance. The dataset was compiled from flight data from major airports.

[0090] 21. Parameter settings As shown in Table 2, there are multiple parameters to choose from in this experiment. The present invention uses the parameters that make the training most stable and efficient under performance conditions.

[0091] Table 2 Parameter settings 22. Experiment and result analysis This experiment used past airport flight data records, and the output included the current flight departure time, the estimated flight duration, the number of delays this Monday, traffic flow, weather conditions, delay probability and prediction conclusions.

[0092] Table 3 Experimental results In this experiment, the present invention also conducted 10 independent random experiments on the fusion algorithms of DNN, DNN+BFA and DNN+BFA+GA. The experimental results are shown in Table 3.

[0093] According to the experimental results, the DNN+BFA+GA fusion algorithm performs better in terms of maximum accuracy, average accuracy, minimum, maximum, and average F1 index. Figure 6 and Figure 7As shown in the figure, compared with DNN, the BFA and GA optimized DNNs achieved an average improvement of 40.94% in accuracy and 61.59% in F1 score. This indicates that the BFA and GA optimized DNNs significantly outperformed DNN in both precision and recall, significantly improving model performance and demonstrating the effectiveness of this approach. For single-method optimization, DNN+BFA+GA also outperformed DNN+BFA and DNN+GA. Furthermore, the DNN+BFA+GA approach demonstrated an advantage in classification accuracy. This is because the introduction of BFA and GA enables the search and application of optimal DNN parameters, such as the learning rate and number of neurons, resulting in more stable model convergence and reduced overfitting and underfitting. Furthermore, since flight delays are affected by multiple factors, DNN feature representation can be ineffective. GA can help DNNs enhance their feature representation capabilities, thereby improving classification performance for flight data. Furthermore, since regular flights outnumber delayed flights in flight data, DNNs are at a disadvantage when learning from sparse samples in this imbalanced data, resulting in low recall. The introduction of BFA can address this issue. Furthermore, the introduction of GA can optimize the BFA loss weights, resulting in higher classification accuracy for DNN results. Therefore, using BFA and GA to optimize DNNs is meaningful. The characteristics of the flight delay data are shown in Table 4.

[0094] Table 4 Flight delay data characteristics Table 4 shows the collected airport flight data, including flight duration, day of the week, number of delays during the week, flight distance, weather conditions at takeoff, volume of traffic at the time, and whether the flight was delayed. This data can be used as training data for the model.

[0095] This paper focuses on the problem of airport flight delays and proposes a flight delay prediction method based on deep neural networks (DNN) and optimization algorithms (genetic algorithm GA, bacterial foraging algorithm BFA). GA is used to optimize BFA, which enhances the global search capability and convergence speed, and solves the problem of DNN model in hyperparameter selection. This paper proposes a dual-hidden layer DNN model and introduces an attention mechanism and residual blocks to optimize the network structure, effectively enhancing nonlinear mapping and generalization capabilities. At the same time, flight and weather condition data are integrated to further improve prediction accuracy.

[0096] The experimental results show that the DNN method combined with GA-optimized BFA is significantly better than the single method in terms of accuracy and F1 score. Specifically: The average precision increased from 0.469 in the DNN to 0.661, a 40.94% improvement; the average F1 score increased from 0.44 in the DNN to 0.711, a 61.59% improvement. This method utilizes flight delay data mining to effectively extract features, achieving impressive prediction results and possessing significant application potential.

[0097] This paper proposes a flight delay prediction method based on a deep neural network (DNN) and an optimization algorithm. First, a bacterial foraging algorithm (BFA) is optimized using a genetic algorithm (GA) to improve its global search capability and convergence speed. Second, the optimized algorithm is used to optimize the structure and parameters of the DNN, resulting in a dual-hidden-layer DNN model. By introducing an attention mechanism and residual blocks, this model enhances nonlinear mapping and generalization capabilities, effectively preventing overfitting. Furthermore, the present invention combines flight data with weather data to further improve prediction accuracy. Model performance was evaluated using multiple metrics, demonstrating that this method effectively addresses the challenges of DNN structure and parameter selection, significantly improving model training efficiency and generalization.

[0098] Experiments have confirmed that the flight delay prediction approach proposed in the present invention, which uses a genetic algorithm to optimize the bacterial foraging algorithm and a deep neural network to optimize, has achieved good results in prediction accuracy, model training efficiency, and generalization ability. It can effectively address the problems existing in traditional methods and bring new ideas and methods to flight delay prediction.

[0099] The main contributions of the present invention are as follows: 1. Optimization of Genetic Algorithm (GA): An optimization method based on genetic algorithm is proposed to optimize the population through selection, crossover and mutation operations, and finally obtain a new population with higher adaptability.

[0100] 2. Improvement of the bacterial foraging algorithm (BFA): The bacterial foraging algorithm is introduced to optimize the population by simulating the chemotaxis, reproduction and migration behavior of bacteria. The genetic algorithm is combined to optimize the BFA and enhance the global search capability.

[0101] 3. Optimization of deep neural networks (DNNs): A deep neural network model based on two hidden layers was constructed. By introducing the attention mechanism and residual blocks, the network structure was optimized to improve nonlinear mapping and generalization capabilities.

[0102] 4. Comprehensive optimization model: By combining GA, BFA, and DNN methods, a comprehensive optimization model was constructed, which significantly improved the performance and adaptability of the model and increased the accuracy of flight delay prediction.

[0103] Based on the same inventive concept, the present invention also provides a flight delay prediction system, comprising: The training set construction module is used to construct sample data containing at least historical time, historical weather and historical delay count features, convert the sample data into binary features, and form a training data set through the binary features.

[0104] The model building module is used to build a neural network consisting of an input layer, two hidden layers and an output layer. The attention mechanism and residual block are introduced between the two hidden layers of the neural network to form a deep neural network DNN.

[0105] The model training model is used to optimize the bacterial foraging algorithm (BFA) using the genetic algorithm (GA), and find the optimal hyperparameter combination of the deep neural network (DNN) model through the optimized BFA; the binary features representing historical flight data and weather condition data in the training dataset are used as input, and the binary features representing landing data and delay data are used as output to train the optimized DNN model to obtain a trained DNN model.

[0106] The delay prediction module is used to convert the real-time flight data and weather condition data into binary features, and input the converted binary features into the trained DNN model to predict flight delays, and output the flight delay results and estimated landing time.

[0107] Each module in the aforementioned flight delay prediction system may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor within a computer device in the form of hardware, or may be stored in a computer device memory in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0108] The present invention further provides a computer device comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the flight delay prediction method embodiment. The specific implementation method can be found in the method embodiment and will not be repeated here.

[0109] Furthermore, the present invention provides a non-transitory computer-readable storage medium containing instructions, wherein the storage medium stores a computer program. For example, the storage medium may be a memory containing instructions, wherein the instructions are executable by a processor of a computer device to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, or optical data storage device. When executed by the processor, the computer program is capable of implementing the steps of the flight delay prediction method embodiment. The specific implementation method can be found in the method embodiment and will not be further described here.

[0110] Those skilled in the art will appreciate that embodiments of the present invention may provide methods, systems, or computer program products. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code.

[0111] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0112] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0113] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0114] It should be pointed out that the specific implementation methods described above can enable those skilled in the art to understand the invention more comprehensively, but do not limit the invention in any way. Therefore, although the present specification and examples have described the invention in detail, those skilled in the art should understand that the invention can still be modified or replaced by equivalents; and all technical solutions and improvements that do not deviate from the spirit and scope of the invention are included in the scope of protection of the patent for the invention. Any figure mark in the claims should not be regarded as limiting the claims involved. Any simple change or equivalent replacement of the technical solution that can be obviously obtained by any person familiar with the art within the technical scope disclosed in the present invention falls within the scope of protection of the present invention.

Claims

1. A flight delay prediction method, characterized in that: include: Construct sample data containing historical flight data, weather data, landing data, and delay data, convert the sample data into binary features, and use the binary features to form a training dataset; Establish a neural network consisting of an input layer, two hidden layers and an output layer, introduce an attention mechanism and residual blocks between the two hidden layers of the neural network to form a deep neural network DNN; A genetic algorithm (GA) was used to optimize the bacterial foraging algorithm (BFA). The optimized BFA was used to find the optimal hyperparameter combination for the deep neural network (DNN) model. The optimized DNN model was trained using binary features representing historical flight data and weather conditions in the training dataset as input and binary features representing landing data and delay data as output. The real-time flight data and weather condition data are converted into binary features, and the converted binary features are input into the trained DNN model for flight delay prediction, outputting the flight delay results and estimated landing time.

2. The flight delay prediction method according to claim 1, characterized in that: The historical flight data includes flight duration, flight distance, air traffic volume, flight scheduled departure time, air traffic control data, and past flight records at the same airport and during the same period; The flight data acquired in real time includes flight scheduled departure time, air traffic control data, and past flight records at the same airport and during the same period. Weather condition data includes take-off weather condition data and real-time weather condition data.

3. The flight delay prediction method according to claim 1, characterized in that: The first hidden layer of the deep neural network DNN has 128 neurons, the second hidden layer has 64 neurons, the activation functions of the two hidden layers are ReLU, and L2 regularization is added to both; the output layer has 2 neurons, the activation function is Softmax, and is used for binary classification tasks.

4. The flight delay prediction method according to claim 1, characterized in that: The method of finding the optimal hyperparameter combination of the DNN model through the optimized BFA specifically includes the following steps: Use the test set classification loss value as the fitness value to construct the fitness function; At the beginning of each iteration, the hyperparameter combination is assigned to the DNN parameters to be optimized, and then the DNN model is trained using the training data; After training is completed, the model is evaluated using the test data and the classification loss value of the model on the test set is calculated; Before BFA starts searching, the positions of individuals in the population are randomly initialized; During the optimization process of BFA, individuals in the population are sorted; The index value array obtained by sorting is used to sort the bacterial individual positions one by one, and an array of bacterial individual positions is obtained, which is sorted in descending order of fitness value. At the same time, use The function sorts the fitness value array in ascending order and returns the sorted fitness value array, obtaining the fitness value array sorted from small to large and the bacterial individual position array of the corresponding index; Then, the individual with the smallest fitness value is taken as the current optimal bacterial individual, and the current individual's optimal fitness value is compared with the historical global optimal fitness value. The global optimal fitness value is updated based on the minimum fitness value, and the position of the optimal bacterial individual is updated accordingly to obtain the optimal hyperparameter combination of the DNN model.

5. The flight delay prediction method according to claim 4, characterized in that: The fitness function is: Where, For fitness, represents the classification loss on the test set, refers to the test dataset, classification Refers to the classification task, Refers to loss.

6. The flight delay prediction method according to claim 4, characterized in that: The initialization formula for randomly initializing the individual positions of the population is: ; in, , j is the population position obtained by initialization, i Indicates the individual number, j Represents dimension; rand (0,1) is a random number between 0 and 1, indicating the initialization starting point; , j and , j Respectively represent the upper and lower limits of each selected optimization parameter.

7. The flight delay prediction method according to claim 4, characterized in that: When sorting individuals in the population, the sorting formula is as follows: ; Where, is the array of bacterial individual positions obtained by sorting by index value; positions is the array of bacterial individual positions before sorting, is a classification indicator.

8. A flight delay prediction system, characterized in that: include: A training set construction module is used to construct sample data containing at least historical time, historical weather, and historical delay count features, convert the sample data into binary features, and form a training data set based on the binary features; The model building module is used to build a neural network consisting of an input layer, two hidden layers, and an output layer. The attention mechanism and residual block are introduced between the two hidden layers of the neural network to form a deep neural network (DNN). A model training model is used to optimize the bacterial foraging algorithm (BFA) using a genetic algorithm (GA) and find the optimal hyperparameter combination of a deep neural network (DNN) model through the optimized BFA. The optimized DNN model is trained using binary features representing historical flight data and weather condition data in the training dataset as input and binary features representing landing data and delay data as output to obtain a trained DNN model. The delay prediction module is used to convert the real-time flight data and weather condition data into binary features, and input the converted binary features into the trained DNN model to predict flight delays, and output the flight delay results and estimated landing time.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory, wherein: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is loaded into a processor, it is capable of executing the steps of the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Road congestion prediction method, device and equipment based on adaptive mixed bacterial foraging optimization algorithm, and medium

    CN122310026A