Microscopic image segmentation algorithm and method

By introducing BDRConv convolutional kernels and ACAF into the U-Net model and combining it with the ResNet model, a composite segmentation model was constructed. This solved the problems of lightweighting and accuracy of the U-Net model in the segmentation of industrial parts microscopic images, achieving efficient and stable segmentation results that are suitable for complex industrial scenarios.

CN122244456APending Publication Date: 2026-06-19JIANGSU XILI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIANGSU XILI TECH CO LTD
Filing Date
2026-05-25
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing U-Net models suffer from insufficient lightweight design, low segmentation accuracy, and poor adaptability to complex industrial scenarios in the segmentation of microscopic images of industrial parts. When combined with ResNet as the backbone network, there is insufficient collaborative adaptation. Existing optimization schemes cannot meet the requirements of high accuracy and high real-time performance.

Method used

We replace the convolutional layers of the U-Net model with bidirectional dynamic residual convolutional kernels (BDRConv) and combine them with the ResNet model for structural fusion using adaptive custom activation function (ACAF) to construct a composite segmentation model. We optimize feature extraction through BDRConv convolutional kernels and optimize the activation function through ACAF to achieve feature fusion and segmentation output.

Benefits of technology

It improves the accuracy and stability of microscopic image segmentation of industrial parts, adapts to complex industrial scenarios, meets real-time detection requirements, achieves a segmentation accuracy of 98.5%, improves the average intersection-union ratio by 3.32%, increases the model training convergence speed by 2.8 times, adapts to multi-source microscopic image input, and reduces the difficulty of engineering implementation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122244456A_ABST
    Figure CN122244456A_ABST
Patent Text Reader

Abstract

This application relates to a microscopic image segmentation algorithm and method, which involves the collaborative adaptation of BDRConv convolutional kernels, U-Net models, and ResNet models. First, the BDRConv convolutional kernels replace the conventional convolutional kernels in each convolutional layer of the traditional U-Net model, optimizing the convolutional layers of the U-Net model. Then, the optimized U-Net model is structurally fused with the ResNet model, using the ResNet model as the feature extraction backbone network, while the optimized U-Net model is responsible for feature fusion and segmentation output, forming a composite segmentation model adapted for industrial microscopic image segmentation. Through adaptive customization of activation functions and deep adaptation with the basic U-Net model, the general parameterization of the activation functions of each layer of the U-Net model is achieved, improving model training stability and the segmentation accuracy of industrial parts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image processing technology, and in particular relates to a microscopic image segmentation algorithm and method. Background Technology

[0002] Microscopic image analysis is applied in fields such as materials science and industrial manufacturing. One of its core technologies is the accurate segmentation of microscopic images. The accuracy of the segmentation results directly determines the reliability of subsequent defect detection, dimensional measurement, morphological analysis, and other tasks, thus affecting the quality control and performance evaluation of industrial products. Traditional microscopic image segmentation methods mainly rely on manual annotation segmentation or simple threshold segmentation and edge detection algorithms. This approach has significant limitations: on the one hand, manual segmentation requires professionals to annotate each part in every microscopic image, which is not only labor-intensive and time-consuming but also extremely inefficient, making it difficult to meet the needs of large-scale industrial inspection. On the other hand, traditional algorithms such as threshold segmentation and edge detection are poorly adapted to complex scenes such as image noise and uneven lighting, resulting in low segmentation accuracy and a tendency to miss or missegment parts, failing to meet the high-precision requirements of industrial production for microscopic image analysis of industrial parts.

[0003] With the rapid development of deep learning technology in the field of image segmentation, convolutional neural networks (CNNs) have become the mainstream technology for the segmentation of microscopic images of industrial parts. Among them, the U-Net model, with its symmetrical encoder-decoder structure and powerful feature fusion and detail recovery capabilities, has been widely used in medical and industrial image segmentation. The Residual Network (ResNet) model, with its deep network structure and excellent deep feature extraction capabilities, has become the core backbone network of various image segmentation models, bringing new possibilities for solving the shortcomings of traditional segmentation methods. However, directly applying the basic U-Net model to industrial microscopic image segmentation still faces many core technical bottlenecks, making it difficult to adapt to the actual needs of industrial scenarios. Furthermore, combining it with ResNet as the backbone network also suffers from insufficient synergistic adaptation: First, the convolutional layers of the basic U-Net model use traditional convolutional kernels, resulting in parameter redundancy and high computational complexity. While combining it with ResNet can alleviate gradient vanishing, the deep network structure still leads to a large overall model size and slow inference speed. Industrial parts detection often requires real-time processing of large numbers of images, and the existing models lack sufficient lightweight design to meet the embedded deployment and real-time detection requirements of industrial equipment. Second, industrial parts microscopic images are characterized by complex backgrounds, strong noise interference, and overlapping parts. The basic U-Net model has limited feature extraction capabilities, easily losing detailed features of small-sized parts, leading to low segmentation accuracy for small-sized parts. When ResNet is used as the backbone network, the feature fusion with U-Net is insufficient, making it difficult to effectively distinguish the boundaries of overlapping parts, further restricting the improvement of segmentation results.

[0004] In existing technologies, optimizations of the U-Net model are mostly focused on general image segmentation, without specifically addressing the unique characteristics of industrial microscopic images or fully integrating the feature extraction advantages of ResNet for collaborative optimization. Some studies, in order to achieve U-Net model lightweighting, employ simple parameter pruning or convolution kernel simplification, which reduces model parameters and computational cost but leads to a decrease in the model's feature extraction capability, further reducing segmentation accuracy. Other studies, in order to improve segmentation performance, increase network depth or width, which can improve segmentation performance to some extent but exacerbates model redundancy and increases computational cost, failing to balance the dual requirements of lightweighting and segmentation performance. Furthermore, existing optimization schemes do not fully consider the noise, illumination, and overlap characteristics of industrial part microscopic images, nor do they effectively address the collaborative adaptation problem between the U-Net and ResNet backbone networks. This results in the optimized model having insufficient generalization ability in the segmentation of real industrial part microscopic images, making it difficult to consistently output high-precision segmentation results.

