Multi-variety small-batch product processing quality prediction method based on instant learning
By adopting an instant learning method in a multi-variety small batch production mode, combining Wast-SNE algorithm and Ad-AFSA to optimize bandwidth parameters, the shortcomings of traditional quality prediction methods in the case of uneven data and insufficient sample size are solved, and high-precision and real-time product quality prediction are achieved.
Patent Information
- Application Number
- CN202411848022.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-08
AI Technical Summary
Traditional product quality prediction methods based on large-scale production are difficult to adapt to the complex needs of multiple varieties of small-scale production models, especially in the case of uneven data distribution and insufficient sample size, it is difficult to achieve high-precision quality prediction.
The multi-variety small batch product processing quality prediction method is adopted based on real-time learning. By selecting the historical samples that are most similar to the current query sample online, a local model is established, and a Wasserstein divergence t-distributed random neighborhood embedding (Wast-SNE) algorithm is introduced for dimensionality reduction. Combined with the improved adaptive artificial fish school algorithm (Ad-AFSA) to optimize bandwidth parameters, real-time prediction of product processing quality is achieved.
It improves the accuracy and real-time product quality prediction in multiple small batch production scenarios, can quickly adapt to changes in the production environment, and ensures the reliability and accuracy of quality prediction.
Smart Images

