Numerical control tool selection method based on PCT-KAN neural network model
By adopting the PCT-KAN neural network model in CNC tool selection, combining Pointnet, Transformer and KAN networks, automatically extracting features and learning to select suitable tools, the problem of inaccurate tool selection caused by insufficient experience in the prior art is solved, and more efficient and accurate tool selection is achieved.
Patent Information
- Application Number
- CN202510071045.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-04-25
AI Technical Summary
The selection of CNC tools in the prior art is limited by manufacturing experience, making it difficult for users to accurately select the optimal CNC tools.
The CNC tool selection method based on the PCT-KAN neural network model is adopted, and Pointnet, Transformer and KAN network are combined to automatically extract features and learn to select suitable tools, solving the problem of inaccurate tool selection caused by insufficient experience.
Through the PCT-KAN model, the appropriate CNC tool can be accurately selected, which improves the accuracy and efficiency of tool selection and reduces the dependence on manufacturing experience.
Smart Images

Figure CN119882608A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of numerical control machining, and in particular to a numerical control tool selection method based on a PCT-KAN neural network model. Background Art
[0002] As the manufacturing industry transforms from mass production to mass customization, personalized products are gradually being customized according to demand. Users only need to upload computer-designed CAD models to the online platform through the Internet and select suitable tools to quickly obtain cost and delivery time estimates. Once the user accepts the quotation, the engineer will further screen the appropriate CNC tools. However, the selection of CNC tools in this process becomes a limiting factor, because the correct selection of tools requires an in-depth understanding of the workpiece model, which usually requires rich experience. Unfortunately, many engineers have limited capabilities in this regard and cannot accurately select the corresponding CNC tools. Summary of the invention
[0003] In order to solve the above technical problems, the present invention provides a CNC tool selection method based on the PCT-KAN neural network model, which combines the Pointnet neural network, the Transformer neural network and the KAN network to automatically extract features and learn how to select suitable tools to obtain the optimal tools, thereby solving the problem in the prior art that users often cannot select the optimal manufacturing tools due to the influence of manufacturing experience.
[0004] In order to solve the above technical problems, the present invention provides a technical solution: a method for selecting a CNC tool based on a PCT-KAN neural network model, characterized in that:
[0005] Step S1: Data preprocessing: collecting 3D shape data and quality information of parts and preprocessing;
[0006] Step S2: Feature extraction: Based on Transformer Block, first use the fully connected layer to map the point cloud data from the original dimension to a lower feature dimension, then use the ReLU activation function to add nonlinear features, then use the PointNetSetAbstraction method for downsampling, select neighborhood points through the K-nearest neighbor algorithm, and use the PointNet structure to extract local features. Finally, stack multiple TransformerBlocks and downsampling modules to extract deeper features layer by layer;
[0007] Step S3: Classification head: aggregate global features by taking the feature mean of all points, then process the quality information of the parts through a linear layer, combine the aggregated global features with the processing results of the quality information of the parts, and further process them through another neural network containing multiple linear layers and ReLU activations, and finally output the classification results through a linear layer;
[0008] Step S4: Model training: During the model training process, the cross entropy loss function is used to evaluate the classification error. The Adam optimizer is combined to dynamically adjust the learning rate, input new part information, and generate a CNC tool suitable for processing the part based on the part information.
[0009] Furthermore, in the step S1, the 3D shape data and quality information of the part include elastic modulus, elongation at break, yield strength, Brinell hardness and thermal diffusivity, dimensional tolerance and area arithmetic mean surface roughness of the part.
[0010] Furthermore, in the step S1, the process of preprocessing the 3D shape data and quality information is as follows: the 3D shape information of the part is stored in an stl type file, and point cloud processing is performed, and the quality information of the part is made into a 1×7 array.
[0011] Furthermore, in step S2, each Transformer Block consists of two KAN layers and several fully connected layers, which are used for preliminary transformation of features and further nonlinear mapping, respectively.
[0012] Furthermore, in step S4, the process of selecting neighborhood points by the K-nearest neighbor algorithm is as follows: the nearest neighbor of each point is found by calculating the distance matrix between all points in the point cloud and then sorting the distances. The index of the nearest neighbor is used to index the nearest k points from the original point cloud, which are then used to calculate the position encoding and attention weights.
[0013] Furthermore, in step S2, position encoding and self-attention mechanism are used to capture the relationship between point cloud features.
[0014] Furthermore, in step S2, at each level after downsampling, the model further transforms and aggregates the extracted features through TransformerBlock.
[0015] Furthermore, in step S4, the CNC tools include turning tools, milling cutters, drilling tools, boring tools and grinding wheels.
[0016] In order to solve the above technical problems, another technical solution provided by the present invention is: a numerical control tool selection device based on the PCT-KAN neural network model according to the above method, characterized in that it includes a data preprocessing module, a feature extraction module, a feature fusion module and model training;
[0017] Data preprocessing module: collects 3D shape data and quality information of parts and performs preprocessing;
[0018] Feature extraction module: Based on Transformer Block, first use the fully connected layer to map the point cloud data from the original dimension to a lower feature dimension, then use the ReLU activation function to add nonlinear features, then use the PointNetSetAbstraction method for downsampling, select neighborhood points through the K-nearest neighbor algorithm, and use the PointNet structure to extract local features. Finally, stack multiple TransformerBlocks and downsampling modules to extract deeper features layer by layer;
[0019] Feature fusion module: aggregates global features by taking the feature mean of all points, then processes the quality information of the parts through a linear layer, combines the aggregated global features with the processing results of the quality information of the parts, and further processes them through another neural network containing multiple linear layers and ReLU activations, and finally outputs the classification results through a linear layer;
[0020] Model training module: During the model training process, the cross entropy loss function is used to evaluate the classification error. The Adam optimizer is combined to dynamically adjust the learning rate, input new part information, and generate a CNC tool suitable for processing the part based on the part information.
[0021] The beneficial effects of the present invention are:
[0022] 1. This application uses the PCT neural network model. PCT draws on the successful application of Transformer in natural language processing and uses the inherent order invariance of Transformer to avoid the problem of defining the order of point cloud data. This makes PCT very suitable for processing disordered and unstructured point cloud data. PCT has shown lower computational efficiency and memory requirements in experiments, which makes it more suitable for deployment in resource-constrained environments such as mobile devices, which is of great significance for realizing real-time point cloud processing applications.
[0023] 2. In this application, KAN is combined with the PCT model. The KAN layer realizes nonlinear transformation and feature fusion of input features through a combination of nonlinear activation functions and linear transformations, which helps the model learn more complex feature representations. By introducing the KAN layer in TransformerBlock, the representation ability of the model can be enhanced, enabling it to better process the input point cloud data and extract useful features for subsequent classification tasks.
[0024] 3. The position encoding in this application improves the model's perception of the point cloud structure by encoding the relative position information between point clouds. The Transformer Block learns the correlation between point cloud features through the self-attention mechanism, and then extracts richer feature representations.
[0025] 4. The combination of the KAN layer and the Transformer in this application can utilize the flexibility and interpretability of KAN to enhance the performance of the Transformer in processing complex data tasks. The design of the KAN layer is inspired by the Kolmogorov-Arnold representation theorem, which provides a representation method for multivariate continuous functions, making the KAN network very interpretable.
[0026] 5. In this application, at each level after downsampling, the model further transforms and aggregates the extracted features through Transformer Block to enhance the representation ability of the features. As the downsampling process proceeds, the feature dimension gradually increases, thereby capturing more levels of information.
[0027] 6. In the TransformerBlock of the present application, the KNN algorithm is used to find the nearest neighbor of each point. This is achieved by calculating the distance matrix between all points in the point cloud and then sorting the distances. The index of the nearest neighbor is used to index the nearest k points from the original point cloud, which are then used to calculate the position encoding and attention weights. The KNN algorithm enables the model to take into account the local neighborhood information of each point in the point cloud, thereby improving the model's understanding and processing capabilities of point cloud data.
[0028] In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only four of the drawings of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0030] Figure 1 A flowchart of the application method;
[0031] Figure 2 It is the structural diagram of the PCT-KAN model;
[0032] Figure 3 Confusion matrix for manufacturing process prediction on the test dataset;
[0033] Figure 4 This is a structural block diagram of the device of this application. DETAILED DESCRIPTION
[0034] Embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not intended to limit the scope of protection of the present invention.
[0035] Example
[0036] like Figure 1 and 2 As shown, a CNC tool selection method based on the PCT-KAN neural network model is characterized by:
[0037] Step S1: Data preprocessing: collecting 3D shape data and quality information of parts and preprocessing;
[0038] Step S2: Feature extraction: Based on Transformer Block, first use the fully connected layer to map the point cloud data from the original dimension to a lower feature dimension, then use the ReLU activation function to add nonlinear features, then use the PointNetSetAbstraction method for downsampling, select neighborhood points through the K-nearest neighbor algorithm, and use the PointNet structure to extract local features. Finally, stack multiple TransformerBlocks and downsampling modules to extract deeper features layer by layer;
[0039] Step S3: Classification head: aggregate global features by taking the feature mean of all points, then process the quality information of the parts through a linear layer, combine the aggregated global features with the processing results of the quality information of the parts, and further process them through another neural network containing multiple linear layers and ReLU activations, and finally output the classification results through a linear layer;
[0040] Step S4: Model training: During the model training process, the cross entropy loss function is used to evaluate the classification error. The Adam optimizer is combined to dynamically adjust the learning rate, input new part information, and generate a CNC tool suitable for processing the part based on the part information.
[0041] In step S1, the 3D shape data and quality information of the part include elastic modulus [GPa], elongation at break [%], yield strength [MPa], Brinell hardness [HB] and thermal diffusivity [m3 / s], dimensional tolerance [mm] and area arithmetic mean surface roughness [Sa] of the part; as shown in Table 1, the manufacturing process category, the corresponding part feature type and its achievable surface roughness and dimensional tolerance range.
[0042] The process of preprocessing the 3D shape data and quality information is as follows: the 3D shape information of the part is stored in an stl type file, and point cloud processing is performed, and the quality information of the part is made into a 1×7 array.
[0043] Table 1 Manufacturing process categories, corresponding part feature types and their achievable surface roughness and dimensional tolerance ranges
[0044]
[0045]
[0046] In step S2, each Transformer Block consists of two KAN layers and several fully connected layers, which are used for preliminary transformation of features and further nonlinear mapping, respectively.
[0047] The process of selecting neighborhood points through the K-nearest neighbor algorithm is to find the nearest neighbor of each point by calculating the distance matrix between all points in the point cloud and then sorting the distances. The nearest neighbor index is used to index the nearest k points from the original point cloud, which are then used to calculate the position encoding and attention weights; the KNN algorithm enables the model to take into account the local neighborhood information of each point in the point cloud, thereby improving the model's understanding and processing capabilities of point cloud data.
[0048] Among them, position encoding and self-attention mechanism are used to capture the relationship between point cloud features to enhance the model's ability to capture the relationship between point cloud features; in order to gradually reduce the number of points and increase the feature dimension, the model uses the PointNetSetAbstraction method for downsampling, selects neighborhood points through the K-nearest neighbor algorithm, and uses the PointNet structure to extract local features.
[0049] Among them, at each level after downsampling, the model further transforms and aggregates the extracted features through Transformer Block.
[0050] In step S3, the cross entropy loss function is used to evaluate the classification error during the model training process, and the Adam optimizer is combined to dynamically adjust the learning rate to improve the convergence speed and accuracy of the model.
[0051] In step S4, the CNC tools include turning tools, milling cutters, drilling tools, boring tools and grinding wheels.
[0052] After training, the PCT-KAN model can accurately select appropriate CNC tools, such as turning tools, milling cutters, drilling tools, boring tools and grinding wheels.
[0053] The KAN function used in the neural network model is expressed as:
[0054]
[0055] in,
[0056] The activation function used in the neural network model is the ReLU function, which is expressed as:
[0057] ReLU(x)=max(x,0)
[0058] The loss function used in the training of the PointTransform neural network model is the classification cross entropy function, which is expressed as:
[0059]
[0060] Where D is a training data set containing n K-class training data, dl is the l-th training data, σi(dl) is the probability that the model predicts that the training data dl belongs to the i-th class, and yi is the true probability that the training data dl belongs to the i-th class; if the training data belongs to the i-th class, yi=1; if it does not belong to the i-th class, yi=0.
[0061] Finally, use the linear layer to select from six types of tools: roughing cutters, turning tools, drilling tools, finishing cutters, turning and grinding wheels, and drilling and boring tools.
[0062] Experiments and Results
[0063] The dataset was constructed to generate 200 data for each feature type in the tool class. For the remaining process classes, 300 data were generated for each feature type in the corresponding process class. Therefore, each process class consisted of 300 data, and the total size of the training dataset was 3600. Similarly, a test dataset consisting of 540 unseen data (90 for each process) was created to test the model. The synthetically generated data includes the 3D shape information file of the part processed by voxelization, and then the voxelized shape information is converted into point cloud data; the corresponding part information, including elastic modulus [GPa], elongation at break [%], yield strength [MPa], Brinell hardness [HB] and thermal diffusivity [m3 / s], dimensional tolerance [mm] and area arithmetic mean surface roughness [Sa] of the part.
[0064] A 70:30 split of the dataset was chosen for training and validation. During the training phase, the Adaptive Moment Estimation (Adam) optimizer was used to determine the optimal weights because of its fast convergence speed and suitability for complex model training on high-dimensional data. The learning rate was set to 10-3 for the first 600 epochs, 10-4 for the 601st to 1200th epochs, 5×10-5 for the 1201st to 1800th epochs, and 10-5 for the 1801st to 3000th epochs. This achieved the best accuracy.
[0065] Finally, the trained model was tested on 540 unseen test data, and the test accuracy reached 92.78%. The confusion matrix of the test data set is as follows: Figure 3 shown.
[0066] In order to solve the above technical problems, another technical solution provided by the present invention is: a CNC tool selection device based on a PCT-KAN neural network model, characterized in that it includes a data preprocessing module, a feature extraction module, a feature fusion module and a model training;
[0067] Data preprocessing module: collects 3D shape data and quality information of parts and performs preprocessing;
[0068] Feature extraction module: Based on Transformer Block, first use the fully connected layer to map the point cloud data from the original dimension to a lower feature dimension, then use the ReLU activation function to add nonlinear features, then use the PointNetSetAbstraction method for downsampling, select neighborhood points through the K-nearest neighbor algorithm, and use the PointNet structure to extract local features. Finally, stack multiple TransformerBlocks and downsampling modules to extract deeper features layer by layer;
[0069] Feature fusion module: aggregates global features by taking the feature mean of all points, then processes the quality information of the parts through a linear layer, combines the aggregated global features with the processing results of the quality information of the parts, and further processes them through another neural network containing multiple linear layers and ReLU activations, and finally outputs the classification results through a linear layer;
[0070] Model training module: During the model training process, the cross entropy loss function is used to evaluate the classification error. The Adam optimizer is combined to dynamically adjust the learning rate, input new part information, and generate a CNC tool suitable for processing the part based on the part information.
[0071] The above description of the various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, this application will not go into details.
[0072] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for selecting a numerical control tool based on a PCT-KAN neural network model, characterized in that: Step S1: Data preprocessing: collecting 3D shape data and quality information of parts and preprocessing; Step S2: Feature extraction: Based on Transformer Block, first use the fully connected layer to map the point cloud data from the original dimension to a lower feature dimension, then use the ReLU activation function to add nonlinear features, then use the PointNetSetAbstraction method for downsampling, select neighborhood points through the K-nearest neighbor algorithm, and use the PointNet structure to extract local features. Finally, stack multiple TransformerBlocks and downsampling modules to extract deeper features layer by layer; Step S3: Classification head: aggregate global features by taking the feature mean of all points, then process the quality information of the parts through a linear layer, combine the aggregated global features with the processing results of the quality information of the parts, and further process them through another neural network containing multiple linear layers and ReLU activations, and finally output the classification results through a linear layer; Step S4: Model training: During the model training process, the cross entropy loss function is used to evaluate the classification error. The Adam optimizer is combined to dynamically adjust the learning rate, input new part information, and generate a CNC tool suitable for processing the part based on the part information.
2. The method for selecting a numerical control tool based on a PCT-KAN neural network model according to claim 1, characterized in that: In the step S1 , the 3D shape data and quality information of the part include elastic modulus, elongation at break, yield strength, Brinell hardness and thermal diffusivity, dimensional tolerance and area arithmetic mean surface roughness of the part.
3. The method for selecting a numerical control tool based on a PCT-KAN neural network model according to claim 1, characterized in that: In the step S1, the process of preprocessing the 3D shape data and quality information is as follows: the 3D shape information of the part is stored in an stl type file, and point cloud processing is performed, and the quality information of the part is made into a 1×7 array.
4. The method for selecting a numerical control tool based on a PCT-KAN neural network model according to claim 1, characterized in that: In step S2, each Transformer Block consists of two KAN layers and several fully connected layers, which are used for preliminary transformation of features and further nonlinear mapping, respectively.
5. The method for selecting a numerical control tool based on a PCT-KAN neural network model according to claim 1, characterized in that: In step S4, the process of selecting neighborhood points by the K-nearest neighbor algorithm is: by calculating the distance matrix between all points in the point cloud, and then sorting the distances to find the nearest neighbor of each point. The index of the nearest neighbor is used to index the nearest k points from the original point cloud, which are then used to calculate the position encoding and attention weight.
6. The method for selecting a numerically controlled tool based on a PCT-KAN neural network model according to claim 1, characterized in that: In step S2, position encoding and self-attention mechanism are used to capture the relationship between point cloud features.
7. The method for selecting a numerically controlled tool based on a PCT-KAN neural network model according to claim 1, characterized in that: In step S2, at each level after downsampling, the model further transforms and aggregates the extracted features through the Transformer Block.
8. The method for selecting a numerical control tool based on a PCT-KAN neural network model according to claim 1, characterized in that: In step S4, the CNC tools include turning tools, milling cutters, drilling tools, boring tools and grinding wheels.
9. A numerical control tool selection device based on a PCT-KAN neural network model according to any one of claims 1 to 8, characterized in that: Includes data preprocessing module, feature extraction module, feature fusion module and model training; Data preprocessing module: collects 3D shape data and quality information of parts and performs preprocessing; Feature extraction module: Based on Transformer Block, first use the fully connected layer to map the point cloud data from the original dimension to a lower feature dimension, then use the ReLU activation function to add nonlinear features, then use the PointNetSetAbstraction method for downsampling, select neighborhood points through the K-nearest neighbor algorithm, and use the PointNet structure to extract local features. Finally, stack multiple TransformerBlocks and downsampling modules to extract deeper features layer by layer; Feature fusion module: aggregates global features by taking the feature mean of all points, then processes the quality information of the parts through a linear layer, combines the aggregated global features with the processing results of the quality information of the parts, and further processes them through another neural network containing multiple linear layers and ReLU activations, and finally outputs the classification results through a linear layer; Model training module: During the model training process, the cross entropy loss function is used to evaluate the classification error. The Adam optimizer is combined to dynamically adjust the learning rate, input new part information, and generate a CNC tool suitable for processing the part based on the part information.