[0005] In summary, the basic U-Net model suffers from insufficient lightweight design, low segmentation accuracy, and poor adaptability to complex industrial scenarios when directly applied to the segmentation of industrial part microscopic images. When combined with ResNet as the backbone network, it suffers from insufficient collaborative adaptation. Existing optimization schemes for U-Net and ResNet models cannot meet the dual requirements of high accuracy and high real-time performance for industrial part microscopic image segmentation. Summary of the Invention

[0006] The technical problem to be solved by this invention is to provide a microscopic image segmentation algorithm and method to address some of the problems existing in the direct application of the basic U-Net model to the segmentation of industrial parts microscopic images.

[0007] The technical solution adopted by this invention to solve its technical problem is:

[0008] A microscopic image segmentation algorithm includes the following steps:

[0009] The U-shaped network model is optimized by replacing the original convolutional kernels of each convolutional layer with bidirectional dynamic residual convolutional kernels. At the same time, the activation functions in the original activation layers of the U-shaped network model are replaced with adaptive custom activation functions to obtain the optimized U-shaped network model.

[0010] A composite segmentation model is constructed by structurally fusing the optimized U-shaped network model and the residual network model. The residual network model is used as the feature extraction backbone network of the composite segmentation model, and the optimized U-shaped network model is used as the feature fusion and segmentation output module of the composite segmentation model.

[0011] Preferably, in the microscopic image segmentation algorithm of the present invention, the composite segmentation model includes an encoder, a feature fusion layer and a decoder connected in sequence;

[0012] The bidirectional dynamic residual convolution kernel includes a main part, which contains a parallel basic branch and a diversity branch. The basic branch uses standard convolution operations and is embedded in each convolutional layer of the encoder to extract basic redundant features in the image, which are consistent with the feature output of the backbone network. The diversity branch uses group convolution operations, which reduces inter-group feature interference by dividing the convolution groups, and is embedded in each convolutional layer of the decoder to extract diverse detailed features in the image.

[0013] Preferably, the microscopic image segmentation algorithm of the present invention concatenates the redundant feature map output by the basic branch and the diverse feature map output by the diverse branch in the channel dimension to obtain a fused preliminary feature map. During the concatenation process, the feature map size is kept consistent, while retaining various feature information extracted by the basic branch and the diverse branch.

[0014] Preferably, in the microscopic image segmentation algorithm of the present invention, after obtaining the preliminary feature map, a channel attention mechanism module is embedded. The channel attention mechanism module works in conjunction with the feature fusion logic of the U-shaped network to perform channel weight allocation on the stitched feature map by adaptively learning the importance weights of the feature channels.

[0015] Preferably, in the microscopic image segmentation algorithm of the present invention, the bidirectional dynamic residual convolution kernel further includes an extension part. The main part is responsible for core feature extraction and balancing redundancy and diversity features. The extension part adopts point convolution and is used to enhance diversity features and supplement detailed information.

[0016] Preferably, the microscopic image segmentation algorithm of the present invention uses a fixed activation function as the basic function of the adaptive customized activation function framework.

[0017] Preferably, in the microscopic image segmentation algorithm of the present invention, the residual network model removes the original fully connected classification layer, retains several residual blocks, inputs the preprocessed microscopic image into the backbone network, and extracts the deep basic features of the image layer by layer through continuous convolution and residual connection within each residual block, and finally outputs the backbone feature map.

[0018] A method for segmenting microscopic images includes the following steps:

[0019] Step S1: Preprocess the microscopic images of industrial parts to obtain preprocessed test set images;

[0020] Step S2: Establish the aforementioned microscopic image segmentation algorithm;

[0021] Step S3: Perform collaborative training on the composite segmentation model. During the training process, the adaptive customized activation function parameters, bidirectional dynamic residual convolution kernel parameters, and backbone network parameters are updated synchronously to obtain the trained composite segmentation model.

[0022] Step S4: Input the test set images into the trained composite segmentation model for analysis, and output the binarized segmentation results of the industrial parts.

[0023] Preferably, in the microscopic image segmentation method of the present invention, the binarization segmentation step includes: adding a 1×1 convolutional layer and a Sigmoid activation function to the decoder output of the U-shaped network model.

[0024] Preferably, in the microscopic image segmentation method of the present invention, the adaptive custom activation function framework is configured with a learnable slope parameter α in the input layer of the encoder of the U-shaped network model, and the initial value of the slope parameter α is set to 0.2.

[0025] The beneficial effects of this invention are as follows: The algorithm of this invention collaboratively adapts the BDRConv convolutional kernel (bidirectional dynamic residual convolutional kernel), the U-Net model, and the ResNet model. First, the BDRConv convolutional kernel replaces the conventional convolutional kernels in each convolutional layer of the traditional U-Net model, completing the convolutional layer optimization of the U-Net model. Then, the optimized U-Net model is structurally fused with the ResNet model, with the ResNet model as the feature extraction backbone network, and the optimized U-Net model responsible for feature fusion and segmentation output, forming a composite segmentation model adapted for industrial microscopic image segmentation. Through deep adaptation of the adaptive customized activation function with the basic U-Net model, without changing the core structure of the adaptive customized activation function or significantly increasing the computational cost, the universal parameterization customization of the activation function of each layer of the U-Net model is achieved, adapting to the feature extraction requirements of different layers of the composite segmentation model, improving the model training stability and the segmentation accuracy of industrial parts. Attached Figure Description

[0026] The technical solution of this application will be further described below with reference to the accompanying drawings and embodiments.

[0027] Figure 1 This is a schematic diagram of the network structure of the microscopic image segmentation algorithm in this embodiment;

