On-machine roughness prediction method and device in cylindrical grinding process

Through the improved Swin Transformer model and Fast GLCM method, combined with the multi-head self-attention mechanism, the error and damage problems in high-precision surface roughness measurement are solved, and efficient and accurate roughness detection is achieved to meet the manufacturing industry's surface quality Increase demand.

CN119260492AActive Publication Date: 2025-01-07HUBEI UNIV OF ARTS & SCI +1

Patent Information

Application Number
CN202411484586.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-01-07
Estimated Expiration
2044-10-23

AI Technical Summary

Technical Problem

The prior art is prone to errors when measuring high-precision surface roughness, and the contact method causes damage to the surface, and the measurement speed is slow, making it difficult to meet the manufacturing industry's demand for improving product surface quality.

Method used

Using the improved Swin Transformer model combined with the Fast GLCM method, the surface roughness is achieved through image preprocessing and texture feature extraction, using the multi-head self-attention mechanism or the Inception-multi-head self-attention mechanism to capture the details and global information in the grinding image to achieve surface roughness. high-precision detection.

Benefits of technology

It improves the accuracy and speed of surface roughness detection, reduces errors, avoids surface damage, meets the needs of high-precision measurement, and realizes the prediction of surface roughness in machine during grinding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119260492A_ABST
    Figure CN119260492A_ABST
Patent Text Reader

Abstract

The invention discloses an on-machine roughness prediction method and device in the external grinding process, and belongs to the technical field of grinding machining.The method comprises the steps that a grinding image in any working procedure is obtained and input into an improved Swin Transformer model for prediction, and a prediction result is obtained; the training and improving method of the Swin Transform model comprises the following steps of: acquiring grinding images in a plurality of working procedures; an improved Fast GLCM method is adopted to calculate a gray level co-occurrence matrix of the grinding image; extracting four characteristic quantities of contrast, energy, correlation and difference from the gray-level co-occurrence matrix to obtain a textural feature map; the extracted texture feature map is input into a Swin Transform model to be trained; wherein the Swin Transform model uses a multi-head self-attention mechanism or an improved Inception-multi-head self-attention mechanism so as to capture detail and global information in the image; according to the invention, the detection of the surface roughness in the grinding process is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to an on-machine prediction method and device for roughness in a cylindrical grinding process, belonging to the technical field of grinding processing. Background Art

[0002] As the manufacturing industry's requirements for product surface quality continue to increase, precision rollers are an indispensable key component in the metal sheet processing process. Their surface quality has a decisive influence on the entire production process. Therefore, surface roughness measurement in grinding is crucial to controlling product quality.

[0003] At present, the main method for high-precision surface roughness measurement is the contact method. Roughness measuring instruments are commonly used in industry to measure. The surface height information of a certain area is recorded by the probe to calculate the surface roughness. Due to the limitations of the measurement area and the probe radius, it is difficult to measure high-precision surfaces (Ra<0.64 ) is prone to measurement errors, requiring multiple measurements to take the average value as the result, resulting in a slow measurement speed. At the same time, the contact method is prone to damage to the surface due to the sliding of the probe. Summary of the invention

[0004] The purpose of the present invention is to overcome the deficiencies in the prior art and to provide an on-machine prediction method and device for the roughness of a cylindrical grinding process, so as to realize the detection of the surface roughness during the grinding process.

[0005] To achieve the above object, the present invention is implemented by adopting the following technical solutions:

[0006] In a first aspect, the present invention provides an on-machine prediction method for roughness of a cylindrical grinding process, comprising: Obtain the grinding image in any process, input it into the improved Swin Transformer model for prediction, and obtain the prediction result; The training and improvement method of the Swin Transformer model includes: Collect grinding images in multiple processes; The gray-level co-occurrence matrix of grinding images is calculated using the improved Fast GLCM method; Extract four feature quantities, namely contrast, energy, correlation and difference, from the gray-level co-occurrence matrix to obtain a texture feature map; The extracted texture feature map is input into the Swin Transformer model for training; The Swin Transformer model uses a multi-head self-attention mechanism or an improved Inception-multi-head self-attention mechanism to capture details and global information in the image.

