Groundwater level prediction method and system assisted by large language model and hyper-heuristic optimization
By using a large language model-assisted hyperheuristic optimization method, the automated co-evolution of metaheuristic algorithms and artificial neural network models was achieved, solving the problems of insufficient accuracy and reliance on expert experience in groundwater level prediction, and improving prediction accuracy and robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGXI UNIV FOR NATITIES
- Filing Date
- 2026-02-09
- Publication Date
- 2026-06-02
AI Technical Summary
Existing technologies for groundwater level prediction suffer from insufficient accuracy, time-consuming optimization processes that rely on expert experience, and difficulty in adapting to different dataset characteristics. Furthermore, existing hyperheuristic algorithms lack the ability to generate large language models and are not deeply integrated with hyperheuristic search paradigms, resulting in limited generalization ability of prediction results.
A large language model-assisted hyperheuristic optimization method is adopted. An initial population is constructed through a hybrid encoding scheme. Combining metaheuristic algorithms and artificial neural network models, a mutation strategy with dynamic probability adjustment and cross-operation with mutation type constraints are used to achieve automated co-evolution of metaheuristic algorithms and artificial neural network models.
It significantly improves the accuracy, robustness, and adaptability of groundwater level prediction, enhances global search capabilities, reduces reliance on expert experience, and provides an automated groundwater level prediction solution.
Smart Images