[0028] Figure 2 This is a schematic diagram of the BDRConv convolutional kernel structure in this embodiment;

[0029] Figure 3 This is a schematic diagram illustrating the four adaptive activation functions exemplified in this embodiment. Detailed Implementation

[0030] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.

[0031] In the description of this application, it should be understood that the terms "center," "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as limiting the scope of protection of this application. Furthermore, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. In the description of this invention, unless otherwise stated, "a plurality of" means two or more. For example, if the description object is "field," then the ordinal numbers preceding "field" in "first field" and "second field" do not restrict the position or order of the "fields." "First" and "second" do not restrict whether the "fields" they modify are in the same message, nor do they restrict the order of "first field" and "second field." Similarly, if the description object is "level," then the ordinal numbers preceding "level" in "first level" and "second level" do not restrict the priority between "levels." Furthermore, if the description object is "information," then "first information" and "second information" can be the same information or different information, and their content can be the same or different.

[0032] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art will understand the specific meaning of the above terms in this application based on the specific circumstances.

[0033] In the accompanying drawings, for clarity, the length, area, volume, gap dimensions, and relative dimensions of components, as well as the included angles and relative positional relationships between components, may be exaggerated. The same reference numerals denote the same elements throughout the drawings.

[0034] The technical solution of this application will now be described in detail with reference to the accompanying drawings and embodiments.

[0035] This embodiment provides a microscopic image segmentation algorithm, including the following steps:

[0036] The U-Net model is optimized by replacing the original convolutional kernels of each convolutional layer with BDRConv (Bidirectional Dynamic Residual Convolution) convolutional kernels. At the same time, the activation functions in the original activation layers of the U-Net model are replaced with adaptively customized activation functions (ACAF), resulting in the optimized U-Net model.

[0037] A composite segmentation model is constructed by structurally fusing the optimized U-Net model and the ResNet model. The ResNet model is used as the feature extraction backbone network of the composite segmentation model, and the optimized U-Net model is used as the feature fusion and segmentation output module of the composite segmentation model.

[0038] The microscopic image segmentation algorithm of this embodiment operates in the following aspects:

[0039] (I) Optimized architecture design based on replacing U-Net with BDRConv convolutional kernel

[0040] To address the issues of redundant feature extraction, insufficient feature fusion, and high computational complexity in existing ResNet models, as well as the low feature extraction accuracy and insufficient lightweight nature of traditional U-Net models when applied to the segmentation of industrial part microscopic images, this invention replaces the BDRConv convolutional kernel in the convolutional layers of the U-Net model, thus replacing the traditional convolutional kernel. This optimized U-Net model is then combined with the ResNet model for application in the field of industrial part microscopic image segmentation. Through the adaptation and fusion of the BDRConv convolutional kernel and the U-Net model, the redundancy and diversity of feature extraction are balanced. This reduces computational load and achieves lightweighting while improving the feature extraction accuracy of industrial part microscopic images, adapting to the segmentation needs of complex scenarios in industrial part microscopic images. The specific adaptation and fusion structure and implementation method are as follows:

[0041] Overall optimized structural design: First, the BDRConv convolutional kernel replaces the conventional convolutional kernels in each convolutional layer of the traditional U-Net model, completing the convolutional layer optimization of the U-Net model. Then, the optimized U-Net model is structurally fused with the ResNet model, with the ResNet model as the feature extraction backbone network and the optimized U-Net model responsible for feature fusion and segmentation output, forming a composite segmentation model adapted to industrial microscopic image segmentation (named the ResNet+U-Net composite model in this embodiment). The main part of the BDRConv convolutional kernel is responsible for core feature extraction and redundancy-diversity feature balancing, while the extended part is responsible for further enhancing diverse features and supplementing detailed information. It is highly compatible with the encoder-decoder structure of the U-Net model, reducing the computational complexity of convolutional operations in the traditional U-Net model and compensating for its insufficient feature extraction. Simultaneously, combined with the deep feature extraction capabilities of ResNet, it adapts to the characteristics of industrial part microscopic images with numerous part details and complex backgrounds.

[0042] (II) Adaptive Optimization Design of ACAF-based Adaptive Custom Activation Function Framework

[0043] To address the issues of gradient vanishing, slow convergence, and insufficient adaptability inherent in fixed activation functions in existing ResNet models, as well as the limited generalization ability, difficulty in guaranteeing convergence, and significant increase in computational cost of existing adaptive activation functions, and the poor adaptability and insufficient training stability of activation functions when applying the basic U-Net model to the microscopic image segmentation of industrial parts, this invention replaces the original fixed activation functions with an adaptive custom activation function framework in each activation layer of the basic U-Net model. This optimized U-Net model is then further integrated with the aforementioned structure optimized by BDRConv convolutional kernels and the ResNet backbone network. Through deep adaptation of ACAF with the basic U-Net model, without changing the core structure of ACAF or significantly increasing computational cost, universal parameter customization of activation functions for each layer of the U-Net model is achieved. This adapts to the feature extraction requirements of different layers in the composite segmentation model, improving model training stability and the segmentation accuracy of industrial parts. The specific adaptation and optimization design and implementation methods are as follows:

[0044] 1. ACAF and Basic U-Net Adaptation Design Concept: The core adaptation concept of this invention is to reuse the ACAF framework, accurately adapt to U-Net, and collaborate with ResNet. With universal adaptation, lightweight efficiency, and stable convergence as the core objectives, it avoids the problem of poor compatibility between existing adaptive activation functions and U-Net. It fully utilizes the core advantages of the ACAF framework—fixed functions as the basis and a small number of customized parameters—and replaces them in each activation layer of the basic U-Net. Combining the structural characteristics of the U-Net encoder-decoder, the feature output patterns of the ResNet backbone network, and the feature characteristics of industrial microscopic images, the ACAF framework is specifically adapted and adjusted. While retaining the original simplicity and low overhead advantages of ACAF, personalized parameter customization of the activation functions of each layer of the U-Net model is achieved, enabling it to adaptively adapt to the feature distribution characteristics of different layers of U-Net. This avoids problems such as gradient vanishing and slow convergence, balancing performance improvement and lightweight requirements, and forming a synergistic effect with the aforementioned BDRConv convolutional kernel optimization.

