A tool damage intelligent detection method based on self-distillation
Patent Information
- Application Number
- CN202311044500.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-17
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2043-08-17
AI Technical Summary
[0003]中国专利公开号CN115345872A公开了一种基于自适应降噪模块的刀具损伤智能分类方法,通过端到端联合训练,能够对带有噪声的崩刃、碎断、后刀面磨损以及裂纹四种损伤类型图像进行识别,但是该方法需要耗费大量的训练时间,效率较低,同时占据大量地计算消耗,难以满足终端设备的低功耗、低内存部署要求;中国专利申请号202310277281.4公开了一种基于改进YOLOX的刀具损伤智能检测与预警方法,能够自动识别输入图像是否损伤并进行刀具损伤类别、区域判断,同时能够根据损伤类型进行刀具健康预警,也通过轻量级骨干网络的替换初步给工业级部署提供新的思路,但是整体网络层数过深,参数冗余,在实际的工业应用还存在较大差距;中国专利公开号CN115937292A公开了一种基于自蒸馏和偏移映射的自监督室内深度估算方法,该方法能够同时聚合一对低尺度和高尺度特征,并保持它们的上下文一致性,解决对于遮挡部分深度估计错误的问题,使得深度估计精度更高,但是该方法主要针对室内目标进行检测与深度估计,难以直接应用于刀具损伤检测领域;中国专利公开号CN115690440A公开了一种基于自蒸馏和自注意力的目标检测方法,该方法将卷积神经网络的局部特征和Transformer的全局特征结合起来,在Faster-RCNN上直接采用三级阈值筛选出高级的候选框,最后进行精确的目标检测,同样的,该方法主要针对真实目标检测,难以部署于刀具损伤检测终端设备;中国专利公开号CN115837606A公开了一种基于多模态数据的数控机床加工的故障缺陷识别方法,该方法采用云端服务器部署的第二识别算法进行视觉信号的识别,得到所述视觉信号所对应的刀具故障缺陷,但该方法的部署需要消耗较大算力,同时也需要特定的终端设备,不利于实际工业场景的广泛应用;中国专利公开号CN116000701A公开了一种可集成在刀库上的刀具检测装置和方法,该装置可利用采集的底刃、侧刃图像,计算磨损量,初步实现了简单的工业应用,但所采用的方法基于人工神经网络,需要大量先验知识以及手动调参,识别速度和准确性不足,而且难以预测出具体的刀具损伤类型,同时模型不具备较强的泛化能力,难以适应大规模的工业部署需求
[0010](1)本发明网络训练效率高,通过采用自蒸馏方法,使得师生网络共同训练,共享网络参数,省去了教师模型的训练时间,与同类方法相比,可以节省约50%的训练时间,极大提升模型训练效率。
Smart Images