[0007] Furthermore, the method further comprises: preprocessing the grinding image, including: The image is geometrically corrected using the calibration parameters of the zoom lens. The correction method is shown in formula (1): (1); Where r is the undistorted normalized radius, is the normalized radius after distortion, k1, k2, k3 are radial distortion coefficients; The grayscale value of the grinding image is processed using the histogram equalization method to expand the grayscale gap between image elements.

[0008] Furthermore, the gray level co-occurrence matrix of the grinding image is calculated using the improved Fast GLCM method, including: By performing overall affine transformation and matrix transformation operations on the grinding image, the joint probability distribution of the grayscale values ​​of the grinding image is calculated, and the occurrence times of each pair of grayscale values ​​in all pixel pairs are counted to construct the grayscale co-occurrence matrix; The gray level co-occurrence matrix statistical method formula is as follows: (2); in, Indicates the midpoint of the image The probability of grayscale values ​​I and J appearing at a specified direction and distance; I and J represent the point and Point The gray value of ; a and b represent the offset in the i and j directions; M and N represent the size of the matrix.

[0009] Furthermore, the four feature quantities of contrast, energy, correlation and difference are extracted from the gray level co-occurrence matrix to obtain a texture feature map, including: By comparing the discreteness of each feature parameter, four feature quantities, namely, contrast, energy, correlation, and dissimilarity, are selected from the gray-level co-occurrence matrix to obtain the texture feature map. The calculation formula is as follows: (3); (4); (5); (6); in, for The mean in the horizontal and vertical directions, for The variance in the horizontal and vertical directions, N is the total number of gray levels in the image.

[0010] Furthermore, the extracted texture feature map is input into the Swin Transformer model for training, including: The input grinding image is divided into blocks through the image block partition structure, and the original image is divided into 4×4 patches; The block-based grinding image is linearly embedded and then input into the four stages in sequence; In the Stage, the image block merging operation is used for downsampling, multiple patches are combined together according to the set rules, and then passed to the Swin Transformer module for training.

[0011] Furthermore, the multi-head self-attention mechanism is limited to calculation within a local window; the improved Inception-multi-head self-attention mechanism processes different scales of input features in parallel through a multi-scale processing strategy, and finally fuses this information to capture global and local features at the same time.

[0012] Furthermore, when calculating the Concatenation parameters, the improved Inception-multi-head self-attention mechanism divides the input window into three channels, receives the results of three convolutional layers of different scales, 1×1, 3×3, and 5×5, respectively, and uses Concat for fusion after Batch Normalization and GELU activation layers.

[0013] In a second aspect, the present invention provides an on-machine prediction device for roughness of a cylindrical grinding process, comprising: The prediction module is used to obtain the grinding image in any process, input it into the improved Swin Transformer model for prediction, and obtain the prediction result; The training and improvement method of the Swin Transformer model includes: Collect grinding images in multiple processes; The gray-level co-occurrence matrix of grinding images is calculated using the improved Fast GLCM method; Extract four feature quantities, namely contrast, energy, correlation and difference, from the gray-level co-occurrence matrix to obtain a texture feature map; The extracted texture feature map is input into the Swin Transformer model for training; The Swin Transformer model uses a multi-head self-attention mechanism or an improved Inception-multi-head self-attention mechanism to capture details and global information in the image.

[0014] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the aforementioned methods.

[0015] In a fourth aspect, the present invention provides a computer device, comprising: Memory, for storing computer programs / instructions; A processor is used to execute the computer program / instructions to implement the steps of any of the aforementioned methods.