[0045] 2. ACAF and basic U-Net adaptation method: The ACAF framework is directly embedded into each activation layer of the basic U-Net model, replacing the original fixed activation function, and combined with the ResNet backbone network for collaborative adaptation.

[0046] 3. Core Advantages and Adaptability of the ACAF Framework: The ACAF framework effectively solves many pain points of existing activation functions through its design of "basic functions + a small number of adaptive parameters." Its core advantages and adaptability are as follows:

[0047] To address the issues of vanishing gradients and slow convergence, and improve the training stability of U-Net: By adapting ACAF to U-Net in a layered manner, the core characteristics of activation functions in each layer are dynamically adjusted, effectively alleviating the vanishing gradient phenomenon in the deep layers of the U-Net encoder and the detail recovery process of the decoder. At the same time, it accelerates the convergence speed of the composite segmentation model, shortens the model training cycle, improves training efficiency, and solves the core pain point of poor adaptability of existing U-Net activation layers.

[0048] Strong generalization ability and wide adaptability: ACAF is precisely adapted to U-Net and optimized by combining the structural differences of the ResNet model. It can flexibly adapt to the composite structure of the two backbone networks and U-Net, and can also adaptively adapt to the feature distribution differences of each layer of U-Net. Even in the complex scenario of industrial microscopic image segmentation (small size, overlapping parts, noise interference), it can still maintain stable performance. Compared with the current situation in the field of microscopic image segmentation, where ACAF is not combined with U-Net and is not applied, the adaptation design of this invention significantly improves the generalization ability of the composite model.

[0049] Lightweight and efficient for industrial deployment: It introduces only a small number of learnable parameters, and the computational cost is increased by no more than 10% compared with the original fixed activation function of U-Net, avoiding the problem of excessive cost of existing adaptive activation functions. It works in synergy with the lightweight design of the BDRConv convolutional kernel and the Globally Soft Filter Pruning (GSFP) method to further help the lightweight optimization of the entire ResNet+U-Net composite model, adapting to resource-constrained scenarios such as industrial mobile devices and embedded systems, and meeting the needs of real-time detection.

[0050] Converging stably and easily implemented in engineering, it synergistically enhances segmentation performance: It retains the convergent characteristics of the ACAF framework and basic activation functions, and further ensures the stability of composite model training through parameter regularization constraints and layered adaptation adjustments, avoiding training non-convergence issues in complex scenarios. Simultaneously, the adaptation process is simple, allowing direct replacement of the original activation layers in U-Net with ACAF, without significant modifications to the overall structure of U-Net and ResNet models, facilitating engineering implementation. It synergizes with the BDRConv convolutional kernel optimization, strengthening feature extraction capabilities at both the convolutional kernel and activation function levels, providing favorable conditions for subsequent GSFP model pruning, and further improving the segmentation accuracy of industrial parts.

[0051] Preferably, in this embodiment, a microscopic image segmentation algorithm includes a composite segmentation model comprising an encoder, a feature fusion layer, and a decoder connected sequentially.

[0052] The BDRConv convolutional kernel includes a main part, which contains a parallel basic branch and a diversity branch. The two branches are adapted in conjunction with the feature extraction logic of U-Net: the basic branch uses standard convolution operations and is embedded in each convolutional layer of the encoder to extract basic redundant features in the image, which are consistent with the feature output of the backbone network; the diversity branch uses group convolution operations, which reduces inter-group feature interference by dividing the convolutional groups, and is embedded in each convolutional layer of the decoder to extract diverse detailed features in the image, especially key features such as edges and textures in microscopic images of industrial parts, which makes up for the lack of diversity feature extraction in the basic branch, and at the same time helps the U-Net model to restore detailed features at the decoder end and improve segmentation accuracy.

[0053] Preferably, the microscopic image segmentation algorithm of this embodiment splices the redundant feature map output by the basic branch and the diverse feature map output by the diverse branch in the channel dimension to obtain a fused preliminary feature map. During the splicing process, the feature map size is kept consistent to ensure the effectiveness of subsequent operations, while retaining various feature information extracted by the two branches, laying the foundation for subsequent feature selection.

[0054] Preferably, in the microscopic image segmentation algorithm of this embodiment, after obtaining the preliminary feature map, a channel attention mechanism module is embedded. This module works in conjunction with the feature fusion logic of U-Net. By adaptively learning the importance weights of feature channels, channel weights are allocated to the stitched feature map, focusing on strengthening the feature channels related to the segmentation of industrial parts microscopic images, suppressing irrelevant feature channels such as background noise and invalid textures, improving the effective utilization rate of the U-Net model feature map, further optimizing the feature extraction accuracy, and laying the foundation for subsequent feature fusion with the ResNet backbone network.

[0055] Preferably, in the microscopic image segmentation algorithm of this embodiment, the BDRConv convolution kernel further includes an extended portion. The main portion is responsible for core feature extraction and redundancy-diversity feature balancing, while the extended portion employs point convolution. The extended portion is used to enhance diversity features and supplement detailed information. As a supplement to the main portion, the core function of the extended portion is to further enhance diversity features and compensate for the shortcomings of the main portion in extracting subtle features.

[0056] Preferably, the extended part is implemented as follows:

[0057] Point convolution and lightweight adaptation to U-Net: The extended part of the BDRConv convolutional kernel adopts point convolution (1×1 convolution). After replacing it with the U-Net convolutional layer, the focus is on further processing the feature maps output by the diverse branches of the U-Net decoder. Through the dimensionality reduction and feature fusion effect of the 1×1 convolutional kernel, the subtle details in the diverse features are enhanced, especially the feature information of small-sized industrial parts. At the same time, the number of channels in the U-Net model feature map is reduced, the overall computational complexity is reduced, and the lightweight design of the U-Net model is realized. This promotes the overall lightweighting of the composite segmentation model and adapts to the needs of industrial embedded deployment.

