1. Introduction
With the continuous innovation in science and technology, the intersection of traditional manufacturing and advanced AI technologies has sparked significant advancements, fueling confidence in the forthcoming era of intelligent industry [
1]. In this era of digital manufacturing, computer numerical control (CNC) machines play a pivotal role, and cutting tools have a direct impact on machining quality [
2]. Efficient and intelligent tool condition monitoring (TCM) is therefore crucial for enhancing production efficiency, maintaining dimensional accuracy, and supporting predictive maintenance [
3]. This study focuses specifically on coated solid-carbide end mills used in end-milling operations.
Currently, research in tool condition monitoring predominantly focuses on indirect and direct methods [
4]. Indirect methods assess tool wear by analyzing online sensor signals like current, acoustic emissions, and vibrations [
5]. Despite their efficiency and accuracy, these methods heavily rely on sensors and signal processing technologies. However, noise disturbances continue to undermine signal transmission, posing a significant and unresolved challenge [
6]. Direct methods primarily apply radiographic graphic measurement, resistance measurement, and machine vision to determine wear on the cutting edge’s surface [
7]. Compared to indirect methods, direct methods are better suited for high-efficiency automated environments and offer higher detection accuracy. Additionally, direct methods monitor targets more directly than sensor-based indirect methods, enhancing reliability.
In recent years, a growing body of research has integrated machine vision with tool wear monitoring. Common image-processing techniques include segmentation, morphology, filtering, adaptive thresholding, and grayscale transformation. Agarwal et al. [
8] combined Gaussian filtering and Otsu thresholding [
9] to quantify wear area in milling tools. Shahabi and Ratnam [
10] developed an online tool-tip wear system based on the difference between unworn and worn images, and later examined notch wear and built-up edge in turning tools [
11,
12]. These examples also show why the cutting process and workpiece material must be stated: continuous turning, interrupted end-milling, and stamping impose different combinations of thermal cycling, impact, abrasion, and adhesion. Likewise, steels of moderate hardness, hardened die steels, and difficult-to-cut alloys produce different dominant wear mechanisms and optical appearances [
13].
Lachance et al. [
14] developed the Fully Automated Surface Condition Analysis Tool (FASCAT) wear measurement system, which measures wear flats by capturing them optically. A total of 254 edge profile cutting head images make up the new dataset constructed by García-Ordás et al. [
15]. This is the first adequately curated dataset available to the public. Bagga et al. [
16] measured flank wear by using region segmentation and edge detection techniques. To evaluate the probability of low, medium, and high wear levels, Barreiro et al. [
17] suggested an approach based on texture description and linear discriminant analysis. Ye et al. [
18] separated the tool damage into areas that were broken and worn. Next, utilizing visual feature migration and state-of-the-art reconstruction, tool wear and breakage picture data were recovered, respectively. To address the impossibility of directly measuring the worn tool, Fernández-Robles et al. [
19] processed and analyzed micro-tool pictures, providing useful information to estimate the evolution of tool wear.
Although the aforementioned methods achieve high testing accuracy in specific application scenarios, the limitations of traditional digital image processing in manual feature extraction, limited adaptability, and difficulty in coping with noise disturbances critically compromise their generalizability. Additionally, the need for manual parameter adjustments complicates the optimization of the network. Over the past ten years, there has been notable progress in machine learning approaches—specifically in deep learning (DL) methods—to tackle computer vision (CV) issues at a level that is comparable to or better than human performance [
20]. Recent research has witnessed a surge in the application of convolutional neural networks (CNNs) for tool wear monitoring. These CNN-based approaches have demonstrated promising results, suggesting their immense potential as a valuable tool in this domain. Wang et al. [
21] introduced a hybrid machine learning approach that combines recurrent neural networks (RNNs) and CNNs to integrate heterogeneous data for the prognosis of tool condition. In order to identify tool wear areas in microscopic pictures, Bergs et al. [
22] suggested two methods: one for semantic segmentation and the other for tool type classification. Lin et al. [
23] integrated object detection and image segmentation for detecting the tool wear area on stitched images, and they obtained the best maximum dice coefficient score with 0.93. Wu et al. [
24] coupled traditional image processing with the U-Net [
25] semantic segmentation network to extract features of tool wear areas; the prediction accuracy was only 17% less than the error of manual measurements.
Recent work further illustrates three complementary directions. Li et al. [
26] directly quantified micro-milling wear from images and improved robustness to uneven illumination and arbitrary spindle orientation through image restoration, registration, and geometric wear extraction. Singh et al. [
27] used a Vision Transformer for image-based wear recognition in end-milling of Inconel 718 and evaluated generalization under changed lighting, highlighting both the value of global self-attention and the need to test acquisition-domain shifts. Beyond direct imaging, Liu et al. [
28] fused acoustic and force features for abrasive-belt wear recognition under variable grinding parameters; their cross-condition results reinforce that performance measured under fixed operating conditions should not be interpreted as operating-condition-independent generalization. These studies motivate the present combination of direct quantitative imaging, Transformer-based instance representation, and cautious within-domain evaluation.
While these deep learning-based techniques effectively address the limitations of conventional approaches by discovering the innate patterns and characteristics in images, leading to groundbreaking advancements in the field of image processing, they ignore the quantitative assessment of tool wear, making them inadequate in meeting the stringent requirements for accurate and reliable tool damage assessment in industrial applications. Driven by the recognition of quantitative tool wear evaluation’s pivotal role and extensive industrial applications, researchers have embarked on a surge of research in this domain, fueled by the advancements in deep learning segmentation techniques.
To address the challenge of tool wear detection in the stamping process, Schlegel et al. [
29] proposed a tool wear segmentation method based on fully convolutional networks (FCNs) and digital image processing. This method enables pixel-level classification of different wear types, facilitating the spatial analysis of tool wear. Experimental results demonstrate that the model achieves high intersection over union (IoU) values for various tool wear categories, with an average IoU of 91.95% on the test set. Notably, it exhibits exceptional performance in background, no-wear area, and groove categories. While this method effectively classifies and quantitatively evaluates tool wear regions, it falls short in assessing wear extent and lacks modifications or innovations to the employed backbone network, making it difficult to adapt to different task scenarios. Li et al. [
30] proposed an intelligent detection method based on the Segment Anything Model (SAM). Firstly, an initial image segmentation mask is generated using U-Net. Then, points of interest (PoIs) are obtained through binarization processing. These PoIs are then fed into the prompt encoder of SAM along with the initial mask. Finally, the mask decoder of SAM outputs the tool wear segmentation mask. The results demonstrate that the proposed method outperforms U-Net under different training dataset sizes, particularly on small datasets. Similarly, the method only locates the wear regions and lacks investigation of the wear extent. To address the challenge of accurate measurement and evaluation of machine tool wear due to its complexity arising from diverse machining conditions and tool types (e.g., end mills, ball-end mills), Yoo et al. [
31] introduced an image segmentation deep learning model based on Mask-RCNN [
32], combined with an automated cutting depth line detection algorithm, for monitoring and measuring tool wear. This method is the most pertinent work that acquires images of the tool wear region and utilizes Hough transform to determine the cutting line’s horizontal angle, enabling precise evaluation of the maximum flank wear (
) of the tool. Experimental results showcase satisfactory performance, with an average accuracy error of 0.004142 compared to microscopic measurements, demonstrating high precision and potential for applications. Despite its utility, the current quantitative assessment approach is constrained to a singular wear type, overlooking other possible types of tool wear. In addition, the employed network model is also difficult to apply for generalized task scenarios. As mentioned above, there is an urgent need for a customized method that can comprehensively quantify tool wear and fracture phenomena.
To address quantitative tool wear assessment under shop-floor imaging, we formulate wear delineation as a query-based instance mask set-prediction problem within a DETR-style [
33] end-to-end matching framework. Although instance-aware mask prediction methods provide a clean way to jointly learn categories and masks, they are not directly tailored to our scenario: industrial monitoring requires not only recognizing and segmenting wear but also producing a traceable geometric indicator—the maximum wear-land width (VB)—and reliably capturing subtle edge-local wear cues under reflective, low-contrast conditions. Directly applying a generic set-prediction pipeline typically leaves VB estimation to post-processing heuristics and offers limited wear-oriented feature enhancement.
Motivated by these gaps, we propose MaskLenNet, a task-driven instance-aware mask prediction architecture that unifies classification, mask prediction, and VB estimation in one end-to-end pipeline. The architecture combines established Swin and query-based mask prediction components with a task-specific two-point VB regression head, wear-oriented feature gating, and joint class-mask-point-length supervision. The detailed distinction between adopted and original components is given in
Section 2.2; the principal contributions and their quantitative outcomes are consolidated in the Conclusions.
The remainder of this paper is organized as follows:
Section 2 describes the dataset construction, image acquisition and annotation procedures, the proposed MaskLenNet architecture, and the experimental setup.
Section 3 presents the quantitative comparison results and ablation study.
Section 4 analyzes the effectiveness of the proposed method, interprets the experimental findings, and discusses its limitations and potential applications. Finally,
Section 5 summarizes the main findings and contributions of this study.
4. Discussion
4.1. Interpretation of the Main Results
On the fixed test set, MaskLenNet’s 96.52% accuracy exceeds the two-stage pipeline, Mask R-CNN, ViT-Base, BEiT-Base, and Mask2Former by 12.37, 3.47, 8.47, 3.04, and 2.42 percentage points, respectively. These are absolute percentage-point differences, not relative percentages. Within this dataset, the result is consistent with improved discrimination of the four retained wear classes.
MaskLenNet’s 95.75% mIoU exceeds Mask2Former’s 93.20% by 2.55 percentage points. Because the metric excludes tool-body/background pixels and macro-averages foreground instances, this value should be interpreted specifically as overlap quality for the four annotated wear classes, not as whole-image semantic accuracy.
The VB MAE of MaskLenNet is 1.95% higher than BEiT-Base. All learned-method MAEs use the linked microscope readings as their operational reference. Accordingly, the principal advantage in this experiment is the joint class-mask-VB output and its segmentation performance, not a statistically established equivalence to microscopy.
These findings support promising within-dataset performance. They do not by themselves establish external generalization, robustness to untested acquisition changes, or measurement interchangeability with a microscope.
4.2. Interpretation of the Ablation Results
In the fixed ablation runs, smooth rather than increased accuracy and mIoU by 4.35 and 5.07 percentage points and reduced MAE by 3.93% in relative terms. Using squared rather than absolute length error increased accuracy and mIoU by 1.83 and 3.51 percentage points and reduced MAE by 42.73% in relative terms. Percentage points are used for Acc/mIoU; percentages are reserved for relative MAE changes.
The smooth
configuration performed better in these runs and is less sensitive to large residuals by construction [
47]. However, no convergence-time comparison or external overfitting analysis was conducted, so the results do not establish that it prevents overfitting or reaches an optimum faster.
The squared-error configuration penalizes large length deviations more strongly and produced the lowest MAE in this ablation. This is an empirical observation for the present split, not a general claim that squared error is always preferable.
Relative to A0, adding channel–spatial attention alone (A1) changes Acc/mIoU by +0.75/+0.60 percentage points and reduces MAE by 7.16%. Wear attention alone (A2) changes Acc/mIoU by +1.30/+1.30 percentage points and reduces MAE by 12.51%. With both modules (A3), Acc and mIoU reach 96.00% and 95.20%, while MAE is 16.58% below A0. These within-split increments are consistent with complementary effects but do not prove causality outside the evaluated data.
Adding the multi-task head (A4) changes Acc/mIoU by +0.35/+0.35 percentage points relative to A3. Adaptive loss balancing (A5) yields the best single run (96.52% Acc, 95.75% mIoU, 0.010214 mm MAE), with +0.17/+0.20 percentage points and a 2.57% relative MAE reduction compared with A4. These modest increments support retaining the components, while repeated external validation is still required.
4.3. Failure Modes and Industrial Workflow
Qualitative review of erroneous cases showed three recurring patterns: cracks occupying only a few pixels were sometimes missed, specular highlights on AlTiSiN tools were occasionally segmented as chipping, and defocus or partial occlusion by adhered chips displaced the predicted VB endpoint. Errors were more frequent for 6 mm tools because the same physical defect covered fewer pixels. The current sample size does not support a reliable factorial analysis of coating, flute count, diameter, and defect size, so these observations are descriptive.
The complete inspection workflow requires the spindle to stop, the door to open, the arm to position, manual fine focus, capture, and retraction. Across the recorded runs, door/handshake required 4–6 s, arm positioning 6–10 s, manual focus 8–15 s, image capture 1–2 s, and retraction/closure 6–10 s, for approximately 25–43 s per inspection, excluding robot travel between machines. Network inference (141 ms/image) is not the dominant delay. Accordingly, the prototype is an off-line, between-cycles, robot-assisted system and is not yet an in-process or fully autonomous monitor.
4.4. Limitations
Small Correlated Dataset: Only 54 physical tools and 234 raw images are available. The tool-disjoint split prevents cross-view leakage, and three seeds quantify some training variability, but augmentation does not create independent experimental variation, and group cross-validation was not performed.
Metric Scope: Accuracy is conditional on Hungarian-matched foreground instances and excludes unmatched/duplicate cases; it is not image-level accuracy or full detection average precision. The mIoU definition assigns zero to unmatched cases. Because confidence-thresholded detection outputs were not archived, precision, recall, and average precision could not be reconstructed.
Measurement Uncertainty: Paired replicate microscope readings, full camera calibration, pose-sensitivity data, confidence intervals, regression agreement, and Bland–Altman limits were not available. Therefore, this study reports MAE against an operational microscope reference only and makes no claim of 0.01 mm metrological accuracy or equivalence to microscopy.
Acquisition Dependence: Illumination, distance, focus, coolant contamination, chip presence, and pose were not varied systematically. The model depends on the stated camera, lens, ring light, and manual-focus procedure.
Limited Domain Coverage: No external-site validation was performed with unseen machines or optical systems. Tools were limited to two coating families, four diameters, two workpiece-material domains, and the cutting ranges in
Table 3. Spalling was excluded because only 11 instances were available.
Operational Maturity: Manual focus and machine stoppage remain necessary. Broader tool families, automated focus/calibration, contamination handling, and cross-site evaluation are required before production deployment.
5. Conclusions
This study makes four principal contributions: First, it provides a traceable mobile-robot imaging and annotation workflow for 234 images from 54 coated solid-carbide end mills, together with a physical-tool-disjoint evaluation protocol that prevents rotational views of one tool from crossing data splits. Second, it formulates wear analysis as joint query-based class, instance-mask, and quantitative VB prediction. Third, it introduces a wear-oriented ROI gate and a candidate-line preprocessing rule that converts multiple irregular-region annotations into one two-endpoint target. Fourth, under the stated test protocol, MaskLenNet obtains 96.52% conditional matched-instance accuracy, 95.75% foreground instance mIoU, and 0.010214 mm VB MAE against the operational microscope reference. Relative to Mask2Former, the accuracy and mIoU gains are 2.42 and 2.55 percentage points, respectively.
These results are promising only within the evaluated acquisition system. The study is limited by 54 physical tools, no group cross-validation or external-site test, no systematic illumination/pose/contamination experiment, manual focusing, and the absence of replicate microscope data needed for confidence intervals or agreement analysis. The results therefore do not establish strong cross-domain generalization or equivalence to microscopy. Future work will prioritize a larger multi-site tool-disjoint benchmark, automated optical calibration/focus, rare-class collection, and repeated-measurement uncertainty analysis.