Surface roughness prediction method based on diffusion model and neural structure search

By combining diffusion models with neural architecture search, synthetic data that meets physical consistency is generated and the prediction network architecture is optimized, solving the problem of surface roughness prediction in small sample scenarios in ultra-precision machining, and achieving high-precision and robust prediction results.

CN122452631APending Publication Date: 2026-07-24NANCHANG HANGKONG UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANCHANG HANGKONG UNIVERSITY
Filing Date
2026-04-30
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

In ultra-precision machining, existing technologies struggle to accurately predict surface roughness in small-sample scenarios. This is due to data scarcity and fixed model architecture, which can lead to overfitting or underfitting. Furthermore, generative amplification methods and prediction models lack adaptive optimization, failing to achieve coordinated matching between data generation and model architecture, thus affecting prediction accuracy and physical consistency.

Method used

We employ a diffusion model and neural architecture search approach. By using an attention-controlled table diffusion model to generate synthetic data that satisfies physical consistency, and combining it with embedded neural architecture search to optimize the predictive network architecture, we can automatically search for the optimal network topology and solve the problems of scarce small sample data and fixed model architecture.

Benefits of technology

It significantly improves the accuracy and robustness of surface roughness prediction, achieves high-precision prediction under small sample conditions, solves the overfitting and underfitting problems in traditional methods, and improves the model's generalization ability and physical consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122452631A_ABST
    Figure CN122452631A_ABST
Patent Text Reader

Abstract

The application discloses a surface roughness prediction method based on a diffusion model and neural structure search, performs quantile normalization on process parameters, and performs Z-score standardization on surface roughness values; synthetic process parameter data meeting physical consistency and distribution fidelity is generated; a balanced, high-variety mixed training set is constructed to alleviate the data scarcity problem in a small sample scene; a Gaussian process-based Bayesian optimization strategy is adopted to automatically search for an optimal prediction network architecture matching the data complexity; then residual correction and structure fine-tuning are performed to improve the generalization ability and prediction robustness of the model under a small sample, and a surface roughness prediction value is output. The generalization ability and robustness of the model are improved, higher-precision surface roughness prediction can be realized, thereby providing a general solution for small-sample, high-dimensional and strong nonlinear process modeling in the field of precision manufacturing, and the surface quality prediction of other precision machining processes can be further popularized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the control technology of geometric accuracy in ultra-precision machining, and in particular to a surface roughness prediction method based on diffusion model and neural structure search. Background Technology

[0002] Ultra-precision machining (UPM) is a core enabling technology for achieving nanoscale surface roughness and submicron-level geometric accuracy. Its processed products are widely used in high-end fields such as aerospace, optical instruments, and biomedical engineering. In these applications, the performance of parts (such as scattering loss in optical systems and fatigue life of moving parts) is highly sensitive to surface morphology. Therefore, accurate prediction and proactive control of surface roughness during machining are crucial for ensuring product performance, improving production yield, and reducing R&D costs.

[0003] The surface formation mechanism in ultra-precision machining is extremely complex, involving strong coupling and nonlinear multi-physics interactions among cutting mechanics, material behavior, vibration dynamics, and thermal effects. Deep correlations exist between process parameters, tool geometry, workpiece material properties, and system dynamics. Traditional analytical or empirical models based on simplification assumptions struggle to accurately capture these intrinsic mechanisms and have limited generalization capabilities. Furthermore, ultra-precision machining experiments are costly and time-consuming, and the available process parameter data for modeling is extremely limited. This constitutes a fundamental bottleneck for the application of data-driven methods in this field.

[0004] In recent years, data-driven methods, represented by deep neural networks, have been introduced into the field of surface quality prediction. However, when applied to small-sample scenarios in ultra-precision machining, they have at least the following problems: First, the model is highly dependent on large-scale training data. When data is scarce, it is prone to severe overfitting, and the generalization performance degrades rapidly. Second, most methods adopt predefined fixed network architectures, which lack the flexibility to adapt to complex and unknown feature mappings of specific process datasets. Third, the predictions of pure black-box models are less constrained by physical principles, which may produce statistically reasonable but physically unreliable results, reducing the interpretability and engineering credibility of the model.

