Generalization method for collaborative optimization tool wear identification field facing low-quality images

By employing a hybrid data augmentation and multi-loss collaborative optimization approach, the robustness problem of tool wear identification under low-quality images is solved, achieving high-precision identification in complex and polluted environments, which is suitable for industrial automation quality control and predictive maintenance.

CN120747613BActive Publication Date: 2026-07-24HUAZHONG UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAZHONG UNIV OF SCI & TECH
Filing Date
2025-06-26
Publication Date
2026-07-24

Smart Images

  • Figure CN120747613B_ABST
    Figure CN120747613B_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of tool wear recognition, and discloses a low-quality image-oriented collaborative optimization tool wear recognition field generalization method, which comprises a mixed data enhancement strategy, an RSA embedded semantic segmentation network, a geometric constraint loss, a field adversarial neural network and a multi-loss collaborative optimization strategy. The semantic segmentation network realizes effective suppression of the reflective region in the synthesized target domain low-quality image. The geometric constraint loss improves the continuity and edge definition of the wear area segmentation. The field adversarial neural network aligns the feature distribution of the source domain high-quality image and the synthesized target domain low-quality image. The multi-loss collaborative optimization strategy outputs an accurate wear area mask in the real target domain low-quality image. The present application significantly improves the robustness, segmentation accuracy and field generalization ability of tool wear recognition, is suitable for industrial automation quality control and predictive maintenance, and solves the technical problem of accurate tool wear recognition under low-quality images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of tool wear recognition, specifically relating to a collaborative optimization method for generalizing tool wear recognition for low-quality images. Background Technology

[0002] During machining, the relative motion between the cutting tool and the workpiece generates friction and cutting heat, which in turn triggers thermochemical reactions, leading to tool wear. Tool wear not only affects the surface quality and machining accuracy of the workpiece but can also result in serious consequences such as workpiece scrap and equipment downtime. Therefore, accurate diagnosis and prediction of tool wear are of great significance for improving product quality, reducing production costs, and increasing machining efficiency.

[0003] The study found that machine vision-based tool wear recognition technology has made significant progress in recent years and is widely used in quality control and predictive maintenance in industrial manufacturing. For example, some existing technologies identify wear regions through methods such as threshold segmentation, edge detection, and semantic segmentation. Among them, the PopulationThreshold technique combines Sobel filters and Blob detection for segmenting and locating wear regions; the semantic segmentation method based on the U-Net architecture detects tool wear on microscope images. In addition, some studies have attempted to mitigate the impact of imaging conditions by optimizing image uniformity and contrast through adaptive lighting frameworks. Other studies have enhanced feature extraction through dual attention mechanisms and self-learning parameters to improve segmentation performance. However, these technologies generally assume ideal imaging conditions and fail to effectively address the challenges of adverse imaging conditions, such as noise from metal reflections, cutting fluid, and iron filings in low-quality images. These contaminants can cause wear regions to be obscured by reflections or noise to be misidentified as wear, significantly reducing recognition accuracy. Furthermore, existing domain generalization methods often rely on prior knowledge of the target domain data, making it difficult to achieve robust recognition in the absence of low-quality image data. Existing technologies have not yet systematically solved the robustness problem of tool wear recognition under adverse imaging conditions, especially the comprehensive optimization of metal reflection and noise false recognition. There is an urgent need to propose a collaborative optimization tool wear recognition method for low-quality images. Summary of the Invention

[0004] To address the aforementioned deficiencies or improvement needs of existing technologies, this invention provides a collaborative optimization method for tool wear identification in low-quality images. Its purpose is to achieve domain generalization through hybrid data augmentation and collaborative optimization in the absence of a target domain and a real low-quality image, thereby solving the technical problem of accurate tool wear identification in low-quality images.

[0005] To achieve the above objectives, according to one aspect of the present invention, a collaborative optimization method for tool wear recognition in low-quality images is provided, comprising a hybrid data augmentation strategy, a semantic segmentation network with RSA embedding, geometric constraint loss, a domain adversarial neural network, and a multi-loss collaborative optimization strategy; wherein,

[0006] Hybrid data augmentation strategy: Simulated physical noise is applied to the high-quality source domain images to generate a preliminary low-quality image dataset that approximates the target domain distribution; then, a FastGAN-based generative model is used to further enhance the preliminary low-quality images to generate synthetic low-quality target domain images in complex polluted environments.

[0007] A semantic segmentation network with RSA embedding: Based on high-quality source domain images and low-quality generated synthetic target domain images, a U-Net tool wear semantic segmentation network was constructed. An RSA module was proposed and embedded. By fusing spatial attention mechanism and channel attention mechanism, the reflective area in the low-quality synthetic target domain image was effectively suppressed.

