Defect detection method, device and equipment for vertical milling cutter and storage medium

Through the endmill tool defect detection model of teacher-student network and convolutional autoencoder, local and global anomaly diagrams are generated, which solves the problem of inefficient and low-precision caused by traditional detection relying on manual, and realizes efficient and accurate defect detection, ensuring the safe use of endmill tools.

CN120495200APending Publication Date: 2025-08-15XIAMEN TUNGSTEN CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510556453.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

Traditional end milling tools rely on manual labor, low efficiency and accuracy, and cannot guarantee safety during use.

Method used

The endmill tool defect detection model based on teacher-student network and convolutional autoencoder is adopted to detect defects by generating local and global anomaly graphs, and fused detection is performed in combination with local and global features.

Benefits of technology

It improves the efficiency and accuracy of end mill tool defect detection, reduces labor costs, and ensures safety during the use of end mill tool.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120495200A_ABST
    Figure CN120495200A_ABST
Patent Text Reader

Abstract

The invention discloses a vertical milling cutter defect detection method, device and equipment and a storage medium. The method comprises the steps that an obtained end milling cutter image data set is input into an end milling cutter defect detection model for defect detection, the end milling cutter defect detection model comprises a first anomaly detection module, a second anomaly detection module and a third anomaly detection module, the first anomaly detection module is obtained based on teacher-student network training, and the third anomaly detection module is obtained based on teacher-student network training; the graph generation module generates a local anomaly graph and a global feature graph according to input data; the second anomaly detection module is used for generating a global anomaly graph according to the end mill image data set and the global feature graph; the third anomaly detection module is used for performing defect detection on the vertical milling cutter based on the local anomaly graph and the global anomaly graph; and obtaining a defect detection result of the end milling cutter based on the output of the end milling cutter defect detection model. According to the invention, the efficiency and precision of defect detection of the vertical milling cutter can be improved, so that the safety of the vertical milling cutter in the subsequent use process is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of equipment detection, and in particular to a method, device, equipment and storage medium for detecting defects in an end milling tool. Background Art

[0002] During the production of end mills, various defects are unavoidable on the tool surface due to factors such as production technology and operator operation methods. These defects can cause serious safety hazards during the subsequent use of the tool.

[0003] Currently, traditional end mill tool defect detection methods typically require manual labor to perform. However, these methods rely heavily on human experience to ensure effective defect detection, resulting in high labor costs, low efficiency and accuracy, and an inability to guarantee the safety of end mill tools during subsequent use. Summary of the Invention

[0004] The present invention provides a method, device, equipment and storage medium for detecting defects in end milling tools, so as to realize efficient detection of defects in end milling tools, greatly reduce labor costs, improve the efficiency and accuracy of end milling tool defect detection, and thus ensure the safety of end milling tools during subsequent use.

[0005] According to one aspect of the present invention, a method for detecting defects in an end milling tool is provided, the method comprising:

[0006] Acquire an end mill image dataset corresponding to the end mill tool to be inspected;

[0007] The end mill image dataset is input into a pre-trained end mill defect detection model for defect detection. The end mill defect detection model includes a first anomaly detection module, a second anomaly detection module, and a third anomaly detection module. The first anomaly detection module is obtained based on teacher-student network training and is used to generate a local anomaly map and a global feature map according to the input end mill image dataset; the second anomaly detection module is used to generate a global anomaly map according to the input end mill image dataset and the global feature map; the second anomaly detection module includes multiple feature extraction circuits; and the third anomaly detection module is used to perform defect detection on the end mill based on the local anomaly map and the global anomaly map.

[0008] Based on the output of the end milling tool defect detection model, a defect detection result corresponding to the end milling tool is obtained.

[0009] According to another aspect of the present invention, there is provided a device for detecting defects in an end milling tool, the device comprising:

[0010] A data acquisition module is used to acquire an end mill image data set corresponding to the end mill tool to be detected;

[0011] a defect detection module, configured to input the end mill image dataset into a pre-trained end mill defect detection model for defect detection, wherein the end mill defect detection model includes a first anomaly detection module, a second anomaly detection module, and a third anomaly detection module; the first anomaly detection module is obtained based on teacher-student network training, and is configured to generate a local anomaly map and a global feature map based on the input end mill image dataset; the second anomaly detection module is configured to generate a global anomaly map based on the input end mill image dataset and the global feature map; the second anomaly detection module includes multiple feature extraction circuits; and the third anomaly detection module is configured to perform defect detection on the end mill based on the local anomaly map and the global anomaly map;

[0012] The detection result determination module is used to obtain the defect detection result corresponding to the end milling tool based on the output of the end milling tool defect detection model.

[0013] According to another aspect of the present invention, an electronic device is provided, comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the end mill tool defect detection method described in any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the end mill tool defect detection method according to any embodiment of the present invention when executed.