[0005] To address the scarcity of small sample data, generative data augmentation has become a mainstream strategy. Diffusion models, as an emerging generative modeling method, have demonstrated strong capabilities in tabular data modeling. However, traditional tabular diffusion models, based on MLP (Multilayer Perceptron) denoising networks, struggle to explicitly capture the physically meaningful global coupling relationships between process parameters. Furthermore, the generation process is decoupled from the downstream prediction task, failing to guarantee that the generated data can effectively improve prediction accuracy and physical consistency. Simultaneously, the integration of existing generative augmentation methods with prediction models lacks adaptive optimization, failing to achieve a synergistic match between data generation and model architecture, thus hindering the full realization of the value of augmented data. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention proposes a surface roughness prediction method based on a diffusion model and neural architecture search. By using an attention-controlled table diffusion model to amplify physically consistent small sample data, and combining it with an embedded neural architecture search model to automatically optimize the prediction network architecture, this method solves the problems of data scarcity, parameter coupling, and fixed model architecture in ultra-precision machining scenarios with small sample sizes, thereby improving the accuracy and robustness of surface roughness prediction.

[0007] The objective of this invention is achieved through the following technical solution: A surface roughness prediction method based on diffusion models and neural structure search, comprising the following steps: Step 1: Obtain the ultra-precision machining process parameters and the corresponding raw surface roughness data, perform quantile normalization on the process parameters, standardize the surface roughness values ​​using Z-score (standard score), and complete data cleaning, outlier removal, and feature encoding preprocessing. Step 2: Construct an attention-controlled table diffusion model, train the model using the preprocessed raw data, and generate synthesis process parameter data that meets physical consistency and distribution fidelity. Step 3: The generated high-fidelity synthesis process parameter data is fused with the original experimental data in proportion to construct a balanced and highly diverse hybrid training set to alleviate the data scarcity problem in small sample scenarios; Step 4: Construct an embedded neural architecture search (NAS) module on the mixed training set. Using the number of hidden layers, the number of neurons, and the activation function as the search space, a Bayesian optimization strategy based on Gaussian processes is adopted to automatically search for the optimal prediction network architecture that matches the data complexity. Step 5: Construct a coarse-fine two-level prediction model based on the optimal network architecture obtained from the search. First, complete the basic training on the mixed training set, and then perform residual correction and structural fine-tuning to improve the model's generalization ability and prediction robustness under small sample conditions. Step 6: Input the ultra-precision machining process parameters to be predicted into the trained prediction model after the same preprocessing, and output the predicted surface roughness value.

[0008] Furthermore, the main body of the attention-controlled table diffusion model adopts a multi-head self-attention (MHSA) mechanism and introduces a time-conditioning modulation module (TMM). The TMM integrates a cross-attention structure to achieve accurate modeling of the global dependence of process parameters and the diffusion time characteristics. During the model training phase, the preprocessed raw process parameter data is used as input, and a forward diffusion process is executed: Gaussian noise is progressively added to the raw data, for a total of T... The diffusion operation is performed step by step, with the noise intensity increasing by a preset cosine function at each step, ultimately resulting in a noisy data sequence consistent with the distribution of pure Gaussian noise. In the reverse denoising process, the input features are first weighted dimension-wise using a feature gating mechanism to dynamically strengthen key process parameter features and suppress redundant information, providing more discriminative feature representations for subsequent attention calculations. A multi-head self-attention mechanism, as the core feature extraction unit, globally models the gated process parameter features, capturing the nonlinear coupling relationships between different process parameters and the potential correlation between process parameters and surface roughness, addressing the shortcomings of traditional table-based diffusion models that can only model local features and lack sufficient global dependency capture. The Time Conditional Modulation (TMM) module, through an internal cross-attention structure, encodes the diffusion time step information as a query vector with a sinusoidal position and uses process parameter features as key / value vectors. Through cross-attention calculations, it achieves deep fusion of time information and features, guiding the network to learn the noise prediction patterns at different time steps, solving the problems of insufficient time information modeling and poor denoising accuracy in traditional diffusion models. After model training, starting from pure Gaussian noise, a T... The reverse denoising process is then used to generate the final synthesis process parameters and corresponding surface roughness data that meet physical consistency and have no significant difference from the statistical distribution of the original data.