[0008] Geometric constraint loss: Based on the synthetic target domain low-quality image processed by the semantic segmentation network embedded by RSA, the overall geometric loss is optimized by co-optimizing the overall geometric loss, and the mask prediction is guided to conform to the geometric characteristics of the tool, thereby improving the coherence and edge clarity of the wear area segmentation in the synthetic target domain low-quality image.

[0009] Domain Adversarial Neural Network: Based on the encoding features of semantic segmentation networks with RSA embedding, a domain adversarial neural network is established to calculate adversarial loss in order to align the feature distributions of high-quality source domain images and low-quality synthetic target domain images;

[0010] Multi-loss collaborative optimization strategy: Based on the semantic segmentation network with RSA embedding, geometric constraint loss and domain adversarial neural network are used to obtain segmentation loss, geometric constraint loss and domain adversarial loss respectively. Combined with the collaborative optimization strategy, the output is an accurate mask of wear area in low-quality image of real target domain, which improves the robustness and accuracy of tool wear recognition under low-quality image.

[0011] Preferably, the hybrid data augmentation strategy is implemented as follows: First, various simulated contaminations are added to the high-quality source domain image using physical noise to generate a preliminary low-quality image dataset that approximates the distribution of the target domain. Second, a FastGAN generative model is used with the preliminary low-quality image and random noise as input. Its encoder extracts convolutional features, and the decoder generates enhanced synthetic low-quality target domain images based on the features and noise. Simultaneously, differentiable augmentation strategies, including color adjustment, translation, and cropping operations, are applied to improve training stability and image diversity. The FastGAN discriminator evaluates the realism of the generated image compared to the initial low-quality image. The generator is optimized through adversarial training to iteratively generate more realistic low-quality images, thereby enriching the synthetic low-quality target domain data. This synthetic target domain data aims to simulate the distribution characteristics of the real target domain, enabling the model trained on high-quality images to effectively generalize to the accurate identification of tool wear in low-quality images.

[0012] Preferably, the U-Net tool wear semantic segmentation network includes a U-Net network encoder and a U-Net decoder. The U-Net network encoder uses a pre-trained ResNet-18 as the encoder backbone network and efficiently extracts multi-scale features from low-level spatial details to high-level semantic information through multi-layer convolution and pooling operations.

[0013] The U-Net decoder performs upsampling through transposed convolutional layers, batch normalization, and ReLU activation to gradually restore spatial resolution, and uses skip connections to fuse multi-scale features from the encoder to generate a segmentation mask.

[0014] Preferably, the U-Net network encoder includes multiple sub-modules that progressively downsample to capture rich contextual information and utilize residual connections to enhance the stability of feature representation, ensuring robust feature support for subsequent RSA modules and decoders under adverse imaging conditions.

[0015] Preferably, the RSA module is placed between the U-Net network encoder and the U-Net decoder, and effectively suppresses reflective interference under unfavorable imaging conditions in the synthesized low-quality images of the target domain by fusing spatial attention mechanism and channel attention mechanism.

[0016] Preferably, the domain adversarial network is used to achieve robust domain generalization between the source domain and the synthesized target domain. The implementation method is to design a fully connected neural network as a domain discriminator, and determine whether the feature vector extracted from the U-Net encoder belongs to the source domain or the simulated target domain after processing by the RSA module and adaptive average pooling. The encoded features are then input into the discriminator through a gradient inversion layer to calculate the domain adversarial loss, thereby aligning the features of the high-quality image in the source domain with the low-quality image in the synthesized target domain.

[0017] Preferably, the geometric constraint loss includes connectivity loss, geometric consistency loss, and morphological similarity loss; wherein,

[0018] The connectivity loss reduces fragmented regions in the prediction mask, ensuring that worn regions in the synthesized target domain low-quality image form a continuous and complete segmentation result in space;

[0019] The geometric consistency loss makes the aspect ratio of the predicted mask close to the preset target value, ensuring that the geometry of the worn area in the low-quality image of the synthesized target domain is reasonable;

[0020] The morphological similarity loss makes the predicted mask consistent with the statistical template in terms of overlapping areas and boundary shapes, forcing the mask of the synthesized low-quality image of the target domain to conform to typical wear patterns.

[0021] By synergistically optimizing the geometric characteristics of the prediction mask through connectivity loss, geometric consistency loss, and morphological similarity loss, the mask prediction is comprehensively guided to conform to the geometric characteristics of the cutting tool, thereby improving the coherence and edge sharpness of wear region segmentation in low-quality images of the synthetic target domain.

[0022] As a preferred embodiment, the multi-loss collaborative optimization strategy method is as follows: the segmentation loss is improved to pixel-level accuracy, the geometric constraint loss is optimized to improve the geometric characteristics of the mask, and the domain adversarial loss is enhanced to improve the domain generalization ability. The three are combined by weight to form the total loss. The total loss updates the model parameters through backpropagation. At the same time, a learning rate scheduler is used to gradually reduce the learning rate, and an early stopping mechanism is applied to prevent overfitting and optimize model convergence, outputting an accurate mask of the worn area in the low-quality image of the synthetic target domain.