Figure CN122132736A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, specifically to a groundwater level prediction method and system based on large language model-assisted hyperheuristic optimization. Background Technology
[0002] Water resources are crucial to human societal development. Groundwater, a key resource supporting ecosystems, agricultural output, and human well-being, faces serious threats to its availability and quality from climate change and human activities. Accurate and consistent prediction of groundwater levels, as an readily available hydrogeological parameter, is the cornerstone of water resource management. Early research primarily monitored groundwater levels using physical and statistical models. While these methods have value, they typically require large amounts of data and significant computational resources, and often adhere to linear assumptions, limiting their effectiveness in capturing complex groundwater dynamics. In recent years, artificial intelligence and machine learning technologies have been widely applied in groundwater level prediction due to their efficiency and flexibility. Artificial neural networks, in particular, have attracted considerable attention due to their powerful nonlinear mapping capabilities. However, the performance of these models is highly dependent on the correct configuration of their internal parameters and structure, and the training process may face challenges such as sensitivity to initial conditions and difficulties in manual hyperparameter tuning.
[0003] To enhance the performance of artificial neural networks, researchers have introduced metaheuristic algorithms into neural network model optimization. Metaheuristic algorithms, as high-level search frameworks, find optimal solutions in complex search spaces by simulating natural or social intelligent behavior. Common algorithms include genetic algorithms, particle swarm optimization, ant colony optimization, and differential evolution. These algorithms are independent of the objective function gradient and possess strong global search capabilities, making them suitable for optimizing key elements of artificial neural networks. However, selecting or designing the most suitable metaheuristic optimizer and fine-tuning its parameters for different groundwater time-series data and neural network architectures is typically a time-consuming and experience-dependent process, making it difficult to guarantee an optimal combination.
[0004] Hyperheuristic algorithms, as higher-level optimization frameworks, have been widely applied to various combinatorial optimization problems. They focus on automatically selecting or generating suitable low-level heuristics for a given problem instance, adapting them to low-level solvers, and managing their execution and composition. The rise of large language models has brought new developments to algorithm optimization; their powerful understanding, representation, and generation capabilities are used to automatically generate or improve optimization algorithms, thereby enhancing the performance of evolutionary algorithms.
[0005] Existing technologies suffer from the following technical problems: Traditional metaheuristic-artificial neural network combination methods have insufficient accuracy in groundwater level prediction, the optimization process relies on expert experience and is time-consuming, and it is difficult to adapt to different dataset characteristics; existing hyperheuristic algorithms have limited application in the field of groundwater level prediction and lack an automated co-evolutionary mechanism that deeply integrates the ability to generate large language models with the hyperheuristic search paradigm; existing methods cannot achieve bidirectional optimization of metaheuristic algorithms and artificial neural network models, and the exploration and utilization balance mechanism is not flexible enough, resulting in unstable convergence performance and limited generalization ability of prediction results. Summary of the Invention
[0006] To address the aforementioned issues, this invention provides a groundwater level prediction method and system based on large language model-assisted hyperheuristic optimization, aiming to improve the accuracy, automation, and generalization ability of groundwater level prediction.
[0007] To achieve the above objectives, the present invention provides the following technical solution:
[0008] On one hand, embodiments of the present invention provide a groundwater level prediction method based on large language model-assisted hyperheuristic optimization, the method comprising the following steps:
[0009] S100 acquires groundwater level datasets, metaheuristic algorithm libraries, artificial neural network model libraries, and trained large language models;
[0010] S200, Construct an initial population and evaluate its fitness value. Each individual in the initial population is represented by a hybrid encoding scheme, which includes a metaheuristic algorithm type, an algorithm description, an algorithm code, a neural network model type, and a fitness value.
[0011] S300, perform iterative evolutionary operations on the initial population until the termination condition is met. In each iteration, perform a mutation operation with dynamic probability adjustment, a crossover operation with mutation type constraints, and an adaptive selection operation based on elite preservation on each individual in the population. The mutation operation includes metaheuristic mutation, neural network mutation, and large language model evolutionary mutation.
[0012] S400, the metaheuristic algorithm code and artificial neural network model configuration contained in the individual with the best fitness value obtained after the iteration terminates are applied to the groundwater level dataset to generate groundwater level prediction results.
[0013] Optionally, in S200, the construction of the initial population and evaluation of fitness values includes:
[0014] S210, randomly select an algorithm type from the metaheuristic algorithm library as the metaheuristic algorithm type, and randomly select a network type from the artificial neural network model library as the neural network model type;
[0015] S220 is the algorithm description and executable code associated with the metaheuristic algorithm type, and the network structure code associated with the neural network model type.
[0016] S230, the executable code is executed to optimize the parameters in the network structure code, and the groundwater level dataset is used to calculate the prediction performance index as the fitness value.
[0017] Optionally, in S300, the step of performing a mutation operation with dynamic probability adjustment, a crossover operation with mutation type constraints, and an adaptive selection operation based on elite preservation on each individual in the population in each iteration includes:
[0018] S310, perform a mutation operation with a first probability. The mutation operation includes three types: metaheuristic mutation that selects different algorithm types from the metaheuristic algorithm library, neural network mutation that selects different network types from the artificial neural network model library, and large language model evolution mutation that generates improved algorithm code by calling the large language model. The selection probability of the three mutation types is dynamically adjusted with the number of iterations.
[0019] S320, perform a crossover operation with a second probability. The type of the crossover operation is constrained by the type of the mutation operation. When the mutation operation type is the metaheuristic mutation or the large language model evolution mutation, only the neural network components are swapped. When the mutation operation type is the neural network mutation, only the metaheuristic algorithm components are swapped.
[0020] S330, evaluate the fitness value of the offspring individuals and perform an adaptive selection operation between the parent individuals and the offspring individuals, the adaptive selection operation determining the individuals to enter the next generation based on the globally optimal fitness value and a probabilistic selection mechanism;
[0021] Optionally, in S310, the dynamic adjustment of the selection probability of the three mutation types with the number of iterations includes:
[0022] S311, when the current iteration number is less than the first proportion interval of the maximum iteration number, the selection probability of the metaheuristic mutation and the neural network mutation is set to a higher value, and the selection probability of the large language model evolution mutation is set to a lower value;
[0023] S312, when the current iteration number is greater than the second proportion interval of the maximum iteration number, reduce the selection probability of the metaheuristic mutation and the neural network mutation, and increase the selection probability of the large language model evolution mutation.
[0024] Optionally, in S310, the evolutionary variations of the large language model include:
[0025] S313, Input the algorithm description and algorithm code of the parent metaheuristic algorithm into the large language model;
[0026] S314, improve the heuristic by performing an improved heuristic through the large language model to improve performance, modify the heuristic parameters, or delete redundant parts to simplify the heuristic operation, and generate an improved algorithm description and executable code as new algorithm components for the offspring individuals.
[0027] Optionally, in S320, the crossover operation includes:
[0028] S321, when the mutation operation type is the metaheuristic mutation or the large language model evolution mutation, keep the metaheuristic algorithm component unchanged, and select neural network components from other individuals for exchange;
[0029] S322, when the mutation operation type is the neural network mutation, keep the neural network components unchanged, and select metaheuristic algorithm components from other individuals for exchange.
[0030] Optionally, in S330, the adaptive selection operation includes:
[0031] S331, when the fitness value of the offspring individual is less than or equal to the global optimal fitness value, the offspring individual is selected to enter the next generation;
[0032] S332, when both the fitness value of the parent individual and the fitness value of the offspring individual are greater than the global optimal fitness value, the selection probability is calculated based on the fitness values of the parent individual and the fitness values of the offspring individual, and the individual entering the next generation is determined according to the selection probability.
[0033] Optionally, in S400, applying the metaheuristic algorithm code and artificial neural network model configuration contained in the individual with the optimal fitness value obtained after iteration termination to the groundwater level dataset includes:
[0034] S410, the groundwater level dataset is divided into a training set and a test set;
[0035] S420, Optimize the configuration parameters of the artificial neural network model in the optimal individual using the metaheuristic algorithm code in the optimal individual;
[0036] S430, the optimized parameter configuration is loaded into the artificial neural network model to predict the test set and generate the groundwater level prediction result.
[0037] On the other hand, embodiments of the present invention provide a groundwater level prediction system assisted by a large language model and employing hyperheuristic optimization, comprising:
[0038] The data acquisition module is used to acquire groundwater level datasets, metaheuristic algorithm libraries, artificial neural network model libraries, and trained large language models.
[0039] The population construction module is used to construct an initial population and evaluate fitness values. Each individual in the initial population is represented by a hybrid encoding scheme, which includes a metaheuristic algorithm type, algorithm description, algorithm code, neural network model type, and fitness value.
[0040] The evolution iteration module is used to perform iterative evolution operations on the initial population until the termination condition is met. In each iteration, the module performs a mutation operation with dynamic probability adjustment, a crossover operation with mutation type constraints, and an adaptive selection operation based on elite preservation on each individual in the population. The mutation operation includes metaheuristic mutation, neural network mutation, and large language model evolution mutation.
[0041] The prediction output module is used to apply the metaheuristic algorithm code and artificial neural network model configuration contained in the individual with the best fitness value obtained after the iteration terminates to the groundwater level dataset to generate groundwater level prediction results.
[0042] Optionally, the evolutionary iteration module includes:
[0043] The mutation operation unit is used to perform the mutation operation with a first probability. The mutation operation includes three types: metaheuristic mutation that selects different algorithm types from the metaheuristic algorithm library, neural network mutation that selects different network types from the artificial neural network model library, and large language model evolution mutation that generates improved algorithm code by calling the large language model. The selection probability of the three mutation types is dynamically adjusted with the number of iterations.
[0044] A crossover operation unit is configured to perform the crossover operation with a second probability. The crossover operation unit determines whether to swap the metaheuristic algorithm component or the neural network component based on the mutation operation type. When the mutation operation type is the metaheuristic mutation or the large language model evolution mutation, only the neural network component is swapped. When the mutation operation type is the neural network mutation, only the metaheuristic algorithm component is swapped.
[0045] The selection operation unit is used to evaluate the fitness value of offspring individuals and perform the adaptive selection operation between parent and offspring individuals.
[0046] On the other hand, embodiments of the present invention provide a groundwater level prediction system assisted by a large language model and employing hyperheuristic optimization, comprising:
[0047] At least one processor;
[0048] At least one memory for storing at least one program;
[0049] When the at least one program is executed by the at least one processor, the at least one processor performs the method described above.
[0050] On the other hand, embodiments of the present invention provide a computer-readable storage medium storing a processor-executable program, which, when executed by a processor, is used to perform the above-described method.
[0051] The beneficial effects of this invention are:
[0052] This invention discloses a groundwater level prediction method and system based on large language model-assisted hyperheuristic optimization. By deeply integrating the generation capability of large language models with the optimization paradigm of hyperheuristic algorithms, it realizes the automated co-evolution of metaheuristic algorithms and artificial neural network models, significantly improving the accuracy, robustness and adaptability of groundwater level prediction.
[0053] Specifically, the LLMHHEA framework constructed in this invention employs a hybrid encoding scheme, unifying the representation of algorithm components and network parameters. Through a mutation strategy with dynamically adjusted probabilities (encompassing metaheuristic mutation, neural network mutation, and large language model evolutionary mutation) and directional cross-operations constrained by mutation type, a unique balance mechanism between exploration and utilization is formed. This mechanism focuses on exploring structural diversity in the early stages of evolution, while introducing innovative mutations driven by the large language model in the later stages, effectively enhancing global search capabilities, enabling the algorithm to escape local optima, and achieving stable convergence performance.
[0054] Experimental results show that the present invention outperforms the traditional metaheuristic-artificial neural network combination method in prediction performance on two independent groundwater level datasets. Specifically, on dataset I, the combination of the improved Kepler optimization algorithm based on the large language model and the adaptive neurofuzzy inference system achieves the best prediction results; on dataset II, the combination of the improved genetic algorithm based on the large language model and the backpropagation network achieves the best performance. These improved algorithms significantly outperform the original version in both generalization ability and prediction accuracy, fully verifying the key role of the large language model as an intelligent generator in the framework.
[0055] Furthermore, this invention balances elite preservation and population diversity through an adaptive selection strategy, avoiding premature convergence and reducing reliance on expert experience, thus providing a new intelligent paradigm for complex optimization and prediction problems. This method not only improves the accuracy of groundwater level prediction but also provides strong technical support and automated solutions for sustainable water resource management. Attached Figure Description
[0056] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0057] Figure 1 This is an overall flowchart of a groundwater level prediction method assisted by a large language model and superheuristic optimization in an embodiment of the present invention.
[0058] Figure 2 This is a representative architecture diagram of the LLMHHEA framework in an embodiment of the present invention;
[0059] Figure 3 This is an overall flowchart of the LLMHHEA algorithm in this embodiment of the invention;
[0060] Figure 4 This is a flowchart of the LLMHHEA algorithm in an embodiment of the present invention;
[0061] Figure 5 These are probability curves for three mutation types in embodiments of the present invention;
[0062] Figure 6 This is a diagram showing the change in groundwater level in an embodiment of the present invention;
[0063] Figure 7 This is a diagram illustrating the optimization process of LLMHHEA on dataset I in this embodiment of the invention;
[0064] Figure 8 This is a graph showing the prediction results of dataset I based on different artificial neural networks in this embodiment of the invention;
[0065] Figure 9 This is a graph showing the test prediction results of dataset I based on different artificial neural networks in an embodiment of the present invention;
[0066] Figure 10 These are the histograms of four indicators in Dataset I based on different artificial neural networks in this embodiment of the invention;
[0067] Figure 11This is a graph showing the prediction results of dataset I trained based on different metaheuristic algorithms in this embodiment of the invention;
[0068] Figure 12 This is a graph showing the prediction results of dataset I based on different metaheuristic algorithms in this embodiment of the invention;
[0069] Figure 13 These are box plots of four metrics for dataset I based on different metaheuristic algorithms in this embodiment of the invention;
[0070] Figure 14 This is a diagram illustrating the optimization process of LLMHHEA on dataset II in this embodiment of the invention.
[0071] Figure 15 This is a graph showing the prediction results of dataset II based on different artificial neural networks in an embodiment of the present invention;
[0072] Figure 16 These are the four index histograms of Dataset II based on different artificial neural networks in this embodiment of the invention;
[0073] Figure 17 This is a graph showing the prediction results of dataset II based on different metaheuristic algorithms in an embodiment of the present invention;
[0074] Figure 18 These are box plots of four indicators for dataset II based on different metaheuristic algorithms in this embodiment of the invention. Detailed Implementation
[0075] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0076] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in sequences other than those illustrated or described herein.
[0077] This invention provides a groundwater level prediction method and system based on large language model-assisted hyperheuristic optimization. By combining the generation capability of large language models with the optimization paradigm of hyperheuristic algorithms, it achieves automated co-evolution of metaheuristic algorithms and artificial neural network models, significantly improving the accuracy and robustness of groundwater level prediction.
[0078] refer to Figure 1 , Figure 1 This is an overall flowchart of a groundwater level prediction method using large language model-assisted hyperheuristic optimization provided by an embodiment of the present invention. The method includes the following steps:
[0079] S100 acquires groundwater level datasets, a metaheuristic algorithm library, an artificial neural network model library, and a trained large language model.
[0080] Specifically, the groundwater level dataset includes historical groundwater level time series data, such as continuous monitoring data obtained from a data platform or regional average groundwater depth data publicly released by government agencies. The metaheuristic algorithm library predefines various standard metaheuristic algorithms, including but not limited to genetic algorithms, particle swarm optimization, ant colony optimization, differential evolution, artificial bee colony optimization, Kepler optimization, and whale optimization. The artificial neural network model library predefines various neural network architectures, including but not limited to backpropagation networks, radial basis function networks, extreme learning machines, adaptive neurofuzzy inference systems, and recurrent neural networks. The trained large language model is a pre-trained language model with code generation capabilities, such as the DeepSeek-R1 version.
[0081] S200, Construct an initial population and evaluate its fitness value. Each individual in the initial population is represented by a hybrid encoding scheme, which includes a metaheuristic algorithm type, an algorithm description, algorithm code, a neural network model type, and a fitness value.
[0082] Specifically, S200 includes the following sub-steps:
[0083] S210, randomly select an algorithm type from the metaheuristic algorithm library as the metaheuristic algorithm type, and randomly select a network type from the artificial neural network model library as the neural network model type;
[0084] S220, is the algorithm description and executable code associated with the metaheuristic algorithm type, and the network structure code associated with the neural network model type, wherein the algorithm description and the executable code can be obtained from a predefined standard library or dynamically generated by the large language model;
[0085] S230, the executable code is executed to optimize the parameters in the network structure code, and the groundwater level dataset is used to calculate the prediction performance index as the fitness value, wherein the prediction performance index uses the root mean square error as the optimization target.
[0086] S300, perform iterative evolution operations on the initial population until the termination condition is met, and perform the following operations on each individual in the population in each iteration:
[0087] S310, perform a mutation operation with a first probability. The mutation operation includes three types: metaheuristic mutation that selects different algorithm types from the metaheuristic algorithm library, neural network mutation that selects different network types from the artificial neural network model library, and large language model evolution mutation that generates improved algorithm code by calling the large language model. The selection probability of the three mutation types is dynamically adjusted with the number of iterations.
[0088] Specifically, the dynamic adjustment mechanism for the selection probability of the three mutation types is as follows:
[0089] Let the current iteration number be t, and the maximum iteration number be Tmax. The selection probability Pm_Meta(t) of the metaheuristic mutation decreases with increasing iteration number, the selection probability Pm_Neural(t) of the neural network mutation decreases with increasing iteration number, and the selection probability Pm_LLMe(t) of the large language model evolution mutation increases with increasing iteration number. In the early stages of evolution, the selection probabilities of the metaheuristic mutation and the neural network mutation are set to higher values to promote structural diversity exploration; in the later stages of evolution, the selection probability of the large language model evolution mutation is set to a higher value to introduce innovative improvement strategies.
[0090] The specific implementation of the evolutionary mutation of the large language model includes:
[0091] S313, Input the algorithm description and algorithm code of the parent metaheuristic algorithm into the large language model;
[0092] S314, the large language model executes one of the following three evolutionary strategies: modifying the heuristic to improve performance, modifying the heuristic parameters, or removing redundant parts to simplify the heuristic, generating an improved algorithm description and executable code as new algorithm components for offspring individuals. The large language model receives input through a predefined prompting engineering structure, which includes five components: task definition, parent heuristic, evolutionary strategy prompts, expected output and format requirements, and robustness and efficiency guidelines.
[0093] S320, perform a crossover operation with a second probability, the type of which is constrained by the mutation operation type.
[0094] Specifically, when the mutation operation occurs, the mutation type Mu_type is recorded, and the crossover operation determines its execution method based on the mutation type Mu_type:
[0095] S321, when the mutation type is the metaheuristic mutation or the large language model evolution mutation, keep the metaheuristic algorithm component unchanged, select the neural network component from other individuals in the population for parameter exchange, and generate offspring individuals;
[0096] S322, when the mutation type is the neural network mutation, keep the neural network components unchanged, select metaheuristic algorithm components from other individuals in the population for parameter exchange, and generate offspring individuals;
[0097] When the mutation operation does not occur, one of the metaheuristic algorithm components or the neural network components is randomly selected for swapping.
[0098] S330, evaluate the fitness value of the offspring individuals and perform an adaptive selection operation between the parent individuals and the offspring individuals. The adaptive selection operation determines the individuals to enter the next generation based on the globally optimal fitness value and a probabilistic selection mechanism.
[0099] Specifically, the adaptive selection operation follows the principle of preserving the best, assuming the global optimal fitness value is gBest, and performs the following judgment:
[0100] S331, when the fitness value of the offspring individual is less than or equal to the global optimal fitness value gBest, the offspring individual is selected to enter the next generation;
[0101] S332, when the fitness value of the offspring individual is less than the fitness value of the parent individual and greater than the global optimal fitness value gBest, calculate the selection probability of the offspring individual. The selection probability is inversely proportional to the fitness value. Determine the individual to enter the next generation according to the selection probability.
[0102] S333, when the fitness value of the parent individual is equal to the global optimal fitness value gBest and the fitness value of the offspring individual is greater than the global optimal fitness value gBest, the parent individual is selected to enter the next generation.
[0103] S400, the metaheuristic algorithm code and artificial neural network model configuration contained in the individual with the best fitness value obtained after the iteration terminates are applied to the groundwater level dataset to generate groundwater level prediction results.
[0104] Specifically, S400 includes the following sub-steps:
[0105] S410, the groundwater level dataset is divided into a training set and a test set, wherein the training set accounts for 70% of the total dataset and the test set accounts for 30% of the total dataset;
[0106] S420, use the metaheuristic algorithm code in the optimal individual to optimize the configuration parameters of the artificial neural network model in the optimal individual. The optimization process executes the search strategy in the metaheuristic algorithm code to find the parameter combination that minimizes the prediction error of the training set in the parameter space.
[0107] S430, the optimized parameter configuration is loaded into the artificial neural network model, the test set is predicted, and the groundwater level prediction result is generated. The prediction result is used to evaluate the generalization performance of the model.
[0108] refer to Figure 2 , Figure 2 This is a representative architecture diagram of the LLMHHEA framework in this embodiment of the invention; where ANN represents Artificial Neural Network, PSO represents Particle Swarm Optimization, ACO represents Ant Colony Optimization, ELM represents Extreme Learning Machine, BP represents Back Propagation, GA represents Genetic Algorithm, KOA represents Knowledge Optimization Algorithm, RNN represents Recurrent Neural Network, ANFI represents Adaptive Neuro-Fuzzy Inference System, and EA represents Evolutionary Algorithm.
[0109] The LLMHHEA framework comprises two layers: high-level components and low-level components. The high-level components serve as the overall strategy to guide the generation or selection of low-level heuristics, while the low-level components are defined by the actual low-level heuristics and are implemented directly on problem instances to build or modify solutions.
[0110] refer to Figure 3The LLMHHEA framework implements the co-evolution of metaheuristic algorithms and artificial neural networks for groundwater level prediction tasks. The core difference from traditional evolutionary algorithms lies in LLMHHEA's innovative introduction of a large language model and a hyperheuristic algorithm architecture. Under the dual guidance of the evolutionary algorithm EA and the metaheuristic algorithm LLM, it achieves bidirectional optimization of the metaheuristic and neural network models. This method differs fundamentally from classical evolutionary algorithms in key mutation, crossover, and selection operations: population initialization constructs heterogeneous algorithm-network combinations through random sampling; the co-evolution process employs three mutation strategies and a directional constraint crossover mechanism to achieve population structure recombination; and the selection module balances elite preservation and exploration potential through an adaptive strategy.
[0111] refer to Figure 4 , Figure 4 This is a flowchart of the LLMHHEA algorithm in an embodiment of the present invention. The flowchart clearly illustrates the complete process of population initialization, iterative evolution, mutation operation, crossover operation, selection operation, and termination judgment.
[0112] Individual representation and population initialization:
[0113] In the LLMHHEA framework, an individual in the evolutionary algorithm is not a single solution vector, but rather consists of two key parts: a metaheuristic algorithm and a neural network. Each evolutionary individual employs a hybrid encoding scheme, collectively representing the optimization strategy and model architecture for the groundwater level prediction task. An individual consists of the following five groups:
[0114] ;
[0115] Among them, LLH_type represents the type of metaheuristic algorithm, selected from a predefined low-level metaheuristic algorithm library, such as PSO, KOA, etc.; LLH_idea describes the idea of the algorithm, briefly summarizing the core principles; LLH_code represents the executable code segment of the metaheuristic algorithm optimization process; ANN_type represents the type of neural network model, selected from a predefined low-level neural network library, such as RBF, ANFIS, etc.; Fitness represents the fitness value, corresponding to the performance evaluation result of the combined algorithm and neural network on the prediction task. The advantage of this hybrid encoding scheme is that it can simultaneously optimize the search strategy (metaheuristic algorithm) and model structure (neural network), thereby significantly enhancing the algorithm's global search capability and adaptability to specific problems. Table 1 summarizes the specific details and sources of these components.
[0116] Table 1: LLMHEA Individual Coding Scheme
[0117]
[0118] During population initialization, the algorithm randomly creates an initial population of size N. For each individual, LLH_type and ANN_type are randomly selected from the corresponding low-level library. The underlying metaheuristic library pre-provides the conceptual descriptions and executable code of standard algorithms, while the neural network library provides the network type and its corresponding code implementation. During the evolution of an individual, if LLH_type is one of the initial predefined algorithms, its standard description and code are automatically associated; if it is an improved algorithm generated by a large language model, LLM dynamically generates LLH_idea and LLH_code. Subsequently, the parameters of the corresponding network are optimized using the individual's LLH_code, and the predicted performance is calculated based on the dataset and converted into fitness values. This initialization process ensures the diversity of the initial population, laying a solid foundation for subsequent evolutionary operations.
[0119] Mutation and crossover co-evolutionary mechanisms:
[0120] In each generation of LLMHHEA's evolution, each individual in the population undergoes mutation and crossover operations sequentially. Unlike traditional evolutionary algorithms, this paper introduces a co-evolutionary mechanism during the mutation and crossover stages, employing a dynamic probability adjustment strategy to select mutation types, thus enhancing the diversity and rationality of evolution. For the current individual, the probability of mutation is Pm (mutation probability). Mutation operations are divided into three types, described below:
[0121] Metaheuristic mutation: Randomly select a new algorithm type LLH_type from the underlying algorithm library that is different from the current type, and update the corresponding algorithm description (LLH_idea) and executable code (LLH_code).
[0122] Neural Mutation: Randomly selects a new neural network type (ANN_type) from the low-level neural network library that is different from the current type.
[0123] LLM Evolutionary Mutation (LLMe): By accessing large language model APIs, it generates improved metaheuristic algorithms using pre-designed hint engineering and evolutionary strategies, thereby updating the algorithm's description and implementation code.
[0124] In the mutation process, a dynamic probability adjustment mechanism is used to select the mutation type. The probability of each of the three mutation types being selected is not fixed, but dynamically adjusted as evolution progresses.
[0125] The specific probability calculation formula is as follows:
[0126] ;
[0127] ;
[0128] ;
[0129] ;
[0130] Where Tmax is the maximum number of iterations, t is the current iteration number, and decay_factor is a perturbation factor used to control the rate of probability change. For metaheuristic mutation probability, Represents the mutation probability of a neural network. This refers to the evolutionary mutation probability of a large language model. In the early stages of evolution, metaheuristic mutations and neural network mutations have higher probabilities, prompting the algorithm to explore different combinations of algorithms and networks to increase population diversity. As evolution progresses, their probabilities gradually decrease. In contrast, the probability of LLM evolutionary mutations is lower in the early stages of evolution, but gradually increases with the number of iterations. This invention aims to introduce more innovative and complex mutations as the algorithm develops, enhancing global search capabilities and enabling the algorithm to escape local optima.
[0131] refer to Figure 5 , Figure 5 This is a probability curve diagram of the three mutation types in this embodiment of the invention. The horizontal axis represents the number of iterations, and the vertical axis represents the probability value. The curves show the changing trends of the selection probability of the metaheuristic mutation, the neural network mutation, and the large language model evolution mutation with the number of iterations. Through the above dynamic probability adjustment mechanism, the algorithm can focus on exploring structural diversity in the early stages of evolution, while introducing more innovative mutations in the later stages, thereby improving the overall optimization performance and global search capability. The type of mutation operation is recorded to constrain subsequent crossover operations.
[0132] After the mutation operation is completed, a random value and Pc (crossover probability) are used to determine whether to perform crossover. To ensure the effectiveness of evolution, the crossover method is constrained by the mutation type that occurred in the previous step. This invention uses Mu_type to record the mutation type:
[0133] If the mutation type is Meta or LLMe, then only the neural network type crossover is allowed, that is, only the neural network structure is swapped, while the metaheuristic algorithm part remains unchanged.
[0134] If the mutation type is Neural, then only metaheuristic algorithm type crossover is allowed, that is, only the metaheuristic algorithm part is swapped, and the neural network structure remains unchanged.
[0135] If no mutation occurs, a crossover method is randomly selected between the two types.
[0136] During the crossover operation, another individual is randomly selected from the existing individuals as the crossover target. Then, parameters are swapped according to the constraints described above to generate offspring.
[0137] Mutation operations introduce new features through three types of exploratory mutations, expanding the global search space; crossover operations perform targeted feature inheritance based on mutation type, achieving local optimization and fusion of advantageous features. This synergistic effect forms a dynamic balance mechanism between exploration and development: mutation achieves breakthrough exploration through heterogeneous substitution or LLM-driven creation, while crossover achieves refined development through feature combination.
[0138] Select operation:
[0139] During each generation of evolution, the algorithm employs an adaptive selection strategy based on the principle of elite preservation, selecting superior individuals from the parent population and newly generated offspring populations to enter the next generation. This selection strategy is guided by the relationship between an individual's fitness value and the global optimum (gBest), and is divided into the following two main scenarios:
[0140] Elite preservation (gBest constraint): Elite preservation is triggered when the fitness of offspring or parents is less than or equal to gBest. When the fitness of the parents is not less than gBest, there are three possibilities:
[0141] Offspring superior to gBest: If the fitness of an individual offspring is lower than that of gBest, it indicates superior performance. This offspring is directly passed on to the next generation, ensuring the continuous improvement of population quality.
[0142] If the fitness of a parent or offspring is equal to gBest, and the fitness of another individual is greater than gBest, then the individual with fitness equal to gBest is selected. This preserves the existence of the current optimal solution in the population.
[0143] If both the parent and offspring have fitness equal to gBest, then one is randomly selected to be retained. This random selection mechanism introduces a degree of diversity, which helps the algorithm explore better solutions during subsequent evolution.
[0144] Probabilistic selection: When the fitness values of both the parent and offspring individuals are greater than gBest, a probabilistic selection mechanism is employed. The selection probability is calculated based on the individual's fitness value; the higher the fitness, the higher the selection probability. This method allows the algorithm to propagate the characteristics of high-quality individuals while preserving some diversity, thus preventing premature convergence to local optima.
[0145] This selection strategy fully leverages gBest's guidance, prioritizing the retention of high-quality individuals to ensure an overall increase in population. Simultaneously, the probabilistic selection mechanism is crucial for maintaining population diversity, enabling the algorithm to maintain a dynamic balance between exploration and development, thus enhancing its global search capability and convergence stability.
[0146] The technical effects of this invention are illustrated below with specific experimental data:
[0147] The experiment used two independent groundwater level datasets for validation. Dataset I was obtained from the Kaggle data mining and prediction competition platform, and 1656 consecutive days of data were extracted as the experimental sample. Dataset II was publicly released by a local government agency, recording the average groundwater depth in a plain area, and a total of 176 data points were collected. Both datasets were split into 70% training set and 30% test set.
[0148] The experimental environment was the Cursor code editor, running on Python 3.9.21, and the DeepSeek-R1 version of the large language model was used for algorithm evolution. The artificial neural network model library included Extreme Learning Machine, Backpropagation Network, Radial Basis Function Network, Adaptive Neural Fuzzy Inference System, and Recurrent Neural Network. The metaheuristic algorithm library included Genetic Algorithm, Particle Swarm Optimization Algorithm, Ant Colony Optimization Algorithm, Differential Evolution Algorithm, Artificial Bee Colony Algorithm, Kepler Optimization Algorithm, and Whale Optimization Algorithm.
[0149] refer to Figure 6 , Figure 6 This is a groundwater level change diagram in an embodiment of the present invention, showing the trend of groundwater level change over time in datasets I and II; the horizontal axis represents time, and the vertical axis represents groundwater level.
[0150] refer to Figure 7 , Figure 7 This is a diagram illustrating the optimization process of LLMHHEA on dataset I in this embodiment of the invention. The diagram shows that the fitness value gradually decreases from the initial value of 0.27066 to 0.05633, indicating that the LLMHHEA framework successfully converged to a relatively optimal solution. The final optimal combination determined is the improved Kepler optimization algorithm based on the large language model and the adaptive neurofuzzy inference system.
[0151] refer to Figure 8 and Figure 9 , Figure 8 and Figure 9 These are the training and testing prediction results for dataset I based on different artificial neural networks, demonstrating the prediction performance of different neural network models combined with the improved Kepler optimization algorithm.
[0152] refer to Figure 10 , Figure 10In this embodiment of the invention, Dataset I is based on four index histograms of different artificial neural networks, comparing model performance from four dimensions: root mean square error, mean square error, mean absolute percentage error, and mean absolute error.
[0153] refer to Figure 11 and Figure 12 , Figure 11 and Figure 12 These are the training and testing prediction results for dataset I based on different metaheuristic algorithms, demonstrating the prediction performance of combining different metaheuristic algorithms with the adaptive neurofuzzy inference system.
[0154] refer to Figure 13 , Figure 13 The dataset I in this embodiment of the invention consists of four index box plots based on different metaheuristic algorithms. These plots verify that the improved Kepler optimization algorithm has the lowest mean, shortest box, and narrowest whisker distribution during the testing phase, indicating that it has stable convergence and good reproducibility.
[0155] refer to Figure 14 , Figure 14 This is a diagram illustrating the optimization process of LLMHHEA on dataset II in this embodiment of the invention. The diagram shows that the fitness value gradually converges from the initial value of 1.33534 to 0.41375, and the final optimal combination is the improved genetic algorithm of the large language model and the backpropagation network.
[0156] refer to Figure 15 , Figure 15 This is a graph showing the prediction results of dataset II based on different artificial neural networks in this embodiment of the invention, demonstrating the prediction effect of combining different neural network models with the improved genetic algorithm.
[0157] refer to Figure 16 , Figure 16 In this embodiment of the invention, Dataset II uses four index histograms based on different artificial neural networks to compare the performance differences of various model combinations.
[0158] refer to Figure 17 , Figure 17 This is a graph showing the prediction results of dataset II based on different metaheuristic algorithms in this embodiment of the invention, demonstrating the prediction effect of combining different metaheuristic algorithms with the backpropagation network.
[0159] refer to Figure 18 , Figure 18 The dataset II in this embodiment of the invention consists of four indicator box plots based on different metaheuristic algorithms, which verify that the improved genetic algorithm has the lowest mean, the shortest box, and the narrowest whisker distribution.
[0160] This invention also provides a groundwater level prediction system based on large language model-assisted hyperheuristic optimization, comprising:
[0161] At least one processor;
[0162] At least one memory for storing at least one program;
[0163] When the at least one program is executed by the at least one processor, the at least one processor performs the method described above.
[0164] The content of the above method embodiments is applicable to this embodiment. The specific functions implemented in this embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments. Therefore, they will not be repeated here.
[0165] This invention also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described above. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0166] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0167] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0168] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0169] This invention also provides a computer program product, including a computer program or computer instructions, which are stored in a memory. A processor of a computer device reads the computer program or computer instructions from the memory and executes the computer program or computer instructions, causing the computer device to perform the above-described method.
[0170] It is understood that the content of the above method embodiments is applicable to the embodiments of this program product. The specific functions implemented by the embodiments of this program product are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0171] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0172] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically include computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0173] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
Claims
1. A groundwater level prediction method assisted by a large language model using hyperheuristic optimization, characterized in that, The method includes the following steps: S100 acquires groundwater level datasets, metaheuristic algorithm libraries, artificial neural network model libraries, and trained large language models; S200, Construct an initial population and evaluate its fitness value. Each individual in the initial population is represented by a hybrid encoding scheme, which includes a metaheuristic algorithm type, an algorithm description, an algorithm code, a neural network model type, and a fitness value. S300, perform iterative evolutionary operations on the initial population until the termination condition is met. In each iteration, perform a mutation operation with dynamic probability adjustment, a crossover operation with mutation type constraints, and an adaptive selection operation based on elite preservation on each individual in the population. The mutation operation includes metaheuristic mutation, neural network mutation, and large language model evolutionary mutation. S400, the metaheuristic algorithm code and artificial neural network model configuration contained in the individual with the best fitness value obtained after the iteration terminates are applied to the groundwater level dataset to generate groundwater level prediction results.
2. The method according to claim 1, characterized in that, In S200, the construction of the initial population and evaluation of fitness values includes: S210, randomly select an algorithm type from the metaheuristic algorithm library as the metaheuristic algorithm type, and randomly select a network type from the artificial neural network model library as the neural network model type; S220 is the algorithm description and executable code associated with the metaheuristic algorithm type, and the network structure code associated with the neural network model type. S230, the executable code is executed to optimize the parameters in the network structure code, and the groundwater level dataset is used to calculate the prediction performance index as the fitness value.
3. The method according to claim 1, characterized in that, In S300, the step of performing a mutation operation with dynamic probability adjustment, a crossover operation with mutation type constraints, and an adaptive selection operation based on elite preservation on each individual in the population in each iteration includes: S310, perform a mutation operation with a first probability. The mutation operation includes three types: metaheuristic mutation that selects different algorithm types from the metaheuristic algorithm library, neural network mutation that selects different network types from the artificial neural network model library, and large language model evolution mutation that generates improved algorithm code by calling the large language model. The selection probability of the three mutation types is dynamically adjusted with the number of iterations. S320, perform a crossover operation with a second probability. The type of the crossover operation is constrained by the type of the mutation operation. When the mutation operation type is the metaheuristic mutation or the large language model evolution mutation, only the neural network components are swapped. When the mutation operation type is the neural network mutation, only the metaheuristic algorithm components are swapped. S330, evaluate the fitness value of the offspring individuals and perform an adaptive selection operation between the parent individuals and the offspring individuals. The adaptive selection operation determines the individuals to enter the next generation based on the globally optimal fitness value and a probabilistic selection mechanism.
4. The method according to claim 3, characterized in that, In S310, the selection probability of the three mutation types is dynamically adjusted with the number of iterations, including: S311, when the current iteration number is less than the first proportion interval of the maximum iteration number, the selection probability of the metaheuristic mutation and the neural network mutation is set to a higher value, and the selection probability of the large language model evolution mutation is set to a lower value; S312, when the current iteration number is greater than the second proportion interval of the maximum iteration number, reduce the selection probability of the metaheuristic mutation and the neural network mutation, and increase the selection probability of the large language model evolution mutation.
5. The method according to claim 3, characterized in that, In S310, the evolutionary variations of the large language model include: S313, Input the algorithm description and algorithm code of the parent metaheuristic algorithm into the large language model; S314, improve the heuristic by performing an improved heuristic through the large language model to improve performance, modify the heuristic parameters, or delete redundant parts to simplify the heuristic operation, and generate an improved algorithm description and executable code as new algorithm components for the offspring individuals.
6. The method according to claim 3, characterized in that, In S320, the crossover operation includes: S321, when the mutation operation type is the metaheuristic mutation or the large language model evolution mutation, keep the metaheuristic algorithm component unchanged, and select neural network components from other individuals for exchange; S322, when the mutation operation type is the neural network mutation, keep the neural network components unchanged, and select metaheuristic algorithm components from other individuals for exchange.
7. The method according to claim 3, characterized in that, In S330, the adaptive selection operation includes: S331, when the fitness value of the offspring individual is less than or equal to the global optimal fitness value, the offspring individual is selected to enter the next generation; S332, when both the fitness value of the parent individual and the fitness value of the offspring individual are greater than the global optimal fitness value, the selection probability is calculated based on the fitness values of the parent individual and the fitness values of the offspring individual, and the individual entering the next generation is determined according to the selection probability.
8. The method according to claim 1, characterized in that, In S400, the step of applying the metaheuristic algorithm code and artificial neural network model configuration contained in the individual with the optimal fitness value obtained after iteration termination to the groundwater level dataset includes: S410, the groundwater level dataset is divided into a training set and a test set; S420, Optimize the configuration parameters of the artificial neural network model in the optimal individual using the metaheuristic algorithm code in the optimal individual; S430, the optimized parameter configuration is loaded into the artificial neural network model to predict the test set and generate the groundwater level prediction result.
9. A groundwater level prediction system assisted by a large language model using hyperheuristic optimization, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor performs the method as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method of any one of claims 1 to 8.