Concrete proportion optimization method and system based on sparrow algorithm and multi-target genetic algorithm
By optimizing the BP neural network and multi-objective genetic algorithm using the sparrow algorithm, the problems of low efficiency and difficulty in balancing multiple objectives in traditional concrete mix design are solved, achieving high-precision, globally optimized concrete mix design that can adapt to different engineering conditions.
Patent Information
- Application Number
- CN202510969451.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-15
- Publication Date
- 2025-10-31
AI Technical Summary
Traditional concrete mix design methods are inefficient and costly, making it difficult to achieve global optimization and multi-objective synergy. Furthermore, they fail to accurately integrate with actual engineering conditions, resulting in mix designs that cannot simultaneously meet the requirements of engineering performance and economic efficiency.
The sparrow algorithm is used to optimize the weights and biases of the BP neural network, and the Levy flight strategy is combined to enhance the global search capability. The concrete mix design is optimized through a multi-objective genetic algorithm. The BP neural network is used to predict compressive strength and cost, and the cost is calculated in conjunction with engineering quota standards.
It significantly improves the prediction accuracy and optimization efficiency of concrete mix proportions, achieves a precise quantitative balance between compressive strength and cost, reduces resource waste, adapts to the mix proportion requirements of different regions and materials, and provides scientific decision support.
Smart Images