[0023] Preferably, the segmentation loss is the difference between the predicted mask output by the U-Net segmentation model and the true mask;

[0024] The segmentation loss is optimized by using cross-entropy loss, which measures the accuracy of pixel-level classification and ensures that the model accurately delineates the boundaries and extent of worn areas in low-quality images.

[0025] Preferably, the optimization method of geometric constraint loss comprehensively constrains the geometric characteristics of the prediction mask by combining connectivity loss, geometric consistency loss and morphological similarity loss, so as to ensure that the segmentation results of the tool wear area are highly consistent in terms of spatial continuity, shape proportion and morphological pattern.

[0026] The optimization method for the domain adversarial loss achieves domain generalization by aligning the feature distributions of high-quality source domain images and low-quality synthetic target domain images through adversarial training. It employs a domain adversarial neural network classifier, which outputs domain classification probabilities based on features extracted by the U-Net encoder, and combines gradient inversion layers to drive the model to learn domain-invariant features.

[0027] In summary, the technical solutions conceived by this invention have the following beneficial effects compared with the prior art:

[0028] 1. Enhanced Recognition Robustness: The Reflection Suppression Attention (RSA) module effectively suppresses interference caused by contamination such as metal reflections, cutting fluid, and iron filings through a dual attention mechanism of channel and spatial attention. Channel attention enhances wear-related information through global feature weighting, while spatial attention generates a reflective mask to attenuate interference regions. This ensures that the model stably focuses on the wear areas of the low-quality synthetic target domain image in complex contaminated environments, overcoming the limitation of traditional methods being susceptible to reflective occlusion.

[0029] 2. Optimized Segmentation Accuracy: Geometric Constraint Loss (GCL) theoretically guarantees the geometric consistency of the predicted mask through connectivity and shape constraints. Connectivity constraints avoid noise misidentification by detecting isolated regions, while shape constraints optimize the mask shape through the aspect ratio of the bounding box, enabling the model to accurately distinguish between worn areas and pollution noise, thus solving the problem of noise being misidentified as wear in existing technologies.

[0030] 3. Enhanced Domain Generalization Ability: A synthetic target domain data generation method combining physical contamination and FastGAN is adopted. Through domain generalization and hybrid data augmentation (DGDA) strategies, robust generalization without requiring real low-quality image data is theoretically achieved. Physical contamination simulates the diversity of real industrial scenarios, while FastGAN generates complex contamination patterns. Combined with adversarial training and distribution alignment techniques, the model can adapt to unknown contamination conditions, breaking through the dependence of traditional methods on target domain data.

[0031] 4. Enhanced industrial applicability: This invention provides a reliable tool wear monitoring solution for heavily polluted industrial environments. The modular design of RSA and GCL facilitates integration into existing machine vision systems. The DGDA strategy reduces the reliance on pollution data acquisition, enabling this invention to be flexibly applied to automated quality control and predictive maintenance scenarios, demonstrating significant practical value. Attached Figure Description

[0032] Figure 1 This is a block diagram of the collaborative optimization method for tool wear recognition in low-quality images provided by the present invention.

[0033] Figure 2 This is a flowchart illustrating the generalization method for collaborative optimization of tool wear recognition for low-quality images provided by this invention. Detailed Implementation

[0034] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.

[0035] Please see Figure 1 and Figure 2 This invention provides a collaborative optimization method for tool wear recognition in low-quality image domains, comprising a hybrid data augmentation strategy, a semantic segmentation network with RSA embedding, geometric constraint loss, a domain adversarial neural network, and a multi-loss collaborative optimization strategy; wherein,

[0036] Hybrid data augmentation strategy: Simulated physical noise is applied to the high-quality source domain images to generate a preliminary low-quality image dataset that approximates the target domain distribution; then, a FastGAN-based generative model is used to further enhance the preliminary low-quality images to generate synthetic low-quality target domain images in complex polluted environments.

[0037] First, various simulated contaminations are added to the high-quality source domain images using physical noise to generate a preliminary low-quality image dataset that approximates the target domain distribution. Specifically, Gaussian noise is applied to the high-quality source domain images, synthetic reflected light is added to simulate the reflective effect of a smooth tool surface, and cutting fluid splashes or metal shavings textures are superimposed to simulate environmental contaminants. These transformations, through parameterized control of the intensity and distribution of contamination, ensure that the generated low-quality images are highly similar to low-quality images in real industrial environments, closely approximating the characteristics of real low-quality images. This lays the foundation for subsequent FastGAN generation of complex contamination patterns, effectively supporting domain generalization training without requiring real target domain data, and providing diverse training data for subsequent domain generalization work.