[0058] Feature fusion and segmentation output adaptation: The diverse feature map of the extended part, enhanced by point convolution, is added to the feature map of the main part, processed by the channel attention mechanism, to achieve deep feature fusion. The fused feature map is then input into the next layer of the U-Net model's convolution or feature fusion module, and finally, the segmentation result of the microscopic image is output through the U-Net decoder. The additive fusion method ensures the complementarity of the two parts' features, retaining the core features and key channel weights of the main part while incorporating the enhanced subtle diverse features of the extended part, achieving a balance between redundant and diverse features. This aligns with the core logic of the U-Net model, "encoder extracts features, decoder restores details," thus improving segmentation accuracy.

[0059] The BDRConv convolutional kernel module employs a collaborative design of basic and diverse branches (standard convolution + group convolution) with extended point convolutions. On one hand, the combination of group and point convolutions significantly reduces the number of parameters and computational cost of convolution operations, solving the problems of redundant kernels and high computational complexity in existing ResNet models, thus contributing to model lightweighting. On the other hand, through balanced extraction of redundant and diverse features, feature selection via channel attention mechanism, and subtle feature enhancement in the extended part, it effectively improves the completeness and accuracy of feature extraction. It can accurately capture key features such as edges, contours, and textures of industrial parts, adapting to microscopic image segmentation scenarios of small-sized, overlapping, and complex backgrounds of industrial parts. This provides favorable conditions for subsequent activation function optimization and model pruning, while simultaneously improving the segmentation performance and generalization ability of the entire ResNet segmentation model.

[0060] Preferably, the microscopic image segmentation algorithm of this embodiment uses a fixed activation function as the basic function of the adaptive customized activation function framework. The specific implementation steps are as follows:

[0061] Basic activation function selection and U-Net adaptation: Combining the core characteristics of the ACAF framework with the structural requirements of the basic U-Net, a fixed activation function that is suitable for microscopic image feature extraction and has strong compatibility with the activation layers of U-Net is selected as the basic function of the ACAF framework. The ReLU function is preferred (it is computationally simple, not prone to overfitting, and matches the feature response pattern of U-Net). Alternatively, it can be replaced with other fixed activation functions such as Leaky ReLU and GELU according to the training requirements of the composite segmentation model. The core is to retain the low cost and easy convergence characteristics of the basic function, while ensuring that it is adapted to the feature output of each layer of U-Net and avoiding feature response distortion.

[0062] Adaptive parameter introduction and U-Net hierarchical adaptation design: A small number of learnable adaptive parameters are introduced into the selected basic activation function, with the number of parameters controlled between 2 and 4, to avoid increasing computational overhead due to excessive parameters, which aligns with the lightweight goal of this invention. The basic activation function is reconstructed through parameterized formulas, and personalized customization of the activation function of each layer of U-Net is achieved by combining the hierarchical feature requirements of the U-Net encoder and decoder: For the U-Net encoder (connected to the ResNet backbone network, focusing on basic feature extraction), the slope parameter of the reconstructed activation function is adjusted to improve the feature response speed and adapt to the basic redundant features output by the BDRConv convolutional kernel; For the U-Net decoder (focusing on detailed feature recovery, focusing on the edges and contours of industrial parts), the threshold parameter of the reconstructed activation function is adjusted to avoid gradient vanishing, enhance the response capability of subtle features, and adapt to the feature extraction requirements of small-sized industrial parts.

[0063] Co-training of parameters and adaptation to U-Net and ResNet: The adaptive parameters of the ACAF framework are co-trained with the parameters of the BDRConv convolutional kernel, the parameters of the ResNet backbone network, and other parameters of the U-Net model. During model training, the adaptive parameters will dynamically adjust their values ​​according to the feature distribution of the corresponding U-Net layer, the feature output of the ResNet backbone network, and the changes in the loss function, without manual intervention. Parameter regularization constraints are introduced during training to avoid parameter overfitting, ensure the rationality and stability of parameter adjustment, and guarantee the overall convergence of the composite segmentation model, adapting to the complex scenario of microscopic image segmentation of industrial parts.

[0064] Framework Layered Adaptation and Optimization: Combining the structural differences between the U-Net encoder and decoder and the structural characteristics of the ResNet model, the ACAF framework is layered and adapted to ensure synergy with the entire composite segmentation model: First, U-Net encoder adaptation focuses on optimizing the ACAF threshold parameters to avoid gradient vanishing, while matching the feature outputs of the basic branches of the BDRConv convolutional kernel; combined with the residual connection structure of the ResNet model, the slope parameters of ACAF are adjusted to improve feature fusion efficiency; Second, U-Net decoder adaptation focuses on optimizing the detail response parameters of ACAF, enhancing the feature response of small-sized, overlapping parts, and adapting it to the feature outputs of the diversity branches of the BDRConv convolutional kernel to help the decoder recover detailed contours; Third, overall adaptation ensures smooth feature transfer between the activation output of ACAF and the U-Net feature fusion module and the ResNet backbone network, forming a collaborative link of "feature extraction-activation enhancement-feature fusion".

[0065] Preferably, in a microscopic image segmentation algorithm of this embodiment, the original fully connected classification layer of the ResNet model is removed, and several residual blocks are retained. The preprocessed microscopic image is input into the backbone network, and the deep basic features of the image are extracted layer by layer through continuous convolution and residual connection in each residual block, and finally the backbone feature map is output.

[0066] This embodiment provides a method for microscopic image segmentation, including the following steps:

[0067] Step S1: Preprocess the microscopic images of industrial parts to obtain preprocessed test set images;