Figure CN119784178A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of product processing quality prediction, in particular to a method for predicting the processing quality of multi-variety and small-batch products based on real-time learning. Background Art
[0002] Product quality prediction is a key link in industrial production. Its purpose is to make real-time predictions of quality characteristics by establishing a mathematical relationship between process variables and key quality characteristics, so as to ensure that products meet quality standards and optimize the production process. In the traditional mass production model, product quality prediction methods rely on global modeling techniques. These methods usually assume that data distribution is uniform and sample size is sufficient, and predict product quality by making full use of historical data. However, with the increasing diversification and personalization of market demand, the production model is gradually shifting from mass production to multi-variety small batch production, which poses new challenges to traditional quality prediction methods.
[0003] In the multi-variety small batch production mode, the same production line needs to frequently switch to produce products of multiple specifications, models or brands, and the production quantity of each product is relatively small, resulting in significant diversity and imbalance in data distribution. These characteristics make it difficult for traditional quality prediction methods based on mass production to adapt to the complex needs of multi-variety small batch scenarios. First, traditional quality prediction methods based on mass production often rely on global models. This method assumes that the data distribution is relatively balanced, but in multi-variety small batch production, due to the sparsity of data volume and the differences in distribution, global modeling methods are difficult to adapt effectively. Secondly, building an independent model only for a single specification product will lead to overfitting due to insufficient data volume, and the generalization ability of the model is weak, resulting in poor prediction results. Summary of the invention
[0004] In view of this, the present invention proposes a method for predicting the processing quality of multi-variety small batch products based on real-time learning. In each prediction, the method selects the historical sample most similar to the current query sample online to establish a local model, and has good adaptive ability for multi-specification characteristics. In view of the small amount of data in the process of multi-variety small batch production, the local weighted regression method in real-time learning is introduced to establish a local weighted regression model. Through the "divide and conquer" strategy, complex nonlinear problems are converted into linear problems, the computational complexity is reduced, and it is suitable for the calculation of small sample data. In terms of sample similarity calculation in the local modeling strategy, considering the characteristics of high dimension, high redundancy and nonlinearity of multi-variety small batch production process data, the t-distributed random neighbor embedding (Wast-SNE) algorithm with Wasserstein divergence is proposed for dimensionality reduction, and the Mahalanobis distance considering the time interval is used to calculate the similarity between the sample feature vectors after dimensionality reduction. Finally, in order to further improve the modeling accuracy under the conditions of small samples and uneven data distribution, the traditional global fixed weighted bandwidth parameter is abandoned, and the improved adaptive artificial fish swarm algorithm (Ad-AFSA) is used to design the optimal bandwidth parameter for each query sample to achieve real-time prediction of product processing quality.
[0005] According to one aspect of the present application, a method for predicting the processing quality of multi-variety and small-batch products based on real-time learning is proposed:
[0006] S1. Obtain the processing data and corresponding quality characteristic data of a certain production line in a multi-variety small batch production mode for processing products of different specifications. Preprocess the data and construct a historical sample set (x n ;z n ), (n=1,2,3,…,N).
[0007] S2. Based on the historical data obtained, the Wasserstein divergence-introduced t-distributed stochastic neighbor embedding (Wast-SNE) algorithm is used to analyze the historical sample set (x n ;z n ) to reduce the dimension and obtain the historical sample set after dimension reduction (y n ;z n ).
[0008] Specifically, step S2 is as follows:
[0009] S201, historical processing data x n As input, each x n It is a high-dimensional feature vector representing the processing variables of products of various specifications in the process of multi-variety small batch production.
[0010] S202. Traditional t-SNE uses KL divergence to calculate the difference between high-dimensional distribution and low-dimensional distribution during dimensionality reduction. However, when the two distributions do not overlap, KL divergence does not work effectively and does not pay enough attention to the global distribution characteristics. The Wasserstein divergence is introduced to replace the KL divergence. The Wasserstein divergence measures the distribution difference through geometric distance, can handle non-overlapping distributions and better preserve global and local characteristics, and improve the accuracy of dimensionality reduction results.
[0011] S203, use the Wast-SNE algorithm to transform the high-dimensional feature x n Map to the low-dimensional feature space to generate the sample point y after dimensionality reduction n , and obtain the historical sample set after dimension reduction (y n ;z n ), which is used for subsequent similarity calculation between samples and local model construction.
[0012] S3. Global bandwidth parameter τ of local weighted partial least squares regression (LWPLS) based on Mahalanobis distance considering time interval and improved adaptive artificial fish swarm algorithm (Ad-AFSA) g and controllable parameter a for optimization.
[0013] Specifically, step S3 is as follows:
[0014] S301. Incorporate the time interval as a weight factor into the Mahalanobis distance calculation formula to enhance the consideration of time correlation in the distance metric.
[0015] S302: Calculate the Mahalanobis distance matrix between samples.
[0016] S303, set the global bandwidth parameter τ of the local weighted partial least squares regression (LWPLS) g The controllable parameter a of the time interval is the decision variable. The optimization objective is to minimize the root mean square error (RMSE) of the LWPLS model prediction.
[0017] S304: an improved adaptive artificial fish swarm algorithm (Ad-AFSA) is proposed to solve the global optimal bandwidth parameter τ through iterative optimization. g and time interval controllable parameter a.
[0018] S4. Use the improved Ad-AFSA and LWPLS hybrid model to calculate the optimal bandwidth parameter τ for each training sample point n .
[0019] Specifically, step S4 is as follows:
[0020] S401: Take each training sample point in the historical sample set as a query sample in turn, and the remaining samples as training samples, and perform separate optimization calculations on bandwidth parameters.
[0021] S402: Calculate the distance between samples using the same method as steps S301 and S302.
[0022] S403: Set the bandwidth parameter τ of each training sample point n Set as decision variable. With fitness function F AFSA The maximum is the optimization target, and the fitness function F AFSA :
[0023]
[0024] in, is a sample (y n ;z n )The values predicted by the LWPLS model.
[0025] S404: An improved adaptive artificial fish swarm algorithm (Ad-AFSA) is proposed to solve the optimal bandwidth parameter τ of each training sample through iterative optimization. n .
[0026] S5. After calculating the optimal bandwidth parameters corresponding to all historical sample sets, the optimal bandwidth parameter τ n and the corresponding historical sample (y n ;z n ) are stored together as (y n ;z n ; τ n ),n=1,2,…,N.
[0027] S6. When the processing data of the current product on the production line is collected, a real-time data sample that needs to be predicted is formed, that is, query sample x q , reduce the dimension of the sample to obtain the query sample y after dimension reduction q .
[0028] S7. Select query sample y in the historical sample set q The L nearest samples around it, and the global optimal bandwidth parameter τ obtained in the offline training phase g Calculate the weight W of the L nearest samples around it g,l .
[0029] Specifically, step S7 is as follows:
[0030] S701 , calculating the distance between the query sample and the historical sample in the same manner as steps S301 and S302 .
[0031] S702: Select query sample x from the historical sample set qThe L nearest samples around it, and the global optimal bandwidth parameter τ obtained in the offline training phase g Calculate the weights of the L nearest samples around it. The weight calculation formula is as follows:
[0032]
[0033] Among them, W g,l represents the weight of the lth most recent sample.
[0034] S8. Perform weighted average calculation on the optimal bandwidth parameters of the L most recent samples to obtain the query sample y q The optimal bandwidth parameter τ q The specific formula is as follows:
[0035]
[0036] Here we use the weighted average method, that is, for the query sample x q The optimal bandwidth parameters of the nearest L training samples are weighted averaged to obtain the bandwidth parameter τ of the query sample. q Compared with the method of directly using the bandwidth parameter value of the Lth similar sample as the query sample bandwidth parameter, weighted averaging can effectively reduce the sensitivity of the bandwidth parameter to the selection of the L value, making it easier to find a suitable L value by the trial-and-error method.
[0037] S9. Run the LWPLS model according to the obtained optimal bandwidth parameters to perform real-time prediction and output key quality characteristic values.
[0038] Beneficial effects of the present invention: In view of the characteristics of diverse product specifications, uneven data distribution, and dynamic changes in the production environment in multi-variety small batch production, the present invention proposes a multi-variety small batch product processing quality prediction method based on instant learning, which can improve the prediction accuracy and real-time performance in practical applications. By introducing the improved t-SNE algorithm of Wasserstein divergence to reduce the dimension of high-dimensional feature data, not only the local neighborhood information of high-dimensional data is effectively retained, but also the similarity between samples is truly reflected in the low-dimensional space, solving the problem that the traditional method is prone to lose the global distribution characteristics in dimensionality reduction. In terms of sample similarity calculation, the time interval factor and Mahalanobis distance are combined to make the selected similar samples more representative, thereby improving the prediction accuracy of the quality characteristics of products of different specifications. In production, this method can quickly adapt to the addition of new products or new orders, adjust the model parameters in real time, and ensure reliability in a changing production environment. In addition, through the improved adaptive artificial fish swarm algorithm (Ad-AFSA), the global and local bandwidth parameters are optimized, which solves the problem that the traditional optimization algorithm is prone to fall into the local optimum, and further improves the model performance. In the actual scenario of multi-variety small-batch production, the present invention successfully achieves high-precision prediction of product quality, provides effective support for dynamic optimization and management decisions of production lines, and significantly helps improve enterprise production efficiency and product quality stability.
[0039] Based on the following detailed description of the present invention in conjunction with the accompanying drawings, those skilled in the art will become more aware of the above and other objects, advantages and features of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is a flow chart of a method for predicting processing quality of multi-variety and small-batch products based on just-in-time learning according to an embodiment of the present application.
[0041] Figure 2 A flow chart of a method for calculating distance between samples is provided for this application.
[0042] Figure 3 A two-stage computing framework diagram of an embodiment of the present application.
[0043] Figure 4 This is a flow chart of a method for calculating the optimal bandwidth parameter of each training sample point using improved Ad-AFSA according to one embodiment of the present application. DETAILED DESCRIPTION
[0044] The implementation process mainly includes the following nine steps, which are used to predict the real-time processing quality through two stages: offline training and online prediction. S1, S2, S3, S4, and S5 are offline training stages, and S6, S7, S8, and S9 are online prediction stages. The two-stage calculation framework diagram is shown in the attached figure. Figure 3 shown.
[0045] S1. Obtain the processing data and corresponding quality characteristic data of a certain production line in a multi-variety small batch production mode for processing products of different specifications. Remove outliers, remove missing values, and normalize the data to construct a historical sample set (x n ;z n ), (n=1,2,3,…,N).
[0046] Specifically, step S1 is as follows:
[0047] S101. In the multi-variety small batch production mode, the key process variable data of the product processing process is collected through various sensors arranged on the production line. n At the same time, the quality characteristic data of each batch of products is obtained from production records or testing equipment. n (such as hardness, surface roughness, dimensional tolerance, etc.), and associate these data with process variable data to form a complete original data set.
[0048] S102: for the acquired data, outliers outside the upper and lower interquartile ranges are identified and eliminated using a box plot method to eliminate abnormal values.
[0049] S103: For the acquired data, linear interpolation is used to fill in the missing values.
[0050] S104. The acquired data is normalized using the Min-Max normalization method to eliminate the influence of dimensional differences on subsequent modeling.
[0051] S2. In order to reduce the impact of high-dimensionality, high redundancy and nonlinearity of data on modeling in the process of processing multi-variety and small-batch products, the t-distributed stochastic neighbor embedding (Wast-SNE) algorithm with the introduction of Wasserstein divergence is used to analyze the historical sample set (x n ;z n ) to reduce the dimension and obtain the historical sample set after dimension reduction (y n ;z n ) to preserve the local structure of the sample, improve the accuracy of similarity calculation, and reduce the computational complexity.
[0052] Specifically, step S2 is as follows:
[0053] S201, the processing data set X={x1,x2,x3,…,x n The distribution of each sample in the high-dimensional space is represented by a Gaussian probability distribution, and the conditional probability p of the sample in the high-dimensional space is obtained. j|i :
[0054]
[0055] in, The data point x i The Gaussian mean square error centered at .
[0056] S202. In the low-dimensional space, for the low-dimensional feature matrix Y = {y1, y2, y3, ..., y n}, using t distribution instead of Gaussian distribution, the heavy-tailed characteristics of t distribution allow better matching of similarity distribution in high-dimensional space in low-dimensional space, effectively solving the crowding problem. The probability q that the i-th sample under t distribution is distributed around sample j j|i The calculation formula is as follows:
[0057]
[0058] Here, k and l are indices used to iterate over all possible point pairs in the dataset.
[0059] S203, introduce Wasserstein divergence to replace KL divergence to calculate the distance W (p) between two probability distributions in high-dimensional space and low-dimensional space j|i ,q j|i ), the calculation formula of Wasserstein divergence is as follows:
[0060]
[0061] Among them, ∏(P1,P2) represents all possible joint distributions of distributions P1 and P2. For each possible joint distribution γ, we can sample (x,y)~γ to get a sample x and y, and calculate the distance ‖xy‖ between the two samples. At the same time, we can calculate the expected value E of the distance between the two samples under the joint distribution γ. (x,y)~γ [‖xy‖], find the maximum next inf(E (x,y)~γ [‖xy‖]), thus obtaining the Wasserstein divergence of the two probability distributions.
[0062] S204, iteratively update the feature matrix Y of the low-dimensional space through the gradient descent method, calculate the probability distribution, and optimize the minimum Wasserstein divergence. The update expression of the feature matrix Y of the low-dimensional space is as follows:
[0063]
[0064] Among them, Y (t) represents the feature matrix after t rounds of iterations, η is the learning rate of gradient update, and a is the momentum factor.
[0065] S205, obtain a low-dimensional feature matrix Y, retain the various effective feature structures of the original data, and generate a historical sample set after dimensionality reduction (y n ;zn ), which provides a reliable basis for subsequent similarity calculation between samples and construction of local models.
[0066] S3. Considering the production time interval of products of different specifications and the overall data distribution imbalance, the global bandwidth parameter τ of the local weighted partial least squares regression (LWPLS) is calculated based on the Mahalanobis distance considering the time interval and the improved adaptive artificial fish swarm algorithm (Ad-AFSA). g and controllable parameter a for optimization.
[0067] Specifically, step S3 is as follows:
[0068] S301. Considering the influence of time interval on similarity, a time interval coefficient T(Δt) is introduced on the basis of Mahalanobis distance. The specific formula is as follows:
[0069]
[0070] Where Δt is x i and x j time interval, a is a controllable parameter used to control the rate of change of the time interval coefficient with Δt. i and x j The larger the time interval, the greater the i x j The smaller the impact; if x i and x j The smaller the time interval, the smaller the x i x j The greater the impact.
[0071] S302, calculate the Mahalanobis distance between samples, and the final calculation formula is:
[0072]
[0073] The controllable parameter a in the formula has a great influence on the result of the distance calculation between samples, and is then optimized together with the bandwidth parameter.
[0074] S303, set the global bandwidth parameter τ of the local weighted partial least squares regression (LWPLS) g and controllable parameter a are decision variables. The optimization objective is to minimize the root mean square error (RMSE) of the LWPLS model prediction.
[0075] S304: an improved adaptive artificial fish swarm algorithm (Ad-AFSA) is proposed to solve the global optimal bandwidth parameter τ through iterative optimization. g and time interval controllable parameter a.
[0076] Specifically, step S304 is as follows:
[0077] S3041, randomly generate the initial position of the artificial fish (i.e., parameter combination (τ g ,a)), set the number of fish, step length, field of view, etc.
[0078] S3042: Execute the artificial fish's tail-chasing, grouping, and foraging behaviors. If no new artificial fish that meets the conditions is found after executing the foraging behaviors for more than Try_Number times in a row, execute the random behavior. Here, the random behavior is improved by incorporating the reverse mechanism into the iterative process, expanding the optimization space, increasing the diversity of the population, and avoiding premature convergence of the algorithm.
[0079]
[0080] Among them, τ inext Indicates the random generation of new artificial fish. and Represents the maximum and minimum values of the artificial fish after trial exploration. τ i Indicates the current position of the artificial fish.
[0081] S3043. After each round of iteration, the fitness function is calculated for the parameters corresponding to all artificial fish in the fish school. If a new solution is found that is better than the bulletin board, the bulletin board is updated. This step ensures that the entire optimization process always moves in the direction of improving the accuracy of quality prediction.
[0082] S3044, the worst fitness N p ×θ artificial fishes are mutated. Otherwise, it is determined whether the cumulative number of times the billboard has not been updated is greater than Gtime; if the billboard has not been updated for Gtime, the population is initialized. The specific mutation operation formula is:
[0083]
[0084] Among them, τ iwnext The mutated artificial fish. best It is the artificial fish with the optimal solution for the billboard. τ iworst It is the artificial fish selected from the worst artificial fish group. As a mutation operator, in order to make the algorithm explore a wider solution space through a higher mutation rate in the early stage and refine the search through a lower mutation rate in the later stage to improve the solution accuracy, an adaptive mutation operator is proposed that gradually reduces the mutation rate as the number of evolutionary generations increases. The specific formula is as follows:
[0085]
[0086] in, is the initial mutation probability.
[0087] S3045. If the iteration reaches the preset termination condition, the optimal solution is output, that is, the optimal parameter combination (τ g ,a). Otherwise, adjust the step size and field of view, and return to S3042. Adaptive field of view and step size are introduced here. The field of view visual and step size step of the fish school decrease linearly with the increase of the number of iterations according to the following formula, ensuring that the algorithm performs global search in the early stage of iteration and realizes fine optimization around the minimum point in the later stage of iteration.
[0088]
[0089] Among them, visual i represents the visual field of the ith artificial fish in each iteration, max and visual min k are the maximum and minimum values of the artificial fish’s field of view. i is the current artificial fish iteration number, k max The maximum number of iterations set. max and step min They are the maximum and minimum values of the step size respectively.
[0090] S4. According to the local data characteristics of each training sample point, the improved Ad-AFSA and LWPLS hybrid model is used to calculate the optimal bandwidth parameter τ for each training sample point. n .
[0091] Specifically, step S4 is as follows:
[0092] S401: Take each training sample point in the historical sample set as a query sample in turn, and the remaining samples as training samples, and perform independent optimization calculations on bandwidth parameters one by one.
[0093] S402: Calculate the distance between samples using the same method as steps S301 and S302.
[0094] S403, for each training sample (y n ;z n ) to predict the quality characteristics and obtain the corresponding predicted value On this basis, the artificial fish swarm is randomly initialized and the number of artificial fish in the artificial fish swarm is set to N. p , each artificial fish corresponds to an alternative bandwidth parameter solution τ n By calculating the fitness function F of each artificial fish AFSA To evaluate the quality of the solution, take the fitness function F of the optimal artificial fish AFSA The value is recorded on the bulletin board. Here the fitness function F AFSA for:
[0095]
[0096] because It is the predicted value of the quality feature based on the LWPLS model and the current bandwidth parameter setting. The larger the fitness function is, the closer the predicted value is to the true value, that is, the bandwidth parameter makes the quality prediction more accurate.
[0097] S404, the subsequent optimization steps are the same as S3042-S3045, but the final result is the calculated optimal bandwidth parameter τ n .
[0098] S5. After calculating the optimal bandwidth parameters corresponding to all historical sample sets, the optimal bandwidth parameter τ n and the corresponding historical sample (y n ;z n ) are stored together as (y n ;z n ; τ n ),n=1,2,…,N, which provides a basis for fast retrieval and adaptive adjustment in the online prediction stage.
[0099] S6. When the processing data of the current product on the production line is collected, a real-time data sample that needs to be predicted is formed, that is, query sample x q , reduce the dimension of the sample to obtain the query sample y after dimension reduction q , ensuring that the comparison is made with historical samples in the same feature space.
[0100] S7, to adaptively adjust the optimal bandwidth parameter τ of the query sample q , select query sample y in the historical sample set q The L nearest samples around it, and the global optimal bandwidth parameter τ obtained in the offline training phase g Calculate the weight W of the L nearest samples around it g,l .
[0101] Specifically, step S7 is as follows:
[0102] S701 . Calculate the distance between the query sample and the historical sample using the same method as steps S301 and S302 .
[0103] S702: Select query sample x from the historical sample set q The L nearest samples around it, and the global optimal bandwidth parameter τ obtained in the offline training phase g Calculate the weights of the L nearest samples around it. The weight calculation formula is as follows:
[0104]
[0105] Among them, Wg,l represents the weight of the lth most recent sample.
[0106] S8. Perform weighted average calculation on the optimal bandwidth parameters of the L most recent samples to obtain the query sample y q The optimal bandwidth parameter τ q The specific formula is as follows:
[0107]
[0108] Here we use the weighted average method, that is, for the query sample x q The optimal bandwidth parameters of the nearest L training samples are weighted averaged to obtain the bandwidth parameter τ of the query sample. q Compared with the method of directly using the bandwidth parameter value of the Lth similar sample as the query sample bandwidth parameter, weighted averaging can effectively reduce the sensitivity of the bandwidth parameter to the selection of the L value, making it easier to find a suitable L value by the trial-and-error method.
[0109] S9, according to the optimal bandwidth parameter τ q , run the LWPLS algorithm and calculate its predicted value Through real-time learning and adaptive optimal bandwidth parameter adjustment, accurate prediction of the processing quality of multi-variety and small-batch products can be achieved.
[0110] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0111] The above is only the most effective implementation scheme of the present invention. It should be pointed out that for ordinary technicians in this technical field, appropriate improvements and modifications can be made without departing from the working principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for predicting the processing quality of multi-variety and small-batch products based on real-time learning, characterized by: In view of the characteristics of product specifications diversity, small production quantity of single product specifications, unbalanced data volume of various product specifications and high-dimensional nonlinear coupling of product quality influencing factors in multi-variety small batch production, real-time processing quality prediction is performed through two stages of offline training and online prediction, wherein (1), (2), (3), (4) and (5) are offline training stages, and (6), (7), (8) and (9) are online prediction stages. The method comprises: (1) Obtain the historical processing data and corresponding quality characteristic data of a production line in a multi-variety small batch production mode for products of different specifications. Remove outliers, remove missing values, and normalize the data to construct a historical sample set (x n ;z n ), (n=1,2,3,…,N). (2) In order to reduce the impact of high dimensionality, high redundancy and nonlinearity of data on modeling in the process of processing multi-variety and small batch products, the t-distributed stochastic neighbor embedding (Wast-SNE) algorithm with the introduction of Wasserstein divergence is used to analyze the historical sample set (x n ; z n ) to reduce the dimension and obtain the historical sample set after dimension reduction (y n ; z n ) to preserve the local structure of the sample, improve the accuracy of similarity calculation, and reduce the computational complexity. (3) Taking into account the production time interval of products of different specifications and the overall data distribution imbalance, the distance between samples is calculated based on the Mahalanobis distance considering the time interval, with the controllable parameter a and the global bandwidth parameter τ of the local weighted partial least squares regression (LWPLS) g As the decision variable, minimizing the root mean square error (RMSE) of LWPLS is the goal, and an improved adaptive artificial fish swarm algorithm (Ad-AFSA) is proposed to calculate the global optimal bandwidth parameter τ g and the optimal controllable parameter a. (4) According to the local data characteristics of each training sample point, the improved Ad-AFSA and LWPLS hybrid model is used to calculate the optimal bandwidth parameter τ for each training sample point n When calculating the optimal bandwidth parameter, this sample is used as the query sample, and the remaining samples are used as training samples, with the fitness function F AFSA The maximum is the goal. (5) After calculating the optimal bandwidth parameters corresponding to all historical sample sets, the optimal bandwidth parameter τ n And the corresponding historical sample (y n ; z n ) are stored together as (y n ; z n ; τ n ),n=1,2,…,N, which provides a basis for fast retrieval and adaptive adjustment in the online prediction stage. (6) When the processing data of the current product on the production line is collected, a real-time data sample that needs to be predicted is formed, that is, the query sample x q , reduce the dimension of the sample to obtain the query sample y after dimension reduction q , ensuring that the comparison is made with historical samples in the same feature space. (7) In order to accurately identify the historical samples that are most similar to the query sample in the case of data imbalance, the distance between samples is calculated based on the Mahalanobis distance considering the time interval. (8) is the optimal bandwidth parameter τ for adaptively adjusting the query sample q , select query sample y in the historical sample set q The L nearest samples around it, and the global optimal bandwidth parameter τ obtained in the offline training phase g Calculate the weight W of the L nearest samples around it g,l Based on the above weights, the optimal bandwidth parameters of the L most recent samples are weighted averaged to obtain the query sample y q The optimal bandwidth parameter τ q . (9) According to the optimal bandwidth parameter τ q , run the LWPLS algorithm and calculate its predicted value Through real-time learning and adaptive optimal bandwidth parameter adjustment, accurate prediction of the processing quality of multi-variety and small-batch products can be achieved.
2. The dimensionality reduction method and distance calculation between samples according to claim 1, characterized in that: The dimension reduction method and the distance calculation step between samples specifically include: (1) The processing data set X = {x1, x2, x3, …, x n The distribution of each sample in the high-dimensional space is represented by a Gaussian probability distribution, and the conditional probability p of the sample in the high-dimensional space is obtained. j|i : in, The data point x i The Gaussian mean square error centered at . (2) In low-dimensional space, for the low-dimensional feature matrix Y = {y1, y2, y3, …, y n }, using t distribution instead of Gaussian distribution, the heavy-tailed characteristics of t distribution allow better matching of similarity distribution in high-dimensional space in low-dimensional space, effectively solving the crowding problem. The probability q that the i-th sample under t distribution is distributed around sample j j|i The calculation formula is as follows: Here, k and l are indices used to iterate over all possible point pairs in the dataset. (3) Introduce Wasserstein divergence to replace KL divergence to calculate the distance W(p) between two probability distributions in high-dimensional space and low-dimensional space j|i ,q j|i ), through the gradient descent method, iteratively update the feature matrix Y of the low-dimensional space, calculate the probability distribution, and optimize the minimum Wasserstein divergence. The update expression of the feature matrix Y of the low-dimensional space is as follows: Among them, Y (t) represents the feature matrix after t rounds of iterations, η is the learning rate of gradient update, and a is the momentum factor. (4) The low-dimensional feature matrix Y retains multiple effective feature structures of the original data. By calculating the Mahalanobis distance between the sample points of the low-dimensional feature matrix, the similarity between the target sample and other samples is obtained. The larger the distance, the lower the similarity between the samples, and vice versa. The Mahalanobis distance calculation formula is as follows: Among them, y i and j are the eigenvectors of the i-th sample and the j-th sample after dimensionality reduction, and Δ is the class covariance matrix. (5) Considering the influence of time interval, the time interval coefficient T(Δt) is introduced on the basis of Mahalanobis distance. The specific formula is as follows: Where Δt is x i and x j time interval, a is a controllable parameter used to control the rate of change of the time interval coefficient with Δt. i and x j The larger the time interval, the greater the i x j The smaller the impact; if x i and x j The smaller the time interval, the smaller the x i x j The final x i and x j The distance between them is:
3. The method of claim 1 wherein the improved Ad-AFSA and LWPLS hybrid model is used to calculate the optimal bandwidth parameter τ for each training sample point. n , characterized in that: The improved Ad-AFSA and LWPLS hybrid model is used to calculate the optimal bandwidth parameter τ for each training sample point n The steps include: (1) Through the LWPLS model, each training sample (y n ; z n ) to predict the quality characteristics and obtain the corresponding predicted value On this basis, the artificial fish swarm is randomly initialized and the number of artificial fish in the artificial fish swarm is set to N. p , each artificial fish corresponds to an alternative bandwidth parameter solution τ n By calculating the fitness function F of each artificial fish AFSA To evaluate the quality of the solution, take the fitness function F of the optimal artificial fish AFSA The value is recorded on the bulletin board. Here the fitness function F AFSA for: because It is the predicted value of the quality feature based on the LWPLS model and the current bandwidth parameter setting. The larger the fitness function is, the closer the predicted value is to the true value, that is, the bandwidth parameter makes the quality prediction more accurate. (2) Execute the artificial fish's tail-chasing, flocking, and foraging behaviors. If a new artificial fish that meets the conditions is not found after executing the foraging behaviors for more than Try_Number times, that is, a new bandwidth parameter that improves the prediction quality is not found, it means that the current search may have fallen into a local optimal area and it is difficult to further improve the product quality prediction accuracy. At this time, the improved random behavior is introduced, and the reverse mechanism is incorporated into the iterative process to expand the optimization space, increase the diversity of the population, and avoid premature convergence of the algorithm. Among them, τ inext Indicates the random generation of new artificial fish. and Represents the maximum and minimum values of the artificial fish after trial exploration. τ i Indicates the current position of the artificial fish. (3) After each iteration, the fitness function is calculated for the bandwidth parameters corresponding to all artificial fish in the fish swarm. If a new solution is found that is better than the bulletin board, the bulletin board is updated. This step ensures that the entire optimization process always moves in the direction of improving the accuracy of quality prediction. (4) To further avoid falling into local optimality in complex multi-specification data scenarios, the N with the worst fitness p ×θ artificial fishes are mutated to make the bandwidth parameter distribution more diversified. Otherwise, it is determined whether the cumulative number of unupdated bulletin boards is greater than Gtime; if the bulletin board has not been updated for Gtime, the population is initialized. The specific mutation operation formula is: Among them, τ iwnext The mutated artificial fish. best It is the artificial fish with the optimal solution for the billboard. τ iworst It is the artificial fish selected from the worst artificial fish group. As a mutation operator, in order to make the algorithm explore a wider solution space through a higher mutation rate in the early stage and refine the search through a lower mutation rate in the later stage to improve the solution accuracy, an adaptive mutation operator is proposed that gradually reduces the mutation rate as the number of evolutionary generations increases. The specific formula is as follows: in, is the initial mutation probability. (5) If the iteration reaches the preset termination condition, the optimal solution is output, that is, the bandwidth parameter τ that can maximize the fitness function and improve the quality prediction accuracy n Otherwise, adjust the step size and field of view, and return to (2). Adaptive field of view and step size are introduced here. The field of view visual and step size step of the fish school decrease linearly with the increase of the number of iterations according to the following formula, ensuring that the algorithm performs a global search in the early stage of the iteration and achieves fine optimization around the minimum point in the later stage of the iteration. Among them, visual i represents the visual field of the ith artificial fish in each iteration, max and visual min k are the maximum and minimum values of the artificial fish’s field of view. i is the current artificial fish iteration number, k max The maximum number of iterations set. max and step min They are the maximum and minimum values of the step size respectively.
4. According to claim 1, the optimal bandwidth parameters of the L most recent samples are weighted averaged to obtain the query sample y q The optimal bandwidth parameter τ q , characterized in that: The optimal bandwidth parameters of the L most recent samples are weighted averaged to obtain the query sample y q The optimal bandwidth parameter τ q The steps include: (1) When the processing data of the current product on the production line is collected, a real-time data sample that needs to be predicted is formed, that is, the query sample x q . Based on claim 2, the distance between samples is calculated and the query sample x is selected from the historical sample set. q The L nearest samples around it, and the global optimal bandwidth parameter τ obtained in the offline training phase g Calculate the weights of the L nearest samples around it. The weight calculation formula is as follows: in, W g,l represents the weight of the lth most recent sample. (2) Based on the above weights, the optimal bandwidth parameters of the L most recent samples are weighted averaged to obtain the query sample x q The optimal bandwidth parameter τ q , the specific formula is as follows: Here we use the weighted average method, that is, for the query sample x q The optimal bandwidth parameters of the nearest L training samples are weighted averaged to obtain the bandwidth parameter τ of the query sample. q Compared with the method of directly using the bandwidth parameter value of the Lth similar sample as the query sample bandwidth parameter, weighted averaging can effectively reduce the sensitivity of the bandwidth parameter to the selection of the L value, making it easier to find a suitable L value by the trial-and-error method.