[0038] Secondly, the FastGAN generative model is used as input, with initial low-quality images and random noise. Its encoder extracts convolutional features, and the decoder generates enhanced synthetic low-quality images of the target domain based on the features and noise. At the same time, differentiable enhancement strategies, including color adjustment, translation, and cropping operations, are applied to improve training stability and image diversity. The FastGAN discriminator evaluates the realism of the generated images compared to the initial low-quality images. The generator is optimized through adversarial training to iteratively generate more realistic low-quality images, thereby enriching the synthetic low-quality data of the target domain. This synthetic target domain data aims to simulate the distribution characteristics of the real target domain, enabling the model trained on high-quality images to effectively generalize to the accurate identification of tool wear in low-quality images.

[0039] The specific steps are as follows: The FastGAN generator G takes a high-quality source domain image and random noise as input. The FastGAN encoder extracts convolutional features, and the decoder generates an enhanced synthetic low-quality image based on the features and noise. The process of FastGAN extending the synthetic low-quality image is shown in Table 1. At the same time, a differentiable enhancement strategy (DiffAug) is applied, including color adjustment, translation, and cropping operations, to improve training stability and image diversity. The FastGAN discriminator D evaluates the realism of the generated image compared to the initial low-quality image. The generator is optimized through adversarial training. G is iteratively optimized to generate more realistic low-quality images, thereby enriching the synthetic target domain data and ensuring that the synthetic data is close to the real low-quality image. This supports domain generalization training without real target domain data and provides a high-quality data foundation for robust tool wear segmentation.

[0040]

[0041] in Indicates a high-quality image in the source domain. Indicates physical noise The initial low-quality image being processed, Represents differentiable data augmentation strategies. FastGAN generator. Includes encoder and decoder The encoder extracts latent features through convolutional layers, and the decoder reconstructs an enhanced synthetic image based on these features and noise.

[0042] A semantic segmentation network with RSA embedding: Based on high-quality source domain images and low-quality generated synthetic target domain images, a U-Net tool wear semantic segmentation network was constructed. An RSA module was proposed and embedded. By fusing spatial attention mechanism and channel attention mechanism, the reflective area in the low-quality synthetic target domain image was effectively suppressed.

[0043] The U-Net tool wear semantic segmentation network includes a U-Net network encoder and a U-Net decoder. The U-Net network encoder uses a pre-trained ResNet-18 as the encoder backbone network to efficiently extract multi-scale features. It efficiently extracts multi-scale features through multi-layer convolution and pooling operations, from low-level spatial details (such as edges and textures) to high-level semantic information (such as the global structure of the wear area).

[0044] The U-Net network encoder comprises multiple sub-modules that progressively downsample to capture rich contextual information and utilize residual connections to enhance the stability of feature representations. This ensures robust feature support for subsequent RSA modules and decoders under adverse imaging conditions (such as reflections and cutting fluid contamination), thereby improving the accuracy and reliability of tool wear segmentation. Specifically, the encoder includes five sub-modules, Enc1 to Enc5, corresponding to different layers of ResNet-18, designed to effectively capture multi-scale representations from low-level spatial features to high-level semantic features. Enc1 contains the initial convolutional block, batch normalization, ReLU activation, and max-pooling layers of ResNet-18, primarily responsible for extracting low-level spatial features such as edges and texture details. Enc2 and Enc3 correspond to the first and second residual block layers of ResNet-18, respectively, utilizing residual connections to extract intermediate semantic features and capture local patterns in the wear region. Enc4 and Enc5 correspond to the third and fourth residual block layers of ResNet-18, extracting high-level semantic features to represent the global structure and semantic information of the wear region. These encoder submodules utilize the pre-trained weights of ResNet-18 to generate multi-scale features through progressive downsampling, providing rich contextual information for the U-Net decoder, thereby improving the robustness and accuracy of tool wear segmentation.

[0045] The U-Net decoder performs upsampling through transposed convolutional layers, batch normalization, and ReLU activation to progressively restore spatial resolution. It then utilizes skip connections to fuse multi-scale features from the encoder (from low-level spatial details to high-level semantic information), specifically by fusing multi-scale features from Enc1 to Enc4, to generate a segmentation mask for reconstructing a high-precision tool wear segmentation mask. The decoder leverages the encoder's contextual information combined with features optimized by the RSA module to effectively suppress reflections and contamination interference, ensuring the generation of coherent and accurate wear region masks even under adverse imaging conditions (such as metal reflections, cutting fluid, and metal chips), providing reliable support for industrial quality control.