Figure CN116993711B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of tool damage detection technology, and more specifically, relates to an intelligent tool damage detection method based on self-distillation. Background Technology
[0002] With the rapid development of deep learning technology, the demand for deep learning models has increased due to the need for lightweight industrial deployments. Cutting tools, as a crucial component of CNC machine tools, play a vital role in the current manufacturing industry. Currently, in the field of tool condition monitoring, most researchers modify numerous machine tools using machine vision methods to obtain tool damage images and then employ large-scale deep learning models to intelligently detect tool damage from these images, achieving some success. However, the high resource and memory consumption of current deep learning models severely restricts their application in the industrial field. On the one hand, machine vision-based tool damage detection research mainly focuses on laboratory environments where tool posture is easily obtained. However, in actual industrial environments, factors such as oil and dust interference, machine tool modification costs, and production schedules make it difficult to guarantee these conditions, posing new requirements for tool damage detection methods. On the other hand, although deep learning-based visual tool damage detection methods have achieved significant results, these methods often require models with large network parameters, consuming substantial resources and memory. Currently, the computing power and memory of terminal devices are insufficient to support such large-scale detection models, making it difficult to truly implement visual tool damage detection methods. Therefore, there is an urgent need for a method that combines visual inspection of cutting tools with industrial deployment, to open up new possibilities for the industrial deployment of cutting tool damage detection.
[0003] Chinese Patent Publication No. CN115345872A discloses a tool damage intelligent classification method based on an adaptive noise reduction module. Through end-to-end joint training, it can identify four damage types of images with noise: chipping, breakage, flank wear, and cracks. However, this method requires a large amount of training time, is inefficient, and consumes a lot of computational resources, making it difficult to meet the low power consumption and low memory deployment requirements of terminal devices. Chinese Patent Application No. 202310277281.4 discloses a tool damage intelligent detection and early warning method based on an improved YOLOX, which can automatically identify whether the input image is damaged and determine the tool damage type and region. Tool health warnings based on damage type and the initial provision of new ideas for industrial deployment through the replacement of lightweight backbone networks; however, the overall network layer is too deep and parameters are redundant, resulting in significant gaps in practical industrial applications; Chinese patent publication CN115937292A discloses a self-supervised indoor depth estimation method based on self-distillation and offset mapping. This method can simultaneously aggregate a pair of low-scale and high-scale features while maintaining their contextual consistency, solving the problem of depth estimation errors for occluded parts and improving depth estimation accuracy. However, this method is mainly for indoor target detection and depth estimation and is difficult to directly apply to the field of tool damage detection; Chinese patent publication... Patent application CN115690440A discloses a target detection method based on self-distillation and self-attention. This method combines local features from convolutional neural networks and global features from Transformers, directly using a three-level threshold to filter high-level candidate boxes on Faster R-CNN, and finally performing accurate target detection. However, this method is mainly for real-world target detection and is difficult to deploy on tool damage detection terminal equipment. Chinese patent publication CN115837606A discloses a fault and defect identification method for CNC machine tool machining based on multimodal data. This method uses a second recognition algorithm deployed on a cloud server to identify visual signals. While the visual signal can identify the corresponding tool faults and defects, this method requires significant computing power and specific terminal equipment, hindering its widespread application in practical industrial scenarios. Chinese Patent Publication No. CN116000701A discloses a tool detection device and method that can be integrated into a tool magazine. This device can calculate wear using acquired bottom and side edge images, achieving a preliminary simple industrial application. However, the method is based on artificial neural networks, requiring extensive prior knowledge and manual parameter tuning. Its recognition speed and accuracy are insufficient, and it is difficult to predict specific tool damage types. Furthermore, the model lacks strong generalization ability, making it difficult to adapt to large-scale industrial deployment needs.In summary, current tool damage detection methods still have certain shortcomings. Furthermore, research on the detection of tools that are difficult to modify or are used in production line machine tools is not in-depth enough, and they are difficult to adapt to the current situation of industrial-grade deployment with insufficient computing power and memory. Therefore, there is an urgent need for a high-precision, high-efficiency, and resource-saving intelligent tool damage detection method that can be flexibly deployed on terminal devices with limited computing power and memory to achieve process monitoring of the machining status of machine tool tools. Summary of the Invention
[0004] The purpose of this invention is to provide a self-distillation-based intelligent tool damage detection method. This method can be flexibly deployed on terminal devices with limited computing power and memory, and can determine whether there is damage and identify the type of damage based on the input image, thereby improving the applicability of tool damage detection and reducing industrial production losses caused by tool damage.
[0005] The technical solution to achieve the purpose of this invention is as follows:
[0006] A self-distillation-based intelligent tool damage detection method includes the following steps: uniformly numbering and grayscale processing of the acquired tool images, and setting tool damage types, which are defined as four types: fracture, chipping, crack, and flank wear; then classifying and labeling the images according to the damage type; and randomly dividing the obtained images and corresponding classification files into training set, validation set, and test set in a ratio of 7:1:2.
[0007] A self-distillation-based intelligent tool damage detection model is established. This model includes building an adaptive denoising classification network based on a multi-task learning framework as the teacher model. The original self-distillation network architecture is divided into different shallow layers, which can squeeze knowledge from the deep network into the shallow network, thereby increasing the amount of information received by the student model and improving model performance. Corresponding classifiers, bottleneck layers, and fully connected layers are added to the divided shallow layers. At the same time, four loss functions, including cross-entropy, KL divergence, L2 norm, and adaptive denoising, are added to improve model performance and robustness. Two hyperparameters introduced in the loss functions are used to balance the accuracy and efficiency of the student model.
[0008] Model training is performed, and the optimal detection model is obtained by adjusting hyperparameters and increasing the number of iterations.
[0009] Compared with existing intelligent tool damage detection methods and knowledge distillation methods, the significant advantages of this invention are:
[0010] (1) The network training efficiency of this invention is high. By adopting the self-distillation method, the teacher and students train the network together and share the network parameters, saving the training time of the teacher model. Compared with similar methods, it can save about 50% of the training time and greatly improve the model training efficiency.
[0011] (2) This invention divides the network into four shallow layers and adds corresponding bottleneck layers, fully connected layers and softmax functions, which improves learning efficiency while the student model learns more feature maps. Compared with similar model compression algorithms, the classification accuracy can be improved by more than 3%.
[0012] (3) The present invention adds an adaptive noise reduction function to the loss function, which improves the robustness of the model to tool image detection in actual machining environment. Compared with other tool damage detection algorithms, the accuracy is improved by about 2.4%.
[0013] (4) Introduce hyperparameters into loss functions from different sources to enable the model to achieve a balance between adaptive accuracy and efficiency. Attached Figure Description
[0014] Figure 1 The flowchart shows a smart tool damage detection method based on self-distillation.
[0015] Figure 2 Examples of tool damage types are shown in Figure (a), which is an example of tool chipping, Figure (b) is an example of tool breakage, and Figure (c) is an example of tool flank wear.
[0016] Figure 3 The structure diagram of the constructed teacher network model;
[0017] Figure 4 The network structure diagram of the intelligent tool damage detection method based on self-distillation is shown. Detailed Implementation
[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0019] To achieve intelligent detection and deployment of damaged cutting tools, this embodiment provides a tool damage intelligent detection model based on self-distillation, which specifically includes two parts: teacher model establishment and tool damage intelligent detection model training based on self-distillation.
[0020] Establishment of a teacher model for intelligent detection of tool damage, such as Figure 3 As shown, the process includes the following:
[0021] First, prepare the training set by acquiring images of damaged tools using a tool image acquisition system. Then, perform data augmentation on the obtained raw images, including: 1) horizontal and vertical flipping; 2) 30°, 45°, and 90° rotation; 3) adding mixed noise (Gaussian noise, salt-and-pepper noise, and Poisson noise).
[0022] Then determine the type of tool damage, specifically, such as... Figure 2 As shown, four main types are defined: 1. Chipping: Small notches appearing on the cutting edge after thermal and mechanical shocks to the tool in the early stages of cutting (at the beginning of cutting or after a short period of cutting); 2. Fracture: Large fragments appear on the cutting edge after prolonged cutting, making it difficult for the tool to continue cutting; 3. Rake face wear: Wear caused by friction between the flank face and the machined surface during tool operation, with the wear surface roughly parallel to the machined surface; 4. Cracks: Fatigue-induced damage to the rake and flank faces of a carbide tool after prolonged intermittent cutting. These cracks are divided into two categories: mechanical fatigue cracks, which are parallel to the cutting edge or form a network; and thermal cracks, which are generally perpendicular or inclined to the cutting edge. Crack propagation usually causes tool breakage. Images are labeled according to the defined types and then randomly divided into training, validation, and test sets in a 7:2:1 ratio.
[0023] To adapt to the training model, all images were processed into grayscale, and the input image size was uniformly set to 224×224.
[0024] like Figure 3 As shown, the teacher model mainly consists of two parts: a noise reduction module and a classification module. The backbone of the classification network has been replaced from the original VGG16 to ResNet18 to reduce network parameters, speed up model convergence, and thus improve training efficiency.
[0025] Then, a network design for a tool damage intelligent detection method based on self-distillation is performed, such as... Figure 4 As shown, specifically, the backbone network is divided into four shallow layers, each followed by a bottleneck layer, a fully connected layer, and a softmax function. The bottleneck layer suppresses internal interference between multiple classifiers by aligning feature maps of different depths, thus ensuring that the student model learns more knowledge while improving recognition accuracy. The learning efficiency of the model is controlled by adding loss functions from different sources, the first being cross-entropy loss, as shown in Equation 1: (1-θ)·CrossEntropy(p i ,y) (1) Here, θ is an introduced hyperparameter, p i Indicates O from the softmax layer i / NThe output is calculated using labels from the training dataset and results from the softmax layer, which provides knowledge of a single classifier directly from the hidden information in the dataset derived from the labels. The second loss function is the KL divergence function, as shown in Equation 2, i.e.: θ·KL(p i p N (2) Where p N This represents the output of the softmax layer of the deepest classifier; the KL divergence is calculated using the softmax layer outputs between the teacher and student networks, guided by the teacher network; since a softmax layer is introduced in each shallow classifier and the deepest classifier, the teacher network can influence each shallow classification. The third loss function is the L2 loss, as shown in Equation 3: Here, λ is a hyperparameter, F i and F N Representing i respectively th Features of the classifier and features of the deepest classifier. The meaning applied to this loss comes from the output of the deepest classifier, which is the output of the hidden layer of the teacher model and can be used to guide the learning of the student model. The idea behind it is to narrow the gap between the feature maps of the shallowest classifier and the deepest classifier, forcing the feature maps in all classifiers to adapt to the feature maps of most deep classifiers.
[0026] Then, in order to solve the problem of detecting noisy images in actual machining environments, an adaptive noise reduction loss function is introduced, as shown in Equation 4: Here, H, W, and C represent the height, width, and number of channels of the input image, respectively. L1 loss is used to suppress the amplification effect of adversarial noise, which indicates that small visual disturbances are gradually amplified by the neural network, leading to incorrect predictions. The L1 norm loss function is used to calculate the predictions obtained by the model. and The difference between them.
[0027] The final loss function of the model is shown in Equation 5: Here, θ and λ are introduced into the loss function to balance the model's adaptive accuracy and efficiency.
[0028] The iteration count was set to b = 5000, the training batch size to b = 32, the learning rate to 0.1-0.0001, the momentum to 0.9, the weight decay to 0.0001, and the SGD algorithm was selected as the optimization algorithm. The model was trained, and when the accuracy did not meet the expected requirements, it was fine-tuned by increasing the number of iterations and adjusting the hyperparameters, and finally the expected model was obtained.
[0029] The aforementioned intelligent tool damage detection model based on self-distillation exhibits good performance and high training efficiency. Compared with similar detection networks, it has higher prediction accuracy and is suitable for industrial deployment of machine tool detection. It also has the ability to detect noisy tool images in actual machining environments.
[0030] The specific embodiments described above illustrate the technical solution and beneficial effects of the present invention in detail. It should be understood that the above description is only the most preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, additions, and equivalent substitutions made within the scope of the principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A smart tool damage detection method based on self-distillation, characterized in that, include Step 1: Establish a self-distillation tool damage detection dataset. This includes acquiring tool damage images using an industrial camera, performing data augmentation through flipping, rotating, and adding noise to expand the dataset sample size, labeling the tool image samples, classifying tools with different damage types, and dividing the labeled tool damage dataset into training, validation, and test sets. Step 2: Select a teacher model. This includes choosing an adaptive noise reduction classification network based on a multi-task learning framework and testing the network performance using the dataset constructed in Step 1. Step 3: Construct a self-distillation-based tool damage target recognition teacher-student network model. This involves dividing the original self-distillation network architecture into different shallow layers, allowing knowledge to be pushed from deep layers into shallow layers to increase the amount of information received by the student model. Classifiers, bottleneck layers, and fully connected layers are added to the shallow layers to suppress internal interference from multiple classifiers. An adaptive noise reduction function is added to the loss function to improve the model's robustness in recognizing noisy images under real-world conditions. Hyperparameters are introduced into loss functions from different sources to achieve a balance between adaptive accuracy and efficiency. The number of shallow layer partitions within the network is N, where N∈N and N≥4. Within each shallow layer partition, a classifier is constructed in the order of a bottleneck layer, a fully connected layer, and a softmax function. The loss function includes cross-entropy loss, KL divergence loss, feature map L2 norm loss, and adaptive denoising loss. The total loss function L is expressed as: Among them, is the total loss function, is the cross-entropy loss, is the divergence loss, is the class probability distribution output by the s-th shallow classifier for the input tool image sample, is the class probability distribution output by the deepest classifier for the same input tool image sample, is the true damage class label corresponding to the input tool image sample, is the feature map extracted by the s-th shallow part for the input tool image sample, is the feature map extracted by the deepest part for the same input tool image sample, and are the introduced hyperparameters, s is the shallow classifier serial number and 1 ≤ s < N, H, W, and C are the image height, image width, and number of channels respectively, [[ID=2�]]is the true input value of the input tool image sample at the h-th row, w-th column, and c-th channel, is the reconstructed value of the output image of the adaptive noise reduction network at the h-th row, w-th column, and c-th channel; Step 4: Train the self-distillation-based tool damage target recognition teacher-student network model constructed in Step 3, including setting the number of training iterations and fine-tuning hyperparameters, setting a uniform input image size and format, and using pre-trained weights of the classification network for training; Step 5: Evaluate the model, including evaluating the self-distillation-based tool damage detection teacher-student network model trained in Step 4 based on recognition accuracy and training time, adjusting training parameters, and obtaining the optimal detection model if the recognition accuracy reaches the highest value; otherwise, repeat Step 4.
2. The intelligent tool damage detection method based on self-distillation as described in claim 1, characterized in that: In step 1, the number of tool damage types is set to i, i≥2, i∈N, and the setting of i is based on the tool damage category.
3. The intelligent tool damage detection method based on self-distillation as described in claim 1, characterized in that: In step 4, the initial number of iterations for training the tool damage detection model is set to j, and 3000≤j≤10000.
4. The intelligent tool damage detection method based on self-distillation as described in claim 1, characterized in that: In step 4, the uniform image format for model training is set to a×a, where a∈N, the image size is determined based on processor memory, and a≥224.
5. The intelligent tool damage detection method based on self-distillation as described in claim 1, characterized in that: In step 4, the training batch size for model training is set to b, where b∈N and 4≤b≤256. The value of b is determined based on the graphics card memory.
6. The intelligent tool damage detection method based on self-distillation as described in claim 1, characterized in that: The optimization algorithm used during model training in step 4 is the stochastic gradient descent algorithm.
Citation Information
Patent Citations
Cutter damage grayscale image intelligent classification method based on adaptive noise reduction
CN115345872A
Multi-modal data numerical control machine tool processing fault defect identification method
CN115837606A
Self-supervised indoor depth estimation method based on self-distillation and offset mapping
CN115937292A
Tool detection device and method capable of being integrated on tool magazine
CN116000701A
Cutter damage intelligent detection and early warning method based on improved YOLOX
CN116309458A