[0018] The technical solution of an embodiment of the present invention obtains an end mill image dataset corresponding to the end mill tool to be inspected and inputs the end mill image dataset into a pre-trained end mill tool defect detection model for defect detection. The end mill tool defect detection model includes a first anomaly detection module, a second anomaly detection module, and a third anomaly detection module. The first anomaly detection module is trained based on a teacher-student network and is used to generate a local anomaly map and a global feature map based on the input end mill image dataset. The second anomaly detection module is used to generate a global anomaly map based on the input end mill image dataset and the global feature map. The second anomaly detection module includes multiple feature extraction circuits. The third anomaly detection module is used to perform defect detection on the end mill tool based on the local anomaly map and the global anomaly map, thereby improving detection efficiency and accuracy. Based on the output of the end mill tool defect detection model, a defect detection result corresponding to the end mill tool is obtained. Implementing end mill tool defect detection using the end mill tool defect detection model can significantly reduce labor costs, improve the efficiency and accuracy of end mill tool defect detection, and thus ensure the safety of the end mill tool during subsequent use.

[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 This is a flow chart of a method for detecting defects in an end milling tool provided according to the first embodiment of the present invention;

[0022] Figure 2 This is a flow chart of a method for detecting defects in an end milling tool provided according to a second embodiment of the present invention;

[0023] Figure 3 is a structural diagram of a second anomaly detection module involved in Embodiment 2 of the present invention;

[0024] Figure 4 is a schematic diagram of an adaptive feature fusion method according to the second embodiment of the present invention;

[0025] Figure 51 is a schematic diagram of the structure of an unsupervised network according to the second embodiment of the present invention;

[0026] Figure 6 2 is a schematic structural diagram of an end milling tool defect detection device provided according to a third embodiment of the present invention;

[0027] Figure 7 It is a structural schematic diagram of an electronic device for implementing the end mill tool defect detection method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first," "second," "target," and the like in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this way are interchangeable where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or apparatus.

[0030] Example 1

[0031] Figure 1 A flowchart of a method for detecting defects in end milling tools is provided for the first embodiment of the present invention. This embodiment is applicable to the case of detecting defects in end milling tools. The method can be performed by an end milling tool defect detection device, which can be implemented in the form of hardware and / or software. The end milling tool defect detection device can be configured in an electronic device. Figure 1 As shown, the method includes:

[0032] S110 , obtaining an end mill image dataset corresponding to the end mill to be inspected.

[0033] An end mill cutter may refer to a cutting tool used for milling, with cutting edges distributed on cylindrical or conical surfaces and a spindle axis perpendicular to the work surface. It is primarily used for machining planes, grooves, stepped surfaces, forming surfaces, and parting. An end mill cutter image dataset may refer to a collection of images captured from multiple angles of the end mill cutter to be inspected.

[0034] Specifically, uniform image acquisition is performed around the end mill tool to be inspected, and an end mill tool image data set corresponding to the end mill tool to be inspected is obtained to ensure the integrity of the image data, thereby providing a data basis for subsequent defect detection.

[0035] Exemplarily, S110 may include: performing image acquisition on the end mill tool to be inspected based on multiple preset shooting angles to obtain image information of the end mill tool at different preset shooting angles; performing preprocessing operations on the image information at different preset shooting angles to obtain an end mill tool image data set corresponding to the end mill tool, wherein the preprocessing operations include at least one of image scaling, data cleaning, and data enhancement.

[0036] The preset shooting angle may refer to a preset shooting orientation of a camera, and the image information may refer to an image obtained by shooting.

[0037] Specifically, the camera can be located on an image acquisition platform, which can be composed of two parts: a conveying facility for conveying the end milling tool and a multi-angle image acquisition system. The multi-angle image acquisition system and the conveying facility work together to capture a complete surface image of the end milling tool. After the image acquisition platform is powered on, the multi-angle camera in the platform is automatically powered on and started; the system automatically loads and determines whether the communication of the multi-angle camera is normal. If so, the multi-angle camera begins to capture images in real time according to the preset shooting angle, and obtains image information of the end milling tool at different preset shooting angles. The obtained image information is pre-processed according to at least one of image scaling, data cleaning, and data enhancement to obtain an end mill image data set corresponding to the end milling tool, which can ensure the accuracy and diversity of the image data, thereby helping to improve the accuracy of defect detection.

[0038] S120. Input the end mill image data set into the pre-trained end mill defect detection model for defect detection. The end mill defect detection model includes a first anomaly detection module, a second anomaly detection module and a third anomaly detection module. The first anomaly detection module is obtained based on the teacher-student network training, and is used to generate a local anomaly map and a global feature map according to the input end mill image data set; the second anomaly detection module is used to generate a global anomaly map according to the input end mill image data set and the global feature map; the second anomaly detection module includes multiple feature extraction circuits; the third anomaly detection module is used to perform defect detection on the end mill based on the local anomaly map and the global anomaly map.

[0039] Among them, the end milling tool defect detection model may refer to an unsupervised model for defect detection of end milling tools. The first anomaly detection module may refer to a trained teacher-student network for feature extraction of images. The second anomaly detection module may refer to a convolutional autoencoder for feature extraction of images. The third anomaly detection module may refer to a network module for defect detection of end milling tools. The local anomaly map may refer to an image used to represent the difference between the local features extracted by the student network and the local features extracted by the teacher network. The global feature map may refer to an image used to represent the global semantic information of the entire image. The global anomaly map may refer to an image used to represent the difference between the global features extracted by the student network and the global features extracted by the autoencoder.

[0040] Specifically, the end mill image dataset is input into a pre-trained first anomaly detection module for local anomaly detection and global feature extraction, wherein the first anomaly detection module is obtained based on teacher-student network training and is used to generate local anomaly maps and global feature maps; the end mill image dataset is input into a pre-trained second anomaly detection module, which performs global feature extraction on the image data through multiple feature extraction circuits, thereby increasing feature information, and compares the feature extraction results with the global feature map output by the first anomaly detection module to detect logical anomalies in the overall structure of the image and generate a global anomaly map. The local anomaly map and the global anomaly map are input into a third anomaly detection module for fusion, and defect detection of the end mill tool is performed based on the fusion results. By combining the local anomaly map and the global anomaly map, structural and logical anomalies can be detected simultaneously, thereby improving the accuracy and robustness of the model anomaly detection.

[0041] S130 , obtaining a defect detection result corresponding to the end milling tool based on the output of the end milling tool defect detection model.

[0042] The defect detection result may refer to a result indicating whether the end mill tool has a defect. When the detection result indicates that there is a defect, the result also includes the specific location of the defect on the surface of the end mill tool.

[0043] Specifically, based on the output of the end mill tool defect detection model, it is determined whether there are defects on the surface of the end mill tool. When defects are detected, the specific area where the defects exist is determined, and the defect detection results corresponding to the end mill tool are obtained without the need for human intervention, thereby greatly reducing labor costs and improving the efficiency and accuracy of end mill tool defect detection.

[0044] In this embodiment, defect detection is performed by obtaining an end mill image dataset corresponding to the end mill tool to be inspected and inputting the end mill image dataset into a pre-trained end mill tool defect detection model. The end mill tool defect detection model includes a first anomaly detection module, a second anomaly detection module, and a third anomaly detection module. The first anomaly detection module is trained based on a teacher-student network and is used to generate a local anomaly map and a global feature map based on the input end mill image dataset. The second anomaly detection module is used to generate a global anomaly map based on the input end mill image dataset and the global feature map. The second anomaly detection module includes multiple feature extraction circuits. The third anomaly detection module is used to perform end mill tool defect detection based on the local anomaly map and the global anomaly map, thereby improving detection efficiency and accuracy. Based on the output of the end mill tool defect detection model, the corresponding end mill tool defect detection result is obtained. Implementing end mill tool defect detection using the end mill tool defect detection model can significantly reduce labor costs, improve the efficiency and accuracy of end mill tool defect detection, and thus ensure the safety of end mill tools during subsequent use.

[0045] Example 2

[0046] Figure 2 This is a flowchart of a method for detecting end mill tool defects, provided in Example 2 of the present invention. This example, based on the previous examples, optimizes the step of "inputting the end mill tool image dataset into a pre-trained end mill tool defect detection model for defect detection." Explanations of terms that are identical or corresponding to those in the previous examples are omitted here.

[0047] See also Figure 2 Another end mill tool defect detection method provided in this embodiment specifically includes the following steps:

[0048] S210: Acquire an end mill image dataset corresponding to the end mill to be inspected.

[0049] S220 , inputting the end mill image data set into a first anomaly detection module to extract local features and generate a local anomaly map.

[0050] Specifically, the end mill image data set is input into the first anomaly detection module for local feature extraction and local feature prediction, and the local feature extraction results and the local feature prediction results are compared, the difference between the two is calculated, and a local anomaly map is generated, so that the anomaly of the local structure can be accurately located.

[0051] Exemplarily, the first anomaly detection module includes: a teacher network unit and a student network unit; S220 may include: inputting the end mill image data set into the teacher network unit for local feature extraction and image reconstruction to obtain a first local feature map corresponding to the end mill tool; inputting the end mill image data set into the student network unit for local feature extraction and image reconstruction to obtain a second local feature map corresponding to the end mill tool; performing error analysis on the first local feature map and the second local feature map to generate a local anomaly map corresponding to the end mill tool.

[0052] The teacher network unit may refer to a pre-trained patch description network for extracting local features. The student network unit may refer to a pre-trained patch description network with the same structure as the teacher network unit, but with twice the output channels: one part predicts (extracts) local features, and the other part predicts (extracts) global features. The first local feature map may refer to the output result of the teacher network unit performing local feature extraction on the image. The second local feature map may refer to the output result of the student network unit performing local feature extraction on the image.

[0053] Specifically, the end mill image data set is input into the teacher network unit for local feature extraction, and the image is reconstructed according to the extracted first local feature to obtain the first local feature map corresponding to the end mill; the end mill image data set is input into the student network unit for local feature extraction, and the image is reconstructed according to the extracted second local feature to obtain the second local feature map corresponding to the end mill; the error analysis is performed between the first local feature map and the second local feature map, the square difference between the first local feature map and the second local feature map is calculated, and the channels are averaged and then upsampled to the input size to generate a local anomaly map corresponding to the end mill, so as to accurately reflect and locate the anomalies of the local structure.

[0054] It should be noted that the student network unit can be trained to learn the features of normal images, and thus has a stronger feature extraction capability for normal images and a weaker feature extraction capability for abnormal images. Therefore, during the detection process, the difference between the performance of the student network and the teacher network reflects whether there are abnormalities in the image.

[0055] S230: Input the end mill image data set into a first anomaly detection module for global feature extraction and image reconstruction to generate a first global feature map.

[0056] Among them, the first global feature map may refer to the output result of the student network unit performing global feature extraction on the image.

[0057] Specifically, the end mill image data set is input into the first anomaly detection module for global feature extraction, and image reconstruction is performed based on the extracted first global features to generate a first global feature map, which can provide a basis for subsequent global anomaly detection.

[0058] S240: Input the end mill image data set into the second anomaly detection module for global feature extraction and image reconstruction to generate a second global feature map.

[0059] The second global feature map may refer to the output result of the second anomaly detection module performing global feature extraction on the image.

[0060] Specifically, the end mill image data set is input into the second anomaly detection module for global feature extraction, and image reconstruction is performed based on the extracted second global features to generate a second global feature map, which can provide a basis for subsequent global anomaly detection.

[0061] Exemplarily, the second abnormality detection module includes: an encoding unit, a feature extraction unit and a decoding unit; S240 may include: inputting the end mill image data set into the feature extraction unit for global feature extraction to obtain a first global feature corresponding to the end mill tool; inputting the end mill image data set into the encoding unit for global feature extraction, and during the feature extraction process, fusing and clustering the global feature with the output of a preset convolution layer in the encoding unit, so that the encoding unit continues to perform the convolution operation of the next layer based on the clustering result to determine the second global feature corresponding to the end mill tool; inputting the second global feature into the decoding unit for image reconstruction to obtain a second global feature map corresponding to the end mill tool.

[0062] The encoding unit may refer to an encoder. The feature extraction unit may refer to a feature extraction branch that uses a pre-trained network Resnet18 for feature extraction. The decoding unit may refer to a decoder.

[0063] Specifically, the end mill image dataset is input into a feature extraction unit for global feature extraction, and the outputs of the two preset layers in the feature extraction unit are used as the first global features corresponding to the end mill. The end mill image dataset is input into an encoding unit for global feature extraction. During the feature extraction process, the first global features corresponding to different preset layers are fused with the outputs of the preset convolutional layer in the encoding unit, and the fusion results are clustered so that the encoding unit continues to perform the convolution operation of the next layer based on the clustering results, and the output of the last convolutional layer is determined as the second global feature corresponding to the end mill. The second global feature is input into a decoding unit for image reconstruction to obtain the second global feature map corresponding to the end mill. By using the feature extraction unit and the encoding unit as two different feature extraction circuits, global features are extracted from different scales, improving the model's expressiveness and enhancing the model's ability to capture global information.

[0064] For example, Figure 3 As shown, feature extraction can be performed using Resnet18 (feature extraction unit), resulting in feature maps of size 1×128×64×64 and 1×256×32×32 in layer2 and layer3, respectively, which are the first global features. The resulting feature maps layer2 and layer3 are then resized using two 1×1 convolutions to obtain new_layer2 and new_layer3, respectively, with sizes of 1×64×64×64 and 1×64×32×32. The resized feature maps are then adaptively fused with the corresponding features in the encoder (encoding unit). The autoencoder can consist of six layers of convolution. Feature3, obtained after the third convolution, is fused with new_layer2, which has been resized using the 1×1 convolution. The fused features are then resized using a 3×3 convolution (clustering operation) to obtain new_feature3. New_feature3 is convolved through the fourth layer of the autoencoder to obtain feature4. Feature4 is then fused with new_layer3 adjusted by 1×1 convolution. The fused features are then convolved through 3×3 convolution to obtain new_feature4. Finally, new_feature4 is sent to the subsequent convolution to complete the encoding process. Figure 4 As shown in the figure, the fusion process uses a weighted average approach, with the weights of the two branches in each fusion being set to learnable parameters w1 and w2. Each fused feature is further aggregated through a 3×3 convolution before being encoded. This fusion process enriches the information of the autoencoder features, providing rich information for the subsequent decoding process. The fused second global feature is input to the decoder, and the encoded features are decoded to obtain the reconstructed image, namely the second global feature map.

[0065] S250: Input the first global feature map and the second global feature map into a second anomaly detection module for error analysis to generate a global anomaly map corresponding to the milling tool.

[0066] Specifically, the square difference between the first global feature map output by the student network and the second global feature map output by the autoencoder is calculated, and the error result is upsampled to the input size to obtain the global anomaly map corresponding to the end milling tool, which can effectively detect anomalies involving the global structure.

[0067] S260: Input the local anomaly map and the global anomaly map into a third anomaly detection module to perform defect detection and obtain an anomaly detection result.

[0068] Specifically, the local anomaly map and the global anomaly map are input into the third anomaly detection module for fusion processing, and defect detection is performed based on the fused image to obtain anomaly detection results, thereby improving the accuracy and robustness of detection by combining local and global anomaly information.

[0069] Exemplarily, the anomaly detection result includes at least a comprehensive anomaly map and an anomaly score; S260 may include: inputting the local anomaly map and the global anomaly map into a third anomaly detection module, normalizing the local anomaly map and the global anomaly map through the third anomaly detection module, and fusing the normalized local anomaly map and the global anomaly map based on a preset fusion method to obtain a comprehensive anomaly map corresponding to the end mill tool, and determining the anomaly score corresponding to the comprehensive anomaly map based on a preset algorithm.

[0070] The comprehensive anomaly map may be a map obtained by fusing the local anomaly map and the global anomaly map, and is used to represent the comprehensive degree of anomaly at each location in the image. The anomaly score may be a single numerical value obtained by quantitatively evaluating the comprehensive anomaly map, and is used to represent the overall degree of anomaly in the image.

[0071] Specifically, the local and global anomaly maps are input into the third anomaly detection module, where they are normalized, bringing anomaly maps of different scales into the same range for easy fusion. Based on specific needs, a suitable fusion method, such as average fusion or weighted fusion, is selected to fuse the normalized local and global anomaly maps to obtain a comprehensive anomaly map corresponding to the end mill. This combines local and global anomaly information to improve the comprehensiveness and accuracy of anomaly detection. Based on specific needs, a suitable algorithm, such as the maximum method, average method, or regional statistics method, is selected to determine the anomaly score corresponding to the comprehensive anomaly map. The anomaly score quantitatively assesses the degree of anomaly in the image, facilitating comparison and ranking. Combined with the comprehensive anomaly map, the anomaly location can be intuitively displayed, improving the interpretability of the results.

[0072] S270 , based on the output of the end milling tool defect detection model, obtain a defect detection result corresponding to the end milling tool.

[0073] Exemplarily, S270 may include: in response to the abnormality score being greater than a preset score threshold, determining that there is an abnormal area in the comprehensive abnormality map, and determining the area in the comprehensive abnormality map where the regional abnormality score is greater than the preset score threshold as the abnormal area corresponding to the comprehensive abnormality map; performing position analysis based on the abnormal area to determine the defect area on the surface of the end mill tool corresponding to the abnormal area.

[0074] The regional anomaly score may refer to a single value obtained by quantitatively evaluating a local region in a comprehensive anomaly map, indicating the degree of abnormality of the local region of the image.

[0075] Specifically, the calculated anomaly score is compared with a preset score threshold. If the anomaly score is greater than the preset score threshold, an abnormal region is considered to exist in the comprehensive anomaly map. The comprehensive anomaly map is then segmented by a threshold, and regions with regional anomaly scores greater than the preset score threshold are marked as abnormal regions. The coordinates of the abnormal region in the comprehensive anomaly map are mapped to the actual coordinate system of the end mill image. Based on the mapped coordinates, the actual position of the abnormal region on the end mill surface is calculated. The defect region corresponding to the abnormal region is determined based on the geometric shape and size of the end mill. Through threshold segmentation and coordinate mapping, abnormal and defect regions can be accurately identified, improving the efficiency and accuracy of detection.

[0076] The technical solution of this embodiment is adopted. The present invention inputs the end mill image data set into the first abnormality detection module for local feature extraction and generates a local abnormality map, which can accurately locate the abnormality of the local structure. The end mill image data set is input into the first abnormality detection module for global feature extraction and image reconstruction to generate a first global feature map, and the end mill image data set is input into the second abnormality detection module for global feature extraction and image reconstruction to generate a second global feature map, which provides a basis for subsequent global abnormality analysis. The first global feature map and the second global feature map are input into the second abnormality detection module for error analysis to generate a global abnormality map corresponding to the end milling tool, which can effectively detect abnormalities involving the global structure and improve the accuracy of abnormality detection. The local abnormality map and the global abnormality map are input into the third abnormality detection module for defect detection to obtain abnormality detection results, thereby improving the accuracy and robustness of detection. By combining local and global features, the sensitivity of the model to abnormalities can be improved, and structural and logical abnormalities can be detected at the same time, which can greatly improve the accuracy of abnormality detection.

[0077] For example, the training process of the above-mentioned end mill tool defect detection model can be as follows:

[0078] S10: Setting up an end mill image acquisition platform to collect image information of the end mill;

[0079] Specifically, the image acquisition platform can be composed of two parts: a conveyor for transporting the end mill tool and a multi-angle image acquisition system. The multi-angle image acquisition system and the conveyor work together to capture a complete image of the end mill tool surface.

[0080] S20: image preprocessing to obtain a dataset of end mill image samples;

[0081] Specifically, we first scaled the image to a size of 512 × 512. We then constructed a dataset of end mill image samples containing a sufficient number of samples. Since the method employed is unsupervised, we needed to divide the image dataset into one containing only normal images and one containing only defects.

[0082] S30: Dataset image data cleaning and data enhancement;

[0083] Specifically, we filter and remove abnormal images containing interference from the dataset. We then use data augmentation on the filtered dataset to increase its diversity and ensure that the model can learn more robust features.

[0084] S40: Build an unsupervised detection network;

[0085] Specifically, if Figure 5 As shown, the present invention uses an unsupervised detection model as the basic network model. This avoids the complex steps of labeling large numbers of samples required by supervised detection models, reducing the manual and time complexity of dataset preparation. The unsupervised network mainly consists of two parts: the first part is the teacher-student network, and the second part is the autoencoder.

[0086] S41: Feature Extraction: During the encoding process, a new feature extraction branch is first introduced. This branch uses the pre-trained Resnet18 network for feature extraction. Resnet18 is used to obtain feature maps of size 1×128×64×64 and 1×256×32×32 for layer 2 and layer 3, respectively. The weights of the pre-trained Resnet18 network are frozen during training.

[0087] S42: Feature Dimension Adjustment: Two 1×1 convolutions are performed on the obtained feature maps layer2 and layer3 to obtain new_layer2 and new_layer3, which are 1×64×64×64 and 1×64×32×32, respectively. At the same time, 1×1 convolutions are also performed to eliminate data deviations between the pre-training dataset and the actual end mill dataset.

[0088] S43: Adaptive feature fusion: The adjusted feature maps are fused with the corresponding features in the autoencoder. The autoencoder consists of six convolutional layers. Feature 3, obtained after the third convolution, is fused with new_layer2, which has been adjusted through a 1×1 convolution. The fused features are then convolved through a 3×3 convolution to obtain new_feature3. New_feature3 is convolved through the fourth convolution layer of the autoencoder to obtain feature 4. Feature 4 is then fused with new_layer3, which has been adjusted through a 1×1 convolution. The fused features are then convolved through a 3×3 convolution to obtain new_feature4. Finally, new_feature4 is fed into the subsequent convolution to complete the encoding process. The fusion process uses a weighted average approach, with the weights of the two branches in each fusion being set to learnable parameters w1 and w2. Each fused feature is further aggregated through a 3×3 convolution before being encoded. This fusion process enriches the features of the autoencoder, providing rich information for the subsequent decoding process.

[0089] S44: Feature reconstruction; the fused features are input into the encoder, and the reconstructed image is obtained by decoding the encoded features.

[0090] S50: Model iterative training.

[0091] Specifically, the hyperparameters of the unsupervised network are set, where the initial value of the learning rate is set to 0.0001, and it is reduced to one tenth of the original value when the learning step size reaches 65,000. The total training step size is set to 70,000 steps;

[0092] S60: Select model performance evaluation indicators

[0093] Specifically, AUROC is used as the evaluation index for model performance, and the training weight with the best performance of the evaluation index is retained based on the validation set;

[0094] S70: test model detection performance;

[0095] Specifically, the image to be inspected is input into the trained model for inference to output defect detection results; the detection results include whether the image contains defects and the area of the defects in the image.

[0096] Example 3

[0097] Figure 6 This is a schematic diagram of the structure of a device for detecting defects in an end milling tool provided by the third embodiment of the present invention. Figure 6 As shown, the device includes: a data acquisition module 310, a defect detection module 320, and a detection result determination module 330;

[0098] The data acquisition module is used to acquire an end mill image data set corresponding to the end mill tool to be detected;

[0099] a defect detection module, configured to input the end mill image dataset into a pre-trained end mill defect detection model for defect detection, wherein the end mill defect detection model includes a first anomaly detection module, a second anomaly detection module, and a third anomaly detection module; the first anomaly detection module is obtained based on teacher-student network training, and is configured to generate a local anomaly map and a global feature map based on the input end mill image dataset; the second anomaly detection module is configured to generate a global anomaly map based on the input end mill image dataset and the global feature map; the second anomaly detection module includes multiple feature extraction circuits; and the third anomaly detection module is configured to perform defect detection on the end mill based on the local anomaly map and the global anomaly map;

[0100] The detection result determination module is used to obtain the defect detection result corresponding to the end milling tool based on the output of the end milling tool defect detection model.

[0101] In this embodiment, defect detection is performed by obtaining an end mill image dataset corresponding to the end mill tool to be inspected and inputting the end mill image dataset into a pre-trained end mill tool defect detection model. The end mill tool defect detection model includes a first anomaly detection module, a second anomaly detection module, and a third anomaly detection module. The first anomaly detection module is trained based on a teacher-student network and is used to generate a local anomaly map and a global feature map based on the input end mill image dataset. The second anomaly detection module is used to generate a global anomaly map based on the input end mill image dataset and the global feature map. The second anomaly detection module includes multiple feature extraction circuits. The third anomaly detection module is used to perform defect detection on the end mill tool based on the local anomaly map and the global anomaly map, thereby improving detection efficiency and accuracy. Based on the output of the end mill tool defect detection model, a defect detection result corresponding to the end mill tool is obtained. Implementing end mill tool defect detection using the end mill tool defect detection model can significantly reduce labor costs, improve the efficiency and accuracy of end mill tool defect detection, and thus ensure the safety of the end mill tool during subsequent use.

[0102] Optionally, the data acquisition module 310 is specifically used to: perform image acquisition on the end mill tool to be inspected based on multiple preset shooting angles to obtain image information of the end mill tool at different preset shooting angles; perform preprocessing operations on the image information at different preset shooting angles to obtain an end mill tool image data set corresponding to the end mill tool, wherein the preprocessing operation includes at least one of image scaling, data cleaning and data enhancement.

[0103] Optionally, the defect detection module 320 includes:

[0104] a local anomaly determination unit, configured to input the end mill image data set into the first anomaly detection module for local feature extraction to generate a local anomaly map;

[0105] a first feature extraction unit, inputting the end mill image data set into the first anomaly detection module for global feature extraction and image reconstruction to generate a first global feature map;

[0106] a second feature extraction unit, configured to input the end mill image data set into the second anomaly detection module for global feature extraction and image reconstruction to generate a second global feature map;

[0107] a global anomaly determination unit, configured to input the first global feature map and the second global feature map into the second anomaly detection module for error analysis, and generate a global anomaly map corresponding to the end milling tool;

[0108] The anomaly detection unit is used to input the local anomaly map and the global anomaly map into the third anomaly detection module to perform defect detection and obtain an anomaly detection result.

[0109] Optionally, the first anomaly detection module includes: a teacher network unit and a student network unit; the local anomaly determination unit is specifically used to: input the end mill image data set into the teacher network unit for local feature extraction and image reconstruction, and obtain a first local feature map corresponding to the end mill tool; input the end mill image data set into the student network unit for local feature extraction and image reconstruction, and obtain a second local feature map corresponding to the end mill tool; perform error analysis on the first local feature map and the second local feature map, and generate a local anomaly map corresponding to the end mill tool.

[0110] Optionally, the second abnormality detection module includes: an encoding unit, a feature extraction unit and a decoding unit; the second feature extraction unit is specifically used to: input the end mill image data set into the feature extraction unit for global feature extraction to obtain a first global feature corresponding to the end mill tool; input the end mill image data set into the encoding unit for global feature extraction, and during the feature extraction process, fuse and cluster the global feature with the output of a preset convolution layer in the encoding unit, so that the encoding unit continues to perform the convolution operation of the next layer based on the clustering result to determine the second global feature corresponding to the end mill tool; input the second global feature into the decoding unit for image reconstruction to obtain a second global feature map corresponding to the end mill tool.

[0111] Optionally, the abnormality detection result includes at least a comprehensive abnormality map and an abnormality score; the abnormality detection unit is specifically used to: input the local abnormality map and the global abnormality map into the third abnormality detection module, so as to normalize the local abnormality map and the global abnormality map through the third abnormality detection module, and fuse the normalized local abnormality map and the global abnormality map based on a preset fusion method to obtain the comprehensive abnormality map corresponding to the end mill tool, and determine the abnormality score corresponding to the comprehensive abnormality map based on a preset algorithm.

[0112] Optionally, the detection result determination module 330 is specifically used to: in response to the abnormality score being greater than a preset score threshold, determine that there is an abnormal area in the comprehensive abnormality map, and determine the area in the comprehensive abnormality map where the regional abnormality score is greater than the preset score threshold as the abnormal area corresponding to the comprehensive abnormality map; perform position analysis based on the abnormal area to determine the defect area on the surface of the end mill tool corresponding to the abnormal area.

[0113] The above-mentioned device can execute the end milling tool defect detection method provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the end milling tool defect detection method.

[0114] Example 4

[0115] Figure 7 1 is a schematic diagram of the structure of an electronic device for implementing the end mill tool defect detection method according to an embodiment of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0116] like Figure 7As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by the at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12 and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0117] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0118] The processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any other suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the end mill tool defect detection method.