[0046] The RSA module is positioned between the U-Net network encoder and decoder. By fusing spatial attention and channel attention mechanisms, it effectively suppresses reflective interference under unfavorable imaging conditions in low-quality synthetic target domain images, aiming to effectively mitigate the impact of reflective artifacts. Specifically, the channel attention mechanism enhances feature channels related to tool wear through global feature weighting, while the spatial attention mechanism generates a reflective mask to attenuate interference regions and highlight wear areas. The weighted fusion of the two mechanisms calibrates the feature representation, ensuring that the model focuses on the semantic information of the wear region, providing robust feature support for the subsequent decoder, and improving the accuracy and reliability of tool wear segmentation in low-quality images.

[0047] Specifically, a dual attention mechanism is employed to suppress reflective interference. The channel attention module utilizes global average pooling to spatially reduce the dimensionality of features, followed by two 1×1 convolutional layers (with channel reduction factors), ReLU activation, and a sigmoid function to calculate channel weights, enhancing channels relevant to wear features and suppressing channels dominated by reflective noise. The spatial attention module generates a spatial attention map using 3×3 convolutional layers, batch normalization, and sigmoid activation, constructing a reflective mask (1 minus the attention map) to attenuate reflective areas (such as metallic reflections on a smooth tool surface) and highlight wear areas. The RSA module fuses the suppressed features with the original input through 3×3 convolutions and residual connections, further calibrating the feature representation to ensure the model focuses on the semantic information of the wear area. This method, through collaborative optimization of segmentation loss and other constraints, stably outputs accurate wear masks in low-quality images, providing robust support for industrial automation quality control and predictive maintenance.

[0048] Geometric Constraint Loss (GCL): Based on the synthetic target domain low-quality image processed by the semantic segmentation network embedded by RSA, the overall geometric loss is optimized through collaborative optimization, and the mask prediction is guided to conform to the geometric characteristics of the tool, thereby improving the coherence and edge clarity of wear area segmentation in the synthetic target domain low-quality image.

[0049] The geometric constraint loss includes connectivity loss L c Geometric consistency loss L gc With morphological similarity loss L ms ;in,

[0050] The connectivity loss L c Reducing fragmented regions in the prediction mask ensures that worn areas in the synthesized target domain low-quality image form a spatially continuous and complete segmentation result. This helps eliminate isolated small noise patches, making the segmentation mask more consistent with the actual distribution of worn areas, improving the reliability and visual consistency of segmentation, and is particularly suitable for applications in industrial scenarios where clear distinction of worn areas is required. It includes morphological erosion, small-area noise penalty, minimal-area penalty, single-batch loss calculation, and average loss calculation. The calculation steps are as follows: First, the input probability mask P is binarized into a discrete mask M through a threshold of 0.5. b For each sample mask M, morphological erosion is performed using a 3x3 convolution kernel to obtain M. eroded The proportion of pixels removed due to erosion is calculated as a penalty term for small connected regions; then, the total area A of the mask is calculated, and if A is less than a threshold A0... th =50, add insufficient area penalty (A) th -A) / A th If A is close to zero, directly set L. cb =1.0 to penalize invalid masks; finally, sum the L values ​​of each sample.cb And take the batch average to obtain L c .

[0051] The geometric consistency loss L gc The aspect ratio of the predicted mask is made close to the preset target value to ensure that the geometry of the wear area in the low-quality image of the synthesized target domain is reasonable. By constraining the shape ratio of the mask, abnormal segmentation caused by excessive stretching or compression is reduced, generating a mask that is closer to the real geometric features of the tool, thereby improving the geometric reliability of the segmentation results. This includes calculating the mask's length and width, projecting it onto the X / Y axes, calculating the aspect ratio, calculating single-batch loss, and calculating the average loss. The calculation steps are as follows: calculate the area A from the binarized mask M, obtain the effective width and height by projecting M along the horizontal and vertical axes, and calculate the aspect ratio R; then, calculate L... gcb =|RR target |As a penalty for deviation; if A th But if it is non-zero, set L gcb =0 to avoid noise gradient; if Set L gcb =1.0 as the default penalty; finally, accumulate L. gcb And take the batch average to obtain L gc .

[0052] The morphological similarity loss L ms This method ensures that the predicted mask maintains consistency with the statistical template in overlapping regions and boundary shapes, forcing the mask of the synthesized low-quality target domain image to conform to typical wear patterns. By comparing the similarity between the mask and the template, this ensures that the segmentation results are not only accurate but also reflect the wear patterns summarized in the training data, improving the model's adherence to standard wear patterns. The process includes generating a morphological template, matching the mask to the template, calculating similarity, calculating single-batch loss, and calculating average loss. The calculation steps are as follows: for an effective mask M, extract its bounding box and calculate the width W. m and height H m Adjust the template T interpolation to H m W m Get T r And obtain M by cropping the corresponding region from M. c If M c With T r Shape mismatch, further interpolation M c Alignment is then performed; subsequently, the Dice loss D (measuring overlap) and the bounded bidirectional Hausdorff distance H are calculated. d (Maximum value 10.0, measures boundary differences); by weighted sum L msb =w D ·D+w H ·H d The single-sample loss is obtained; if A th ​​Set L msb =1.0; Finally, sum and average to get L. ms .