[0068] Step S2: Establish the aforementioned microscopic image segmentation algorithm;

[0069] Step S3: Perform co-training on the composite segmentation model. During the training process, the ACAF parameters, BDRConv convolutional kernel parameters, ResNet backbone network parameters, and other U-Net parameters are updated synchronously to obtain the trained composite segmentation model.

[0070] Step S4: Input the test set images into the trained composite segmentation model for analysis, and output the binarized segmentation results of the industrial parts.

[0071] The microscopic image segmentation method in this embodiment shows improved performance in the following aspects, according to actual measurements:

[0072] 1. Algorithm segmentation accuracy: The ResNet+U-Net composite model in this embodiment achieves a segmentation accuracy of 98.5% by leveraging the redundancy-diversity feature balance extraction of the BDRConv convolutional kernel and the hierarchical adaptive adaptation of the ACAF activation function. This is a 1.04% improvement over the basic U-Net model. The mean intersection over union (mIoU) reaches 88.89%, a 3.32% improvement, which is significantly better than mainstream segmentation algorithms such as traditional U-Net and U-Net++. It can accurately capture key features such as the edges and contours of parts.

[0073] 2. Model training stability: The deep adaptation of ACAF with the U-Net model effectively alleviates the problem of deep gradient vanishing in the U-Net encoder. Combined with the feature extraction stability and parameter regularization constraints of the BDRConv convolution kernel, the model training convergence speed is increased by 2.8 times, and the oscillation amplitude of the loss function during training is reduced by 60%. Stable training can be achieved without complex parameter tuning, which greatly reduces the difficulty of engineering implementation.

[0074] 3. Adaptability to industrial scenarios: Supports multi-source microscopic image input such as electron microscope (SEM / TEM) and optical microscope, and is suitable for typical industrial scenarios such as large differences in part size, complex background, overlapping parts, and strong noise interference. In the scenario of industrial part microscopic image segmentation, the segmentation accuracy reaches 98.5%, which fully meets the high-precision inspection needs of industrial production.

[0075] The specific manifestations of adaptability to industrial scenarios are:

[0076] ① It is compatible with multi-source microscopic image input and can be adapted to various commonly used microscopic imaging devices such as electron microscopes (SEM / TEM) and optical microscopes. It eliminates the need for complex preprocessing of microscopic images from different sources, reducing the pre-preparation cost of industrial image segmentation.

[0077] ② It has outstanding anti-interference capabilities and can effectively adapt to common problems in industrial scenarios such as large differences in part size, complex background, and strong noise interference, avoiding omissions and missegments, and ensuring the reliability of segmentation results.

[0078] ③ The segmentation accuracy meets industrial needs. In the scenario of microscopic image segmentation of industrial parts, the segmentation accuracy reaches 98.5%. It can accurately capture key features such as the edge and contour of the parts, providing accurate data support for subsequent industrial quality inspection work such as defect detection, size measurement, and morphological analysis. It helps industrial production achieve high-precision quality control, reduces the error and workload of manual inspection, and improves the efficiency and standardization of industrial inspection.

[0079] The experimental environment setup and dataset preparation are as follows:

[0080] 1. Experimental environment configuration, see Table 1

[0081]

[0082] Table 1

[0083] 2. Dataset Preparation: A dataset of industrial parts microscopic images was selected, containing over 700 original microscopic images (1024×1024 pixels resolution). 700 images were used as the training set, and 8 as the validation set. The images were taken with an optical microscope and included industrial parts of different sizes, exhibiting typical industrial scene problems such as part defects, background noise, and uneven lighting. All original images underwent preprocessing: Gaussian filtering was used to remove noise (3×3 kernel size), and grayscale normalization was performed (normalizing pixel values ​​to the [0,1] range) to preserve part contours and detailed features. Simultaneously, segmentation labels for all images were manually labeled (using binary labels, with the foreground representing metal parts and the background representing irrelevant areas) to ensure accurate correspondence between labels and images, providing high-quality data support for model training.

[0084] Steps to optimize the U-Net model:

[0085] 1. ResNet backbone feature extraction network construction: such as Figure 1 As shown, this method first uses classic ResNet-50 / 101 architectures as the backbone network, retaining the conv1 convolutional layer and four residual blocks (conv2_x to conv5_x), and removing the original fully connected classification layer to adapt to the microscopic image segmentation task. The preprocessed microscopic image is input into this backbone network, and deep basic features of the image are extracted layer by layer through continuous convolutions and residual connections within each residual block. The final output is a backbone feature map of size 16×16×1024 (the number of channels can be flexibly adjusted according to the ResNet depth). This feature map contains the core contour and texture information of the industrial parts and serves as the input to the subsequent U-Net encoder. Figure 1 The characteristic flow of the "ResNet backbone network" module. In other embodiments, the number of residual blocks can be 2, 3, 5, or 6.

[0086] 2. Replacing U-Net's regular convolutional layers with BDRConv convolutional kernels: To improve feature extraction capabilities, such as... Figure 2 As shown, this method replaces all conventional 3×3 convolutional layers in the U-Net encoder and decoder with BDRConv convolutional kernels. The BDRConv kernel consists of a main part and an expansion part: the main part includes a base branch and a diversity branch. The base branch uses standard 3×3 convolutions to extract basic redundant features of the parts; the diversity branch uses 3×3 grouped convolutions (4 groups) to capture diverse detailed features of the parts. The feature maps output from the two branches are concatenated along the channel dimension and then input to the channel attention module. Learnable weights are used to enhance edge features and suppress background noise. The expansion part uses 1×1 point convolutions to reduce the dimensionality and enhance the features of the attention-processed feature maps, further compressing redundant information and highlighting key features.

[0087] 3. U-Net encoder construction: U-Net encoder corresponding to Figure 1 The input section shown consists of four encoding modules, each containing two BDRConv convolutional layers, one batch normalization (BN) layer, and one ACAF layer. The 16×16×1024 feature map output from the ResNet backbone is input to the encoder. After progressive downsampling by the four encoding modules, the final output is an encoded feature map of size 2×2×2048 (the number of channels matches the ResNet depth). Figure 1 The output logic is shown below.