[0119] In some embodiments, the end mill tool defect detection method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the end mill tool defect detection method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the end mill tool defect detection method in any other appropriate manner (for example, by means of firmware).

[0120] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product that includes a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication unit 19, or installed from the storage unit 18, or installed from the ROM 12. When the computer program is executed by the processor 11, the above-mentioned functions defined in the method of the embodiment of the present invention are performed.

[0121] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0122] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0123] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0124] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0125] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0126] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.

[0127] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.

[0128] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. A method for detecting defects in an end milling tool, characterized in that: include: Acquire an end mill image dataset corresponding to the end mill tool to be inspected; The end mill image dataset is input into a pre-trained end mill defect detection model for defect detection. The end mill defect detection model includes a first anomaly detection module, a second anomaly detection module, and a third anomaly detection module. The first anomaly detection module is obtained based on teacher-student network training and is used to generate a local anomaly map and a global feature map based on the input end mill image dataset; the second anomaly detection module is used to generate a global anomaly map based on the input end mill image dataset and the global feature map; the second anomaly detection module includes multiple feature extraction circuits; The third anomaly detection module is used to perform defect detection on the end milling tool based on the local anomaly map and the global anomaly map; Based on the output of the end milling tool defect detection model, a defect detection result corresponding to the end milling tool is obtained.