[0053] By synergistically optimizing the geometric characteristics of the prediction mask through connectivity loss, geometric consistency loss, and morphological similarity loss, the mask prediction is comprehensively guided to conform to the geometric characteristics of the cutting tool, thereby improving the coherence and edge sharpness of wear region segmentation in low-quality images of the synthetic target domain.

[0054] Total geometric loss L geo Through weighted combination of connectivity loss L c Geometric consistency loss L gc And morphological similarity loss L ms The guided mask prediction conforms to geometric properties. Its calculation steps are as follows: Initialize L... c L gc L ms The accumulator is 0; L is calculated sequentially for each sample in the batch. cb L gcb L msb And sum them up separately; calculate L c L gc L ms The batch average; finally, using the weight w c w gc w ms Calculate the weighted sum L geo , return L geo As the final loss, it is integrated into the overall loss function to optimize the segmentation model, comprehensively guiding the mask prediction to conform to the geometric characteristics of the tool. This multi-dimensional constraint makes the segmentation mask closer to the real wear area in terms of continuity, shape proportion, and morphological features, enhancing the segmentation accuracy and stability of the model in complex industrial environments. The calculation method is shown in Table 2.

[0055]

[0056]

[0057] Where P represents the predicted mask of the segmentation model, Ath represents the area threshold used to distinguish small regions, Rtarget represents the expected aspect ratio of the tool wear region, Wc represents the connectivity loss weight, and Ws represents the geometric consistency loss weight. Overall, the method comprises two main components: connectivity regularization and shape alignment. First, GCL binarizes the input probabilities to generate a mask and analyzes its connectivity. Using a morphological erosion operation with a 3×3 kernel, small, isolated regions are identified and penalized to ensure the mask forms a coherent wear pattern. For masks with sufficient regions, GCL calculates the spatial projection along the horizontal and vertical axes, estimates the width and height, derives the shape ratio, and compares it with the target value to penalize deviations, promoting the elongated shape typical of tool wear. For small or empty masks, additional penalties are applied to prevent degradation. The connectivity loss and geometric consistency loss are averaged across batches and combined by balancing weights to obtain the final geometric constraint loss GCL.

[0058] Domain Adversarial Neural Network: Based on the encoding features of semantic segmentation networks with RSA embedding, a domain adversarial neural network is established to calculate adversarial loss in order to align the feature distributions of high-quality source domain images and low-quality synthetic target domain images;

[0059] The described domain adversarial network is used to achieve robust domain generalization between the source domain and the synthesized target domain. Specifically, it achieves feature alignment between the source and target domains through adversarial training, enhancing the model's generalization ability in unseen real target domains. The implementation involves designing a fully connected neural network as the domain discriminator. Feature vectors extracted from the U-Net encoder Enc5 are processed by an RSA module and adaptive average pooling to determine whether they belong to the source or simulated target domain. Specifically, the input feature vector passes through a gradient inversion layer and is then processed by a fully connected layer, outputting a probability value between 0 and 1, indicating whether the feature originates from the source or target domain. This allows for optimization of domain-invariant feature extraction through adversarial training. The encoded features are input to the discriminator through a gradient inversion layer (GRL), and the domain adversarial loss L is calculated. adv This allows the encoder to learn domain-invariant features, while the discriminator distinguishes domain differences, thus aligning the features of the high-quality source domain image with the low-quality synthesized target domain image; combined with the segmentation loss L... seg and geometric constraint loss L gcl Joint optimization ensures that the model generates geometrically consistent and robust wear region segmentation masks in complex industrial environments.

[0060] Multi-loss collaborative optimization strategy: Based on the segmentation network, geometric constraint loss and domain adversarial neural network, the segmentation loss, geometric constraint loss and domain adversarial loss are obtained respectively. Combined with the collaborative optimization strategy, the output is an accurate mask of wear area in low-quality synthetic target domain image, so as to achieve robustness and accuracy of tool wear recognition under low-quality image.

[0061] The segmentation loss improves pixel-level accuracy, the geometric constraint loss optimizes the mask geometry, and the domain adversarial loss enhances domain generalization ability. These three factors are combined in a weighted manner to form a total loss, which drives the model to stably output high-quality segmentation masks in environments with pollution such as reflective surfaces and cutting fluid, supporting industrial applications.

[0062] The segmentation loss is the difference between the predicted mask output by the U-Net segmentation model and the true mask, improving the segmentation accuracy of tool wear areas. The segmentation loss is optimized using cross-entropy loss, which measures the accuracy of pixel-level classification, ensuring that the model accurately delineates the boundaries and extent of wear areas in low-quality images. This loss drives the model to learn wear features, overcoming interference from reflections, cutting fluid, and metal chips, and improving the segmentation robustness in low-quality images.