[0016] In a fifth aspect, the present invention provides a computer program product, comprising a computer program / instruction, which implements the steps of any one of the aforementioned methods when executed by a processor.

[0017] Compared with the prior art, the present invention has the following beneficial effects:

[0018] The present invention provides an on-machine prediction method and device for roughness in a cylindrical grinding process. By collecting grinding images and performing data optimization on an image texture enhancement method, an improved Inception-multi-head self-attention mechanism is used to construct a SwinTransformer model, thereby realizing on-machine detection of surface roughness in the grinding process. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a schematic diagram of a grinding machine model provided by an embodiment of the present invention;

[0020] Figure 2 is a schematic diagram of a cylindrical grinding motion model provided by an embodiment of the present invention;

[0021] Figure 3 is a schematic diagram of an on-machine vision acquisition system for a grinding machine provided by an embodiment of the present invention;

[0022] Figure 4 is a schematic diagram of grinding surface images corresponding to different roughness values ​​provided by an embodiment of the present invention;

[0023] Figure 5 is a schematic diagram of an image processing result provided by an embodiment of the present invention;

[0024] Figure 6 is a schematic diagram of representing different texture feature images provided by an embodiment of the present invention;

[0025] Figure 7 is a schematic diagram of the Swin Transformer algorithm structure provided by an embodiment of the present invention;

[0026] Figure 8 Schematic diagram of the original multi-head attention mechanism (MSA) provided by an embodiment of the present invention;

[0027] Fig. 9 Schematic diagram of an improved multi-head attention mechanism (IMSA) provided by an embodiment of the present invention;

[0028] Fig.10 is a schematic diagram of the grinding surface data enhancement effect provided by an embodiment of the present invention;

[0029] Fig.11 is a schematic diagram of prediction results of different texture feature images provided by an embodiment of the present invention;

[0030] Fig.12 is a schematic diagram of roughness prediction results under different algorithms provided by an embodiment of the present invention;

[0031] Fig.13 It is a schematic diagram of roughness prediction error distribution provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0032] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.

[0033] Embodiment 1: This embodiment introduces an on-machine prediction method for roughness of a cylindrical grinding process, comprising: Obtain the grinding image in any process, input it into the improved Swin Transformer model for prediction, and obtain the prediction result; The training and improvement method of the Swin Transformer model includes: Collect grinding images in multiple processes; The gray-level co-occurrence matrix of grinding images is calculated using the improved Fast GLCM method; Extract four feature quantities, namely contrast, energy, correlation and difference, from the gray-level co-occurrence matrix to obtain a texture feature map; The extracted texture feature map is input into the Swin Transformer model for training; The Swin Transformer model uses a multi-head self-attention mechanism or an improved Inception-multi-head self-attention mechanism to capture details and global information in the image.

[0034] The application process of the on-machine prediction method for roughness of cylindrical grinding process provided in this embodiment specifically involves the following steps:

[0035] 1 Grinding surface data acquisition

[0036] 1.1 External cylindrical grinding model

[0037] External cylindrical grinding is a method of grinding the outer cylindrical surface of a rotating workpiece using a grinding wheel, and is usually used to process cylindrical shaft workpieces. Figure 1 , Figure 2 As shown in the figure, the workpiece is mounted at both ends of the grinder and fixed between the center and the chuck. The grinding wheel rotates at high speed, and the surface of the workpiece is ground by the cutting edge of the grinding wheel. The workpiece rotates at a lower speed and moves slowly along the axial direction, so that the grinding wheel can evenly grind the entire outer cylindrical surface of the workpiece.

[0038] 1.2 Grinding machine on-machine visual inspection system

[0039] The core of roughness prediction method is to study the correlation between part surface image features and roughness.

[0040] In order to reduce the environmental interference of the grinding process and improve the detection speed, a portable on-machine vision acquisition system is designed for the grinding machine. Figure 3 As shown in Figure 1, the system consists of a mobile platform, a spherical integrating light source, a camera, and a microscope lens. The hardware information of the imaging system is shown in Table 1.