[0088] 4. Construction of U-Net Feature Fusion Layer: The U-Net feature fusion layer corresponds to... Figure 1 The Copy and Crop module employs a skip connection approach, concatenating and fusing the encoded feature maps output by each module of the encoder with the decoded feature maps output by the corresponding modules of the decoder. Simultaneously, deep feature maps output by the residual blocks (conv2_x, conv3_x, conv4_x, conv5_x) of the ResNet backbone are incorporated into the fusion process, achieving a collaborative fusion of "backbone features + encoded features + decoded features," effectively improving the completeness and representational power of the features. Figure 1 The design intent is to fuse input and output and collaborate with ResNet backbone features.

[0089] 5. U-Net Decoder Construction: The corresponding U-Net decoder is attached... Figure 1The output section adopts a symmetrical structure to the encoder (input section), containing four decoding modules. Each decoding module consists of two BDRConv convolutional layers, one batch normalization (BN) layer, one ACAF layer, and one transposed convolutional upsampling layer with a stride of 2. Consistent with the encoder, the main part of the BDRConv convolutional kernel in the decoding module still consists of a 3×3 standard convolution and a 3×3 grouped convolution with 4 groups, focusing on enhancing the extraction of detailed features from small-sized parts; the 1×1 point convolution in the extended part further enhances the fused detailed features. The decoder gradually enlarges the feature map size through the upsampling layer, and combined with the fused features input from the feature fusion layer, gradually recovers the complete outline of the part, finally outputting a decoded feature map with a size of 512×512×64, corresponding to... Figure 1 The feature flow direction from the decoder to the output layer.

[0090] 6. ACAF Adaptation Optimization: ACAF mainly refers to a function whose parameters or shape can be trained and learned together with other parameters in the neural network (e.g., ...). Figure 3 As shown in the diagram, the activation function can adapt to changes in training data. The shape of the activation function can be controlled and adjusted through several parameters, which participate in training along with other parameters in the neural network. The ACAF framework is replaced in all activation layers of the aforementioned U-Net model (encoder + decoder), replacing the original fixed ReLU activation function. The ReLU function is selected as the base function of ACAF, and a learnable adaptive parameter α (initially set to 0.2) is introduced to adapt to the detailed differences in industrial parts. The adaptive parameter of ACAF is then correlated with the parameters of the ResNet backbone network, the BDRConv convolutional kernel parameters, and other parameters of U-Net to prepare for subsequent co-training.

[0091] Preferably, the microscopic image segmentation method in this embodiment uses a loss function that is a weighted sum of the cross-entropy loss function and the class imbalance robustness (Dice) loss function. This effectively improves segmentation accuracy and region overlap while ensuring training stability and mitigating class imbalance. Furthermore, it is simple to implement and highly robust. It also supports mitigating the positive-negative sample imbalance problem through focal loss.

[0092] Model training and parameter optimization steps (adapted to ResNet backbone):

[0093] 1. Training parameter settings: A stochastic gradient descent (SGD) optimizer can be used, with an initial learning rate of 1e-2, a learning rate of 0.001, a momentum of 0.9, and a weight decay coefficient of 1e-5 to avoid overfitting. The loss function is a weighted sum of cross-entropy loss and Dice loss (with weights of 0.6 and 0.4 respectively). Cross-entropy loss is used to optimize the classification accuracy of the model, while Dice loss is used to optimize the segmentation accuracy of part edges, adapting to the high-precision requirements of industrial part segmentation. The number of training epochs is set to 50, the batch size is set to 8, and an early stopping strategy (patience=5) is adopted. When the validation set loss does not decrease for 5 consecutive epochs, training is stopped, and the optimal model parameters are saved.

[0094] Alternatively, the Adaptive Moment Estimation (Adam) optimizer can be used, with the initial learning rate set to 1e-4, momentum set to 0.9, and weight decay coefficient set to 0.

[0095] The learning rate can be decreased using either step or cosine annealing strategies, with a minimum learning rate of 0.01 times the initial learning rate.

[0096] 2. Model Co-training: Input the training set images and corresponding labels into the constructed composite segmentation model to initiate model co-training. During training, the adaptive parameters of ACAF, BDRConv convolutional kernel parameters, ResNet backbone network parameters, and other parameters of the U-Net model are updated synchronously. The adaptive parameters of ACAF are dynamically adjusted according to the feature distribution of each layer of U-Net, the feature output of ResNet backbone, and the changes in the loss function. The dual-branch parameters of the BDRConv convolutional kernel are adaptively optimized through backpropagation to optimize the feature extraction weights and balance the extraction effects of redundant and diverse features. After each round of training, the model is validated using validation set images. The changes in the model's average intersection-over-union ratio and loss function are monitored, and training parameters are adjusted in a timely manner to ensure stable convergence of model training.

[0097] Training is divided into two phases: freezing and unfreezing. In the freezing phase, the number of training epochs is set to 50 and the batch size to 2. In the unfreezing phase, the total number of training epochs is set to 100 and the batch size to 4. The input image size is set to 1024×1024. During model inference, the ResNet backbone network is paired with downsampled BDRConv convolutional kernels, while the upsampling settings remain unchanged. Compared with the original ResNet model, the segmentation accuracy is improved to 98.5%, the average intersection-over-union ratio is improved to 88.89%, and the total loss value is reduced to 0.048.

[0098] Preferably, after step S4, the segmentation effect can be verified by indicators such as segmentation accuracy, mean intersection-over-union ratio (mIoU), and total loss, so that the composite segmentation model can be iteratively corrected.

[0099] Model inference and segmentation result verification steps: (adapted to ResNet backbone)