Figure CN120874178A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of concrete mix design technology, and in particular to a concrete mix design optimization method and system based on the Sparrow Algorithm and a multi-objective genetic algorithm. Background Technology
[0002] Concrete, as the most commonly used basic material in the construction industry, has its mix design directly affecting key performance indicators such as compressive strength, durability, and construction costs. Traditional concrete mix design methods mainly rely on manual experience and repeated experimental verification, requiring numerous trial mixes to adjust material ratios, resulting in low efficiency, long cycles, and high costs. Although artificial intelligence technologies such as neural networks have been introduced into the field of mix optimization in recent years, traditional neural networks (such as BP networks) are prone to getting stuck in local optima during training, making it difficult to obtain the globally optimal solution. At the same time, existing methods usually only optimize a single performance indicator (such as strength), lacking systematic support for the coordinated optimization of multiple objectives (such as cost and strength), making it difficult for mix designs to simultaneously meet engineering performance and economic requirements.
[0003] Furthermore, existing optimization models lack adaptability under complex constraints (such as material usage range and curing cycle limitations), and cost accounting often relies on simplified formulas or regionally applicable standards, failing to accurately combine engineering quotas with actual material price fluctuations, further reducing the practicality and reliability of mix design. Therefore, there is an urgent need for an intelligent concrete mix design method that can achieve global optimization, multi-objective balance, and conform to engineering realities, in order to overcome the bottlenecks of traditional technologies. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a method and system for optimizing concrete mix proportions based on the Sparrow Algorithm and a multi-objective genetic algorithm.
[0005] To achieve the above-mentioned objectives, the technical solution adopted by the present invention is as follows:
[0006] A concrete mix design optimization method based on the Sparrow Algorithm and a multi-objective genetic algorithm includes the following steps:
[0007] S1. Data Acquisition and Preprocessing: Obtain the concrete mix design dataset. Input features include cement, slag, fly ash, water, water-reducing agent, coarse aggregate, fine aggregate, and number of days. Output targets include compressive strength and cost. Normalize the input features and output targets, and divide the data into training and testing sets.
[0008] S2. Sparrow Algorithm Optimization of BP Neural Network Training: Construct a BP neural network model with 8 nodes in the input layer and 2 nodes in the output layer to predict compressive strength and cost, respectively.
[0009] The weights and biases of the BP neural network are optimized using a sparrow search algorithm, including: initializing a sparrow population, where each individual in the population represents a potential solution for the neural network parameters; calculating the prediction error of each individual using a fitness function, where the fitness function is the mean squared error of the neural network; updating the individual position using sine and cosine factors to adjust the search step size, and introducing a Levy flight strategy to enhance the global search capability; and generating globally optimal neural network parameters by iteratively selecting and retaining the individuals with the best fitness.
[0010] The optimized neural network parameters are assigned to the BP neural network to complete the model training.
[0011] S3. Multi-objective genetic algorithm optimization scheme: Initialize the genetic algorithm population, where each individual in the population represents a potential solution for the concrete mix proportion parameters;
[0012] The fitness value of each individual is calculated based on the optimized BP neural network. The fitness value includes the predicted value of stress resistance, the predicted value of cost, and the penalty for violating the constraints. The predicted value of stress resistance must meet a preset lower limit, and the predicted value of cost must meet a preset upper limit.
[0013] New populations are generated through roulette wheel selection, single-point crossover, and mutation operations, and iterative optimization is performed until the maximum number of generations or fitness convergence is reached.
[0014] Output the optimal concrete mix design that satisfies both compressive strength and cost constraints.
[0015] Furthermore, the data preprocessing in S1 includes:
[0016] The input features and output target are normalized using Min-Max normalization, as shown in the formula:
[0017]
[0018] Where X represents the original input feature or the output target value; X min X represents the minimum value of the feature or target; max X represents the maximum value of the feature or target; norm The value is the normalized value, and its range is limited to [0,1].
[0019] Cost calculation is based on engineering quota standards, combined with the actual consumption of each component in the concrete mix to generate cost indicators.
[0020] Furthermore, the specific process of optimizing neural network parameters using the sparrow algorithm in S2 includes:
[0021] The step size adjustment formula for the sine and cosine factors is as follows:
[0022]
[0023] Among them, w min The minimum step size; w max `i` represents the maximum step size; `i` represents the current iteration number; `Max_iteration` represents the total number of iterations.
[0024] The formula for updating individual location is:
[0025] X i (t+1)=X best +w·sin(2π·rand)·|rand·X best -X i (t)|
[0026] Among them, X i (t) represents the position of the i-th sparrow in the t-th iteration; X best This represents the position of the current global optimal solution; rand is a random number between 0 and 1.
[0027] The step size generation formula for the Levy flight strategy is as follows:
[0028]
[0029] Where u and v are random variables that follow a normal distribution, β is a constant, and L is the Levy flight step size.
[0030] Furthermore, the fitness value calculation in S3 includes:
[0031] The predicted compressive strength value is generated by the following linear combination formula:
[0032] f1=10·x1+8·x2-5·x3+2·x4+4·x5+3·x6-6·x7+5·x8
[0033] The cost forecast is generated by the following linear combination formula:
[0034] f2=80·x1+40·x2+20·x3+10·x4+25·x5+30·x6+5·x7+50·x8
[0035] Among them, x1 to x8 are input features.
[0036] The constraints include a predicted compressive strength value greater than or equal to a preset lower limit and a predicted cost value less than or equal to a preset upper limit. If any constraint is violated, the fitness value is adjusted through a penalty term.
[0037] Furthermore, the genetic algorithm operations in S3 include:
[0038] In single-point crossover, the gene crossover point of the parent individual is randomly selected, the gene fragments after the crossover point are exchanged, and the parameters of the offspring individual are ensured to be within the preset upper and lower bounds.
[0039] In the mutation operation, gene loci of an individual are randomly selected, and the mutation amplitude is generated through a normal distribution. The parameters after mutation are then truncated to ensure that they are within the legal range.
[0040] In one embodiment of the present invention, a concrete mix design optimization system based on the Sparrow Algorithm and a multi-objective genetic algorithm is provided. This system can be used to implement the above-mentioned concrete mix design optimization method, specifically including:
[0041] Data acquisition and preprocessing module: used to acquire concrete mix proportion dataset, the dataset includes input features and output targets, the input features include the proportion parameters of cement, slag, fly ash, water, water-reducing agent, coarse aggregate, fine aggregate and days, the output targets include compressive strength and cost; the module normalizes the data and divides it into training set and test set;
[0042] The sparrow algorithm optimization module includes a BP neural network unit and a sparrow search unit.
[0043] The BP neural network unit includes an input layer, a hidden layer, and an output layer. The input layer contains 8 nodes, and the output layer contains 2 nodes, which are used to predict compressive strength and cost, respectively.
[0044] The sparrow search unit is used to optimize the weights and biases of the BP neural network, including:
[0045] The population initialization subunit is used to generate a sparrow population, where each individual represents a potential solution to the neural network parameters;
[0046] The fitness calculation subunit calculates the prediction error of an individual using the mean square error function;
[0047] The position update sub-unit adjusts the search step size using sine and cosine factors and updates the individual position using the Levy flight strategy.
[0048] Iteratively optimize sub-units, select individuals with the best fitness, and generate globally optimal neural network parameters;
[0049] Multi-objective genetic algorithm optimization module: includes population management unit, fitness evaluation unit, and evolutionary operation unit;
[0050] The population management unit is used to initialize the genetic algorithm population, where each individual represents a potential solution for the concrete mix proportion.
[0051] The fitness evaluation unit calculates the fitness value of each individual based on the optimized BP neural network, including the predicted value of stress resistance, the predicted value of cost, and the constraint penalty term. The predicted value of stress resistance must meet a preset lower limit, and the predicted value of cost must meet a preset upper limit.
[0052] The evolutionary operation unit generates a new population through roulette wheel selection, single-point crossover, and mutation operations, and iteratively optimizes it until the termination condition is met;
[0053] Output module: Used to generate and output the optimal concrete mix design that meets the constraints of compressive strength and cost.
[0054] The present invention also discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described concrete mix design optimization method.
[0055] The present invention also discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described concrete mix design optimization method.
[0056] Compared with the prior art, the advantages of the present invention are as follows:
[0057] 1. By optimizing the weights and biases of the BP neural network using the sparrow search algorithm, the drawback of traditional neural networks being prone to getting trapped in local optima is overcome. The Levy flight strategy is then combined to enhance the global search capability. The model significantly improves the prediction accuracy of concrete compressive strength and cost. The coefficients of determination on the training and test sets are close to ideal values, and the mean absolute error and root mean square error are both superior to conventional models, validating its high-precision modeling capability.
[0058] 2. An optimization framework based on a multi-objective genetic algorithm, considering both compressive strength requirements and cost constraints, dynamically adjusts the fitness function through a penalty term mechanism, thus solving the problem of balancing performance and economy in traditional empirical design. The output optimal ratio scheme satisfies the strength requirements while achieving precise quantification of cost control, effectively balancing the conflicts among multiple objectives.
[0059] 3. A hybrid optimization strategy combining the Sparrow Algorithm and Genetic Algorithm significantly improves optimization efficiency and reduces the number of iterations and experimental verification costs through a step-size adjustment mechanism and parallel search capabilities. Simultaneously, based on precise control of proportioning parameters, it optimizes raw material utilization efficiency and reduces resource waste.
[0060] 4. The system automates the entire process of mix design through data-driven processes, including data preprocessing, model training, multi-objective optimization, and result output, eliminating subjective biases from human experience. Combined with the cost calculation module based on engineering quotas, it ensures that cost accounting conforms to industry standards, providing scientific and standardized decision support for engineering practice.
[0061] 5. After training and verification with large-scale experimental data, the optimized BP neural network has significantly enhanced its ability to model the nonlinear relationship between complex proportioning parameters and performance. It can adapt to the proportioning requirements of different regions, materials and maintenance conditions, and shows excellent generalization performance. Attached Figure Description
[0062] Figure 1 This is a diagram illustrating the concrete mix design optimization method according to an embodiment of the present invention;
[0063] Figure 2 This is a flowchart of the Sparrow Algorithm according to an embodiment of the present invention;
[0064] Figure 3 This is a flowchart of the multi-objective genetic algorithm according to an embodiment of the present invention;
[0065] Figure 4 This is a schematic diagram of BP neural network linear regression according to an embodiment of the present invention;
[0066] Figure 5 This is a graph showing the error values of the coefficient of determination, mean absolute error, and root mean square error in embodiments of the present invention.
[0067] Figure 6 This is the optimal ratio diagram output by an embodiment of the present invention. Detailed Implementation
[0068] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and examples.
[0069] like Figure 1 As shown, this invention provides a concrete mix design optimization method based on the Sparrow Algorithm and a multi-objective genetic algorithm, comprising the following steps:
[0070] S1. Data Acquisition and Experiment
[0071] This embodiment uses concrete compressive strength test data published on the Kaggle website, totaling 1030 sets of experimental data with different mix proportions, as the basis for model testing and verification. The input layer structure of the data consists of cement, slag, fly ash, water, water-reducing agent, coarse aggregate, fine aggregate, and days, while the output layer includes two indicators: compressive strength and cost. All data undergoes cleaning and standardization during the preprocessing stage to ensure that the numerical range and distribution of each feature are reasonable, providing a reliable data foundation for subsequent model training and optimization. Simultaneously, cost calculation is based on the "Hubei Province Construction Engineering Public Professional Consumption Quota and Full Cost Base Price Table (2024)". Specifically, based on the relevant provisions of the table regarding the quota consumption, base price, and other costs of each raw material, combined with the actual raw material consumption of each concrete mix proportion, the cost per cubic meter of concrete is calculated. This method ensures that the cost calculation not only conforms to the actual engineering quota but also considers regional and time-sensitive factors.
[0072] S2.BP Neural Network Training and Optimization
[0073] like Figure 2 As shown, a BP neural network model was constructed using the preprocessed experimental data. The input layer consists of eight nodes, corresponding to cement, slag, fly ash, water, water-reducing agent, coarse aggregate, fine aggregate, and days, respectively. The output layer has two nodes used to predict the compressive strength and cost of concrete. During training, the weights and biases of the network are continuously adjusted using the backpropagation algorithm to minimize the error between the predicted and actual test values, ensuring that the model can accurately capture the nonlinear mapping relationship between the raw material proportions and concrete performance. To avoid the BP network getting stuck in local optima during training, a sparrow search algorithm is used to globally optimize the network parameters. The sparrow search algorithm simulates the foraging behavior of sparrows, initializes a set of candidate solutions, evaluates each solution according to the fitness function, and gradually updates the network parameters, ultimately achieving a globally optimal weight and bias configuration, improving the model's prediction accuracy and generalization ability.
[0074] S3. Genetic Algorithm for Optimizing Concrete Mix Proportion
[0075] like Figure 3As shown, based on the BP neural network optimized by the sparrow search algorithm, a genetic algorithm is further employed for multi-objective optimization to obtain the optimal concrete mix design that satisfies both compressive strength requirements and economic efficiency. The genetic algorithm generates multiple mix design schemes by initializing the population, and then continuously evolves them using genetic operations such as crossover and mutation. The BP neural network is used as a performance prediction model to evaluate the fitness of each mix design. During this process, a compressive strength target (e.g., ensuring the predicted value reaches or exceeds 30 MPa) and cost constraints are set to achieve a balance between performance and cost. After multiple generations of evolution, the genetic algorithm finally converges to the optimal mix design that meets the predetermined requirements.
[0076] S21: Data Reading and Preprocessing
[0077] Read concrete mix proportions and performance data from the file "concrete mix proportion data.xlsx". There are 8 input features (e.g., cement, sand, fly ash, mineral powder, water, coarse aggregate, etc.) and 3 output targets (e.g., compressive strength, cost, modulus of elasticity). Divide the data into training and test sets at a ratio of 70% / 30%.
[0078] S22: Map the training and test sets to the [0,1] interval using Min-Max normalization:
[0079]
[0080] The output Y is then normalized accordingly to accelerate network training and prevent inconsistencies in dimensions.
[0081] S23: Initialize the sparrow population
[0082] First, a certain number of sparrow individuals are randomly generated as the initial population. Each individual represents a potential solution, and each solution is a vector in D-dimensional space. The position of each sparrow individual corresponds to the weights and biases in the BP neural network.
[0083] Individual position initialization: The position of each individual is randomly generated, representing the weights and bias parameters of the neural network.
[0084] Individual coding: Each individual X i The position is a D-dimensional vector:
[0085] X i =[x i1 ,x i2 ,...,x iD ]
[0086] Where D is the dimension of the solution space (i.e., the total number of neural network weights and biases).
[0087] S24: Calculate the fitness function
[0088] For each individual sparrow, its fitness value is calculated. The fitness value is used to measure the quality of the current solution. The fitness function is usually the training error of the BP neural network, such as the mean squared error (MSE).
[0089] Fitness assessment: Calculate the fitness value f(X) for each individual. i This is typically the training error of the neural network. The fitness value is used to evaluate the quality of each individual.
[0090] Sorting: Sort all individuals according to their fitness values and select the individual with the best fitness as the global optimal solution.
[0091] S25: Update individual position (introduce sine and cosine factors)
[0092] In the sparrow search algorithm, sine and cosine factors are used to adjust the step size of each individual during each update, thereby improving search efficiency and avoiding early convergence. The sine factor allows adjustment of the individual's movement direction and step size, enhancing the global search capability.
[0093] Sine and Cosine Factors: When updating the position of each individual sparrow, a sine factor w is introduced to control the update step size, as shown in the following formula:
[0094]
[0095] Among them, w min and w max These are the minimum and maximum step sizes, respectively; i is the current iteration number; and Max_iteration is the maximum iteration number.
[0096] Position Update: Update the position of each sparrow based on the global optimal solution and a random factor. The formula for updating the position of an individual sparrow is as follows:
[0097] X i (t+1)=X best +w·sin(2π·rand)·|rand·X best -X i (t)|
[0098] Among them, X best It is the current global optimal solution, rand is a randomly generated value, and w is the step size factor, which controls the magnitude of the individual position update.
[0099] S26: Introduction of Levy Flight Strategy
[0100] The Levy flight strategy simulates the sparrow's random step size selection during the search process, which can enhance the algorithm's exploration ability, especially in complex high-dimensional spaces.
[0101] Levy flight: Through the levy flight strategy, individual sparrows can perform large-stride jumps, thereby exploring regions in the search space far from local optima. The update rules are as follows:
[0102] X i (t+1)=X best +Levy(dim)
[0103] The Levy flight stride is generated by the following formula:
[0104]
[0105] Here, u and v are random variables generated from a normal distribution, and β is a constant (usually taken as 3 / 2) that controls the distribution characteristics of the step size.
[0106] S27: Individual Elimination and Retention
[0107] High-quality solutions are selected based on their fitness values. Individuals with poor fitness are eliminated, while those with good fitness are retained and continue to participate in subsequent iterations.
[0108] Fitness ranking: Calculate the fitness value of each individual and rank the population, eliminating the individual with the worst fitness.
[0109] Retain the best individuals: Keep the individuals with the best fitness and move them to the next search cycle.
[0110] S28: Determine the termination condition
[0111] Determine whether to stop the iteration based on the set termination conditions.
[0112] Termination condition: The algorithm terminates when the maximum number of iterations is reached or the fitness value converges; otherwise, it returns to step S22 to continue iterating.
[0113] S29: Applying optimization results to neural networks
[0114] Once the sparrow search algorithm completes its iterations and converges, the globally optimal solution found is assigned to the weights and biases of the neural network, thus completing the network training.
[0115] Optimal solution assignment: assign the optimal solution X best Decode the weights and biases into a BP network and update the network.
[0116] Complete training: Use the optimized neural network to make predictions and evaluate the model's performance.
[0117] S210: Results Evaluation and Performance Analysis
[0118] The trained neural network model is evaluated using test data, and its performance metrics (such as R-squared) are calculated. 2 RMSE, MAE, etc.
[0119] Prediction and Evaluation: Predictions are made on the test set, errors are calculated (e.g., prediction error, training error), and a linear regression plot is generated (e.g.,...). Figure 4 ).
[0120] Performance index calculation: Calculate various error indices, such as the coefficient of determination (R²). 2 ), root mean square error (RMSE), mean absolute error (MAE), etc. Figure 5 ), to evaluate the performance of the model.
[0121] S31: Initialize the population
[0122] First, a set of individuals is generated, each representing a potential solution for a concrete mix proportion. The position of each individual is a multi-dimensional vector representing the proportion of each component in the concrete mix. Individual initialization: A certain number of individuals are randomly generated, each with an 8-dimensional vector representing the proportions of cement, slag, fly ash, water, water-reducing agent, coarse aggregate, fine aggregate, and days, respectively. The initialization range is defined by the upper and lower bounds of the input (lb_GA and ub_GA). Encoding method: The encoding of each individual represents the concrete mix proportion parameters, where each dimension represents a mix component, such as cement or slag. The mix proportions of each generated individual will be randomly distributed within a given interval.
[0123] S32: Calculate fitness values (constrained multi-objective fitness function)
[0124] The fitness value of each individual concrete mix is used to measure the quality of that mix design. The fitness function typically consists of two parts: compressive strength and cost. In this step, we optimize these two objectives simultaneously using a weighted approach to ensure that the concrete mix design meets both strength requirements and cost-effectiveness, while also satisfying the constraints.
[0125] Fitness function calculation:
[0126] f1: Predicted compressive strength
[0127] Example formula:
[0128] f1=10·x1+8·x2-5·x3+2·x4+4·x5+3·x6-6·x7+5·x8
[0129] Where x1 to x8 represent the proportions of cement, slag, fly ash, water, water-reducing agent, coarse aggregate, fine aggregate, and days, respectively. The coefficients before x are weights extracted after training the neural network (weights from the input to the hidden layer and weights from the hidden layer to the output layer) to calculate the contribution of each input feature (each material) to the output (compressive strength f1).
[0130] 2.f2: Cost forecast
[0131] Example formula:
[0132] f2=80·x1+40·x2+20·x3+10·x4+25·x5+30·x6+5·x7+50·x8
[0133] Here, x1 to x8 represent the proportions of each component, and the coefficient before x is determined by the cost of each material (a fixed amount per kilogram).
[0134] 3. Constraints:
[0135] Lower limit constraint of compressive strength: The compressive strength must be greater than or equal to its minimum value f. 1min Right now:
[0136] g1 = f 1min -f1
[0137] Cost ceiling constraint: The cost cannot exceed its maximum value f2max, that is:
[0138] g2=f2-f 2max
[0139] 4. Penalty Clause: If any constraint is violated, a penalty clause must be added to punish the individual who violated the constraint. The penalty clause is calculated using the following formula:
[0140] penalty=α·violate1+β·violate2
[0141] Here, α and β are penalty factors, and violent1 and violent2 represent the degree of violation of compressive strength and cost constraints, respectively.
[0142]
[0143] 5. Fitness Matrix: The fitness matrix for each individual includes stress resistance, cost, and penalty term.
[0144] fitness(i,1)=f1,fitness(i,2)=f2,fitness(i,3)=penalty
[0145] S33: Sparrow Algorithm Optimization of BP Neural Network
[0146] In this step, the sparrow algorithm is used to optimize the weights and biases of the BP neural network to provide an accurate prediction model, supporting the optimization process of the genetic algorithm.
[0147] 1. Individual Initialization: The Sparrow Algorithm randomly generates a certain number of individuals, each representing a potential solution of the neural network. The position of each individual is a D-dimensional vector, where D is the total number of parameters of the neural network (including the weights and biases of all layers).
[0148] 2. Fitness Assessment: Each individual sparrow calculates its fitness value by evaluating its corresponding neural network output (i.e., predictions of concrete compressive strength and cost). The goal is to minimize the error between the predicted and actual values. The fitness value calculation formula is:
[0149] fitness(i,1)=f1,fitness(i,2)=f2,fitness(i,3)=penalty
[0150] Where f1 is the predicted compressive strength, f2 is the predicted cost, and penalty is the penalty term.
[0151] 3. Optimization Process: The sparrow algorithm simulates foraging behavior, gradually finding the optimal solution by updating the position of each individual. This step avoids the problem of getting trapped in local optima during the training of BP neural networks through a global search strategy.
[0152] S34: Selection Operation (Roulette Selection)
[0153] The selection operation uses an individual's fitness value to choose which individuals will be included in the next generation. Individuals with higher fitness values have a greater probability of being selected; the roulette wheel selection method is used to achieve this process.
[0154] 1. Calculate the sum of fitness values: The fitness value of each individual is calculated using the following formula:
[0155] F i =f i (1) +λf i (2) +λf i (3) -f i (4)
[0156] Among them, F i Let i be the total fitness of the i-th individual; Let λ represent the fitness of the i-th individual on the first, second, third, and fourth single objectives; λ is the weighting coefficient among the sub-objectives.
[0157] 2. Individual Selection: A roulette wheel selection is performed based on the sum of fitness scores. The probability of an individual being selected is proportional to its fitness. After random numbers are generated, the selected individual is calculated by accumulating the fitness scores.
[0158] S35: Crossover operation (single-point crossover)
[0159] Crossover is used to generate new individuals (offspring) and explore new concrete mix proportions by exchanging genes between parent individuals. A single-point crossover method is used, where genes are exchanged at a random crossover point in the parent individuals.
[0160] 1. Crossover point selection: Randomly select a crossover point from the genes of the parent individual, and then swap the genes after the crossover point.
[0161] 2. Generation of offspring: Crossover will produce two offspring individuals, and new concrete mix proportions will be generated through gene exchange.
[0162] 3. Ensure legality: After crossover, ensure that the gene values of each offspring individual are within the given upper and lower bounds, i.e., [lb_GA, ub_GA].
[0163] S36: Mutation Operation
[0164] Mutation is used to enhance population diversity and prevent the algorithm from getting trapped in local optima. Mutation is achieved by randomly changing a gene value of an individual.
[0165] 1. Mutation selection: A gene is randomly selected from each individual for mutation. The mutation point is randomly selected by mutation_point.
[0166] 2. Variation amplitude: The variation amplitude is generated by uniformly distributed random numbers. It is assumed that the mutated values come from a standard normal distribution, and the variation amplitude is set to randn*0.1.
[0167] 3. Update genes: After the mutation operation, a truncation operation is used to ensure that each gene value is still within the legal range, that is, to ensure that each gene value is still within the range of [lb_GA, ub_GA].
[0168] mutated_pop(i,:)=max(mutated_pop(i,:),lb_GA);
[0169] mutated_pop(i,:)=min(mutated_pop(i,:),ub_GA);
[0170] S37: Generate a new population
[0171] After the crossover and mutation operations are completed, a new generation of population is generated. The new population contains offspring individuals produced through crossover and mutation, as well as possible parent individuals.
[0172] 1. Generate new individuals: Generate new individuals through crossover and mutation operations, and merge them with the individuals selected in the selection operation to form a new population.
[0173] 2. Update the population: Use the new population mutated_pop as the current generation's population for the next generation's evolution.
[0174] S38: Determine the termination condition
[0175] The termination condition for a genetic algorithm is usually to stop the algorithm when the maximum number of generations is reached or the fitness converges. We determine whether to terminate based on the set conditions.
[0176] 1. Maximum generation: If the current generation reaches the maximum generation (max_generation), the algorithm stops.
[0177] 2. Fitness convergence: If the change in fitness value is less than a certain threshold convergence_threshold, the algorithm is considered to have converged and further iterations are stopped.
[0178] if|f current -f previous |<∈(stop algorithm)
[0179] Among them, f current and f previous ε represents the optimal fitness values for the current generation and the previous generation, respectively, and ε is the preset convergence threshold.
[0180] S39: Output the optimal solution
[0181] When the algorithm terminates, it outputs the individual with the best fitness in the current population as the final optimized solution, i.e., the optimal concrete mix design. By evaluating the fitness of all individuals, the individual with the best fitness is selected as the final solution.
[0182] 1. Select the best individual: By sorting the fitness of all individuals in the population, select the individual with the best fitness as the final solution.
[0183] [~,sort idx GA]=sort(fitness G A(:,4),′ascend′);
[0184] best_solution=pop_GA(sort_idx_GA(1),:)
[0185] Output: Outputs the gene value of the optimal concrete mix design, best_solution (e.g., ...). Figure 6 ).
[0186] In another embodiment of the present invention, a concrete mix design optimization system based on the sparrow algorithm and a multi-objective genetic algorithm is provided. This system can be used to implement the above-mentioned concrete mix design optimization method, specifically including:
[0187] Data acquisition and preprocessing module: used to acquire concrete mix proportion dataset, the dataset includes input features and output targets, the input features include the proportion parameters of cement, slag, fly ash, water, water-reducing agent, coarse aggregate, fine aggregate and days, the output targets include compressive strength and cost; the module normalizes the data and divides it into training set and test set;
[0188] The sparrow algorithm optimization module includes a BP neural network unit and a sparrow search unit.
[0189] The BP neural network unit includes an input layer, a hidden layer, and an output layer. The input layer contains 8 nodes, and the output layer contains 2 nodes, which are used to predict compressive strength and cost, respectively.
[0190] The sparrow search unit is used to optimize the weights and biases of the BP neural network, including:
[0191] The population initialization subunit is used to generate a sparrow population, where each individual represents a potential solution to the neural network parameters;
[0192] The fitness calculation subunit calculates the prediction error of an individual using the mean square error function;
[0193] The position update sub-unit adjusts the search step size using sine and cosine factors and updates the individual position using the Levy flight strategy.
[0194] Iteratively optimize sub-units, select individuals with the best fitness, and generate globally optimal neural network parameters;
[0195] Multi-objective genetic algorithm optimization module: includes population management unit, fitness evaluation unit, and evolutionary operation unit;
[0196] The population management unit is used to initialize the genetic algorithm population, where each individual represents a potential solution for the concrete mix proportion.
[0197] The fitness evaluation unit calculates the fitness value of each individual based on the optimized BP neural network, including the predicted value of stress resistance, the predicted value of cost, and the constraint penalty term. The predicted value of stress resistance must meet a preset lower limit, and the predicted value of cost must meet a preset upper limit.
[0198] The evolutionary operation unit generates a new population through roulette wheel selection, single-point crossover, and mutation operations, and iteratively optimizes it until the termination condition is met;
[0199] Output module: Used to generate and output the optimal concrete mix design that meets the constraints of compressive strength and cost.
[0200] In one embodiment of the present invention, a terminal device is provided, comprising a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions to achieve a corresponding method flow or corresponding function. The processor described in this embodiment of the present invention can be used for the operation of a concrete mix design optimization method.
[0201] In one embodiment of the present invention, a storage medium is provided, specifically a computer-readable storage medium (memory), which is a memory device in a terminal device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the terminal device and extended storage media supported by the terminal device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by a processor, which can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device.
[0202] One or more instructions stored in a computer-readable storage medium can be loaded and executed by a processor to implement the corresponding steps of the concrete mix proportion optimization method in the above embodiments; one or more instructions in the computer-readable storage medium are loaded and executed by a processor.
[0203] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0204] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0205] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0206] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0207] Those skilled in the art will recognize that the embodiments described herein are intended to help the reader understand the implementation methods of the present invention, and should be understood that the scope of protection of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific modifications and combinations based on the technical teachings disclosed in this invention without departing from the spirit of the invention, and these modifications and combinations are still within the scope of protection of the present invention.
Claims
1. A concrete mix design optimization method based on the Sparrow Algorithm and a multi-objective genetic algorithm, characterized in that: Includes the following steps: S1. Data Acquisition and Preprocessing: Obtain the concrete mix design dataset. Input features include cement, slag, fly ash, water, water-reducing agent, coarse aggregate, fine aggregate, and number of days. Output targets include compressive strength and cost. Normalize the input features and output targets, and divide the data into training and testing sets. S2. Sparrow Algorithm Optimization of BP Neural Network Training: Construct a BP neural network model with 8 nodes in the input layer and 2 nodes in the output layer to predict compressive strength and cost, respectively. The weights and biases of the BP neural network are optimized using a sparrow search algorithm, including: initializing a sparrow population, where each individual in the population represents a potential solution for the neural network parameters; calculating the prediction error of each individual using a fitness function, where the fitness function is the mean squared error of the neural network; updating the individual position using sine and cosine factors to adjust the search step size, and introducing a Levy flight strategy to enhance the global search capability; and generating globally optimal neural network parameters by iteratively selecting and retaining the individuals with the best fitness. The optimized neural network parameters are assigned to the BP neural network to complete the model training. S3. Multi-objective genetic algorithm optimization scheme: Initialize the genetic algorithm population, where each individual in the population represents a potential solution for the concrete mix proportion parameters; The fitness value of each individual is calculated based on the optimized BP neural network. The fitness value includes the predicted value of stress resistance, the predicted value of cost, and the penalty for violating the constraints. The predicted value of stress resistance must meet a preset lower limit, and the predicted value of cost must meet a preset upper limit. New populations are generated through roulette wheel selection, single-point crossover, and mutation operations, and iterative optimization is performed until the maximum number of generations or fitness convergence is reached. Output the optimal concrete mix design that satisfies both compressive strength and cost constraints.
2. The concrete mix design optimization method according to claim 1, characterized in that, Data preprocessing in S1 includes: The input features and output target are normalized using Min-Max normalization, as shown in the formula: Where X represents the original input feature or the output target value; X min X represents the minimum value of the feature or target; max X represents the maximum value of the feature or target; norm The value is the normalized value, and its range is limited to [0,1]. Cost calculation is based on engineering quota standards, combined with the actual consumption of each component in the concrete mix to generate cost indicators.
3. The concrete mix design optimization method according to claim 1, characterized in that, The specific process of optimizing neural network parameters using the Sparrow Algorithm in S2 includes: The step size adjustment formula for the sine and cosine factors is as follows: Among them, w min The minimum step size; w max `i` represents the maximum step size; `i` represents the current iteration number; `Max_iteration` represents the total number of iterations. The formula for updating individual location is: X i (t+1)=X best +w·sin(2π·rand)·|rand·X best -X i (t)| Among them, X i (t) represents the position of the i-th sparrow in the t-th iteration; X best This represents the position of the current global optimal solution; rand is a random number between 0 and 1. The step size generation formula for the Levy flight strategy is as follows: Where u and v are random variables that follow a normal distribution, β is a constant, and L is the Levy flight step size.
4. The concrete mix design optimization method according to claim 1, characterized in that, The fitness value calculation in S3 includes: The predicted compressive strength value is generated by the following linear combination formula: f1=10·x1+8·x2-5·x3+2·x4+4·x5+3·x6-6·x7+5·x8 The cost forecast is generated by the following linear combination formula: f2=80·x1+40·x2+20·x3+10·x4+25·x5+30·x6+5·x7+50·x8 Where x1 to x8 are the input features; The constraints include a predicted compressive strength value greater than or equal to a preset lower limit and a predicted cost value less than or equal to a preset upper limit. If any constraint is violated, the fitness value is adjusted through a penalty term.
5. The concrete mix design optimization method according to claim 1, characterized in that, The genetic algorithm operations in S3 include: In single-point crossover, the gene crossover point of the parent individual is randomly selected, the gene fragments after the crossover point are exchanged, and the parameters of the offspring individual are ensured to be within the preset upper and lower bounds. In the mutation operation, gene loci of an individual are randomly selected, and the mutation amplitude is generated through a normal distribution. The parameters after mutation are then truncated to ensure that they are within the legal range.
6. A concrete mix design optimization system based on the Sparrow Algorithm and a multi-objective genetic algorithm, characterized in that: This system can be used to implement the concrete mix design optimization method according to any one of claims 1 to 5, specifically including: Data acquisition and preprocessing module: used to acquire concrete mix proportion dataset, the dataset includes input features and output targets, the input features include the proportion parameters of cement, slag, fly ash, water, water-reducing agent, coarse aggregate, fine aggregate and days, the output targets include compressive strength and cost; the module normalizes the data and divides it into training set and test set; The sparrow algorithm optimization module includes a BP neural network unit and a sparrow search unit. The BP neural network unit includes an input layer, a hidden layer, and an output layer. The input layer contains 8 nodes, and the output layer contains 2 nodes, which are used to predict compressive strength and cost, respectively. The sparrow search unit is used to optimize the weights and biases of the BP neural network, including: The population initialization subunit is used to generate a sparrow population, where each individual represents a potential solution to the neural network parameters; The fitness calculation subunit calculates the prediction error of an individual using the mean square error function; The position update sub-unit adjusts the search step size using sine and cosine factors and updates the individual position using the Levy flight strategy. Iteratively optimize sub-units, select individuals with the best fitness, and generate globally optimal neural network parameters; Multi-objective genetic algorithm optimization module: includes population management unit, fitness evaluation unit, and evolutionary operation unit; The population management unit is used to initialize the genetic algorithm population, where each individual represents a potential solution for the concrete mix proportion. The fitness evaluation unit calculates the fitness value of each individual based on the optimized BP neural network, including the predicted value of stress resistance, the predicted value of cost, and the constraint penalty term. The predicted value of stress resistance must meet a preset lower limit, and the predicted value of cost must meet a preset upper limit. The evolutionary operation unit generates a new population through roulette wheel selection, single-point crossover, and mutation operations, and iteratively optimizes it until the termination condition is met; Output module: Used to generate and output the optimal concrete mix design that meets the constraints of compressive strength and cost.
7. A computer device, characterized in that: It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the concrete mix design optimization method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: It stores a computer program that, when executed by a processor, implements the concrete mix design optimization method according to any one of claims 1 to 5.
Citation Information
Cited By
Multi-source data fusion foam concrete construction process monitoring method and system
CN120931436A