[0009] Furthermore, the attention-controlled table diffusion model introduces a multi-head self-attention mechanism (MHSA) and a time-conditional modulation module (TMM) to capture the global dependencies between process parameters and the temporal characteristics of the diffusion process.

[0010] Furthermore, the search space includes the number of hidden layers, the number of neurons in each layer, and the type of activation function, and a Bayesian optimization strategy based on Gaussian processes is used for architecture search.

[0011] This invention addresses the overfitting or underfitting issues of traditional fixed network architectures in small-sample scenarios, ensuring that the statistical distribution of generated data does not differ significantly from that of real data, thus improving the model's generalization ability and robustness. It also solves the problem of insufficient physical consistency in the generated data of traditional diffusion models, enabling higher-precision surface roughness prediction. This provides a general solution for small-sample, high-dimensional, and strongly nonlinear process modeling in precision manufacturing, and can be further extended to surface quality prediction for other precision machining processes. It effectively solves the overfitting problem under small-sample conditions and significantly improves prediction accuracy and generalization ability, making it suitable for quality prediction and process optimization in ultra-precision machining processes. Attached Figure Description

[0012] Figure 1 This is a flowchart of the present invention; Figure 2 This is a structural diagram of the present invention; Figure 3 This is a comparison chart of predicted and actual values ​​in an embodiment of the present invention; In the diagram: 1. Input dataset; 2. Preprocessing module; 3. Attention-controlled table diffusion model; 31. Forward diffusion noise addition; 32. Inverse denoising network; 33. Feature gating mechanism; 34. Self-attention module; 35. Cross-attention module; 36. Temporal embedding module; 37. Temporal control module; 38. MLP; 4. Mixed dataset; 41. Synthetic data; 42. Real data; 5. Embedded neural architecture search module; 51. Prior distribution; 52. Acquisition function; 53. Candidate architecture set; 54. Training evaluation; 55. Termination criterion; 6. Coarse-fine two-level prediction module; 61. Basic predictor; 62. Feature fusion; 63. Fine-grained predictor; 64. Prediction Ra. Detailed Implementation

[0013] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings and embodiments. See also... Figures 1 to 3 A surface roughness prediction method based on diffusion model and neural structure search is proposed. High-fidelity processing data is generated by using a self-attention-based attention-controlled table diffusion model 3, and then the surface roughness is predicted by the model obtained by neural structure search.

[0014] Example 1: The method of the present invention includes the following steps (e.g.) Figure 1 and Figure 2 (as shown) S201 acquires the original dataset of ultra-precision machining and performs quantile normalization preprocessing to obtain a standardized feature sequence; In this embodiment, the ultra-precision machining experimental dataset used for model training is taken from the publicly published journal paper "Surface Roughness Modeling of Elliptical Vibration Cutting of Ductile Materials". This data also constitutes the input dataset 1 of the model. In order to ensure the learnability and distribution stability of the small sample data of ultra-precision machining in the diffusion model, the machining parameter features and surface roughness target values ​​are preprocessed differently by the preprocessing module 2.

[0015] For machining parameter features (including feed rate, depth of cut, cutting speed, tool tip radius, tool clearance angle, and tool cutting edge radius), quantile normalization is used. Let the original feature be x, and its empirical cumulative distribution function be F(x). Then the normalized feature is represented as: x′=F(x). After this transformation, each feature is mapped to the [0,1] interval. While eliminating dimensional differences, the original data's ordering relationship and distribution pattern are preserved, which is beneficial for characterizing the nonlinear coupling relationship between process parameters.