2. The method according to claim 1, characterized in that The step of obtaining an end mill image dataset corresponding to the end mill tool to be detected includes: Capturing images of the end milling tool to be inspected based on a plurality of preset shooting angles to obtain image information of the end milling tool at different preset shooting angles; A preprocessing operation is performed on the image information at different preset shooting angles to obtain an end mill image data set corresponding to the end mill tool, wherein the preprocessing operation includes at least one of image scaling, data cleaning and data enhancement.

3. The method according to claim 1, characterized in that Inputting the end mill image dataset into a pre-trained end mill defect detection model for defect detection includes: Inputting the end mill image data set into the first anomaly detection module to extract local features and generate a local anomaly map; Inputting the end mill image data set into the first anomaly detection module for global feature extraction and image reconstruction to generate a first global feature map; Inputting the end mill image data set into the second anomaly detection module for global feature extraction and image reconstruction to generate a second global feature map; Inputting the first global feature map and the second global feature map into the second anomaly detection module for error analysis to generate a global anomaly map corresponding to the end milling tool; The local anomaly map and the global anomaly map are input into the third anomaly detection module to perform defect detection to obtain an anomaly detection result.

4. The method according to claim 3, characterized in that The first anomaly detection module includes: a teacher network unit and a student network unit; The step of inputting the end mill image data set into the first anomaly detection module to extract local features and generate a local anomaly map includes: Inputting the end mill image data set into the teacher network unit to perform local feature extraction and image reconstruction to obtain a first local feature map corresponding to the end mill; Inputting the end mill image data set into the student network unit to perform local feature extraction and image reconstruction to obtain a second local feature map corresponding to the end mill; An error analysis is performed on the first local feature map and the second local feature map to generate a local anomaly map corresponding to the end milling tool.