[0041] Table 1 Imaging system information

[0042]

[0043] In order to ensure the stability of surface imaging and reduce the interference of high reflective light on the curved surface, an industrial zoom lens is used to image it, and the spherical integral light source is used to effectively improve the uniformity of lighting. At the same time, in order to reduce the problem of ambient light pollution, the light source brightness is set to 1500LUX, and the ambient light pollution below 500LUX is filtered by controlling the exposure, and black light-absorbing cotton is used to further reduce the pollution of ambient light.

[0044] The acquisition system is used to collect the grinding surface in multiple processes such as rough grinding, semi-finishing and fine grinding, and the MarSurf PS10 measuring instrument is used to measure the grinding surface roughness in the rough grinding, semi-finishing and fine grinding stages, and the average value of 3 measurements is taken as the standard value. Among them, the rough grinding requires Ra<1.2 , semi-finishing grinding requires Ra<0.6 , fine grinding requires Ra<0.1 The measurement process and imaging results are as follows: Figure 4 shown.

[0045] 1.3 Image Correction and Enhancement

[0046] Preprocessing after acquiring the grinding image can enhance feature differences, which is conducive to the deep learning network to better extract image information, thereby correcting and enhancing the image.

[0047] The zoom lens will magnify the target surface features during the imaging process to improve the image clarity, but it will also magnify the surface features of shaft parts. In order to reduce the influence of distortion on the imaging results, the imaging system is corrected after obtaining the system internal parameters through calibration. The correction method is shown in formula (1). Where r is the normalized radius without distortion, is the normalized radius after distortion, k1, k2, k3 are radial distortion coefficients.

[0048] (1);

[0049] Then, the histogram equalization method is used to process the grayscale value of the roughness image to expand the grayscale difference of the image elements and effectively improve the overall contrast of the image. Figure 5 As shown in the figure, compared with the histogram before processing, the grayscale levels of the histogram after equalization are evenly distributed between 0 and 255, the image contrast is significantly improved, and the structural features of the grinding surface are more prominent.

[0050] 1.4 Fast Gray Level Co-occurrence Matrix Calculation

[0051] Using surface texture information to train deep learning models can improve detection accuracy and model robustness. Therefore, by extracting and analyzing the grinding surface texture, the influence of roughness image texture on detection accuracy is further studied.

[0052] The method based on gray-level co-occurrence matrix (GLCM) calculates the joint probability distribution of the gray values ​​of the image and counts the number of occurrences of each pair of gray values ​​in all pixel pairs to construct the co-occurrence matrix. It can fully capture the global and local texture features of the image, so it is widely used in texture information extraction. The gray-level co-occurrence matrix statistical method is shown in formula 2. Among them, Indicates the midpoint of the image The probability of grayscale values ​​I and J appearing at a specified direction and distance; I and J represent the point and Point The gray value of ; a and b represent the offset in the i and j directions; M and N represent the size of the matrix.

[0053] (2);

[0054] However, using different calculation methods will significantly affect the calculation speed of the algorithm. The traditional GLCM method selects pixel pairs pixel by pixel in the entire image to construct the co-occurrence matrix. This pixel-by-pixel statistical method is highly complex, especially when processing large images or more gray levels. The calculation is very time-consuming. In order to improve the efficiency of image processing, the improved Fast GLCM method is used for calculation. Fast GLCM avoids pixel-by-pixel calculation when performing statistics. Instead, it performs affine transformation on the entire image and uses matrix transformation operations to avoid the selection process of traditional GLCM pixel-by-pixel movement, which greatly simplifies the calculation process.

[0055] Two algorithms are used to calculate different gray-level co-occurrence matrix feature maps for an image of size 1000×1000 pixels. The calculation time comparison is shown in Table 2. The Fast GLCM algorithm can effectively improve the roughness detection speed.