[0016] The target surface roughness value is processed using the Z-score normalization method. Let the original roughness value be y, and its mean and standard deviation be μ and σ, respectively. Then the normalized target value is expressed as: After this processing, the target variable is transformed into a standard normal distribution with zero mean and unit variance, which helps improve the numerical stability of the diffusion model in the continuous value modeling process and makes it more consistent with the Gaussian noise assumption.

[0017] Through the above preprocessing steps, a data input format with uniform scale and normalized distribution is obtained, that is, the processing parameters satisfy X∈[0,1]. d The roughness satisfies y ~ N(0,1), thus providing a reliable data foundation for subsequent diffusion model data generation and prediction model training.

[0018] S202 Constructs an attention-modulated table diffusion model 3, which uses a self-attention mechanism to capture the global coupling relationship between processing parameters.

[0019] S203 uses attention-controlled table diffusion model 3 to perform inverse denoising iteration under time step condition adjustment, generating synthetic processing data with physical consistency.

[0020] After preprocessing, feature data of uniform scale and standardized surface roughness data are obtained, denoted as initial sample x. O Based on this, the initial sample x O The input is fed into the attention-controlled table diffusion model 3, and forward diffusion noise addition 31 is performed. Gaussian noise is gradually introduced to obtain the noise sample x at the t-th time step. T Then, the noise sample x TAs input features, they are fed into the inverse denoising network 32 for feature extraction and noise modeling.