5. The method according to claim 3, characterized in that The second anomaly detection module includes: an encoding unit, a feature extraction unit and a decoding unit; The step of inputting the end mill image data set into the second anomaly detection module for global feature extraction and image reconstruction to generate a second global feature map comprises: Inputting the end mill image data set into the feature extraction unit to perform global feature extraction to obtain a first global feature corresponding to the end mill; Inputting the end mill image dataset into the encoding unit for global feature extraction, and in the feature extraction process, fusing and clustering the global features with the output of a preset convolution layer in the encoding unit, so that the encoding unit continues to perform a convolution operation of the next layer based on the clustering result to determine a second global feature corresponding to the end mill; The second global feature is input into the decoding unit for image reconstruction to obtain a second global feature map corresponding to the end milling tool.

6. The method according to claim 3, characterized in that The anomaly detection result includes at least a comprehensive anomaly map and an anomaly score; the inputting the local anomaly map and the global anomaly map into the third anomaly detection module for defect detection to obtain the anomaly detection result includes: The local anomaly map and the global anomaly map are input into the third anomaly detection module, so that the local anomaly map and the global anomaly map are normalized by the third anomaly detection module, and the normalized local anomaly map and the global anomaly map are fused based on a preset fusion method to obtain a comprehensive anomaly map corresponding to the end mill tool, and the anomaly score corresponding to the comprehensive anomaly map is determined based on a preset algorithm.