[0056] Table 2 Calculation time of different feature maps of gray-level co-occurrence matrix

[0057]

[0058] Extracting the texture features of the grinding surface requires calculating different eigenvalues. By comparing the discreteness of each feature parameter, four feature quantities, namely contrast, energy, correlation, and dissimilarity, are selected from the gray-level co-occurrence matrix to obtain the texture feature map. The calculation methods are as follows: formulas (3) to (6).

[0059] (3);

[0060] (4);

[0061] (5);

[0062] (6);

[0063] in, for The mean in the horizontal and vertical directions, for The variance in the horizontal and vertical directions, N is the total number of gray levels in the image.

[0064] Fast GLCM is used to calculate the surface images of different roughness, and the surface texture feature images obtained are as follows: Figure 6 shown.

[0065] 2 Swin-IMSA roughness detection method

[0066] 2.1 Swin-Transformer Algorithm Structure

[0067] In image classification tasks, problems with small inter-class differences and large intra-class differences are usually classified as fine-grained image classification, such as identifying different species of birds. The prediction of grinding surface roughness grading is similar to the fine-grained image classification problem, specifically, it is to identify different roughness grades (small categories) in the surface roughness image (large category). Since the image differences between different grades are small, the recognition difficulty is higher than that of ordinary classification tasks.

[0068] In order to improve the classification accuracy of grinding surface roughness, Swin Transformer is used as the detection model. Compared with the traditional convolutional neural network (CNN), the self-attention mechanism of Transformer can better capture the details and global information in the image. Its hierarchical design and local attention mechanism can achieve better results in fine-grained classification tasks.

[0069] The Swin Transformer model structure is as follows Figure 7 As shown in the figure. First, the input image is divided into 4×4 patches through the image block partition structure, and then the original image is input into 4 stages in sequence after linear embedding transformation. In the stage, the image block merging operation is used for downsampling, and multiple patches are combined together according to the set rules, and then passed to the Swin Transformer module for training.

[0070] 2.2 Fine-grained Enhanced Multi-Head Self-Attention Mechanism

[0071] The self-attention mechanism is the core of Transformer, which is used to capture the dependencies between different positions in the patch sequence. Unlike traditional neural networks, the self-attention mechanism does not need to rely on the previous state step by step when processing the input sequence. Instead, it directly captures the global context information by calculating the similarity between all elements in the input sequence. The implementation principle is as follows: First, given the information sequence , and then use three different weight matrices W Q , W K and W V Map the input sequence to three spaces, Q, K, and V. Then calculate the Query, Key, and Value values ​​using formula (7). Finally, use the points to calculate the similarity between each Query and all Keys. The calculation method is shown in formula (8), where Q, K, and V represent Query, Key, and Value values, X represents the information sequence, and W Q , W K and W VIndicates different weights, Indicates the dimension of the key vector.

[0072] (7);

[0073] (8);

[0074] In Swin Transformer, Multi-Head Attention is used. Figure 8 is the original multi-head self-attention structure, Fig. 9 It is an improved Inception multi-head self-attention structure.

[0075] The multi-head self-attention mechanism (MSA) is limited to the calculation within the local window, rather than performing self-attention calculations on all pixels of the entire image, which effectively reduces the amount of calculation and is conducive to capturing local features.

[13] The multi-scale processing strategy in processes different scales of input features in parallel and fuses this information at the end so that the model can capture both global and local features at the same time.

[0076] The process of IMSA calculating the concatenation parameters is as follows: first, the input window is divided into three channels to receive the results of three different scale convolution layers: 1×1, 3×3, and 5×5. Then, the Batch Normalization (BN) and GELU activation layers are calculated. Finally, the output results are fused using Concat. The subsequent calculation steps are the same as the self-attention mechanism. w1 , Y w2 , Y w3 represents the convolution results of three different channels, GELU represents the activation function, BN represents the normalization operation, Conv represents the convolution operation, X w1 , X w2 , X w3 Represents the input features of three different channels, Y c Indicates fusion Y w1 , Y w2 , Y w3 The result after.