[0063] The optimization method of geometric constraint loss (GCL) comprehensively constrains the geometric characteristics of the prediction mask by combining connectivity loss, geometric consistency loss and morphological similarity loss, ensuring that the segmentation results of the tool wear region are highly consistent in terms of spatial continuity, shape proportion and morphological pattern. This multidimensional regularization method effectively reduces fragmentation, shape anomalies and morphological deviations, and significantly improves the geometric rationality and robustness of the segmentation mask under low-quality images. It is particularly suitable for tool wear recognition in complex and polluted scenarios in industrial environments.

[0064] The optimized method for the domain adversarial loss achieves domain generalization by aligning the feature distributions of high-quality source domain images and low-quality synthetic target domain images through adversarial training. A domain adversarial neural network classifier is employed, which outputs domain classification probabilities based on features extracted by the U-Net encoder, and combines this with a gradient inversion layer to drive the model to learn domain-invariant features. This loss enables the model to adapt to reflections and noise in low-quality images, improving its generalization ability to unknown contaminated scenes.

[0065] Specifically, a synthetic target domain dataset is generated through hybrid data augmentation. Physical noise simulates reflections, fluid splashes, and metal chip textures. FastGAN generates complex contamination patterns, generating five times the sample size of the original data by default. During training, the U-Net segmentation model, embedding an RSA (Reflection Suppression Attention) module to reduce reflection interference, and a domain classifier are optimized on high-quality source domain images and low-quality synthetic target domain images. Segmentation loss is calculated to improve mask accuracy, a geometric constraint loss function forces the connectivity and shape characteristics of the predicted mask, and adversarial loss is calculated to align the feature distributions of the source and synthetic target domains. These losses are combined into a total loss. The total loss updates the model parameters through backpropagation, while a learning rate scheduler gradually reduces the learning rate, and an early stopping mechanism is applied to prevent overfitting and optimize model convergence, outputting accurate wear region masks in the low-quality synthetic target domain images. During testing, the trained U-Net model directly predicts the segmentation masks of wear regions on the low-quality target domain images and extracts quantized tool wear values ​​from them.

[0066] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A collaborative optimization method for generalizing tool wear recognition in low-quality image processing, characterized in that, This includes hybrid data augmentation strategies, semantic segmentation networks with RSA embedding, geometric constraint loss, domain adversarial neural networks, and multi-loss collaborative optimization strategies; among which, Hybrid data augmentation strategy: Simulated physical noise is applied to the high-quality source domain images to generate a preliminary low-quality image dataset that approximates the target domain distribution; then, a FastGAN-based generative model is used to further enhance the preliminary low-quality images to generate synthetic low-quality target domain images in complex polluted environments. A semantic segmentation network with RSA embedding: Based on high-quality source domain images and generated low-quality target domain images, a U-Net tool wear semantic segmentation network is constructed. An RSA module is proposed and embedded, and by fusing spatial attention and channel attention mechanisms, effective suppression of reflective regions in the low-quality target domain images is achieved. The U-Net tool wear semantic segmentation network includes a U-Net encoder and a U-Net decoder. The RSA module is placed between the U-Net encoder and the U-Net decoder, and by fusing spatial attention and channel attention mechanisms, it effectively suppresses reflective interference under unfavorable imaging conditions in the low-quality target domain images. To mitigate reflection interference, a dual attention mechanism is employed. The channel attention module uses global average pooling to spatially reduce the dimensionality of features, followed by two 1×1 convolutional layers, ReLU activation, and a sigmoid function to calculate channel weights, enhancing channels related to wear features and suppressing channels dominated by reflection noise. The spatial attention module generates a spatial attention map using 3×3 convolutional layers, batch normalization, and sigmoid activation, constructing a reflection mask to attenuate reflection areas and highlight wear areas. The RSA module fuses the suppressed features with the original input using 3×3 convolutions and residual connections, further calibrating the feature representation to ensure the model focuses on the semantic information of the wear area. Geometric constraint loss: Based on the synthesized low-quality target domain image processed by the semantic segmentation network embedded with RSA, the overall geometric loss is optimized collaboratively to comprehensively guide the mask prediction to conform to the geometric characteristics of the tool, thereby improving the coherence and edge clarity of the wear region segmentation in the synthesized low-quality target domain image. The geometric constraint loss includes connectivity loss, geometric consistency loss, and morphological similarity loss. Among them, the connectivity loss reduces fragmented regions in the predicted mask, ensuring that the wear region in the synthesized low-quality target domain image forms a continuous and complete segmentation result in space. The geometric consistency loss makes the aspect ratio of the predicted mask close to the preset target value, ensuring that the geometric shape of the wear region in the synthesized low-quality target domain image is reasonable. The morphological similarity loss makes the predicted mask consistent with the statistical template in overlapping areas and boundary shapes, forcing the mask of the synthesized low-quality target domain image to conform to typical wear patterns. Domain Adversarial Neural Network: Based on the encoding features of semantic segmentation networks with RSA embedding, a domain adversarial neural network is established to calculate adversarial loss in order to align the feature distributions of high-quality source domain images and low-quality synthetic target domain images; Multi-loss collaborative optimization strategy: Based on the semantic segmentation network with RSA embedding, geometric constraint loss and domain adversarial neural network are used to obtain segmentation loss, geometric constraint loss and domain adversarial loss respectively. Combined with the collaborative optimization strategy, the output is an accurate mask of wear region in low-quality image of real target domain, so as to achieve robustness and accuracy of tool wear recognition under low-quality image.