[0100] 1. Model Inference: Input the 8 preprocessed microscopic images of industrial parts from the test set into the optimal composite segmentation model saved in step 3 for segmentation inference. The inference process strictly follows... Figure 1 The feature flow shown is as follows: microscopic image → ResNet backbone network extracts deep features → U-Net encoder (BDRConv) extracts encoded features → feature fusion layer fuses features → U-Net decoder (BDRConv) restores detail features → output layer outputs segmentation result image. The model automatically completes the segmentation of parts and background, outputs the binarized segmentation result of each test image, and accurately marks the edges and contours of industrial parts.

[0101] 2. Segmentation Result Verification: Segmentation accuracy, average intersection-over-union ratio (OCU), and total loss value were used as core verification indicators. Simultaneously, the model inference time was statistically analyzed to comprehensively verify the model inference results. The verification results show that the total loss value of the composite segmentation model in this embodiment was reduced to 0.048, and the total model inference time was 1924.50 seconds; the segmentation accuracy reached 98.5%, an improvement of 1.04%; and the average OCU reached 88.89%, an improvement of 3.32%. This effectively adapts to scenarios involving defects and noise interference in industrial parts, avoiding missed or incorrect segmentation. The segmentation results can accurately support subsequent industrial quality inspection work such as defect detection and dimensional measurement.

[0102] Preferably, in the microscopic image segmentation method of this embodiment, the binarization segmentation step includes: adding a 1×1 convolutional layer and a sigmoid activation function to the output of the U-Net decoder. This achieves binary segmentation of industrial parts and the background.

[0103] Preferably, in the microscopic image segmentation algorithm of this embodiment, the ACAF framework is configured with a learnable slope parameter α in the input layer of the U-Net model encoder. The initial value of the slope parameter α is set to 0.2 to improve the feature response speed, avoid gradient vanishing, and enhance the feature response. Furthermore, the ACAF adaptive parameter is trained in conjunction with other parameters of the model to adapt to the differences in the distribution of ResNet backbone features and the detailed distribution of industrial parts.

[0104] Based on the above-described preferred embodiments according to this application, and through the foregoing description, those skilled in the art can make various changes and modifications without departing from the technical concept of this application. The technical scope of this application is not limited to the contents of the specification, but must be determined according to the scope of the claims.

Claims

1. A microscopic image segmentation algorithm, characterized in that, Includes the following steps: The U-shaped network model is optimized by replacing the original convolutional kernels of each convolutional layer with bidirectional dynamic residual convolutional kernels. At the same time, the activation functions in the original activation layers of the U-shaped network model are replaced with adaptive custom activation functions to obtain the optimized U-shaped network model. A composite segmentation model is constructed by structurally fusing the optimized U-shaped network model and the residual network model. The residual network model is used as the feature extraction backbone network of the composite segmentation model, and the optimized U-shaped network model is used as the feature fusion and segmentation output module of the composite segmentation model.

2. The microscopic image segmentation algorithm according to claim 1, characterized in that, The composite segmentation model includes an encoder, a feature fusion layer, and a decoder connected in sequence. The bidirectional dynamic residual convolution kernel includes a main part, which contains a parallel basic branch and a diversity branch. The basic branch uses standard convolution operations and is embedded in each convolutional layer of the encoder to extract basic redundant features in the image, which are consistent with the feature output of the backbone network. The diversity branch uses group convolution operations, which reduces inter-group feature interference by dividing the convolution groups, and is embedded in each convolutional layer of the decoder to extract diverse detailed features in the image.

3. The microscopic image segmentation algorithm according to claim 2, characterized in that, The redundant feature map output by the basic branch and the diverse feature map output by the diverse branch are concatenated along the channel dimension to obtain a preliminary fused feature map. During the concatenation process, the feature map size is kept consistent, while retaining various feature information extracted by the basic branch and the diverse branch.

4. The microscopic image segmentation algorithm according to claim 3, characterized in that, After obtaining the preliminary feature map, a channel attention mechanism module is embedded. The channel attention mechanism module works in conjunction with the feature fusion logic of the U-shaped network to perform channel weight allocation on the concatenated feature map by adaptively learning the importance weights of the feature channels.

5. The microscopic image segmentation algorithm according to any one of claims 2-4, characterized in that, The bidirectional dynamic residual convolution kernel also includes an extension part. The main part is responsible for core feature extraction and balancing redundancy and diversity features. The extension part adopts point convolution and is used to enhance diversity features and supplement detailed information.

6. The microscopic image segmentation algorithm according to claim 1, characterized in that, A fixed activation function is used as the base function of the adaptive custom activation function framework.

7. The microscopic image segmentation algorithm according to claim 1, characterized in that, The residual network model removes the original fully connected classification layer and retains several residual blocks. The preprocessed microscopic image is input into the backbone network. Through continuous convolution and residual connections within each residual block, the deep basic features of the image are extracted layer by layer, and finally the backbone feature map is output.

8. A method for segmenting microscopic images, characterized in that, Includes the following steps: Step S1: Preprocess the microscopic images of industrial parts to obtain preprocessed test set images; Step S2: Establish the microscopic image segmentation algorithm as described in any one of claims 1-7; Step S3: Perform collaborative training on the composite segmentation model. During the training process, the adaptive customized activation function parameters, bidirectional dynamic residual convolution kernel parameters, and backbone network parameters are updated synchronously to obtain the trained composite segmentation model. Step S4: Input the test set images into the trained composite segmentation model for analysis, and output the binarized segmentation results of the industrial parts.

9. The microscopic image segmentation method according to claim 8, characterized in that, The binarization segmentation step includes adding a 1×1 convolutional layer and a Sigmoid activation function to the decoder output of the U-shaped network model.

10. The microscopic image segmentation method according to claim 8, characterized in that, The adaptive custom activation function framework is configured with a learnable slope parameter α in the input layer of the encoder of the U-shaped network model, and the initial value of the slope parameter α is set to 0.2.