[0077] (9);

[0078] (10);

[0079] 3 Experimental results and analysis

[0080] 3.1 Experimental environment and grinding surface dataset

[0081] The experimental environment for training is i9-12900k (CPU), NVIDIA 3090Ti 24GB (GPU), 64G memory, the algorithm framework uses Pytorch1.7.0, Cuda is 11.0, cuDNN is 8.0.5, and the system environment is Windows 10 Professional Edition.

[0082] There are 5 experimental data sets, which are the original grinding surface image and its contrast map, energy map, correlation map, and difference map calculated by gray-level co-occurrence matrix. Each data set contains 3000 surface images at different grinding stages. to 1.2 Set 12 categories, and the number of images in each category is evenly distributed. During training, the data set is expanded to 12,000 images by transforming, cropping, and adjusting the color of the images to enhance the generalization of the training model. Fig.10 shown.

[0083] 3.2 Evaluation Criteria

[0084] The accuracy (Precision, P), recall (Recall, R) and mean average detection precision (mAP) indicators are used to compare the detection performance of the model. The calculation method is as follows.

[0085] (11);

[0086] (12);

[0087] (13);

[0088] Among them, TP is the number of true positives; FP is the number of false positives; FN is the number of false negatives; AP is the accuracy of each prediction; NC is the number of defect categories;

[0089] 3.3 Roughness detection experiment

[0090] 3.3.1 Relationship between roughness and texture representation under different characteristics

[0091] In order to compare the influence of different roughness feature images on the detection results, the original surface image, contrast image, energy image, correlation image and difference image are input into the improved Swin-IMSA network. The prediction results of different roughness surfaces are shown in Figure 2. Fig.11 shown.

[0092] From the perspective of prediction accuracy, the original image and the four types of gray-level co-occurrence matrix feature maps have the same accuracy trend, indicating that as the roughness value increases, the surface microscopic image can reflect the change of roughness, and the greater the roughness, the more accurate the model prediction.

[0093] The experimental results show that among the five types of input data sets, the model trained using contrast maps has the best prediction accuracy, with a value greater than 0.5. The recognition accuracy is higher than that of other images, and the accuracy is higher than 92.86% when the roughness value is low.

[0094] 3.3.2 Roughness prediction accuracy of different detection algorithms

[0095] In order to verify the effect of the prediction model, different algorithms are used for training and comparison. The process is as follows: Fig.12 When other experimental conditions are the same, only the detection algorithm is changed, and the hyperparameters and training environment remain unchanged.

[0096] From the experimental results, it can be seen that the performance of the Swin-IMSA detection algorithm in this paper is better than that of YOLOv

[14] 、MobileNet

[15] 、ResNet

[16] , the accuracy rate reaches 97.56%. In addition, the model converges quickly, tends to converge after 100 epochs, and the model stability is good.

[0097] 3.3.3 Sample measurement experiment

[0098] In order to verify the actual detection effect of the training model, the trained model was used to conduct on-machine detection experiments on the grinding machine, and the predicted results were compared with the actual results for evaluation. From 0.1-1.2 There are 12 groups of rollers in the experiment, each with 10 rollers. Fig.13 As shown, the horizontal axis represents the error interval between the predicted value and the measured value, and the vertical axis represents the number within the error interval.

[0099] The experimental results show that the minimum error is 0.005 in 120 measurements. , the maximum error is 0.133 , the average error is 0.035 , and the roughness error is 0.1 The prediction accuracy rate reached 98.33%, the overall error was small, and the ideal effect was achieved.

[0100] 4 Conclusion