[0021] The inverse denoising network 32 is the core structure of the attention-controlled table diffusion model 3 (e.g. Figure 2 As shown in the diagram, it internally includes a feature gating mechanism 33, a self-attention module 34, a temporal control module 37, and an MLP mapping layer 38. The temporal control module 37 contains a cross-attention module 35 and a temporal embedding module 36. These modules are connected sequentially according to the data flow order to form a unified network structure. First, the input noise sample x... T The initial feature representation H is obtained by mapping to a high-dimensional feature space through a linear projection layer. (0) The projection layer uses a linear transformation to map the original 6-dimensional process parameters to a 128-dimensional hidden feature space, thereby improving the feature representation capability.

[0022] Subsequently, the features are input into the self-attention module 34, in which the input features are set as follows: Each column represents an embedded representation of a processing parameter feature or surface roughness variable. To enhance the model's ability to select key features, a feature gating mechanism is introduced before attention calculation,33 to construct a learnable gating matrix. And by performing element-wise weighted summation, we get: ; This enables the model to dynamically adjust the importance of different features based on the diffusion stage. Based on this, the gated features are mapped to a query matrix, a key matrix, and a value matrix, respectively. ,in These are learnable parameters. A multi-head attention mechanism is used to model the features. For the i-th attention head, the calculation process is as follows: ; The fused features are obtained by concatenating the outputs of each attention point and applying a linear mapping: ; The following is obtained through residual connection and layer normalization operations: ; And further obtained through a feedforward neural network: ; This allows for the modeling of the global dependencies between multidimensional process parameters.

[0023] Based on this, the features output from the self-attention module 34 are input to the cross-attention module 35 to introduce diffusion time step information and achieve conditional modeling. Simultaneously, time step t is input to the temporal embedding module 36, and a temporal conditional vector is obtained through sinusoidal position encoding and multilayer perceptron mapping. ; This is used to characterize global context information for the current diffusion stage. In the cross-attention module 35, the self-attention output H is used. ,(1) As the query matrix, with time condition vector c t Using the key matrix and value matrix, the attention calculation process is constructed as follows: ; in, For the learnable parameter matrix, d k This serves as the feature dimension. Through this cross-attention mechanism, temporal information is explicitly injected into the feature modeling process, enabling the model to dynamically adjust feature representations according to different diffusion stages. Further, fused features are obtained through residual connections and layer normalization. ; Finally, the fused features are input into the MLP38 mapping layer. The MLP38 uses a fully connected structure [128→512→512→6] to perform nonlinear transformation and dimension reduction on the features, and outputs a noise prediction vector with the same dimension as the input. This is used to characterize the noise distribution during the diffusion process and guide the reverse denoising process. Through the above unified structure, the reverse denoising network 32 achieves collaborative modeling of processing parameter features, surface roughness variables, and diffusion time information, enabling the model to have adaptive adjustment capabilities at different diffusion stages, thereby effectively improving the distribution consistency, prediction accuracy, and physical rationality of the generated data.

[0024] S204 mixes the synthetic processing data with the original dataset to construct a hybrid dataset 4 to alleviate small sample overfitting; The generated synthetic data 41 is fused with the real data 42 to construct a hybrid dataset 4, which solves the problem of scarce experimental data for ultra-precision machining and meets the needs of model training.

[0025] S205 utilizes embedded neural architecture search (NAS) to automatically search for the optimal predictive network topology on hybrid dataset 4; The embedded neural architecture search module 5 is used to preset a search space containing the number of hidden layers, the number of neurons, and activation functions, and automatically search for the optimal prediction network architecture on the mixed training set.

[0026] The embedded neural architecture search module 5 is preferably implemented based on a Bayesian optimization strategy, automatically searching for the optimal neural architecture that fits the ultra-precision machining process data, enabling the prediction model to achieve both lightweight and high accuracy. The specific design is as follows: (a) Definition of search space: Hidden layer dimension: Optional parameters are [32, 64, 128, 256, 512], which are used to adjust the feature dimension of the intermediate layers of the network, thereby balancing model processing accuracy and computational efficiency.

[0027] Network layers: The optional parameters are [2, 3, 4, 5], which are used to control the depth of the network structure to adapt to the process data mapping requirements of different complexities.

[0028] Activation function: Optional parameters are [ReLU, Leaky, Softplus, Swish]. By comparing different nonlinear activation functions, the activation strategy that best matches the nonlinear coupling relationship of process parameters is selected.

[0029] Dropout probability: Optional parameters are [0.0, 0.1, 0.2, 0.3, 0.5], used to control the strength of model regularization in order to alleviate overfitting and further improve the model's generalization ability.

[0030] (II) Bayesian Optimization Search Strategy: A Gaussian process is used to construct a performance surface model, and the acquisition function 52 is used to guide the iterative search for candidate architectures. The specific process is as follows: 1. Performance surface modeling: Based on the initial prior distribution 51, the mapping relationship between the hyperparameters of the candidate architecture and the verification performance is modeled using a Gaussian process to accurately capture the distribution characteristics of the architecture performance.

[0031] 2. Acquisition function 52 selection: EI or UCB is used as the acquisition function 52 to intelligently screen the most promising candidate architecture in the current performance surface, thereby balancing the relationship between "utilization" and "exploration".

[0032] 3. Candidate architecture generation: Based on the output of the acquisition function 52, a set of candidate architectures 53 is generated to complete the screening of the architectures to be evaluated in this round.

[0033] 4. Training and Evaluation 54: Train and evaluate the candidate architecture on a mixed training set 54 to obtain the validation performance metrics of the architecture.

[0034] 5. Termination Judgment: Determine whether the iteration termination condition is met by using termination criterion 55 (preferably setting the number of iterations to 20, or performance convergence); if not, feed back the evaluation results to update the prior distribution 51 and repeat the above iteration process; if satisfied, terminate the search and output the optimal architecture.

[0035] 6. Optimal Architecture Output: After 20 iterations of evaluation, the candidate architecture with the smallest MSE and the highest R² on the validation set is selected as the optimal neural architecture for the final adaptation to ultra-precision machining data.

[0036] S206 employs a coarse-fine two-level prediction and feature fusion 62 residual correction mechanism, combined with error-driven iterative training; The optimal network architecture parameters obtained from the search are updated to the prediction network module. The prediction model uses a two-stage coarse and fine prediction module 6 to improve the prediction accuracy. The specific process is as follows: Step 1: Coarse prediction stage: The input process parameters are modeled using the basic predictor 61 to obtain preliminary prediction results of surface roughness; Step 2: Feature Fusion Stage 62: The original input features are fused with the coarse prediction results features 62 times to form a multi-dimensional enhanced feature representation; Step 3: Fine prediction stage: Based on the fusion features, a fine prediction model 63 is constructed to correct the residuals of the coarse prediction results and achieve accurate output of the final prediction results; Step 4: Model Training Phase: Construct a loss function based on the error between the predicted results and the true values, and iteratively optimize the model weights; S207 Surface Roughness Prediction; The elliptical vibration cutting process parameters to be predicted are input into the trained CDNAS model, and the model outputs the prediction results of the surface roughness of ultra-precision machining.

[0037] S208 Model Performance Evaluation and Comparison Experiment (e.g.) Figure 3 (as shown) The predictive performance of the model is evaluated using metrics such as mean absolute error (MAE), root mean square error (RMSE), and coefficient of determination (R²). The technical effectiveness of each innovative module of this invention is verified through module effectiveness verification experiments.

[0038] This invention provides a surface roughness prediction method based on a diffusion model and neural architecture search. It deeply integrates an attention-controlled table diffusion model 3 with an embedded neural architecture search module 5. First, it achieves small-sample data amplification with physical consistency, and then automatically optimizes the prediction network architecture for the amplified mixed dataset 4. It accurately captures the complex nonlinear coupling relationship between six process parameters and surface roughness, thereby significantly improving the prediction accuracy of ultra-precision machined surface roughness. On a real elliptical vibration cutting dataset, it can achieve a high prediction accuracy of MAE=1.5231μm and R²=0.9988.

[0039] Example 2: A surface roughness prediction method based on diffusion model and neural structure search is described below (as shown in Figure 2): Input dataset 1 is used to obtain the original dataset for ultra-precision machining and generate model input data. The original data includes process parameters such as feed rate, depth of cut, cutting speed, tool tip radius, tool clearance angle, and tool edge radius, as well as the corresponding measured surface roughness values. Preprocessing module 2 is used to perform normalization preprocessing on the input original data, including quantile normalization of machining parameters and Z-score standardization of surface roughness to obtain a standardized feature sequence. Attention-controlled table diffusion model 3 is used to perform model training and data generation based on the preprocessed standardized feature sequence, generating synthetic data 41 that meets physical consistency and distribution fidelity. Embedded neural architecture search module 5 is used to perform automatic search for the prediction network architecture based on the hybrid dataset 4 obtained by fusing synthetic data 41 and real data 42, and output the optimal prediction network architecture that adapts to the data complexity. Coarse and fine two-level prediction module 6 is used to construct a complete CDNAS surface roughness prediction model based on the optimal network architecture obtained by the search, and output the predicted surface roughness value for ultra-precision machining (i.e., predicted Ra 64).

[0040] Preprocessing module 2 is configured to perform differentiated preprocessing on machining parameter features and surface roughness target values. Specifically, for machining parameter features such as feed rate, depth of cut, cutting speed, tool tip radius, tool clearance angle, and tool cutting edge radius, quantile normalization is used to process them, mapping each feature to the [0,1] interval, eliminating dimensional differences while preserving the original data's sorting relationship and distribution shape. For surface roughness target values, Z-score standardization is used to process them, converting the target variable into a standard normal distribution with zero mean and unit variance, improving the numerical stability of the diffusion model.

[0041] The attention-controlled table diffusion model 3 includes: forward diffusion noise addition 31 and inverse denoising network 32; wherein the inverse denoising network 32 includes feature gating mechanism 33, self-attention module 34, time control module 37 and MLP 38, and the time control module 37 is composed of cross-attention module 35 and time embedding module 36. The forward diffusion noise addition module 1 is configured to progressively introduce Gaussian noise into the standardized feature sequence to construct a noisy data sequence for the diffusion model. The feature gating mechanism 33 is configured to perform adaptive weight selection and redundant feature suppression on process parameter features. It dynamically assigns higher response weights to key process features through a gating activation function, weakening the interference of low-contribution and weakly correlated features. While preserving the physical correlation characteristics of process parameters, it simplifies feature dimensions and strengthens the expression of core effective information, improving the effectiveness of subsequent feature fusion 62 and noise modeling. The self-attention module 34 is configured to perform global modeling on the preprocessed process parameter features, capturing the nonlinear coupling relationship between different process parameters and the potential correlation between process parameters and surface roughness. The cross-attention module 35 is configured to fuse diffusion time step information to achieve deep fusion of time information and process features. The time embedding module 36 is configured to generate a time condition vector by mapping the diffusion time step t through sinusoidal position encoding and a multilayer perceptron, providing time context information for the cross-attention module 35. The MLP 38 is configured to perform nonlinear transformation and dimensionality restoration on the fused features, outputting a noise prediction vector to guide the reverse denoising process.

[0042] The attention-controlled table diffusion model 3 is also configured to: input the preprocessed initial sample x0 into the model, perform a forward diffusion process through forward diffusion noise addition 31, and gradually introduce Gaussian noise to obtain a noisy data sequence; input the noisy sample into the inverse denoising network 32, and complete feature extraction and noise modeling through the feature gating mechanism 33, the self-attention module 34, the time control module 37 and the MLP 38 in sequence; start from pure Gaussian noise, perform a T-step inverse denoising process, and finally generate synthetic process parameters and corresponding surface roughness data (i.e., synthetic data 41) that are not significantly different from the statistical distribution of the original data.

[0043] The embedded neural architecture search module 5 includes: a prior distribution 51 configured to construct a mapping model between candidate architecture hyperparameters and validation performance based on a Gaussian process; a collection function 52 configured to use an EI or UCB strategy to balance the "utilization" and "exploration" of architecture search and select the most promising candidate architectures; a candidate architecture set 53 configured to generate a set of network architectures to be evaluated based on the output of the collection function 52; a training and evaluation 54 configured to train the candidate architectures on a mixed training set and obtain validation performance metrics; and a termination criterion 55 configured to determine whether the iteration meets the termination condition (20 iterations or performance convergence). If not, the prior distribution 51 is updated and the iteration is repeated. If the condition is met, the optimal network architecture is output.

[0044] The embedded neural architecture search module 5 is also configured to preset a search space, which includes the hidden layer dimension (optional parameters are [32,64,128,256,512]), the number of network layers (optional parameters are [2,3,4,5]), the activation function type (optional parameters are [ReLU,Leaky,Softplus,Swish]), and the dropout probability (optional parameters are [0.0,0.1,0.2,0.3,0.5]), to adapt to the mapping requirements of process data with different complexities, and to balance model accuracy and computational efficiency.

[0045] The coarse and fine two-stage prediction module 6 includes: a basic predictor 61 configured to model the input process parameters and obtain a preliminary prediction result of surface roughness; a feature fusion 62 configured to fuse the original input features with the coarse prediction result of the basic predictor 61 to provide correction input for fine prediction; and a fine predictor 63 configured to fuse the original input features with the coarse prediction result to construct a residual correction model, compensate for the error of the coarse prediction result, and output the final accurate surface roughness prediction value (i.e., prediction Ra64).

[0046] The attention-controlled table diffusion module of this invention explicitly models the global dependency relationship of process parameters through a self-attention mechanism, and dynamically adjusts the feature reconstruction of the diffusion steps by combining the time condition modulation module. This solves the problem of insufficient physical consistency of the data generated by the traditional diffusion model, so that the statistical distribution of the generated data is not significantly different from that of the real data 42 (KS test p≥0.05).

[0047] The embedded neural architecture search module 5 of this invention realizes adaptive optimization of the predictive network architecture without the need for manual parameter tuning and expert experience. It automatically matches the data complexity and model capacity, solving the problem of overfitting or underfitting of traditional fixed network architectures in small sample scenarios, thereby improving the generalization ability and robustness of the model.

[0048] The model of this invention adopts a modular design, with data augmentation and model optimization modules working synergistically and progressively. Through the combined effect of these two modules, it addresses the bottleneck of scarce experimental data in ultra-precision machining and fully leverages the value of augmented data. This provides a general solution for modeling small-sample, high-dimensional, and strongly nonlinear processes in precision manufacturing, and can be further extended to surface quality prediction in other precision machining processes. It solves the problems of low prediction accuracy, poor generalization ability, insufficient physical consistency, and heavy reliance on human experience in small-sample ultra-precision machining scenarios using existing data-driven methods. Synthetic machining data is generated through a diffusion model, and the optimal prediction model is automatically constructed using a neural structure search algorithm to improve the accuracy of surface roughness prediction.

Claims

1. A surface roughness prediction method based on diffusion model and neural structure search, characterized in that, The steps are as follows: Step 1: Obtain the ultra-precision machining process parameters and the corresponding raw surface roughness data, perform quantile normalization on the process parameters, perform Z-score standardization on the surface roughness values, and complete data cleaning, outlier removal and feature encoding preprocessing. Step 2: Construct an attention-controlled table diffusion model, train the model using the preprocessed raw data, and generate synthesis process parameter data that meets physical consistency and distribution fidelity. Step 3: The generated high-fidelity synthesis process parameter data is fused with the original experimental data in proportion to construct a balanced and highly diverse hybrid training set to alleviate the data scarcity problem in small sample scenarios; Step 4: Construct an embedded neural architecture search module on the mixed training set. Using the number of hidden layers, the number of neurons, and the activation function as the search space, a Bayesian optimization strategy based on Gaussian processes is adopted to automatically search for the optimal prediction network architecture that matches the data complexity. Step 5: Construct a coarse-fine two-level prediction model based on the optimal network architecture obtained from the search. First, complete the basic training on the mixed training set, and then perform residual correction and structural fine-tuning to improve the model's generalization ability and prediction robustness under small sample conditions. Step 6: Input the ultra-precision machining process parameters to be predicted into the trained prediction model after the same preprocessing, and output the predicted surface roughness value.

2. The surface roughness prediction method based on diffusion model and neural structure search according to claim 1, characterized in that, The main body of the attention-controlled table diffusion model adopts a multi-head self-attention mechanism and introduces a time-conditional modulation module. The TMM integrates a cross-attention structure to achieve accurate modeling of the global dependence of process parameters and diffusion time characteristics. During the model training phase, the preprocessed raw process parameter data is used as input to perform a forward diffusion process: Gaussian noise is gradually added to the raw data, and a total of T diffusion operations are performed. The noise intensity in each step increases according to a preset cosine function, and finally a noisy data sequence consistent with the distribution of pure Gaussian noise is obtained. In the reverse denoising process, the input features are first weighted dimension by dimension through a feature gating mechanism to dynamically strengthen the key process parameter features and suppress redundant information, providing a more discriminative feature expression for subsequent attention calculation. The multi-head self-attention mechanism serves as the core feature extraction unit, which performs global modeling of the gated process parameter features, captures the nonlinear coupling relationship between different process parameters, and the potential correlation between process parameters and surface roughness, thus solving the shortcomings of traditional table diffusion models that can only model local features and are insufficient in capturing global dependencies. The temporal condition modulation module uses an internal cross-attention structure to encode diffusion time step information as a query vector with sinusoidal position and process parameter features as key / value vectors. Through cross-attention calculation, it achieves deep fusion of temporal information and features, guiding the network to learn the noise prediction rules under different time steps. This solves the problems of insufficient temporal information modeling and poor denoising accuracy in traditional diffusion models. After the model training is completed, it starts from pure Gaussian noise and performs a T-step reverse denoising process to finally generate synthetic process parameters and corresponding surface roughness data that meet physical consistency and have no significant difference from the statistical distribution of the original data.

3. The surface roughness prediction method based on diffusion model and neural structure search according to claim 1, characterized in that, The attention-controlled table diffusion model introduces a multi-head self-attention mechanism and a time-conditional modulation module to capture the global dependencies between process parameters and the temporal characteristics of the diffusion process.

4. The surface roughness prediction method based on diffusion model and neural structure search according to claim 1, characterized in that, The search space includes the number of hidden layers, the number of neurons in each layer, and the type of activation function, and a Bayesian optimization strategy based on Gaussian processes is used for architecture search.