Feature Selection Method and System for Water Quality Abnormality Detection Based on Improved Pigeon Flock Optimization Algorithm
By introducing adaptive iterative maps and compass factors into the pigeon flock optimization algorithm, optimizing pigeon mutation process and altruistic mechanism, the problem of local dilemma and low convergence accuracy in water quality abnormality detection is solved, and more efficient feature selection and water quality detection are achieved.
Patent Information
- Application Number
- CN202510168242.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-17
- Publication Date
- 2025-06-03
- Estimated Expiration
- 2045-02-17
AI Technical Summary
Traditional pigeon flock optimization algorithms are prone to local difficulties in the search space, with low convergence accuracy, and it is difficult to quickly find the optimal solution to the detection characteristics of water quality anomalies.
Adaptive iterative maps and compass factors are introduced to optimize the pigeon mutation process, and promote the information interaction and collaboration of pigeon flocks through altruistic mechanisms to improve the convergence efficiency of the algorithm.
It significantly improves the convergence efficiency of the algorithm, reduces the calculation time required to achieve the global optimal solution, enhances the possibility of discovering the global optimal feature subset, and improves the accuracy and efficiency of water quality anomaly detection.
Smart Images

Figure CN119669716B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method and system for feature selection of water quality anomaly detection based on an improved pigeon flock optimization algorithm, belonging to the field of machine learning. Background Art
[0002] Water quality detection in water purification plants is a key link to ensure the safety of drinking water, aiming to comprehensively monitor and analyze various indicators of source water, treated water, and water leaving the plant through scientific methods. Conventional detection indicators include turbidity, pH value, residual chlorine, total hardness, total nitrogen, total phosphorus, etc. These parameters directly affect the water quality and treatment effect. Through water quality detection, water pollution sources and potential problems in the treatment process can be discovered in a timely manner, ensuring the effectiveness of the water treatment process and the water quality meeting the national drinking water standards. In addition, the application of modern water quality detection technologies, such as on-line monitoring equipment and automated control systems, further improves the real-time performance and accuracy of water quality detection, provides a scientific basis for the water plant, optimizes the water treatment process, and ultimately ensures the health and safety of the public.
[0003] With the progress and development of the times, the field of MLOps (Machine Learning Operations) has emerged, aiming to simplify the entire ML life cycle. The concept of MLOps comes from the DevOps (Development Operations) practice in software development and has gradually evolved into a set of systems and processes specifically used to manage and operate machine learning projects in the field of machine learning. However, currently in the era of information explosion, data shows an unprecedented growth trend. MLOps faces the challenge of processing massive and diverse data, which not only comes from a wide range of sources but also has various forms, including structured data and semi-structured data. At the same time, after analyzing multi-source heterogeneous data, it is found that although there are many data features, there are also a large number of redundant and ineffective features. Removing redundant features and achieving dimensionality reduction for multi-source heterogeneous data can effectively reduce the time cost of MLOps, accelerate the data flow speed of MLOps, and improve the accuracy of machine learning.
[0004] Feature selection is one of the key steps in achieving efficient MLOps. Feature selection aims to select the most relevant and informative subset of features from the original dataset to reduce the complexity of the model, improve the generalization ability of the model, and reduce the risk of overfitting. The methods of feature selection are mainly divided into the following categories: 1. Filter methods: Conducted before feature selection, without considering the performance of the model, and based on statistical tests to evaluate the importance of features. 2. Wrapper methods: Regard the feature selection process as a search problem, evaluate the performance of the model through different subsets of features, and use the performance of the model as a guide to select features. 3. Embedding methods: Conduct feature selection during the model training process, and the model selection process and the feature selection process are integrated. 4. Hybrid methods: Combine the characteristics of filter methods and wrapper methods, first use filter methods to reduce the feature space, and then use wrapper methods for more detailed feature selection.
[0005] Swarm Intelligence (SI) algorithms are a class of heuristic optimization algorithms that simulate the collective behavior of biological groups in nature. They solve complex optimization problems by simulating the collective behavior of simple individuals. The core of swarm intelligence algorithms lies in simulating the self-organization behavior of biological groups. These algorithms usually do not require centralized control, but rely on local interactions between simple individuals to achieve the solution of complex tasks. These algorithms combine prior information and posterior information. Altruism means showing selfless concern for the well-being of others. Humans and some animals sometimes show altruistic behavior towards their family members or friends, which gives other members the opportunity to survive or improve their survival ability.
[0006] The Pigeon-Inspired Optimization (PIO) algorithm is a newly developed bionic swarm intelligence algorithm. Pigeons have the ability to fly long distances to find food, which benefits from their special homing behavior. When pigeons are far from the nest, they reach the nest with the help of the geomagnetic field and landmark buildings. During the flight, pigeons use different cruising tools according to different situations. First, they use the geomagnetic field to identify a general direction, and then use the landform to correct the current direction until they reach the precise destination. Therefore, the pigeon homing in the PIO algorithm consists of two basic parts: the compass operator and the landmark operator. When pigeons are far from their destination, they use the geomagnetic field to identify the direction, and when they are closer to the destination, they use local landmarks for navigation. In the PIO, the map and pointer operator model is proposed based on the geomagnetic field and the sun, while the landmark operator model is proposed based on landmarks.
[0007] The traditional pigeon flock algorithm is prone to lingering around a sub-optimal solution, which means it has a relatively high probability of getting trapped in a local dilemma in a specific area of the search space. At the same time, the traditional pigeon flock algorithm faces the problem of low convergence accuracy, which means it may not be able to reach a very precise feature optimal solution. By introducing a binary process, the problem of low accuracy can be effectively solved, but the binary process limits the effectiveness of the landmark operator. The working principle of the landmark operator is to calculate the position of the ideal pigeon destination as the average of the positions of pigeons with high fitness. Therefore, the probability of generating a new and better solution from the average of the binary vectors is reduced, affecting the convergence rate and prolonging the time to reach the feature optimal solution. Therefore, to address the above challenges, it is necessary to improve the traditional pigeon flock algorithm, set an adaptive iteration factor, and make full use of the map and compass factors; optimize the pigeon mutation process to increase the probability of generating better solutions, thereby improving the algorithm convergence rate and obtaining the optimal feature set. Summary of the Invention
[0008] Aiming at the deficiencies of the prior art, the present invention provides a method and system for water quality anomaly detection feature selection based on an improved pigeon flock optimization algorithm, introducing an adaptive iteration map and compass factor. The adaptive iteration map and compass factor can enable the pigeon flock algorithm to ensure sufficient coverage of the solution space through more diverse area exploration at the initial stage of the search. As the iteration progresses, the particles gradually converge to the optimal solution, thereby realizing the development and optimization of the solution space. At the same time, an altruistic mutation mechanism is introduced to enable information interaction and cooperation among pigeon individuals, promoting the co-evolution of the group. Finally, in the iteration process, by identifying individuals with lower fitness and performing mutation operations on them, the search ability is further optimized.
[0009] The present invention first preprocesses the water treatment plant data so that it can be used as a data source by this method. This method defines a fitness function to evaluate the quality of the feature subset, and realizes the global search and optimization of the solution space by simulating the update of the position and speed of the pigeon flock in the search space. An adaptive iteration map and compass factor are set. Through the adaptive iteration map and compass factor, the possibility of the population lingering around a sub-optimal solution is reduced, and the problem of getting trapped in a local dilemma in a specific area of the search space is reduced. Introducing the adaptive iteration map and compass factor can also adjust the balance between exploration and optimization when searching for the global optimal solution. At the same time, an altruistic mechanism is introduced to enable information interaction and cooperation among pigeon individuals, promoting the co-evolution of the group. In the iteration process, by identifying individuals with lower fitness and performing mutation operations on them, the search ability is further optimized. This mechanism not only improves the average fitness of the group as a whole, but also increases the possibility of discovering the global optimal feature subset. In addition, this method significantly improves the convergence efficiency of the algorithm, reduces the computing time required to reach the global optimal solution, and has good theoretical value and practical application potential.
[0010] The technical solution of the present invention is as follows:
[0011] In the first aspect of the present invention, a method for feature selection of water quality anomaly detection based on an improved pigeon flock optimization algorithm is provided, including:
[0012] Step 1: Preprocess the data of the water purification plant;
[0013] Step 2: Evaluate the current iteration condition. The current iteration condition is the maximum number of iterations. If the condition is met, execute Step 3; otherwise, execute Step 6;
[0014] Step 3: Execute the improved pigeon flock algorithm and evaluate the fitness of the pigeon flock;
[0015] Step 4: Assign the position and speed of the pigeon with the lowest fitness to the globally optimal pigeon; execute Step 5 and Step 6;
[0016] Step 5: Update the speed value of the pigeon, convert the pigeon speed using the Sigmoid function, and then update the pigeon position according to the output value of the Sigmoid function; return to Step 2;
[0017] Step 6: When the iteration stop condition is reached, return the globally optimal pigeon; otherwise, mutate the pigeon flock to make the pigeon flock converge to its optimal solution, and then use it to obtain greater advantages; update the position and speed through altruism; rank the mutated pigeons according to the fitness value, calculate the ideal destination, and update the pigeon flock position; return to Step 3.
[0018] Preferably according to the present invention, preprocessing the data of the water purification plant includes:
[0019] The data of the water purification plant includes: 01 equipment power water pressure status, 02 equipment power water pressure status, 03 equipment power water pressure status (01, 02, and 03 respectively represent the pressures of the monitoring equipment water supply systems in different regions to ensure that the water pressure is within the normal range and avoid affecting the equipment operation due to too high or too low water pressure), the dosing status of sodium bisulfate compound (monitoring the dosing of sodium bisulfate for adjusting the pH value of water), the lack of sodium bisulfate medicine alarm status (sending an alarm when the medicine is insufficient to remind timely replenishment), the dosing status of chlorate compound (monitoring the dosing of chlorate for disinfection or oxidation treatment), the lack of chlorate medicine alarm status (sending an alarm when the medicine is insufficient), the generator operation status (monitoring the operation of the dosing equipment or disinfection equipment), the total amount of compound dosing (the total amount of multiple medicines mixed and dosed), the manual dosing amount (the dosing amount manually operated), and the flow-based dosing amount (the dosing amount automatically adjusted according to the influent flow);
[0020] Data conversion: Convert all symbolic data in the water purification plant data into numerical data, and convert the input values of the data columns into binary form, where "0" represents normal records and "1" represents abnormal records, so as to unify the feature expression form. For example, for the switch composite chlorate dosing status, on means normal use represented by "0", and off means abnormal use represented by "1".
[0021] Duplicate removal: Delete duplicate records in the water purification plant data; to prevent the classifier from being biased towards frequently occurring records during training, improve its learning ability for uncommon records, and ensure the adaptability of the classifier to diverse data.
[0022] Data normalization: Perform normalization on the water purification plant data. Use the difference between the maximum value and the minimum value in the dataset as the denominator, and the difference between the current data value and the minimum value as the numerator. Through fractional operations, obtain the normalized result, eliminate the bias of features with large values in the dataset, convert or scale each feature value into normalized data within a certain proportional range, achieve data balance, and ensure the accuracy of classifier training.
[0023] According to the preference of the present invention, execute the improved pigeon flock algorithm to evaluate the fitness of the pigeon flock; including:
[0024] Use the preprocessed water purification plant data as the dataset, and divide the dataset into a training set and a test set.
[0025] Select the classifier as a model based on the decision tree algorithm; the decision tree classification algorithm is a supervised learning method based on a tree structure, used to divide data into different categories. It is the application of the decision tree algorithm in classification tasks. By learning the relationship between input features and class labels, a series of decision rules are generated to achieve the classification of new samples and perform data classification and prediction.
[0026] Use the selected feature subset to train the model based on the decision tree algorithm; use the improved pigeon flock algorithm to perform feature selection on the dataset. The dataset after feature selection is the feature subset; judge each piece of data in the dataset to determine whether it is water quality abnormal.
[0027] Use the test set to verify the model based on the decision tree algorithm.
[0028] Use the verified model based on the decision tree algorithm to evaluate each pigeon in the pigeon flock; each pigeon represents a potential feature subset, and its fitness is determined by the fitness function (Equation (1)); the fitness function is as follows:
[0029] (1)
[0030] where Fitness represents the fitness value, W1 The weight parameter W representing the ratio of the number of selected features to the number of features in the dataset 2 The weight parameter W representing the false positive rate 3 The weight parameter representing the reciprocal of the correct rate, and w 1 + w 2 + w 3 = 1, TPR and FPR are equally important for the Fitness value, so the weight value is set to w 1 = 0.1, w 2 = w 3 = 0.45, SF represents the number of selected features, NF represents the number of features in the dataset, FPR represents the false positive rate, and TPR represents the correct rate
[0031] According to the preference of the present invention, the position and speed of the pigeon with the lowest fitness are assigned to the global optimal pigeon; including:
[0032] Through the global optimal search function, that is, searching for the pigeon with the lowest fitness according to the number of pigeon populations, locating the pigeon (Xp) with the lowest fitness value. Once the pigeon with the lowest fitness (Xp) is identified, the position and speed of the pigeon with the lowest fitness are assigned to the global optimal pigeon (Xg). The global optimal pigeon is the pigeon closest to the destination in the pigeon flock, that is, the pigeon with the lowest fitness value;
[0033] The remaining pigeons adjust their search strategies, that is, adjusting the search for the destination using the adaptive iterative map and compass factor to searching for the destination using the landmark factor to follow the global optimal pigeon;
[0034] According to the preference of the present invention, update the speed value of the pigeon, and convert the pigeon speed using the Sigmoid function, and then update the pigeon position according to the output value of the Sigmoid function; including:
[0035] Update Rt through formula (2), and update the speed value of the pigeon through formula (3). The formulas are shown as follows:
[0036]
[0037]
[0038]
[0039]
[0040]
[0041] (2)
[0042] (3)
[0043] Among them, dP represents the change rate of the pigeon flock, P represents the pigeon flock, and P e represents the final state of the pigeon flock, and P i represents the current iterative state of the pigeon flock, and t e represents the total number of iterations of the pigeon flock, and t i represents the current iteration number of the pigeon flock, c is the introduced constant, Rt is the adaptive iterative map and compass factor, rand is a uniform random number within the range of [0,1], and X g represents the position of the globally optimal pigeon individual, and X i (t) represents the current position of the pigeon at the t-th iteration, and V i (t) represents the current speed of the pigeon at the t-th iteration; V i (t + 1) represents the current speed of the pigeon at the (t + 1)-th iteration;
[0044] Using the Sigmoid function (Equation (4)), the speed value of each pigeon is mapped to a new value range, and the position of each pigeon is updated according to the output value of the Sigmoid function and the judgment of the uniformly random number generated within the interval [0,1] (Equation (5)), as follows:
[0045] (4)
[0046] (5)
[0047] Among them, V i (t) is the pigeon speed at the t-th iteration, r is the uniform random number, and X(t) (i,P) [i] is the updated position of the pigeon.
[0048] According to the preference of the present invention, mutate the pigeon flock to make the pigeon flock converge to its optimal solution, and then use it to obtain greater advantages; update the position and speed through altruism; rank the pigeons after mutation according to the fitness value, calculate the ideal destination, and update the position of the pigeon flock; including:
[0049] First, evaluate the fitness value of each pigeon in the previous iteration, that is, compare the magnitudes of the fitness values, and accordingly sort all the obtained fitness values from smallest to largest. If the fitness value is low (the lower the fitness value, the better), retain the elite pigeons (such as the top k%). Elite pigeons refer to the pigeons with the top k% of fitness values after the fitness sorting. Let them converge to the optimal solution (converging to the optimal solution means not performing any processing and flying towards the destination using the original speed and position); for the remaining pigeons, allow the pigeons ranked in the first half, that is, the better pigeons, to exhibit altruistic behavior in pairs with the pigeons in the second half, that is, the weaker pigeons. That is, assign the positions and speeds of the pigeons ranked in the first half (better) to the pigeons in the second half (weaker).
[0050] To selectively perform this task, set a random value. If the random value is greater than P and less than P + γ, the probability of a specific pigeon being selected is within the range (p, p + γ). A specific pigeon refers to the pigeon that will be mutated; where γ is the interval value of the mutation performed, and p is the starting value.
[0051] Once the entire process is completed, that is, the positions and speeds of the weaker pigeons are assigned by the positions and speeds of the better pigeons, and the speeds and positions of the better pigeons are assigned according to Equations (4) and (5). These weaker pigeons reset the pigeon flock through altruism. That is, after the better pigeons assign their speeds and positions to the weaker pigeons, the speeds of the better pigeons are mutated according to Equation (6), and the positions are mutated according to Equation (7) to obtain a potentially better fitness.
[0052] Among them, the speed and position update mechanism of the weaker pigeons, that is, a part of the pigeons with the lowest fitness values, is based on the state of their corresponding better pigeons, that is, a part of the pigeons with the higher fitness values selected after excluding the elite pigeons from the fitness values. Finally, through the implementation of the above mechanism, the entire altruistic mutation process is completed, as shown in the following formula:
[0053] (6)
[0054] (7)
[0055] Among them, v good_idx represents the speed, good_idx represents the index value of the better pigeons after selecting the better proportion, bad_idx represents the index value of the weaker pigeons selected, and X good_idx represents the position.
[0056] Then, the mutated pigeons are ranked according to their fitness values. In each generation, the number of pigeons is updated by Equation (8), where only half of the pigeons are considered to calculate the ideal position of the central pigeon, i.e., the position of the desired destination, and all other pigeons adjust their destinations according to the ideal destination position. The specific meaning of the desired destination is that after screening, the accuracy effect of the decision tree classification model can reach the highest; as shown in the following formula:
[0057] (8)
[0058] Where, N p (t + 1) is the number of pigeons in the current iteration;
[0059] The position of the desired destination is calculated by Equation (9), and all other pigeons update their positions towards the position of the desired destination by Equation (10), as shown in the following formula:
[0060] (9)
[0061] Where, N p is the number of pigeons in the flock, X c (t + 1) is the position of the central pigeon, i.e., the position of the pigeon at the center of the flock (the desired destination), and X i (t + 1) is the current position of all pigeons, as shown in the following formula:
[0062] (10)
[0063] Where, rand is a uniform random number in the range of [0, 1].
[0064] After all pigeons reach the desired destination, the water quality anomaly detection feature selection is completed.
[0065] A computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the water quality anomaly detection feature selection method based on the improved pigeon flock optimization algorithm.
[0066] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the steps of the water quality anomaly detection feature selection method based on the improved pigeon flock optimization algorithm.
[0067] The second aspect of the present invention provides a water quality anomaly detection feature selection system based on the improved pigeon flock optimization algorithm, including:
[0068] A preprocessing module, configured to: preprocess the water treatment plant data;
[0069] The iterative condition evaluation module is configured to: evaluate the current iterative condition, where the current iterative condition is the maximum number of iterations. If the condition is met, the pigeon flock evaluation module is executed; otherwise, the pigeon flock position update module is executed.
[0070] The pigeon flock evaluation module is configured to: execute the improved pigeon flock algorithm to evaluate the fitness of the pigeon flock.
[0071] The pigeon update module is configured to: assign the position and speed of the pigeon with the lowest fitness to the globally optimal pigeon; execute the speed and position update module and the pigeon flock position update module.
[0072] The speed and position update module is configured to: update the speed value of the pigeon, convert the pigeon speed using the Sigmoid function, and then update the pigeon position according to the output value of the Sigmoid function; return to the iterative condition evaluation module.
[0073] The pigeon flock position update module is configured to: when the iterative stop condition is reached, return the globally optimal pigeon; otherwise, mutate the pigeon flock, update the position and speed through altruism; rank the mutated pigeons according to the fitness value, calculate the ideal destination, and update the pigeon flock position; return to the pigeon flock evaluation module.
[0074] The beneficial effects of the present invention are as follows:
[0075] 1. By setting the adaptive iterative map and compass factor, the exploration of the solution space in the initial iterative stage is enhanced, effectively avoiding the population from falling into local sub-optimal solutions. In subsequent iterations, the process of finding the optimal solution is strengthened, promoting the rapid convergence of the population to the optimal solution. At the same time, the exploration of the feature space and the development of the optimal solution are balanced, significantly improving the algorithm performance. The improved pigeon flock algorithm shows more stability in complex problems.
[0076] 2. By integrating altruism and the Sigmoid pigeon flock algorithm, the problems of low convergence accuracy and inability to obtain the exact feature optimal solution in the traditional pigeon flock algorithm can be solved. The generation of the Sigmoid pigeon flock can improve the convergence accuracy of the pigeon flock. At the same time, adding altruism to the pigeon flock for beneficial mutation behaviors of the pigeon flock can effectively increase the probability of generating the optimal solution by the Sigmoid pigeon flock, increase the convergence rate of the pigeon flock, and reduce the time to reach the feature optimal solution.
[0077] 3. The feature selection method for water quality anomaly detection based on the improved pigeon flock optimization algorithm can effectively reduce the number of features in the water purification plant dataset to achieve the purpose of reducing the complexity of model training, directly reducing the computing resources and time required for model training, enabling the model to iterate and optimize faster, improving the accuracy of water quality detection, and accelerating the transfer speed of water purification plant data in the MLOps data pipeline. At the same time, by eliminating irrelevant or redundant features, feature selection helps prevent model overfitting and enhances the generalization ability of the model on data, so that MLOps can have higher stability and reliability in water purification plant water quality detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] Figure 1 This is the data preprocessing flowchart of the present invention;
[0079] Figure 2 This is the flowchart of the feature selection method for water quality anomaly detection based on the improved pigeon flock optimization algorithm;
[0080] Figure 3 This is the schematic diagram of the MLOps process of the feature selection method based on the improved pigeon flock algorithm. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0081] The present invention will be further described below by way of examples in conjunction with the drawings, but is not limited thereto.
[0082] Example 1
[0083] A feature selection method for water quality anomaly detection based on the improved pigeon flock optimization algorithm, as Figure 2 shown, includes:
[0084] Step 1: Preprocess the data of the water purification plant;
[0085] Step 2: Evaluate the current iteration condition, where the current iteration condition is the maximum number of iterations. If the condition is met, execute Step 3; otherwise, execute Step 6;
[0086] Step 3: Execute the improved pigeon flock algorithm to evaluate the fitness of the pigeon flock;
[0087] Step 4: Assign the position and speed of the pigeon with the lowest fitness to the globally optimal pigeon; execute Step 5 and Step 6;
[0088] Step 5: Update the speed value of the pigeon, convert the pigeon speed using the Sigmoid function, and then update the pigeon position according to the output value of the Sigmoid function; return to Step 2;
[0089] Step 6: When the iteration stop condition is reached, return the globally optimal pigeon; otherwise, mutate the pigeon flock, let the pigeon flock converge to its optimal solution, and then use it to gain greater advantages; update the position and velocity through altruism; rank the pigeons after mutation according to the fitness value, calculate the ideal destination, and update the position of the pigeon flock; return to Step 3.
[0090] Example 2
[0091] A method for feature selection in water quality anomaly detection based on an improved pigeon flock optimization algorithm according to Example 1, wherein the difference lies in:
[0092] The water quality treatment process in a water purification plant generally includes the following main stages:
[0093] Pretreatment: Raw water collection: Collect raw water from water sources (such as rivers, lakes, groundwater); Preliminary filtration: Remove large particulate impurities through a grille or sieve; Water quality adjustment: Add chemicals such as sodium bisulfate for adjustment according to the pH of the raw water.
[0094] Coagulation and sedimentation: Adding coagulants: Add coagulants (such as aluminum sulfate, polyaluminum chloride) to make the suspended solids and colloidal particles in the water coagulate into larger flocs; Mixing reaction: Make the coagulant fully contact with water through stirring or water flow mixing; Sedimentation separation: The flocs settle in the sedimentation tank, and the clear water rises.
[0095] Filtration Sand filtration: Remove fine particles in the water through a sand filter; Activated carbon filtration: Remove organic matter, odor, and color in the water; Backwashing: Regularly backwash the filter to restore the filtration capacity.
[0096] Disinfection: Adding disinfectants: Such as chlorate, chlorine dioxide, etc., used to kill bacteria and viruses in the water; Contact time control: Ensure that the disinfectant fully contacts the water to achieve the disinfection effect.
[0097] Reverse osmosis / nanofiltration: Remove dissolved solids in the water; Effluent water quality detection: Detect the treated water to ensure compliance with national standards.
[0098] Water conveyance: Convey the qualified water to the water supply network; Through the above data monitoring and processing process, the water purification plant can efficiently convert raw water into drinking water that meets the standards and ensure the safety of residents' water use.
[0099] Preprocess the data of the water purification plant, including:
[0100] The water purification plant data includes: 01 equipment power water pressure status, 02 equipment power water pressure status, 03 equipment power water pressure status (01, 02, and 03 respectively represent the pressures of the water supply systems of monitoring equipment in different areas to ensure that the water pressure is within the normal range and avoid affecting equipment operation due to too high or too low water pressure), the dosing status of compound sodium bisulfate (monitoring the dosing of sodium bisulfate for adjusting the pH value of water), the drug shortage alarm status of compound sodium bisulfate (sounding an alarm when the drug is insufficient to remind timely replenishment), the dosing status of compound chlorate (monitoring the dosing of chlorate for disinfection or oxidation treatment), the drug shortage alarm status of compound chlorate (sounding an alarm when the drug is insufficient), the generator operation status (monitoring the operation of the dosing equipment or disinfection equipment), the total amount of compound dosing (the total amount of multiple drugs mixed and dosed), the manual dosing amount (the dosing amount manually operated), and the flow-based dosing amount (the dosing amount automatically adjusted according to the influent flow);
[0101] Data conversion: Convert all symbolic data in the water purification plant data into numerical data, and convert the input values of the data columns into binary form, where "0" represents a normal record and "1" represents an abnormal record, so as to unify the feature expression form. For example, for the switch of compound chlorate dosing, on means normal use represented by "0", and off means abnormal use represented by "1";
[0102] Duplicate removal: Delete duplicate records in the water purification plant data; to prevent the classifier from being biased towards frequently occurring records during training, improve its learning ability for infrequent records, and ensure the adaptability of the classifier to diverse data;
[0103] Data normalization: Perform normalization processing on the water purification plant data. Use the difference between the maximum value and the minimum value in the dataset as the denominator, and the difference between the current data value and the minimum value as the numerator. Through fractional operations, the normalized result is obtained, eliminating the deviation of the dataset with large value features, converting or scaling each feature value into normalized data within a certain proportional range, achieving data balance, and ensuring the accuracy of classifier training;
[0104] Set the parameters of the improved pigeon flock algorithm. The number of pigeons (Np) is 70, the maximum number of iterations (Nc) is 150. Initialize the pigeon flock, with vector X as the position of the current pigeon and vector V as the speed of the current pigeon. The dimensionality of the space is the number of features of the selected dataset, which is 41. Set the upper and lower bounds (L, U) of the pigeon flock speed to (0, 1), and set the random calculation value (R) to 0.09. Initialize and generate the first-generation pigeon flock;
[0105] Judge whether the current number of iterations is greater than or equal to 1. If the number of iterations is greater than 1 (Nc >= 1), then subtract 1 from the number of iterations and perform the next step to evaluate the pigeon flock; if the number of iterations is less than 1 (Nc < 1), jump to step 6.
[0106] Execute the improved pigeon flock algorithm to evaluate the fitness of the pigeon flock, including:
[0107] Use the preprocessed water purification plant data as the data set, and divide the data set into a training set and a test set; randomly extract 60% of the data from the data set as the training set, and the remaining 40% of the data as the test set to ensure the balanced distribution of training and test samples; select the classifier as the model based on the decision tree algorithm for data classification and prediction. The decision tree algorithm is suitable for the data characteristics after preprocessing in this embodiment due to its clear structure and efficient classification ability.
[0108] Select the classifier as the model based on the decision tree algorithm; the decision tree classification algorithm is a supervised learning method based on a tree structure for dividing data into different categories. It is the application of the decision tree algorithm in classification tasks. By learning the relationship between input features and class labels, a series of decision rules are generated to achieve the classification of new samples; perform data classification and prediction.
[0109] Use the selected feature subset to train the model based on the decision tree algorithm; use the improved pigeon flock algorithm to perform feature selection on the data set, and the data set after feature selection is the feature subset; judge each piece of data in the data set to determine whether it is water quality anomaly.
[0110] Use the test set to verify the model based on the decision tree algorithm.
[0111] Use the verified model based on the decision tree algorithm to evaluate each pigeon in the pigeon flock; each pigeon represents a potential feature subset, and its fitness is determined by the fitness function (Equation (1)); the fitness function is as follows:
[0112] (1)
[0113] Among them, Fitness represents the fitness value, W 1 represents the weight parameter of the ratio of the number of selected features to the number of features in the data set, W 2 represents the weight parameter of the false positive rate, W 3 represents the weight parameter of the reciprocal of the correct rate, and w 1 + w 2 + w 3 = 1. TPR and FPR are of equal importance to the Fitness value, so the weight values are set as w 1 = 0.1, w 2 = w 3 = 0.45. SF represents the number of selected features, NF represents the number of features in the data set, FPR represents the false positive rate, and TPR represents the correct rate.
[0114] Assign the position and velocity of the pigeon with the lowest fitness to the globally optimal pigeon, including:
[0115] Through the global optimal search function, that is, search for the pigeon with the lowest fitness according to the number of the pigeon population, locate the pigeon (Xp) with the lowest fitness value. Once the pigeon with the lowest fitness (Xp) is identified, assign the position and velocity of the pigeon with the lowest fitness to the globally optimal pigeon (Xg). The globally optimal pigeon is the pigeon closest to the destination in the pigeon flock, that is, the pigeon with the lowest fitness value;
[0116] The remaining pigeons adjust their search strategies, that is, adjust the search for the destination from the adaptive iterative map and compass factor to using the landmark factor to search for the destination, so as to follow the globally optimal pigeon;
[0117] Update the velocity value of the pigeon, and use the Sigmoid function to transform the pigeon velocity, and then update the pigeon position according to the output value of the Sigmoid function, including:
[0118] Update Rt through Equation (2), and update the velocity value of the pigeon through Equation (3). The formulas are as follows:
[0119]
[0120]
[0121]
[0122]
[0123]
[0124] (2)
[0125] (3)
[0126] Among them, dP represents the change rate of the pigeon flock, P represents the pigeon flock, P e represents the final state of the pigeon flock, P i represents the current iteration state of the pigeon flock, t e represents the total number of iterations of the pigeon flock, t i represents the current iteration number of the pigeon flock, c is an introduced constant, Rt is the adaptive iterative map and compass factor, rand is a uniform random number within the range of [0,1], X g represents the position of the globally optimal pigeon individual, X i (t) represents the current position of the pigeon at the t-th iteration, V i (t) represents the current velocity of the pigeon at the t-th iteration; Vi (t + 1) represents the current speed of the pigeon at the (t + 1)-th iteration;
[0127] Using the Sigmoid function (Equation (4)), map the speed value of each pigeon to a new value range, and the position of each pigeon will be updated according to the output value of the Sigmoid function and the judgment of the uniformly random number generated in the interval [0, 1] (Equation (5)), as follows:
[0128] (4)
[0129] (5)
[0130] where, V i (t) is the pigeon speed at the t-th iteration, r is the uniformly random number, and X(t) (i,P) [i] is the updated position of the pigeon.
[0131] Mutate the pigeon flock to make the pigeon flock converge to its optimal solution, and then use it to obtain greater advantages; update the position and speed through altruism; rank the pigeons after mutation according to the fitness value, calculate the ideal destination, and update the position of the pigeon flock; including:
[0132] First, evaluate the fitness value of each pigeon in the previous iteration, that is, compare the magnitudes of the fitness values, and sort all the obtained fitness values from smallest to largest accordingly. If the fitness value is low (the lower the fitness value, the better), retain the elite pigeons (such as the top k%). Elite pigeons refer to the pigeons in the top k% of the fitness values after the fitness sorting. Let them converge to the optimal solution (converging to the optimal solution means not performing any processing and flying towards the destination with the original speed and position); for the remaining pigeons, allow the pigeons ranked in the first half (the better pigeons) to pair with the pigeons in the second half (the weaker pigeons) and exhibit altruistic behavior, that is, assign the position and speed of the pigeons ranked in the first half (the better ones) to the pigeons in the second half (the weaker ones);
[0133] To selectively perform this task, set a random value. If the random value is greater than P and less than P + γ, the probability that a specific pigeon is selected is in the range (p, p + γ). A specific pigeon refers to the pigeon that will be mutated; where, γ is the interval value of the mutation performed, and p is the starting value;
[0134] Once the whole process is over, that is, the positions and velocities of the weaker pigeons are assigned by the positions and velocities of the better pigeons, and the destinations of the velocities and positions of the better pigeons are assigned according to equations (4) and (5). After the better pigeons assign their velocities and positions to the weaker pigeons through altruism, the velocities of the better pigeons are mutated by equation (6), and the positions are mutated by equation (7) to obtain a possibly better fitness;
[0135] Among them, the update mechanism of the velocities and positions of the weaker pigeons, that is, a part of the pigeons with the lowest fitness values, is based on the states of their corresponding better pigeons, that is, a part of the pigeons with higher fitness values selected after removing the elite pigeons from the fitness values. Finally, through the implementation of the above mechanism, the entire altruistic mutation process is completed;
[0136] Adding altruistic mutation to the iterative process of the Sigmoid pigeon flock includes:
[0137] Input: N represents the number of features, k represents the intercepted ratio, i is used as the loop operation record value, z is the better ratio to select alturism_rank, alturism_rank is an array tuple sorted in descending order of fitness, good_idx is the index value of the better features selected by z from alturism_rank, bad_idx is the index value of the weaker features selected by alturism_rank, v is the velocity, x is the position, where [N = 41, k = 0.3, z = 0.4];
[0138] Specific operations: Pass the velocities and positions of the pigeons at good_idx in the pigeon flock and the velocities and positions of the pigeons at bad_idx in the pigeon flock into the altruistic mechanism; mutate by generating a random number 1 (controlling the mutation of the pigeons at bad_idx), and assign the velocity value and position of the pigeons at good_idx to the pigeons at bad_idx; generate a random number 2 for mutation (controlling the mutation of the pigeons at good_idx) and mutate the velocity of the pigeons at good_idx by equation (6), and mutate the position of the pigeons at good_idx by equation (7). After the execution is completed, return the transformed positions and velocities of the pigeons at good_idx and the positions and velocities of the pigeons at bad_idx; after completing the loop mutation process of the entire k * N, exit the loop and complete the mutation operation, as shown in the following formula:
[0139] (6)
[0140] (7)
[0141] Among them, v good_idxrepresents the speed, good_idx represents the index value of the better pigeons after selecting the better proportion, bad_idx represents the index value of the weaker pigeons, and X good_idx represents the position;
[0142] Then, the mutated pigeons are ranked according to their fitness values. In each generation, the number of pigeons is updated by Equation (8), where only half of the pigeons are considered to calculate the ideal position of the central pigeon, that is, the position of the expected destination, and all other pigeons adjust their destinations according to the ideal destination position. The specific meaning of the expected destination is that after screening, the accuracy effect of the decision tree classification model can reach the highest; as shown in the following formula:
[0143] (8)
[0144] where, N p (t + 1) is the number of pigeons in the current iteration;
[0145] The position of the expected destination is calculated by Equation (9), and all other pigeons update their positions to the position of the expected destination by Equation (10), as shown in the following formula:
[0146] (9)
[0147] where, N p is the number of pigeons in the flock, X c (t + 1) is the position of the central pigeon, that is, the position of the pigeon at the center of the flock position (expected destination), X i (t + 1) is the current position of all pigeons, as shown in the following formula:
[0148] (10)
[0149] where, rand is a uniform random number in the range of [0, 1].
[0150] After all pigeons reach the expected destination, the selection of water quality anomaly detection features is completed.
[0151] Visualization display: Calculate TPR using the formula, calculate FPR using the formula, calculate acc using the formula, calculate F-score using the formula. Intercept the selected features. After the above calculations, intercept the selected features and their corresponding performance index results and output them to a text document for users to consult and analyze. This process not only provides an intuitive display of the feature selection effect, but also enables users to deeply understand the specific impact of feature selection on the model performance through detailed numerical results.
[0152] Example 3
[0153] A method for feature selection of water quality anomaly detection based on an improved pigeon flock optimization algorithm according to Embodiment 1, characterized in that the feature selection method based on the improved pigeon flock algorithm is added to the data flow in MLOps, such as Figure 3 shown, including:
[0154] The data of the water purification plant is transmitted to the data lake (hudi) through the Kafka stream processing system, where Apache Hudi (hudi) is an open-source data lake storage framework that supports storing various types of data, efficient data updates, deletions, and incremental processing, provides transactional ACID operations and time travel functions, and is used in the present invention to store raw data and primary feature data. The data lake, as a centralized storage repository, bears various water quality detection data of the water purification plant and provides support for subsequent MLOps processing and analysis. The data stream processing engine technology (such as Flink) performs efficient preprocessing on the raw data on the premise of ensuring the integrity of heterogeneous data storage. The data preprocessing steps include processing methods such as deleting missing values and filling missing values with the mean to ensure the integrity and consistency of the data. The preprocessed data is transmitted to the feature storage system (hive), where Apache Hive (hive) is a Hadoop-based data warehouse tool used for data storage, query, and analysis of large-scale data sets, and is used in the present invention to store the processed data. The data stored in the feature repository is the feature data. Then, feature selection is performed based on the improved pigeon flock algorithm to extract the optimal features, and these features are passed to the feature extraction tool (such as OpenMLDB). The feature extraction tool inputs the extracted features into the machine learning model to complete the data flow and analysis tasks in the MLOps data pipeline. This process significantly accelerates the MLOps process through efficient data flow and feature processing methods, thereby improving the real-time performance and accuracy of water quality anomaly detection and analysis in the water purification plant.
[0155] Obviously, the examples listed in the specific implementation manners are only a part of the examples of the present invention, rather than all examples. Based on the examples of the present invention, all other examples obtained by those skilled in the art without creative labor shall fall within the protection scope of the present invention.
[0156] Embodiment 4
[0157] A computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of the method for feature selection of water quality anomaly detection based on the improved pigeon flock optimization algorithm according to any one of Embodiments 1-3 are implemented.
[0158] Embodiment 5
[0159] A computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method for feature selection of water quality anomaly detection based on the improved pigeon flock optimization algorithm according to any one of Embodiments 1-3 are implemented.
[0160] Embodiment 6
[0161] A system for feature selection of water quality anomaly detection based on the improved pigeon flock optimization algorithm, comprising:
[0162] A preprocessing module, configured to: preprocess the water purification plant data;
[0163] An iteration condition evaluation module, configured to: evaluate the current iteration condition, where the current iteration condition is the maximum number of iterations, and if the condition is satisfied, execute the pigeon flock evaluation module, otherwise execute the pigeon flock position update module;
[0164] A pigeon flock evaluation module, configured to: execute the improved pigeon flock algorithm and evaluate the fitness of the pigeon flock;
[0165] A pigeon update module, configured to: assign the position and speed of the pigeon with the lowest fitness to the globally optimal pigeon; execute the speed and position update module and the pigeon flock position update module;
[0166] A speed and position update module, configured to: update the speed value of the pigeon, convert the pigeon speed using the Sigmoid function, and then update the pigeon position according to the output value of the Sigmoid function; return to the iteration condition evaluation module;
[0167] A pigeon flock position update module, configured to: when the iteration stop condition is reached, return the globally optimal pigeon; otherwise, mutate the pigeon flock, update the position and speed through altruism; rank the mutated pigeons according to the fitness value, calculate the ideal destination, and update the pigeon flock position; return to the pigeon flock evaluation module.
Claims
1. A feature selection method for water quality anomaly detection based on improved pigeon flock optimization algorithm, characterized in that: include: Step 1: Preprocess the water treatment plant data; the water treatment plant data includes: power water pressure status of several equipment, compound sodium bisulfate dosing status, compound sodium bisulfate shortage alarm status, compound chlorate dosing status, compound chlorate shortage alarm status, generator operation status, compound dosing dosage, manual dosing dosage, flow dosing dosage; Step 2: Evaluate the current iteration condition, which is the maximum number of iterations. If the condition is met, execute step 3, otherwise execute step 6. Step 3: Execute the improved pigeon flock algorithm to evaluate the fitness of the pigeon flock; Step 4: Assign the position and speed of the pigeon with the lowest fitness to the global optimal pigeon; execute steps 5 and 6; Step 5: Update the pigeon's speed value, convert the pigeon's speed using the Sigmoid function, and then update the pigeon's position according to the output value of the Sigmoid function; Update R through formula (2), and update the pigeon's speed value through formula (3), the formula is as follows: V i (t+1)=V i (t)*e -Rt +rand*(X g -X i (t)); (3) Where R is the adaptive iterative map and compass factor, rand is a uniform random number in the range [0,1], and X g represents the position of the global optimal pigeon individual, X i (t) represents the current position of the pigeon after iteration t, V i (t) represents the current speed of the pigeon after iteration t; V i (t+1) represents the current speed of the pigeon at iteration t+1; c is the introduced constant, t e It is expressed as the total number of iterations of the pigeon group, t i Represents the number of iterations of the current pigeon group; Return to step 2; Step 6: When the iteration stop condition is reached, return the global optimal pigeon; otherwise, mutate the pigeon flock; update the position and speed through altruism; rank the mutated pigeons according to the fitness value, calculate the ideal destination, and update the position of the pigeon flock; First, the fitness value of each pigeon in the previous iteration is evaluated, that is, the size of the fitness value is compared, and all the obtained fitness values are sorted from small to large accordingly, and the elite pigeons are retained. The elite pigeons refer to the pigeons with the top k% fitness values after the fitness sorting is completed, and they are allowed to converge to the optimal solution; for the remaining pigeons, the pigeons ranked in the first half, that is, the better pigeons, are allowed to show altruistic behavior in pairs with the pigeons in the second half, that is, the positions and speeds of the pigeons ranked in the first half are assigned to the pigeons in the second half; Set a random value. If the random value is greater than p and less than p+γ, the probability of a specific pigeon being selected is within the range (p, p+γ). The specific pigeon is the pigeon that will be mutated. γ is the interval value of the mutation to be performed, and p is the starting value. The speed of the better pigeon is varied by equation (6), and the position is varied by equation (7); as shown in the following equations: Among them, v good_idx represents the speed, good_idx represents the index value of the better pigeon after selecting the better ratio, bad_idx represents the index value of the weaker pigeon, X good_idx Indicates location; Return to step 3; The preprocessed water treatment plant data is used as a data set, and the improved pigeon flock algorithm is used to perform feature selection on the data set. The data set after feature selection is a feature subset; the feature subset is used to train a model based on the decision tree algorithm; each data in the data set is judged to determine whether it is abnormal water quality.
2. According to claim 1, a method for selecting features for water quality anomaly detection based on an improved pigeon flock optimization algorithm is characterized in that: Preprocess the water treatment plant data, including: Data conversion: convert all symbolic data in the water treatment plant data into numerical data, and convert the input values of the data column into binary form, where "0" represents a normal record and "1" represents an abnormal record; Deduplication: Delete duplicate records in water treatment plant data; Data normalization: Normalize the water treatment plant data.
3. The water quality anomaly detection feature selection method based on the improved pigeon flock optimization algorithm according to claim 1 is characterized in that: Execute the improved pigeon flock algorithm to evaluate the fitness of the pigeon flock; including: Divide the data set into training set and test set; select the classifier as a model based on the decision tree algorithm; Use feature subsets to train a model based on the decision tree algorithm; use a test set to validate the model based on the decision tree algorithm; Each pigeon in the flock is evaluated using the validated decision tree algorithm-based model; its fitness is determined by the fitness function; the fitness function is as follows: Among them, Fitness represents the fitness value, w1 represents the weight parameter of the ratio of the number of selected features to the number of features in the data set, W2 represents the weight parameter of the false positive rate, W3 represents the weight parameter of the inverse of the accuracy rate, and w1+w2+w3=1, the weight values are set to w1=0.1, w2=w3=0.45, SF represents the number of selected features, NF represents the number of features in the data set, FPR represents the false positive rate, and TPR represents the accuracy rate.
4. According to claim 3, a method for selecting features for water quality anomaly detection based on improved pigeon flock optimization algorithm is characterized in that: Assign the position and speed of the pigeon with the lowest fitness to the global optimal pigeon; including: The global optimal search function is used to search for the pigeon with the lowest fitness according to the number of pigeon populations, and the pigeon with the lowest fitness value is located. The position and speed of the pigeon with the lowest fitness value are assigned to the global optimal pigeon. The global optimal pigeon is the pigeon closest to the destination in the pigeon group, that is, the pigeon with the lowest fitness value. The remaining pigeons adjusted their search strategy to use landmark factors to search for the destination.
5. According to claim 4, a method for selecting features for water quality anomaly detection based on improved pigeon flock optimization algorithm is characterized in that: Update the pigeon's speed value, convert the pigeon's speed using the Sigmoid function, and then update the pigeon's position according to the output value of the Sigmoid function; including: The Sigmoid function is used to map the speed value of each pigeon to a new value range. The position of each pigeon will be updated according to the output value of the Sigmoid function and the judgment of the random uniform number generated in the [0,1] interval, as shown below: Among them, V i (t) is the speed of the pigeon at the tth iteration, r is a uniform random number, X(t) (i,P) [i] is the updated pigeon position.
6. A method for selecting features for water quality anomaly detection based on improved pigeon flock optimization algorithm according to claim 5, characterized in that: Mutate the pigeon flock and update its position and speed through altruism; Rank the mutated pigeons according to their fitness values, calculate the ideal destination, and update the location of the pigeon flock; including: The mutated pigeons are ranked according to their fitness values. In each generation, the number of pigeons is updated by formula (8), as shown below: Among them, N p (t+1) is the number of pigeons in the current iteration; The position of the desired destination is calculated by equation (9), and all other pigeons update their positions to the desired destination by equation (10), as shown below: Among them, N p is the number of pigeons, X c (t+1) is the position of the central pigeon, i.e. the pigeon at the center of the pigeon group, X i (t+1) is the current position of all pigeons, as shown in the following formula: X i (t+1)=X i (t)+rand*(X c (t+1)-X i (t)) (10) Here, rand is a uniform random number in the range [0,1].
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the water quality anomaly detection feature selection method based on the improved pigeon flock optimization algorithm described in any one of claims 1-6 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the water quality anomaly detection feature selection method based on the improved pigeon flock optimization algorithm described in any one of claims 1-6 are implemented.
9. A water quality anomaly detection feature selection system based on improved pigeon flock optimization algorithm, characterized in that: include: The preprocessing module is configured to: preprocess the water treatment plant data; the water treatment plant data includes: the power water pressure status of several equipments, the compound sodium bisulfate dosing status, the compound sodium bisulfate lack alarm status, the compound chlorate dosing status, the compound chlorate lack alarm status, the generator operation status, the compound dosing dosage, the manual dosing dosage, and the flow dosing dosage; The iteration condition evaluation module is configured to: evaluate the current iteration condition, which is the maximum number of iterations. If the condition is met, the pigeon flock evaluation module is executed, otherwise, the pigeon flock position update module is executed; The pigeon flock evaluation module is configured to: execute the improved pigeon flock algorithm to evaluate the fitness of the pigeon flock; The pigeon update module is configured to: assign the position and speed of the pigeon with the lowest fitness to the global optimal pigeon; execute the speed position update module and the pigeon group position update module; The speed position update module is configured to: update the speed value of the pigeon, convert the pigeon speed using the Sigmoid function, and then update the pigeon position according to the output value of the Sigmoid function; Update R through formula (2), and update the pigeon's speed value through formula (3), the formula is as follows: V i (t+1)=V i (t)*e -Rt +rand*(X g -X i (t)); (3) Where R is the adaptive iterative map and compass factor, rand is a uniform random number in the range [0,1], and X g represents the position of the global optimal pigeon individual, X i (t) represents the current position of the pigeon after iteration t, V i (t) represents the current speed of the pigeon after iteration t; V i (t+1) represents the current speed of the pigeon at iteration t+1; c is the introduced constant, t e It is expressed as the total number of iterations of the pigeon group, t i Represents the number of iterations of the current pigeon group; Return to the iterative condition evaluation module; The pigeon group position update module is configured to: return the global optimal pigeon when the iteration stop condition is reached; otherwise, mutate the pigeon group and update the position and speed through altruism; rank the mutated pigeons according to the fitness value, calculate the ideal destination, and update the pigeon group position; including: First, the fitness value of each pigeon in the previous iteration is evaluated, that is, the size of the fitness value is compared, and all the obtained fitness values are sorted from small to large accordingly, and the elite pigeons are retained. The elite pigeons refer to the pigeons with the top k% fitness values after the fitness sorting is completed, and they are allowed to converge to the optimal solution; for the remaining pigeons, the pigeons ranked in the first half, that is, the better pigeons, are allowed to show altruistic behavior in pairs with the pigeons in the second half, that is, the positions and speeds of the pigeons ranked in the first half are assigned to the pigeons in the second half; Set a random value. If the random value is greater than p and less than p+γ, the probability of a specific pigeon being selected is within the range (p, p+γ). The specific pigeon is the pigeon that will be mutated. γ is the interval value of the mutation to be performed, and p is the starting value. The speed of the better pigeon is varied by equation (6), and the position is varied by equation (7); as shown in the following equations: Among them, v good_idx represents the speed, good_idx represents the index value of the better pigeon after selecting the better ratio, bad_idx represents the index value of the weaker pigeon, X good_idx Indicates location; Return to the Flock Assessment module; The water quality judgment module is configured as follows: the pre-processed water treatment plant data is used as a data set, and the improved pigeon flock algorithm is used to perform feature selection on the data set, and the data set after feature selection is a feature subset; the feature subset is used to train a model based on the decision tree algorithm; and each data in the data set is judged to determine whether it is abnormal in water quality.
Citation Information
Patent Citations
Unmanned aerial vehicle path planning method based on adaptive weight pigeon flock algorithm
CN106441308A
Unmanned aerial vehicle cluster cooperative reconnaissance method based on crossover and variation pigeon flock optimization
CN109254588A
Unmanned aerial vehicle cluster collaborative dynamic target searching method based on improved pigeon inspired optimization
CN114020031A
Unmanned aerial vehicle flight path planning method and system based on improved pigeon inspired optimization algorithm
CN118760227A
Airplane flight path planning method and device based on the pigeon-inspired optimization
US20190035286A1