[0101] (1) In order to measure the surface roughness of precision roller grinding in a portable manner, this paper uses the Swin-IMSA model for training. The microscopic image of the roller grinding surface is used as input. The model is trained after texture feature extraction. Finally, the model is trained with a value of 0.1 The interval is predicted in 12 categories of roughness with an accuracy of 97.56%.

[0102] (2) The Inception-Multi-Head Self-Attention Mechanism (IMSA) is used to improve the Swin Transformer module, and a multi-scale strategy is used to fuse the information of feature maps of different sizes, so that the model can capture both global and local features at the same time.

[0103] (3) Through the on-machine inspection experiment of the grinder, the average error of the prediction model trained with Swin-IMSA in 120 predictions was 0.035 , the error is 0.1 The prediction accuracy rate reached 98.33%.

[0104] Embodiment 2, this embodiment is an on-machine prediction device for roughness of a cylindrical grinding process, comprising:

[0105] The prediction module is used to obtain the grinding image in any process, input it into the improved Swin Transformer model for prediction, and obtain the prediction result;

[0106] The training and improvement method of the Swin Transformer model includes:

[0107] Collect grinding images in multiple processes;

[0108] The gray-level co-occurrence matrix of grinding images is calculated using the improved Fast GLCM method;

[0109] Extract four feature quantities, namely contrast, energy, correlation and difference, from the gray-level co-occurrence matrix to obtain a texture feature map;

[0110] The extracted texture feature map is input into the Swin Transformer model for training;

[0111] The Swin Transformer model uses a multi-head self-attention mechanism or an improved Inception-multi-head self-attention mechanism to capture details and global information in the image.

[0112] The specific functional implementation of each of the above modules can be found in the relevant contents of the method in Example 1 and will not be elaborated here.

[0113] Embodiment 3, this embodiment provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the steps of any one of the methods described in Embodiment 1 are implemented.

[0114] Embodiment 4: This embodiment provides a computer device, including:

[0115] Memory, for storing computer programs / instructions;

[0116] A processor, configured to execute the computer program / instructions to implement the steps of any one of the methods described in Example 1.

[0117] Embodiment 5: This embodiment provides a computer program product, including a computer program / instruction, which implements the steps of any method described in Embodiment 1 when executed by a processor.

[0118] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

[0119] It should be understood by those skilled in the art that the embodiments of the present disclosure may be provided as methods, systems or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0120] The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram and the combination of processes and / or blocks in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0121] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0122] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0123] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure rather than to limit its protection scope. Although the present disclosure has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that after reading the present disclosure, those skilled in the art can still make various changes, modifications or equivalent substitutions to the specific implementation methods of the invention, but these changes, modifications or equivalent substitutions are all within the protection scope of the disclosed claims to be approved.

Claims

1. A method for predicting roughness of cylindrical grinding process on a machine, characterized in that: include: Obtain the grinding image in any process, input it into the improved Swin Transformer model for prediction, and obtain the prediction result; The training and improvement method of the Swin Transformer model includes: Collect grinding images in multiple processes; The gray-level co-occurrence matrix of grinding images is calculated using the improved Fast GLCM method; Extract four feature quantities, namely contrast, energy, correlation and difference, from the gray-level co-occurrence matrix to obtain a texture feature map; The extracted texture feature map is input into the Swin Transformer model for training; Among them, the Swin Transformer model uses a multi-head self-attention mechanism or an improved Inception-multi-head self-attention mechanism to capture details and global information in the image.

2. The on-machine prediction method for roughness of cylindrical grinding process according to claim 1, characterized in that: The method further comprises: preprocessing the grinding image, including: The image is geometrically corrected using the calibration parameters of the zoom lens. The correction method is shown in formula (1): (1); Where r is the undistorted normalized radius, is the normalized radius after distortion, k1, k2, k3 are radial distortion coefficients; The grayscale value of the grinding image is processed using the histogram equalization method to expand the grayscale gap between image elements.