2. The generalization method for collaborative optimization of tool wear recognition for low-quality images as described in claim 1, characterized in that, The specific method of the hybrid data augmentation strategy is as follows: First, various simulated contaminations are added to the high-quality source domain images through physical noise to generate a preliminary low-quality image dataset that approximates the distribution of the target domain. Second, the FastGAN generative model is used with the preliminary low-quality images and random noise as input. Its encoder extracts convolutional features, and the decoder generates enhanced synthetic low-quality images of the target domain based on the features and noise. At the same time, differentiable augmentation strategies are applied, including color adjustment, translation, and cropping operations, to improve training stability and image diversity. The FastGAN discriminator evaluates the realism of the generated images compared to the initial low-quality images. The generator is optimized through adversarial training to iteratively generate more realistic low-quality images, thus enriching the synthetic low-quality data of the target domain.

3. The generalization method for collaborative optimization of tool wear recognition for low-quality images as described in claim 1, characterized in that, The U-Net network encoder uses a pre-trained ResNet-18 as the encoder backbone network, and efficiently extracts multi-scale features from low-level spatial details to high-level semantic information through multi-layer convolution and pooling operations. The U-Net decoder performs upsampling through transposed convolutional layers, batch normalization, and ReLU activation to gradually restore spatial resolution, and uses skip connections to fuse multi-scale features from the encoder to generate a segmentation mask.

4. The generalization method for collaborative optimization of tool wear recognition for low-quality images as described in claim 3, characterized in that, The U-Net network encoder includes multiple sub-modules that progressively downsample to capture rich contextual information and utilize residual connections to enhance the stability of feature representation, ensuring robust feature support for subsequent RSA modules and decoders under adverse imaging conditions.

5. The generalization method for collaborative optimization of tool wear recognition for low-quality images as described in claim 4, characterized in that, The domain adversarial network is used to achieve robust domain generalization between the source domain and the synthesized target domain. The implementation method is to design a fully connected neural network as a domain discriminator. The feature vector extracted from the U-Net encoder is processed by the RSA module and adaptive average pooling to determine whether the feature vector belongs to the source domain or the simulated target domain. The encoded features are input into the discriminator through a gradient inversion layer to calculate the domain adversarial loss, thereby realizing the feature alignment between the high-quality image in the source domain and the low-quality image in the synthesized target domain.

6. The generalization method for collaborative optimization of tool wear recognition for low-quality images as described in claim 5, characterized in that, The multi-loss collaborative optimization strategy is as follows: the segmentation loss improves pixel-level accuracy, the geometric constraint loss optimizes the geometric characteristics of the mask, and the domain adversarial loss enhances the domain generalization ability. The three are combined by weight to form the total loss. The total loss updates the model parameters through backpropagation. At the same time, a learning rate scheduler is used to gradually reduce the learning rate, and an early stopping mechanism is applied to prevent overfitting and optimize model convergence, outputting an accurate mask of the worn area in the low-quality image of the synthetic target domain.

7. The generalization method for collaborative optimization of tool wear recognition for low-quality images as described in claim 6, characterized in that, The segmentation loss is the difference between the predicted mask output by the U-Net segmentation model and the true mask; The segmentation loss is optimized by using cross-entropy loss, which measures the accuracy of pixel-level classification and ensures that the model accurately delineates the boundaries and extent of worn areas in low-quality images.

8. A generalization method for collaborative optimization of tool wear recognition for low-quality images as described in claim 6 or 7, characterized in that, The optimization method of geometric constraint loss comprehensively constrains the geometric characteristics of the prediction mask by combining connectivity loss, geometric consistency loss and morphological similarity loss, ensuring that the segmentation results of the tool wear area are highly consistent in terms of spatial continuity, shape proportion and morphological pattern. The optimization method for the domain adversarial loss achieves domain generalization by aligning the feature distributions of high-quality source domain images and low-quality synthetic target domain images through adversarial training. It employs a domain adversarial neural network classifier, which outputs domain classification probabilities based on features extracted by the U-Net encoder, and combines gradient inversion layers to drive the model to learn domain-invariant features.