A Machine Learning-Based Method for Estimating the Working Hours of Smooth Plug Gauges
Patent Information
- Application Number
- CN202610827912.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-09
- Publication Date
- 2026-09-01
AI Technical Summary
[0004]本发明的目的:为解决光面塞规类工具的工时定额依赖人工经验、准确性低、适应性差等问题,本发明提出一种基于机器学习的光面塞规工时定额方法,通过融合机器学习特征工程与多模型协同预测方法,实现光面塞规类工具工时的自动化精准预测与动态校正
Smart Images

Figure CN122674992A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent manufacturing technology for aerospace manufacturing enterprises, and specifically relates to a method for determining the time quota of smooth plug gauges based on machine learning. Background Technology
[0002] A smooth plug gauge is a specialized tool used to check whether the diameter of a hole is within acceptable limits. Its minimum limit end is called the go end, and its maximum limit end is called the no-go end. When checking the diameter of a workpiece hole, if the go end can pass through but the no-go end cannot, the hole is considered acceptable. In the production of specialized tools in aerospace manufacturing enterprises, smooth plug gauges rank first in both annual production volume and process proportion among tool products, and their time quotas are an important basis for formulating specialized tool production plans.
[0003] Current time quotas for smooth plug gauge tools mainly rely on empirical estimation and statistical analysis, leading to problems such as insufficient accuracy of time quotas, difficulties in time assessment, and poor adaptability of time quotas. This makes it difficult to meet the needs of the aerospace manufacturing industry for rapid and accurate time management of smooth plug gauge tools. Therefore, a new time quota method is needed. Summary of the Invention
[0004] The purpose of this invention is to address the problems of low accuracy and poor adaptability in the time quota of smooth plug gauges, which rely on human experience. This invention proposes a time quota method for smooth plug gauges based on machine learning. By integrating machine learning feature engineering and multi-model collaborative prediction methods, it achieves automated and accurate prediction and dynamic correction of the time of smooth plug gauges.
[0005] The technical solution of the present invention: According to a first aspect of the present invention, a method for determining the time quota of smooth plug gauges based on machine learning is provided, comprising the following steps: S1: Process information collection, collecting process information of smooth plug gauges, including structural attributes, process parameters and time labels, etc. S2: Dynamic time information filtering, dynamically select process information with changing time, and delete process information with fixed time. S3: Construct a dataset using process parameters as feature values and working hours as label values; and divide the dataset into a training dataset (train) and a test dataset (test); S4: Predict working hours using a classification model. The test dataset test from step S3 is used to predict the classification value of the working hour quota using classification algorithms such as support vector machine and random forest. S5: The neural network predicts working hours. The training dataset train is used to train the neural network, and the test dataset test from step S3 is used to infer the continuous value of the working hour quota using the trained neural network. S6: Time correction and synthesis, using a weighted average method to fuse the time quota classification value obtained in step S4 and the time quota continuous value obtained in step S5 to obtain the corrected time H; S7: Add the correction time H for each process change and the fixed time filtered out in step S2 to calculate the total working time of the smooth plug gauge.
[0006] In one possible embodiment, in step S1, the process information includes structural attributes, process parameters, and time tags. The structural attributes include process number, type of work, and process content; the process parameters include diameter, length, cutting speed, feed rate, number of passes, depth of cut, machining allowance, workpiece spindle speed, and width; the time tags are integer time values.
[0007] In one possible embodiment, in step S2, the dynamic working time information filtering involves selecting process information with changing working hours, grouping it according to process number O and job type T to form subsets. Where D represents all process information and H represents working hours; for each group Check if all their working hours are the same; the consistency formula is: Where H1 and H2 represent any two working hours within the subset; delete all that satisfy the condition. The group, namely the static process group with completely consistent filtering time, obtains process information with varying time. .
[0008] In one possible embodiment, after step S2, data cleaning and balancing are further included, such as cleaning the collected process information, removing duplicates, and handling missing values. For each group of process information, duplicates are removed, and missing values are filled using the average value method, i.e., filling is done row-wise using the average value of the entire column. The sample proportions of various work hour values are statistically analyzed, and an upsampling method is used to balance the distribution of work hour data. Specifically, for work hour categories with fewer samples, their samples are duplicated to increase the quantity, thus balancing the sample proportions of each category.
[0009] In one possible embodiment, in step S3, the dataset is divided into a training dataset (train) and a test dataset (test) in an 8:2 ratio using sklearn's train_test_split function.
[0010] In one possible embodiment, step S3 further includes the following process: The process parameter features are divided into continuous features num and discrete features cat according to data type, with working hours as the label lab. For the feature num, firstly, the distribution pattern of each feature on the training and test sets is examined based on the kernel density curve, and features that are significantly separated by the two curves are removed; then, through box plot analysis, features whose medians deviate significantly from the center of the box are removed; next, the Pearson correlation coefficient between each pair of features within num is calculated, and for strongly correlated feature pairs with an absolute value of correlation coefficient exceeding 0.9, only one of them is retained to eliminate redundant information; finally, the variance of each feature is calculated, and features with a variance of 0 are removed to obtain the filtered continuous feature set num1; For the cat feature, first draw the count plots of each category, and remove features that have a single category ratio greater than 90% or contain only one category; then construct a frequency contingency table with each cat feature as a row and the training set label train_lab as a column, calculate the chi-square statistic, delete low-association features with a chi-square value less than 1, and obtain the filtered discrete feature set cat1; Then, cat1 is one-hot encoded and converted into a numerical matrix; Normalization is performed on num1, and dimensionality reduction is performed using principal component analysis, retaining 99% of the original variance information. The dimensionality-reduced num1 is concatenated with the one-hot encoded cat1 matrix along the feature direction to form a new feature set feature. This feature set feature is combined with the label lab and divided into a training dataset train1 and a test dataset test1.
[0011] Through the above multiple screening and fusion, features with inconsistent distribution, redundant information, and weak correlation with labels are removed. The resulting dataset has lower feature dimensionality, less noise, and a closer correlation with working hours, thereby improving the accuracy and stability of subsequent working hour prediction modeling.
[0012] In one possible embodiment, in step S4, a support vector regression model, a random forest regression model, a decision tree regression model, and an XGBoost regression model are constructed as candidate prediction models. On the training dataset, a grid search strategy is used to optimize the hyperparameters of each model, and the training data is fitted using an embedded multi-fold cross-validation method. The search space of the support vector regression model includes at least the penalty coefficient C, the kernel function type, and the kernel coefficient γ. The search spaces of the random forest regression model and the decision tree regression model include at least the maximum depth of the tree, the minimum number of samples required for internal node repartitioning, and the number of subtrees. The search space of the XGBoost regression model includes at least the learning rate, the maximum depth of the tree, and the subsampling ratio. On the discrete grid points formed by the preset combinations of hyperparameter values, the optimal hyperparameter configuration of each model is determined by traversing the search to minimize the mean squared error (MSE) or the mean absolute error (MAE).
[0013] The models that have completed hyperparameter optimization are evaluated using the test dataset. At least one of the following evaluation indicators is calculated for each model on the test set: coefficient of determination R², mean squared error (MSE), and mean absolute error (MAE). The model with the highest coefficient of determination R² or the lowest mean squared error (MSE) is selected from the candidate models to determine the regression model with the best prediction performance, which is then used as the final work time prediction model.
[0014] In one possible embodiment, in step S5, a neural network model is constructed, comprising an input layer, a fully connected layer, and an output layer.
[0015] The neural network model is Y = WX + b, where W is the model parameters, X is the feature vector matrix, b is the offset value, and Y is the label value.
[0016] The model's input dimension is the number of features, and its output dimension is 1.
[0017] The fully connected layer activation function uses leaky ReLU, with an alpha parameter of 0.01.
[0018] In one possible embodiment, in step S5, the training process of the neural network includes: The optimization algorithms used include Adam, RMSPro, SGD with Momentum, and Adagrad.
[0019] Set the learning rate to the range of 0.01 to 0.0001, and use exponential decay, cosine annealing, and warm-up for learning rate scheduling.
[0020] The training process uses a nested loop approach, with the inner loop responsible for one traversal of the entire training dataset train1. It employs a batch method, with batch sizes of 32, 64, 128, etc.
[0021] The outer loop is responsible for iterating through the training dataset train1 a certain number of times, and the number of training epochs is set to be in the range of 100 to 1000.
[0022] The loss function uses mean squared error and mean absolute error. The hyperparameters are continuously adjusted during training. The model performance is evaluated using the test set test1. When the accuracy exceeds 95%, training is stopped, the current parameter data is saved as a model file, and this model file is used to predict work hours.
[0023] In one possible embodiment, in step S6, a weighted average method is used to fuse the model inference results from steps S4 and S5 to obtain the corrected working hours. ),in The result of the neural network prediction, These are the predicted values from the classification model; `round` rounds the value to the nearest integer. Weights ,in The root mean square error of the classification model. This refers to the root mean square error of the neural network model; the smaller the error of the neural network, the better. The larger the value, the greater the time weight for neural network inference.
[0024] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention addresses the difficulties, low efficiency, and insufficient accuracy in determining time quotas for smooth plug gauges by proposing a machine learning-based method. This method processes the raw data through multi-level feature engineering, including dynamic data filtering, balanced data distribution, and deep feature selection, eliminating issues such as duplication, missing data, and skewed distribution, thus laying a solid data foundation for high-precision model construction. Using a neural network model to predict continuous values captures complex nonlinear relationships and improves model generalization ability. Employing a machine learning classification model for multi-dimensional classification improves classification accuracy. Finally, a weighted average of the predicted continuous and categorical values eliminates bias from a single model, effectively balancing the contributions of different feature dimensions and significantly improving the prediction accuracy of time quotas, resulting in more accurate quotas.
[0025] In summary, the innovation of this invention lies in: establishing a full-process optimization framework from feature engineering to model fusion; realizing collaborative modeling of continuous value prediction and classification decision-making; and improving the model's generalization ability through a dynamic weight allocation mechanism. This invention effectively solves the technical limitations of traditional time quota methods in terms of data processing, model adaptability, and prediction accuracy, improving quota accuracy and management efficiency, and providing an intelligent solution for time management in the aerospace manufacturing field. Attached Figure Description
[0026] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a flowchart of the time prediction process for the classification model of this invention; Figure 3 This is a flowchart of the neural network time prediction process of the present invention. Detailed Implementation
[0027] To further understand the present invention, preferred embodiments of the present invention are described below in conjunction with examples. However, it should be understood that these descriptions are only for further illustrating the features and advantages of the present invention and not for limiting the claims of the present invention.
[0028] The following are examples of the time quota method for smooth plug gauges according to the present invention, mainly implemented using Python 3.10, pandas, sklearn, and pytorch, to illustrate the technical solution of the present invention. Example 1 The flowchart of the method of this invention is as follows Figure 1 As shown, the implementation process of Example 1 is as follows.
[0029] Step S1: Process Information Collection: Collect process information for the smooth plug gauge from the PLM system and production planning system, including structural attributes, process parameters, and time tags, and generate an Excel spreadsheet file. Structural attributes include process number, job type, and process content. Process parameters include diameter, length, cutting speed, feed rate, number of passes, depth of cut, machining allowance, workpiece spindle speed, and width. Time tags are integer time values.
[0030] The principle behind how the above process parameters affect machining time is as follows: machining time depends on the amount of material removed, cutting time, and auxiliary motion time. Diameter and length determine the machining volume; cutting speed, feed rate, depth of cut, and workpiece spindle speed determine the material removal rate; the number of passes and machining allowance reflect the need for repeated machining; width affects the efficiency of a single pass. These parameters collectively determine the theoretical machining time and therefore can serve as key characteristics for predicting machining time.
[0031] Step S2: Dynamic Time Information Filtering: In the Excel spreadsheet, select the process information with changing time, and group them according to process number O and job type T to form subsets. Where D represents all process information and H represents working hours. For each group Check if all their working hours are the same; the consistency formula is: Where H1 and H2 represent any two working hours within the subset. Delete all that satisfy the condition. The group, namely the static process group with completely consistent filtering time, obtains process information with varying time. For example, in the process information Excel file, fixed time steps such as quenching, shearing, and sharp edge polishing have been removed. By filtering dynamic time steps and eliminating fixed time steps, the burden on machine learning models to fit redundant constant data can be reduced, allowing the model to focus on process steps with changing time, thereby improving the accuracy of time prediction and training efficiency, and avoiding interference from fixed time steps on the learning of dynamic relationships.
[0032] Step S3: Data Cleaning and Balancing: Clean the collected process information Excel spreadsheet files, for each group... Remove duplicates from the table and fill in missing values using the average value method, that is, fill in the missing values by using the average value of the entire column along the row direction. Use pandas to read the Excel data, count the proportion of work hours, and use an upsampling method to achieve data balance of work hour proportions, that is, increase the sample size by copying the work hour information with a smaller proportion, so as to achieve the goal of balancing the values of each proportion and build a high-quality dataset.
[0033] Step S4: Classification model time prediction (e.g.) Figure 2 As shown in the diagram, a dataset is constructed using process parameters as feature values and working hours as label values. Using sklearn's `train_test_split` function, the dataset is divided into a training dataset (`train`) and a test dataset (`test`) in an 8:2 ratio. The process parameter feature values are divided into continuous features `num` and discrete features `cat`, where `num` represents continuous values and `cat` represents discrete values. The working hours are labeled as `lab`.
[0034] For each feature `num`, kernel density curves are used to determine if the training and test set curves for each feature within `num` are significantly separated. If so, that feature is removed from `num`. Box plots are used to remove features whose medians deviate significantly from the box center. The correlation coefficient matrix among the features within `num` is calculated. ,in , It is an eigenvalue. , The numerator is the sample mean, the denominator is the covariance, and the denominator is the product of the two standard deviations. If the correlation coefficient between two features is close... The above demonstrates that these features carry similar information, and one can be retained to reduce dimensionality. The variance of each feature is calculated, and features with a variance of 0 are removed. After these steps, the filtered feature num1 is obtained.
[0035] For the 'cat' feature, a class count plot is drawn for each feature within 'cat', removing features with more than 90% of the data belonging to a single class and features containing only a single class. The categorical feature values are converted into numerical codes, and a frequency table is created with each feature within 'cat' as a row and the training set label 'train_lab' as a column. The chi-square statistic is then calculated. ,in Let be the observation frequencies of the i-th feature within cat and the j-th feature within lab. This represents the expected frequency. ,in For the sum of the i-th row, The sum of column j is denoted as , and cn is the total number of samples. Features with a chi-square statistic less than 1 are removed. After the above steps, the filtered feature cat1 is obtained. For example, features that do not affect the machining time, such as cutting speed, feed rate, workpiece rotation speed, and grinding wheel width, are removed.
[0036] One-hot encoding was used to convert cat1 into a matrix value. After normalizing num1, principal component analysis was used for dimensionality reduction while retaining 99% of the original information. The processed num1 and cat1 were concatenated to form a new feature, which was then combined with the label to form a new dataset, consisting of a training dataset train1 and a test dataset test1.
[0037] Support Vector Machine (SVM), Random Forest (Random Forest), Decision Tree (Decision Tree), and XGBoost (XGBoost) models were used, and their parameters were tuned using a grid search to continuously fit the training set `train1`. The test set `test1` was used for evaluation to test the accuracy of each model. The model with the highest accuracy was selected as the classification model for predicting work hours. For example, XGBoost achieved the highest accuracy of 98%, and this model was chosen for predicting work hours.
[0038] Step S5: Neural network predicts working hours (e.g.) Figure 3 (As shown): Construct a neural network model containing an input layer, a fully connected layer, and an output layer. Neural Network Model Where W represents the model parameters, X represents the feature vector matrix, b represents the offset value, and Y represents the label value. The model input dimension is the number of features, and the output dimension is 1. The fully connected layer activation function is leaky ReLU, and the alpha parameter is set to 0.01. Training is performed based on the training set train1. Optimization algorithms selected include Adam, RMSPro, SGD with momentum, and Adagrad. The learning rate is set to be between 0.01 and 0.0001, and learning rate scheduling uses exponential decay, cosine annealing, and warm-up. The training process uses a nested two-level loop approach. The inner loop is responsible for one traversal of the entire training dataset train1, using a batch method with batch sizes of 32, 64, 128, etc. The outer loop is responsible for the number of traversals of the training dataset train1, with the number of training epochs set to be between 100 and 1000. The loss function selected is mean squared error and mean absolute error. The hyperparameters were continuously adjusted for training. The model performance was evaluated using the test set test1. When the batch size was 32, the learning rate was 0.001, the learning rate was set to exponential decay, the optimization algorithm was Adagrad, and the loss function was mean squared error, the accuracy was greater than 95%, training was stopped, the current parameter data was saved as a model file, and this model file was used to predict the working hours.
[0039] Step S6: Time Correction and Synthesis: The model inference results from Steps S4 and S5 are fused using a weighted average method to obtain the corrected time. ),in The result of the neural network prediction, These are the predicted values from the classification model; `round` rounds the value to the nearest integer. Weights ,in The root mean square error of the classification model. This refers to the root mean square error of the neural network model; the smaller the error of the neural network, the better. The larger the value, the greater the weight of the time in the neural network inference. The total time for the smooth plug gauge is calculated by adding the variable time H of each process and the fixed time filtered from the Excel table in step S2.
[0040] Example 2 Step S1: Process Information Collection: In the special tool workshop, export the process route card for plug gauges from the PLM system, including the following processes: material preparation (cutting), turning (hole making), heat treatment (quenching), washing (pickling), surface finishing (surface oxidation), external finishing (grinding and chamfering), turning (polishing), and engraving (marking). Extract the production records of plug gauges from the MES system. Each batch of records includes the process number, actual working hours, job type, and process parameters (measured diameter, length, cutting speed, feed rate, number of passes, depth of cut, machining allowance, workpiece rotation speed, grinding wheel width, etc.). A total of 3420 raw data records were obtained.
[0041] Step S2: Dynamic time information filtering: Group by (process number, job type). It was found that the time in the two groups, heat treatment (quenching) and surface oxidation, is completely identical, indicating fixed time and can be deleted. The remaining processes are retained as dynamic time.
[0042] Step S3: Data Cleaning and Balancing: The retained data was then cleaned, deleting 240 duplicate records and filling missing fields with the average value of that column. Statistical analysis of the work hour label distribution revealed that samples with work hour values of 20-30 hours accounted for 50%, samples with work hour values of 90-120 hours accounted for 10%, and the remaining 40%, indicating a class imbalance. An upsampling method was used to copy the minority class samples (90-120 hours) from the original 300 records to 1590 records, thus achieving a more balanced proportion across classes.
[0043] Step S4: Classification model time prediction (e.g.) Figure 2As shown): The continuous feature set contains nine original continuous features: diameter, length, cutting speed, feed rate, number of passes, depth of cut, machining allowance, workpiece spindle speed, and grinding wheel width. Based on the cleaned and balanced data, the continuous features were first screened. Workpiece spindle speed was removed using kernel density analysis (due to severe disparity between the training and test sets). Depth of cut was removed using box plot analysis (the median significantly deviated from the box center). Pearson correlation coefficients were calculated, revealing a strong correlation of 0.93 between machining allowance and number of passes; therefore, the number of passes was retained, and machining allowance was removed. Variance analysis did not find any features with a variance of 0. The final retained continuous feature set is {diameter, length, cutting speed, feed rate, number of passes, grinding wheel width}, a total of 6 dimensions. Discrete features include job types (such as loading, machining, heating, washing, surface finishing, exterior finishing, polishing, and marking) and process content. For each discrete feature, class counting is performed, and features with a single class accounting for more than 90% are removed. Chi-square statistics are calculated, and features significantly related to work hours are retained. One-hot encoding is performed on the retained discrete features to obtain a 4-dimensional numerical matrix. After normalizing the continuous features, they are concatenated with the one-hot encoded discrete features to obtain a new 10-dimensional feature set. The `train_test_split` function in sklearn is used to divide the dataset into training and test sets in an 8:2 ratio.
[0044] Four classification models were constructed: Support Vector Machine (SVM), Random Forest, Decision Tree, and XGBoost. Grid search was used for hyperparameter tuning. Each model was fitted on the training set, and the accuracy was evaluated using the test set. Results showed that Decision Tree achieved the highest accuracy (89.2%), SVM (91.5%), Random Forest (94.3%), and XGBoost (96.8%). XGBoost was used to output the classification values for work hour quotas.
[0045] Step S5: Neural network predicts working hours (e.g.) Figure 3 As shown): Construct a three-layer neural network: an input layer (10 neurons, corresponding to 10-dimensional features), a fully connected hidden layer (64 neurons), and an output layer (1 neuron). Neural Network Model Where W represents the model parameters, X represents the feature vector matrix, b represents the offset value, and Y represents the label value. The activation function used is Leaky ReLU (alpha = 0.01). Training is performed on the training set. The Adam optimizer is used with an initial learning rate of 0.001, coupled with exponential decay scheduling (multiplying by 0.9 every 50 epochs). The batch size is 32, and the number of training epochs is 500. The loss function is mean squared error (MSE). Evaluation is performed on the test set every 20 epochs. When epoch = 280, the test set accuracy reaches 96.3%, MSE = 0.31, training is stopped, and the model parameters are saved. The model is then used to infer continuous values of work time quotas on the test set.
[0046] Step S6: Time Correction and Synthesis: The model inference results from Steps S4 and S5 are fused using a weighted average method to obtain the corrected time. ),in The result of the neural network prediction, These are the predicted values from the classification model; `round` rounds the value to the nearest integer. Weights ,in The root mean square error of the classification model is 0.63. The root mean square error of the neural network model is 0.557.
[0047] Step S7: Calculate the total working time of the smooth plug gauge by adding the variable working time H of each process and the fixed working time filtered out in step S2.
[0048] The above description is merely a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the inventive concept of the present invention and the description and drawings, or direct or indirect applications in other related technical fields, are included within the patent protection scope of the present invention.
Claims
1. A method for determining the time quota of smooth plug gauges based on machine learning, characterized in that, Includes the following steps: S1: Collect process information for smooth plug gauges, including structural attributes, process parameters, and time tags; S2: Dynamic time information filtering, dynamically select process information with changing time, and delete process information with fixed time. S3: Construct a dataset using process parameters as feature values and working hours as label values; and divide the dataset into a training dataset and a test dataset. S4: Using the test dataset from step S3, select the optimal classification algorithm to predict the classification value of the time quota; S5: Train the neural network using the training dataset, and use the test dataset from step S3 to infer the continuous value of the working hour quota using the trained neural network. S6: The corrected working hours H is obtained by merging the classified value of the working hours quota obtained in step S4 and the continuous value of the working hours quota obtained in step S5 using the weighted average method; S7: Add the correction time H for each process change and the fixed time filtered out in step S2 to calculate the total working time of the smooth plug gauge.
2. The method for determining the time quota of smooth plug gauges based on machine learning according to claim 1, characterized in that, In step S1, the process parameters include diameter, length, cutting speed, feed rate, number of passes, depth of cut, machining allowance, workpiece rotation speed, and width; the time label is an integer time value.
3. The method for determining the time quota of smooth plug gauges based on machine learning according to claim 1, characterized in that, In step S2, the dynamic working hour information filtering specifically includes the following process: Select the process information with varying work hours, and group them according to process number O and job type T to form subsets. Where D represents all process information and H represents working hours; For each group Check if all their working hours are the same; the consistency formula is: Where H1 and H2 represent any two working hours within the subset; delete all that satisfy the condition. The group, namely the static process group with completely consistent filtering time, obtains process information with varying time. .
4. The method for determining the time quota of smooth plug gauges based on machine learning according to claim 1, characterized in that, After step S2, data cleaning and balancing are also included; the collected process information is cleaned, duplicates are removed for each group, and missing values are filled using the average value filling method, that is, the average value of the entire column is used to fill in the missing values according to the row direction; the proportion of working hours is statistically analyzed, and an upsampling method is used to achieve data balance of working hour proportions, that is, by copying process information with a small proportion to increase the number of samples, the purpose of balancing the values of each proportion is achieved.
5. The method for determining the time quota of smooth plug gauges based on machine learning according to claim 1, characterized in that, In step S3, the dataset is divided into a training dataset (train) and a test dataset (test) using sklearn's train_test_split function in an 8:2 ratio.
6. The method for determining the time quota of smooth plug gauges based on machine learning according to claim 1, characterized in that, Step S3 also includes the following process: The process parameter features are divided into continuous features num and discrete features cat according to data type, with working hours as the label lab. For the feature num, firstly, the distribution pattern of each feature on the training and test sets is examined based on the kernel density curve, and features that are significantly separated by the two curves are removed; then, through box plot analysis, features whose medians deviate significantly from the center of the box are removed; next, the Pearson correlation coefficient between each pair of features within num is calculated, and for strongly correlated feature pairs with an absolute value of correlation coefficient exceeding 0.9, only one of them is retained to eliminate redundant information; finally, the variance of each feature is calculated, and features with a variance of 0 are removed to obtain the filtered continuous feature set num1; For the cat feature, first draw the count plots of each category, and remove features that have a single category ratio greater than 90% or contain only one category; then construct a frequency contingency table with each cat feature as a row and the training set label train_lab as a column, calculate the chi-square statistic, delete low-association features with a chi-square value less than 1, and obtain the filtered discrete feature set cat1; Then, cat1 is one-hot encoded and converted into a numerical matrix; Normalization is performed on num1, and dimensionality reduction is performed using principal component analysis, retaining 99% of the original variance information. The dimensionality-reduced num1 is concatenated with the one-hot encoded cat1 matrix along the feature direction to form a new feature set feature. This feature set feature is combined with the label lab and divided into a training dataset train1 and a test dataset test1.
7. A method for determining the time quota of smooth plug gauges based on machine learning according to any one of claims 1 or 6, characterized in that, In step S4, support vector regression, random forest regression, decision tree regression, and XGBoost regression models are constructed as candidate prediction models. On the training dataset, a grid search strategy is used to optimize the hyperparameters of each model, and the training data is fitted using an embedded multi-fold cross-validation method. Specifically, the search space of the support vector regression model includes at least the penalty coefficient C, kernel function type, and kernel coefficient γ; the search spaces of the random forest regression and decision tree regression models include at least the maximum tree depth, the minimum number of samples required for internal node re-division, and the number of subtrees; and the search space of the XGBoost regression model includes at least the learning rate, the maximum tree depth, and the subsampling ratio. On the discrete grid points formed by the preset combinations of hyperparameter values, the optimal hyperparameter configuration for each model is determined through a traversal search, with the goal of minimizing the mean squared error (MSE) or mean absolute error (MAE). The models that have completed hyperparameter optimization are evaluated using the test dataset. At least one of the following evaluation indicators is calculated for each model on the test set: coefficient of determination R², mean squared error (MSE), and mean absolute error (MAE). The model with the highest coefficient of determination R² or the lowest mean squared error (MSE) is selected from the candidate models to determine the regression model with the best prediction performance, which is then used as the final work time prediction model.
8. A method for determining the time quota of smooth plug gauges based on machine learning according to any one of claims 1 or 6, characterized in that, In step S5, a neural network model is constructed, which includes an input layer, a fully connected layer and an output layer; The neural network model is Y = WX + b, where W is the model parameters, X is the feature vector matrix, b is the offset value, and Y is the label value. The model's input dimension is the number of features, and its output dimension is 1. The fully connected layer activation function uses leaky ReLU, with an alpha parameter of 0.
01.
9. The method for determining the time quota of smooth plug gauges based on machine learning according to claim 8, characterized in that, In step S5, the training process of the neural network includes: The optimization algorithms used include one or more of Adam, RMSPro, SGD with Momentum, and AdaGrad. Set the learning rate to the range of 0.01 to 0.0001, and use one or more of the following learning rate scheduling methods: exponential decay, cosine annealing, and warm-up. The training process uses a nested loop approach, with the inner loop responsible for one traversal of the entire training dataset, and employs a batch processing method. The outer loop is responsible for iterating through the training dataset a certain number of times, setting the number of training epochs to be between 100 and 1000. The loss function uses mean squared error and mean absolute error; The hyperparameters are continuously adjusted during training. The model performance is evaluated using a test set. When the accuracy is greater than 95%, training is stopped, and the current parameter data is saved as the trained neural network model.
10. The method for determining the time quota of smooth plug gauges based on machine learning according to claim 1, characterized in that, In step S6, the weighted average method is used to obtain the calculation formula for the corrected working time H, as shown in the following equation: ) in, The continuous value of the work hour quota predicted by the neural network. The classification model predicts the time quota classification value, where round is rounded to the nearest integer; weights ,in The root mean square error of the classification model. This refers to the root mean square error of the neural network model; the smaller the error of the neural network, the better. The larger the value, the greater the time weight for neural network inference.