3. The on-machine prediction method for roughness of cylindrical grinding process according to claim 1, characterized in that: The improved Fast GLCM method is used to calculate the gray level co-occurrence matrix of the grinding image, including: By performing overall affine transformation and matrix transformation operations on the grinding image, the joint probability distribution of the grayscale values ​​of the grinding image is calculated, and the occurrence times of each pair of grayscale values ​​in all pixel pairs are counted to construct the grayscale co-occurrence matrix; The gray level co-occurrence matrix statistical method formula is as follows: (2); in, Indicates the midpoint of the image The probability of grayscale values ​​I and J appearing at a specified direction and distance; I and J represent the point and Point The gray value of ; a and b represent the offset in the i and j directions; M and N represent the size of the matrix.

4. The on-machine prediction method for roughness of cylindrical grinding process according to claim 3, characterized in that: The four feature quantities of contrast, energy, correlation and difference are extracted from the gray level co-occurrence matrix to obtain a texture feature map, including: By comparing the discreteness of each feature parameter, four feature quantities, namely, contrast, energy, correlation, and dissimilarity, are selected from the gray-level co-occurrence matrix to obtain the texture feature map. The calculation formula is as follows: (3); (4); (5); (6); in, for The mean in the horizontal and vertical directions, for The variance in the horizontal and vertical directions, N is the total number of gray levels in the image.

5. The on-machine prediction method for roughness of cylindrical grinding process according to claim 1, characterized in that: The extracted texture feature map is input into the Swin Transformer model for training, including: The input grinding image is divided into blocks through the image block partition structure, and the original image is divided into 4×4 patches; The block-based grinding image is linearly embedded and then input into the four stages in sequence; In the Stage, the image block merging operation is used for downsampling, multiple patches are combined together according to the set rules, and then passed to the Swin Transformer module for training.

6. The on-machine prediction method for roughness of cylindrical grinding process according to claim 1, characterized in that: The multi-head self-attention mechanism is limited to calculation within a local window; the improved Inception-multi-head self-attention mechanism processes different scales of input features in parallel through a multi-scale processing strategy, and finally fuses this information to capture global and local features at the same time.

7. The on-machine prediction method for roughness of cylindrical grinding process according to claim 1, characterized in that: When calculating the Concatenation parameters, the improved Inception-multi-head self-attention mechanism divides the input window into three channels, which receive the results of three convolutional layers of different scales, 1×1, 3×3, and 5×5, respectively. After Batch Normalization and GELU activation layers, Concat is used for fusion.

8. An on-machine prediction device for roughness of cylindrical grinding process, characterized in that: include: The prediction module is used to obtain the grinding image in any process, input it into the improved Swin Transformer model for prediction, and obtain the prediction result; The training and improvement method of the Swin Transformer model includes: Collect grinding images in multiple processes; The gray-level co-occurrence matrix of grinding images is calculated using the improved Fast GLCM method; Extract four feature quantities, namely contrast, energy, correlation and difference, from the gray-level co-occurrence matrix to obtain a texture feature map; The extracted texture feature map is input into the Swin Transformer model for training; The Swin Transformer model uses a multi-head self-attention mechanism or an improved Inception-multi-head self-attention mechanism to capture details and global information in the image.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 7 are implemented.

10. A computer device, characterized in that: include: Memory, for storing computer programs / instructions; A processor, configured to execute the computer program / instructions to implement the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Texture based method for extracting characteristics of transmission line equipment

    CN101593274A

  • Intelligent and automatic delineation method for gross tumor volume and organs at risk

    CN107403201A

  • Lung CT image computer aided system and method based on cluster analysis

    CN109036547A

  • Two-stage tongue picture recognition method based on deep learning

    CN113808075A

  • Image-based support vector machine detection method and system for surface roughness of part

    CN113989233A

Cited By

  • Processing surface roughness prediction method and system based on deep learning

    CN120493207A

  • Deep learning-based processing surface roughness prediction method and system

    CN120493207B