7. The method according to claim 6, characterized in that The obtaining of a defect detection result corresponding to the end milling tool based on the output of the end milling tool defect detection model includes: In response to the anomaly score being greater than a preset score threshold, determining that an abnormal region exists in the comprehensive anomaly map, and determining a region in the comprehensive anomaly map whose regional anomaly score is greater than the preset score threshold as an abnormal region corresponding to the comprehensive anomaly map; A position analysis is performed based on the abnormal area to determine a defect area on the surface of the end mill tool corresponding to the abnormal area.

8. A device for detecting defects in end milling cutters, characterized in that: include: A data acquisition module is used to acquire an end mill image data set corresponding to the end mill tool to be detected; A defect detection module is configured to input the end mill image dataset into a pre-trained end mill defect detection model for defect detection, wherein the end mill defect detection model includes a first anomaly detection module, a second anomaly detection module, and a third anomaly detection module. The first anomaly detection module is obtained based on teacher-student network training and is configured to generate a local anomaly map and a global feature map based on the input end mill image dataset; the second anomaly detection module is configured to generate a global anomaly map based on the input end mill image dataset and the global feature map; the second anomaly detection module includes multiple feature extraction circuits; The third anomaly detection module is used to perform defect detection on the end milling tool based on the local anomaly map and the global anomaly map; The detection result determination module is used to obtain the defect detection result corresponding to the end milling tool based on the output of the end milling tool defect detection model.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor. The computer program is executed by the at least one processor to enable the at least one processor to perform the end mill tool defect detection method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the end mill tool defect detection method according to any one of claims 1 to 7 when executed.

Citation Information

Patent Citations

  • Abnormal detection method and system, medium, electronic equipment and abnormal detection model

    CN117934422A

  • Indexable blade defect detection method, electronic equipment and medium

    CN119559182A

  • Method and device for training a machine learning system

    US20250086511A1