Lithium ore microscopic image segmentation method and system based on improved Unet model

By improving the Unet model's cascaded structure of deep convolution and pointwise convolution, dynamic serpentine convolution module, and multi-scale feature aggregation module, the microscopic image segmentation problem of the complex lepidolite-feldspar-quartz system was solved, achieving high-precision mineral segmentation and improving lithium resource recovery rate and sorting efficiency.

CN121304707BActive Publication Date: 2026-06-09YICHUN JIANGLI LITHIUM BATTERY NEW ENERGY IND RES INST +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
YICHUN JIANGLI LITHIUM BATTERY NEW ENERGY IND RES INST
Filing Date
2025-09-08
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing technologies suffer from inaccurate micro-boundary resolution, poor imaging adaptability, and insufficient industrial applicability in the microscopic image segmentation of complex lepidolite-feldspar-quartz systems, resulting in low lepidolite recovery rates and systemic bottlenecks in traditional sorting technologies.

Method used

An improved Unet model is adopted, which improves image segmentation accuracy and precision by constructing a cascaded structure of depthwise convolution and pointwise convolution, a dynamic serpentine convolution module, a channel-space dual-path adaptive attention mechanism, and a multi-scale feature aggregation module, combined with an adaptive area filtering operator.

Benefits of technology

It achieves pixel-level precise segmentation of the lepidolite-feldspar-quartz system, improves the segmentation accuracy and precision of lithium ore microscopic images, enhances resource recovery rate and sorting efficiency, and reduces development costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121304707B_ABST
    Figure CN121304707B_ABST
Patent Text Reader

Abstract

This invention provides a method and system for lithium ore micro-image segmentation based on an improved Unet model, belonging to the field of machine vision and image segmentation. The method constructs a lithium ore micro-image dataset and acquires micro-images of lithium ore samples to be tested, performing image preprocessing; pixel-level annotation of the micro-image dataset is performed to generate corresponding mineral category mask images, which are then segmented and data augmented; a micro-image segmentation model is constructed and improved based on the Unet algorithm, constructing a cascaded structure of depthwise convolution and pointwise convolution in the downsampling path, embedding an anti-adhesion dynamic serpentine convolution module in the skip connections, introducing a channel-space dual-path adaptive attention mechanism module, and constructing a multi-scale feature aggregation module in the upsampling path; a mature model is obtained after training; the input micro-image to be tested yields a preliminary segmented image, which is then subjected to adaptive area filtering. This invention improves the segmentation accuracy and precision of lithium ore micro-images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical fields:

[0001] This invention belongs to the field of machine vision and image segmentation, specifically relating to a method and system for segmenting lithium ore microscopic images based on an improved Unet model. Background technology:

[0002] Lithium holds an irreplaceable position in the fields of power batteries, energy storage systems, and nuclear fusion technology. For example, in the battery field, lithium-ion batteries, with their high energy density and environmentally friendly characteristics, have become the core power source for electric vehicles, and market demand continues to surge. Lepidolite is an important lithium mineral resource. In lithium mining, flotation technology is generally used to separate lepidolite. However, lepidolite forms a complex micro-fine-grained structure with gangue minerals such as feldspar and quartz. Existing flotation processes are constrained by difficulties in mineral liberation and density overlap, resulting in systemic bottlenecks in traditional separation technologies. The recovery rate of lepidolite is less than 40%, and the overall resource recovery rate is only 70%-80%. Although laboratory detection methods such as X-ray fluorescence spectroscopy are accurate, they have drawbacks such as high cost, sample destruction, and poor timeliness, which cannot support real-time process optimization. Experience-driven separation processes further increase acid leaching consumption by about 20%, exacerbating environmental risks. The core of these difficulties lies in the lack of real-time, non-destructive analysis capabilities of traditional technologies for the microscopic composition, distribution, and intergrowth relationships of minerals.

[0003] Overcoming bottlenecks in lithium resource development urgently requires building a comprehensive micro-mineral digitization capability spanning the entire chain of exploration, beneficiation, process control, and quality assurance. This capability can accurately quantify the volume percentage of mineral phases during the exploration stage, reducing investment risk; optimize grinding fineness and reagent formulation during beneficiation; drive closed-loop intelligent control of flotation in process control; and ultimately significantly enhance resource sustainability by improving recovery rates and reducing energy consumption. It is estimated that this capability can increase the overall resource recovery rate by more than 20% and reduce development costs by 30%. Artificial intelligence technology provides a new path to achieving this goal, with semantic segmentation, as a pixel-level recognition method, being a key technology for analyzing the complex lepidolite-feldspar-quartz system.

[0004] In existing technologies, image analysis models are generally constructed to analyze complex systems of lepidolite-feldspar-quartz. However, existing models still have the following problems: In terms of micro-boundary analysis, the geometric complexity of lepidolite's platy cleavage (<5μm) and quartz's serrated contours, coupled with the physical overlap of boundaries caused by particle adhesion, results in a false positive rate of >35% in the contact area; in terms of imaging adaptability, the strong reflection interference of pearly luster and the confusion of textures in low-contrast areas severely weaken the feature discrimination power; in terms of industrial adaptability, there is a sharp contradiction between sub-second processing of 4K images and the need for accurate identification of micron-sized fragments. Summary of the Invention:

[0005] To address the aforementioned issues, this invention provides a method and system for segmenting lithium ore microscopic images based on an improved Unet model. By acquiring microscopic images of lithium ore powder under an electron microscope, and constructing a benchmark dataset for pixel-level segmentation of lepidolite, feldspar, and quartz based on the improved Unet model, the method effectively improves the segmentation accuracy of lithium ore-related powders after imaging under an electron microscope. This results in clear, accurate, and easily interpretable segmentation results when processing the images, reducing the difficulty of identification.

[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of the present invention are as follows:

[0007] In a first aspect, embodiments of the present invention provide a method for segmenting lithium ore microscopic images based on an improved Unet model, the method comprising the following steps:

[0008] Step S1: Construct a lithium ore microscopic image dataset and acquire microscopic images of the lithium ore samples to be tested; preprocess all images to ensure that the input format and size of the images meet the predetermined segmentation requirements.

[0009] Step S2: Pixel-level annotation is performed on the preprocessed microscopic image dataset to generate corresponding mineral category mask images as training ground values; the training ground values ​​are divided into training set, validation set and test set, and data augmentation operations are used to expand sample diversity;

[0010] Step S3: Construct a framework for a microscopic image segmentation model based on the Unet algorithm;

[0011] Step S4: Within the framework of the microscopic image segmentation model, the Unet algorithm is improved by constructing a cascaded structure of depthwise convolution and pointwise convolution in the downsampling path, embedding an anti-adhesion dynamic serpentine convolution module in the skip connection part, introducing a channel-space dual-path adaptive attention mechanism module in the skip connection part, and constructing a multi-scale feature aggregation module in the upsampling path.

[0012] Step S5: Train the improved microscopic image segmentation model using the training dataset to obtain a mature model;

[0013] Step S6: Input the microscopic image of the lithium ore sample to be tested into the mature model and output the preliminary segmentation image;

[0014] Step S7: Perform adaptive area filtering on the initially segmented image and output the final image segmentation result.

[0015] In a preferred embodiment of the present invention, the microscopic image is obtained by taking pictures with an electron microscope, magnifying the surface of the lithium ore sample by 200 times or more, and the image resolution is 4608×3456 or more.

[0016] In a preferred embodiment of the present invention, in step S4, a cascaded structure of depthwise convolution and pointwise convolution is constructed in the downsampling path. The standard convolution operation is decoupled into depthwise convolution and pointwise convolution through depthwise separable convolution. The depthwise convolution performs spatial filtering independently on each input channel, and the pointwise convolution is responsible for reducing the dimensionality of the output channel of the depthwise convolution.

[0017] In a preferred embodiment of the present invention, in step S4, after embedding an anti-adhesion dynamic serpentine convolution module in the jump connection part, the dynamic serpentine convolution dynamically adjusts the sampling point position according to the feature map content through a deformable convolution kernel structure, so that the sampling point position can flexibly fit the meandering, discontinuous or highly curved contour trajectory to adapt to the meandering boundary features of the lepidolite sheet cleavage surface and the quartz sawtooth contour, retain the key structural information of the particle morphology abrupt change region, and accurately fit the irregular boundary.

[0018] In a preferred embodiment of the present invention, the channel-space dual-path adaptive attention mechanism module in step S4 includes a channel attention branch and a spatial attention branch. The channel-space dual-path adaptive attention mechanism in the module includes two levels:

[0019] The first level refers to the adaptive optimization of the number of channels in the channel attention branch;

[0020] The second level refers to the feature extraction and fusion of the input feature map by the channel attention branch and the spatial attention branch; and, in the second level, the extraction of the input feature map by the channel attention branch is based on the adaptively optimized number of channels in the first level.

[0021] In a preferred embodiment of the present invention, at the first level, a learnable logarithmic compression ratio parameter is introduced for the channel attention branch; the logarithmic compression ratio parameter is dynamically optimized during the training process of the channel attention branch, thereby further dynamically optimizing the number of channels, so that the network can adaptively learn the optimal channel compression intensity according to the characteristics of feature maps at different levels, thereby focusing more flexibly on key feature channels.

[0022] As a preferred embodiment of the present invention, the first layer further includes: replacing the standard 1×1 convolutional layer in the channel attention branch with a depthwise separable convolution.

[0023] In a preferred embodiment of the present invention, the formula for dynamically optimizing the number of channels during training is as follows:

[0024]

[0025] In equations (4)-(5), exp(log ratioThe value represents the proposed dynamic compression ratio learned by the channel attention branch. A larger value indicates that the model tends to perform stronger channel compression. ratio This indicates the preset minimum compression ratio lower limit, max() indicates taking the maximum of the two values, and current... ratio Indicates the final effective compression ratio, in channels Indicates the number of input channels, reduced channels This represents the number of channels obtained after theoretical compression based on the effective actual compression ratio, and s represents the lower limit of the number of channels.

[0026] In a preferred embodiment of the present invention, at the second level, the channel attention branch and the spatial attention branch respectively extract features from the input feature map X, and finally fuse them into a comprehensive attention weight; specifically including:

[0027] In the channel attention branch, the input feature map X first undergoes average pooling and max pooling operations, as shown in the following formulas:

[0028] F avg =AvgPool(X) (6)

[0029] F max =MaxPool(X) (7)

[0030] In equations (6)-(7), F avg F represents the average pooling result. max The expression represents the result of max pooling, AvgPool() represents average pooling, MaxPool() represents max pooling, and X represents the input feature map.

[0031] Secondly, using the learnable fusion weight parameter α, and constraining the range of the learnable parameter α within [0,1] by the Sigmoid function σ, the fusion weight ω is obtained, as shown in the following formula:

[0032] ω=σ(α) (8)

[0033] The average pooling result and the max pooling result are weighted and fused using a fusion weight ω, as shown in the following formula:

[0034] F fused =ω·F avg +(1-ω)·F max (9)

[0035] In equations (8)-(9), ω represents the fusion weight, F fused This represents the features after weighted fusion;

[0036] Then, for the F obtained above fusedThen, feature transformation is performed, and a channel attention map F is generated through a lightweight multilayer perceptron (MLP). c(X) The formula is as follows:

[0037] F MLP1 =ReLU(W1·F fused +b1) (10)

[0038] F MLP2 =W2·F MLP1 +b2 (11)

[0039] F c(X) =σ(F MLP2 (12)

[0040] In equations (10)-(12), W1 represents the weight matrix of the first fully connected layer, b1 represents the bias vector of the first fully connected layer, ReLU represents the ReLU activation function, W2 represents the weight matrix of the second fully connected layer, b2 represents the bias vector of the second fully connected layer, and F MLP1 F represents the output obtained after passing through the first fully connected layer. MLP2 This represents the output obtained after passing through the second fully connected layer;

[0041] The spatial attention branch generates a spatial attention graph F by fusing spatial dimensional features. s(X) ;

[0042] Finally, the two attention maps are fused by element-wise multiplication to obtain a comprehensive attention weight map. This comprehensive attention weight map is then applied to the original input feature X to obtain the output result, as shown in the following formula:

[0043]

[0044] In equation (13), F c(X) Represents the channel attention map, F s(X) Represents the spatial attention map; σ represents the Sigmoid function, used to constrain the parameters within [0,1]; F output This represents the characteristics of the final output. This indicates an element-wise multiplication operation.

[0045] In a preferred embodiment of the present invention, step S4 involves constructing a multi-scale feature aggregation module in the upsampling path. This module is constructed using convolutional kernels with different dilation rates and includes three core components: a multi-scale feature extraction layer, a dual-path attention mechanism layer, and a residual feature reconstruction layer.

[0046] The multi-scale feature extraction layer employs multiple parallel dilated convolutional modules with different dilation rates to extract multi-scale features with different effective receptive fields, mathematically expressed as:

[0047]

[0048] In equation (14), F in The input feature map of the multi-scale feature aggregation module is represented by D = {d1, d2, ..., d...}. k} represents a preset set of void ratios. This indicates a splicing operation along the channel dimension, C d F represents a convolution operation with a dilation rate of d. ms Indicates multi-scale fusion features;

[0049] The dual-path attention mechanism layer combines convolutional feature extraction at different scales with channel attention and spatial attention branches. It then fuses the channel and spatial attention maps through element-wise multiplication to obtain a comprehensive importance weight map. This comprehensive importance weight map is used to modulate the multi-scale fused feature F. ms ;

[0050] The residual feature reconstruction layer corrects structural distortion through boundary reconstruction and extracts residual features T.

[0051] Modulate multi-scale fusion features F ms The obtained features are then integrated and reduced in dimensionality through 1×1 convolution, and then added to the residual features T to finally produce the enhanced output features; the formula is expressed as follows:

[0052]

[0053] In equation (15), F c(X) Represents the channel attention map, F s(X) This represents a spatial attention map, where T represents the residual feature. Represents element-wise multiplication, C 1×1 This represents a 1×1 convolution operation, F out This represents the final output feature of the multi-scale feature aggregation module.

[0054] In a preferred embodiment of the present invention, step S7 involves adaptive area filtering of the initially segmented image, including:

[0055] Step S71: Perform connected component analysis to identify all connected components R in the segmentation mask. u That is, an independent region composed of adjacent pixels;

[0056] Step S72, set a minimum area threshold A min The area refers to the number of pixels within a connected region.

[0057] Step S73, calculate R for each connected region u Area Au If A u >A min Then retain the region R. u If A u ≤A min Then filter the region R u .

[0058] Secondly, embodiments of the present invention also provide a lithium ore microscopic image segmentation system based on an improved Unet model. The system comprises: an image acquisition module, an image preprocessing module, an annotation module, a model framework construction module, an improved Unet algorithm module, a model training module, a preliminary segmentation module, an area filtering module, and a final result output module; wherein...

[0059] The image acquisition module is used to construct a lithium ore microscopic image dataset and acquire microscopic images of the lithium ore sample to be tested.

[0060] The image preprocessing module is used to preprocess all images to ensure that the input format and size of the images meet the predetermined segmentation requirements.

[0061] The annotation module is used to perform pixel-level annotation on the preprocessed microscopic image dataset, generate corresponding mineral category mask images as training ground values, divide the training ground values ​​into training set, validation set and test set, and expand sample diversity through data augmentation operations;

[0062] The model framework construction module is used to construct a framework for a microscopic image segmentation model based on the Unet algorithm;

[0063] The Unet algorithm improvement module is used to improve the Unet algorithm within the framework of the microscopic image segmentation model. It constructs a cascaded structure of depthwise convolution and pointwise convolution in the downsampling path, embeds an anti-adhesion dynamic serpentine convolution module in the skip connection part, introduces a channel-space dual-path adaptive attention mechanism module in the skip connection part, and constructs a multi-scale feature aggregation module in the upsampling path.

[0064] The model training module is used to train the improved microscopic image segmentation model using the training dataset to obtain a mature model;

[0065] The preliminary segmentation module is used to input the microscopic image of the lithium ore sample to be tested into the mature model and output the preliminary segmentation image;

[0066] The area filtering module is used to perform adaptive area filtering on the preliminary segmented image to obtain the final image segmentation result;

[0067] The final result output module is used to output the final image segmentation result.

[0068] The solutions of the embodiments of the present invention have the following beneficial effects:

[0069] The lithium ore microscopic image segmentation method and system based on the improved Unet model provided in this invention breaks through the geometric rigidity constraint of traditional convolution kernels. It innovatively uses the cleavage angle parameters of lithium mica sheets and the curvature features of quartz serrated boundaries as prior physical knowledge to guide dynamic snake-like convolution. The invention employs a deformable kernel offset learning mechanism (CRM) to dynamically correct the convolution path through cleavage surface orientation detection units, achieving pixel-level fitting modeling of meandering boundaries and solving the problem of structural information loss in abrupt morphological regions. To address the dual interference of pearly luster reflection and shadow texture confusion, a channel-space dual-path attention mechanism is constructed. This suppresses high-brightness artifacts in the channel dimension (reflection noise blocking the path) and enhances discriminative features in low-light regions in the spatial dimension (shadow compensation path). A multi-scale feature aggregation module is designed to improve the separation capability of adherent particles and the accuracy of multi-scale target recognition, overcoming the scale adaptability limitations of standard U-Net. Furthermore, to achieve synergistic optimization of sub-second processing and high-precision reconstruction, depthwise separable convolution is used instead of conventional convolution operations, compressing the number of parameters to less than 60% of traditional models while maintaining boundary modeling capabilities. An adaptive area filtering operator is integrated, based on the prior dynamic balance of mineral grain size distribution, to retain micro-fragmentation and filter noise. This invention improves the segmentation accuracy and precision of lithium ore micro-images.

[0070] Of course, implementing any product or method of the present invention does not necessarily require achieving all of the advantages described above at the same time. Attached image description:

[0071] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0072] Figure 1 This is a flowchart of the lithium ore microscopic image segmentation method based on the improved Unet model described in the embodiments of the present invention;

[0073] Figure 2 This is the original image of a lithium ore microscopic image collected in a specific application example of an embodiment of the present invention;

[0074] Figure 3 Based on Figure 2The original image is a label image obtained using the segmentation method described in the embodiments of the present invention;

[0075] Figure 4 Based on Figure 2 The original image is used to obtain the output image through the segmentation method described in the embodiments of the present invention. Detailed implementation method:

[0076] After discovering the aforementioned problems, the inventors of this application conducted a detailed study on the existing problems of lithium ore microscopic image segmentation. The study found that existing models have the following problems when performing semantic segmentation on lithium ore electron micrographs:

[0077] At the geometric feature modeling level, the rigid structure of traditional rectangular convolution kernels cannot effectively adapt to irregular geometric features such as the sheet-like cleavage morphology of lepidolite and the serrated contours of quartz. This results in the excessive smoothing or breakage of key morphological information at the curvature abrupt change points of particle edges and the intersection regions of cleavage surfaces. When dealing with high-density packed ore powders, existing feature fusion mechanisms have inherent limitations at physically overlapping boundaries: unidirectional feature transmission via skip connections struggles to decouple mixed signals from adhered regions, causing misalignment and fusion of deep semantic and shallow geometric features; the multi-scale integration capability of feature pyramids fails significantly in areas with blurred contact boundaries, leading to large-area undersegmentation and statistical distortion of particle size distribution.

[0078] At the level of optical interference suppression, the strong specular reflection generated by the pearly luster of mineral surfaces couples with sensor noise, causing the model to overreact to local bright areas and frequently misidentify reflection artifacts as mineral entities. At the same time, in shadow areas and at mineral boundaries, the textural similarity between feldspar and mica leads to a sharp decline in discriminative feature extraction capabilities, especially under complex lighting conditions, resulting in a significant reduction in mineral classification accuracy and forming an inherent optical sensitivity defect.

[0079] At the boundary reconstruction level, the decoder's upsampling operation introduces an artificial smoothing effect, which, combined with the checkerboard artifacts generated during deconvolution, causes the edges of the mica flakes to exhibit a stepped, jagged distortion. This effect is further amplified in low-contrast regions. The lack of spatial alignment mechanisms in skip connections exacerbates the mismatch between edge geometric information and semantic context, leading to systematic distortions in the boundary reconstruction results.

[0080] The aforementioned defects form a closed-loop technical dilemma: geometric modeling failure weakens the ability to separate cohesive particles, amplifying under-segmentation errors; optical interference suppresses the discriminative power of weak contamination features, exacerbating mineral misclassification; boundary reconstruction distortion distorts microscopic morphology analysis, reducing the reliability of dissociation degree assessment; and noise identification imbalance interferes with geometric feature extraction, forming a self-reinforcing error loop. While existing improvement schemes can partially alleviate specific problems, they still lack systematic solutions when facing the morphological diversity, optical complexity, and high cohesion of ore powders. Ultimately, this results in severely insufficient recall and classification accuracy for lepidolite boundary segmentation, hindering the optimization of flotation processes and the improvement of resource recovery efficiency.

[0081] It should be noted that the defects in the above-mentioned prior art solutions are all the result of the inventors' practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the embodiments of the present invention in the following text should be the inventors' contributions to the present invention.

[0082] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. It should be noted that, without conflict, the embodiments and features in the embodiments of the present invention can also be combined with each other.

[0083] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In the description of this invention, the terms "first," "second," "third," "fourth," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0084] Based on the above in-depth analysis, this invention provides a method and system for lithium ore microscopic image segmentation based on an improved Unet model. A new semantic segmentation architecture is developed based on the improved Unet model, simultaneously overcoming the three major bottlenecks of accuracy, efficiency, and robustness, thereby improving flotation recovery rates and providing core support for the efficient development of lithium resources. Specifically, based on the Unet model, this embodiment first designs a channel-space dual-path hybrid attention module to dynamically enhance pearly luster features and suppress background noise; secondly, it constructs a multi-level feature fusion architecture with cross-layer recombination, integrating high-resolution edge and deep semantic information to solve the under-segmentation problem caused by particle adhesion; finally, it uses depthwise separable convolution to improve efficiency and introduces dynamic snake convolution to establish curvature-constrained paths for accurate fitting of irregular boundaries, while integrating an adaptive area filtering algorithm (preset threshold <1μm2) to eliminate high-gloss noise and micro-fragment interference. Experimental verification shows that the improved Unet model can achieve pixel-level accurate segmentation of the lepidolite-feldspar-quartz system, laying the technological foundation for an intelligent dissociation assessment system that meets the real-time analysis needs of the global lithium mining industry.

[0085] The lithium ore microscopic images described in this embodiment of the invention refer to lithium ore morphology images obtained using an electron microscope. The image acquisition stage generally includes sample preparation and imaging to obtain lithium ore microscopic images with a preset magnification and preset resolution.

[0086] like Figure 1 As shown, the lithium ore microscopic image segmentation method based on the improved Unet model includes the following steps:

[0087] Step S1: Construct a lithium ore microscopic image dataset and acquire microscopic images of the lithium ore samples to be tested; preprocess all images to ensure that the input format and size of the images meet the predetermined segmentation requirements.

[0088] In this step, the image preprocessing includes image standardization to ensure that the input image format and size are suitable for subsequent processing steps. The microscopic image here refers to an image of the lithium ore sample magnified 200 times or more, typically acquired using an electron microscope or similar device. The preferred image resolution is 4608×3456 or higher.

[0089] Step S2: Pixel-level annotation is performed on the preprocessed microscopic image dataset to generate corresponding mineral category mask images as training ground values. The training ground values ​​are divided into training set, validation set and test set, and data enhancement operations such as rotation, mirroring and brightness adjustment are used to expand the sample diversity and improve the model's generalization ability.

[0090] Step S3: Construct a framework for a microscopic image segmentation model based on the Unet algorithm.

[0091] In this step, the existing Unet algorithm is used when building the framework.

[0092] Step S4: Within the framework of the microscopic image segmentation model, the Unet algorithm is improved by constructing a cascaded structure of depthwise convolution and pointwise convolution in the downsampling path, embedding an anti-adhesion dynamic serpentine convolution module in the skip connection part, introducing a channel-space dual-path adaptive attention mechanism module in the skip connection part, and constructing a multi-scale feature aggregation module in the upsampling path.

[0093] In this step, a cascaded structure of depthwise convolution and pointwise convolution is constructed in the downsampling path, based on the Unet backbone feature network, to reduce the number of parameters in standard convolution and achieve spatial filtering and channel dimensionality reduction. Considering the real-time deployment in industrial scenarios, the original Unet model has a large number of parameters, which is difficult to meet the sub-second processing requirements of high-resolution electron microscope images in mineral processing sites. Therefore, it is necessary to optimize computational efficiency to achieve high-throughput analysis in industrial environments.

[0094] Specifically, by using depthwise separable convolution, the standard convolution operation is decoupled into two independent steps: depthwise convolution and pointwise convolution, significantly reducing the number of model parameters. Depthwise convolution performs spatial filtering independently on each input channel, while pointwise convolution (i.e., 1×1 convolution) is responsible for dimensionality reduction of the output channels of the depthwise convolution. This separation strategy avoids the large number of parameters generated by standard convolution simultaneously processing spatial and channel dimensions, thus achieving efficient computation and storage. The computational cost of the standard convolution operation is reduced to FLOPs. std1 The calculation formula is as follows:

[0095] FLOPs std1 =K 2 ×C in ×C out ×H×W (1)

[0096] The computational cost (FLOPs) of depthwise separable convolution decoupling std2 The calculation formula is as follows:

[0097] FLOPs std2 =(K 2 ×C in ×H×W)+(C in ×C out ×H×W) (2)

[0098] The computational cost ratio after decoupling versus before decoupling is as follows:

[0099]

[0100] In equations (1)-(3), K represents the height or width of the convolution kernel, and C in Indicates the number of input channels, C out H represents the number of output channels, H represents the height of the input image, and W represents the width of the input image.

[0101] The reduction in the number of parameters can be seen from the computational cost ratio. In a preferred embodiment, the number of parameters in standard convolution is reduced by 78% through a cascaded structure, and channel dimensionality reduction is achieved through 1×1 convolution.

[0102] The embedded anti-adhesion dynamic serpentine convolution module in the skip connection section is designed to achieve accurate modeling of complex geometries. The rigid structure of traditional convolution kernels struggles to adapt to the meandering boundary features of lepidolite sheet-like cleavage surfaces and quartz serrated contours, leading to the loss of key structural information in areas of abrupt changes in particle morphology (such as cleavage angles and curvature abrupt changes), severely restricting the quantitative analysis of mineral morphology. Therefore, this embodiment employs dynamic serpentine convolution to accurately fit irregular boundaries, addressing the inaccurate segmentation problem caused by complex geometries. Dynamic serpentine convolution, through its deformable convolution kernel structure, dynamically adjusts the sampling point position based on the feature map content, enabling it to flexibly fit meandering, discontinuous, or highly curved contour trajectories, making it particularly suitable for extracting mineral boundary features with significant geometric heterogeneity. During training, this module learns the offset in an end-to-end manner, achieving adaptive perception and enhancement of local structural details, thereby effectively preserving the structural integrity of areas of abrupt morphological changes. By using dynamic serpentine convolution to adapt to the meandering boundary features of lepidolite sheet-like cleavage surfaces and quartz serrated contours, key structural information of regions with abrupt changes in particle morphology (such as cleavage angles and curvature abrupt changes) is preserved, and irregular boundaries are accurately fitted.

[0103] The introduction of a channel-spatial dual-path adaptive attention mechanism module in the skip connection part is due to the spectral characteristics of the ore composition, including the pearly luster caused by the regular shape of the ore. The strong specular reflection caused by the pearly luster interferes with the channel attention mechanism, resulting in misidentification of bright artifacts. Furthermore, the low-contrast environment in the shadow area weakens the texture discrimination between feldspar and mica. Therefore, the channel-spatial dual-path adaptive attention mechanism module is designed to mitigate this influence. The channel-spatial dual-path adaptive attention mechanism module includes a channel attention branch and a spatial attention branch. Specifically, the channel-spatial dual-path adaptive attention mechanism in the module includes two levels: the first level refers to the adaptive optimization of the number of channels in the channel attention branch; the second level refers to the feature extraction and fusion of the input feature map by the channel attention branch and the spatial attention branch. In the second level, the extraction of the input feature map by the channel attention branch is based on the adaptively optimized number of channels in the first level.

[0104] At the first level, for the channel attention branch, this embodiment abandons the traditional design of a fixed compression ratio (e.g., ratio = 16) and introduces a learnable logarithmic compression ratio parameter (log ratio This allows the network to adaptively allocate appropriate channel compression intensities to different layers. The logarithmic compression ratio parameter is dynamically optimized during the training of the channel attention branch, thereby further dynamically optimizing the number of channels. This enables the network to adaptively learn the optimal channel compression intensities based on the characteristics of feature maps at different levels, thus allowing for more flexible focus on key feature channels. Preferably, the standard 1×1 convolutional layers in the channel attention branch can also be replaced with depthwise separable convolutions to further reduce the number of parameters.

[0105] The formula for dynamically optimizing the number of channels during training is as follows:

[0106]

[0107] In equations (4)-(5), exp(log ratio The value represents the proposed dynamic compression ratio learned by the channel attention branch. A larger value indicates that the model tends to perform stronger channel compression. ratio This indicates the preset minimum compression ratio lower limit, max() indicates taking the maximum of the two values, and current... ratio Indicates the final effective compression ratio, in channels Indicates the number of input channels, reduced channels This represents the number of channels obtained after theoretical compression based on the effective actual compression ratio, and s represents the lower limit of the number of channels.

[0108] At the second level, the channel attention branch and the spatial attention branch extract features from the input feature map X respectively, and finally merge them into a comprehensive attention weight.

[0109] In the channel attention branch, the input feature map X first undergoes average pooling (AvgPool) and max pooling (MaxPool) operations, as shown in the following formulas:

[0110] F avg =AvgPool(X) (6)

[0111] F max =MaxPool(X) (7)

[0112] In equations (6)-(7), F avg F represents the average pooling result. max The expression represents the result of max pooling, AvgPool() represents average pooling, MaxPool() represents max pooling, and X represents the input feature map.

[0113] Secondly, using the learnable fusion weight parameter α, and constraining the range of the learnable parameter α within [0,1] by the Sigmoid function σ, the fusion weight ω is obtained, as shown in the following formula:

[0114] ω=σ(α) (8)

[0115] The average pooling result and the max pooling result are weighted and fused using a fusion weight ω, as shown in the following formula:

[0116] F fused =ω·F avg +(1-ω)·F max (9)

[0117] In equations (8)-(9), ω represents the fusion weight, F fused This represents the features after weighted fusion.

[0118] Then, for the F obtained above fused Then, feature transformation is performed, and a channel attention map F is generated through a lightweight multilayer perceptron (MLP). c(X) :

[0119] F MLP1 =ReLU(W1·F fused +b1) (10)

[0120] F MLP2 =W2·F MLP1 +b2 (11)

[0121] F c(X) =σ(F MLP2 (12)

[0122] In equations (10)-(12), W1 represents the weight matrix of the first fully connected layer, b1 represents the bias vector of the first fully connected layer, ReLU represents the ReLU activation function, W2 represents the weight matrix of the second fully connected layer, b2 represents the bias vector of the second fully connected layer, and F MLP1 F represents the output obtained after passing through the first fully connected layer. MLP2 This represents the output obtained after passing through the second fully connected layer.

[0123] This design allows the model to adaptively adjust the relative importance of the two pooling methods based on the input features, dynamically balancing the contributions of average pooling and max pooling, more flexibly integrating spatial context information, and improving feature extraction capabilities.

[0124] The spatial attention branch generates a spatial attention map F through efficient fusion of spatial dimensional features. s(X) This significantly enhances the module's positioning capabilities.

[0125] Finally, the two attention maps are fused by element-wise multiplication to obtain a comprehensive attention weight map. This weight map is then applied to the original input feature X to obtain the output result, as shown in the following formula:

[0126]

[0127] In equation (13), F c(X) Represents the channel attention map, F s(X) This represents the spatial attention map, where σ represents the Sigmoid function, used to constrain the parameters within [0,1]; F output This represents the characteristics of the final output. This represents an element-wise multiplication operation. The process first merges the two attention maps to generate a comprehensive weight coefficient matrix, and then uses the weight coefficient matrix to rescale the input feature X to highlight information-rich features and suppress unimportant features.

[0128] The construction of a multi-scale feature aggregation module in the upsampling path, using convolutional kernels with different dilation rates, aims to address the end-to-end separation problem of density-cohesive particles during lithium mineral image segmentation. Existing feature fusion mechanisms are inadequate, and standard skip connections cannot decouple mixed boundary signals. To address the insufficient feature fusion in traditional Unet skip connections, this embodiment employs multi-scale effective feature aggregation, implemented by three core components: a multi-scale feature extraction layer, a dual-path attention mechanism layer, and a residual feature reconstruction layer.

[0129] The multi-scale feature extraction layer employs multiple parallel dilated convolutional modules with different dilation rates to extract multi-scale features with different effective receptive fields, mathematically expressed as:

[0130]

[0131] In equation (14), F in The input feature map of the multi-scale feature aggregation module is represented by D = {d1, d2, ..., d...}. k} represents a preset set of void ratios. This indicates a splicing operation along the channel dimension, C d F represents a convolution operation with a dilation rate of d. ms This represents the multi-scale fusion feature.

[0132] The dual-path attention mechanism layer extracts features from convolutions at different scales and uses channel attention branches (output channel attention map F) c(X) ) and spatial attention branch (output spatial attention graph F) s(X)By combining the channel attention map and the spatial attention map through element-wise multiplication, a comprehensive importance weight map is obtained; and this comprehensive importance weight map is used to modulate the multi-scale fusion feature F. ms .

[0133] The residual feature reconstruction layer corrects structural distortion through boundary reconstruction and extracts residual features T. The artificial smoothing effect of the upsampling process and deconvolution artifacts together cause stepped, jagged distortion at the edges of mica flakes. This, combined with geometric mismatches caused by feature misalignment fusion, disrupts the topological continuity and morphological integrity of the mineral boundaries. Residual feature reconstruction ensures effective gradient propagation while enhancing feature representation capabilities.

[0134] Modulate multi-scale fusion features F ms The obtained features are then integrated and reduced in dimensionality through 1×1 convolution, and then added to the residual features T to finally produce the enhanced output features; the formula is expressed as follows:

[0135]

[0136] In equation (15), F c(X) Represents the channel attention map, F s(X) This represents a spatial attention map, where T represents the residual feature. Represents element-wise multiplication, C 1×1 This represents a 1×1 convolution operation, F out This represents the final output feature of the multi-scale feature aggregation module.

[0137] Step S5: Train the improved microscopic image segmentation model using the training dataset to obtain a mature model.

[0138] Step S6: Input the microscopic image of the lithium ore sample to be tested into the mature model and output the preliminary segmentation image.

[0139] Step S7: Perform adaptive area filtering on the initially segmented image and output the final image segmentation result.

[0140] In this step, deep semantic filtering leads to the loss of semantic information from micron-level debris, while shallow detail preservation causes false detections of specular noise and dust impurities. Adaptive area segmentation filtering is introduced to filter out small areas such as impurities, thus distinguishing between valid debris and imaging artifacts. The adaptive area filtering module employs area threshold filtering technology to remove dust noise with fewer than a preset threshold in the primary segmentation image, outputting the final lithium mineral segmentation image. The preset threshold is preferably 10.

[0141] The specific steps are as follows:

[0142] Step S71: Perform connected component analysis to identify all connected components R in the segmentation mask. u That is, an independent region composed of adjacent pixels;

[0143] Step S72, set a minimum area threshold A min The area refers to the number of pixels within a connected region.

[0144] Step S73, calculate R for each connected region u Area A u If A u >A min Then retain the region R. u If A u ≤A min Then filter the region R u .

[0145] The method may further include:

[0146] Step S8: The optimized mask is superimposed and fused with the original image using the bitwise_and bitwise operation of the OpenCV library, preserving the original texture features while highlighting the mineral phase distribution.

[0147] Based on the same idea, this invention also provides a lithium ore microscopic image segmentation system based on an improved Unet model. The system includes: an image acquisition module, an image preprocessing module, an annotation module, a model framework construction module, an improved Unet algorithm module, a model training module, a preliminary segmentation module, an area filtering module, and a final result output module; wherein...

[0148] The image acquisition module is used to construct a lithium ore microscopic image dataset and acquire microscopic images of the lithium ore sample to be tested.

[0149] The image preprocessing module is used to preprocess all images to ensure that the input format and size of the images meet the predetermined segmentation requirements.

[0150] The annotation module is used to perform pixel-level annotation on the preprocessed microscopic image dataset, generate corresponding mineral category mask images as training ground values, divide the training ground values ​​into training set, validation set and test set, and expand sample diversity through data augmentation operations;

[0151] The model framework construction module is used to construct a framework for a microscopic image segmentation model based on the Unet algorithm;

[0152] The Unet algorithm improvement module is used to improve the Unet algorithm within the framework of the microscopic image segmentation model. It constructs a cascaded structure of depthwise convolution and pointwise convolution in the downsampling path, embeds an anti-adhesion dynamic serpentine convolution module in the skip connection part, introduces a channel-space dual-path adaptive attention mechanism module in the skip connection part, and constructs a multi-scale feature aggregation module in the upsampling path.

[0153] The model training module is used to train the improved microscopic image segmentation model using the training dataset to obtain a mature model;

[0154] The preliminary segmentation module is used to input the microscopic image of the lithium ore sample to be tested into the mature model and output the preliminary segmentation image;

[0155] The area filtering module is used to perform adaptive area filtering on the preliminary segmented image to obtain the final image segmentation result;

[0156] The final result output module is used to output the final image segmentation result.

[0157] In this embodiment, each module is implemented using a processor, with additional memory added as needed for storage. The processor can be, but is not limited to, a microprocessor (MPU), a central processing unit (CPU), a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), other programmable logic devices, discrete gates, transistor logic devices, discrete hardware components, etc. The memory can include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory can also be at least one storage device located remotely from the aforementioned processor.

[0158] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0159] It should also be noted that the lithium ore micro-image segmentation system based on the improved Unet model described in this embodiment corresponds to the lithium ore micro-image segmentation method based on the improved Unet model. The description and limitations of the method also apply to the system, and will not be repeated here.

[0160] The lithium ore micro-image segmentation method and system based on the improved Unet model described in this embodiment of the invention are used to segment the micro-image of a lithium ore sample. The lithium ore sample includes three types of minerals: mica, quartz, and feldspar, and exists in a powder state.

[0161] First, sample preparation and image acquisition are performed. The ore powder sample is placed in an ethanol or isopropanol dispersant and agitated using an ultrasonic processor to achieve uniform particle dispersion. Droplets of the dispersion are then pipetted onto the electron microscope stage, and the solvent is removed by natural evaporation or low-temperature vacuum drying, ensuring no agglomeration occurs during the drying process, ultimately obtaining a uniformly surfaced sample. Representative, clear mineral images are acquired using an electron microscope at a selected resolution (typically 4608 × 3456 pixels). Three typical images are shown below. Figure 2 As shown.

[0162] Secondly, a processing platform was built based on the Python 3.9 programming environment and the PyTorch deep learning framework, and necessary computer vision libraries were installed; pixel-level annotations were performed on the acquired images, such as... Figure 3 As shown, corresponding mineral category mask images are generated as ground truth for training. Data preprocessing and augmentation are then performed, and the labeled dataset is divided into training, validation, and test sets in a 7:2:1 ratio. Data augmentation operations such as rotation, mirroring, and brightness adjustment are used to expand sample diversity and improve the model's generalization ability. Figure 3 and Figure 4 Different colors represent different minerals.

[0163] Then, the improved Unet segmentation model was trained. The model integrates a channel-space dual-path attention module, a dynamic serpentine convolutional boundary optimization unit, and a multi-scale feature aggregation module. The training epochs were set to 100, and key metrics such as mean intersection-over-union (mIoU) and mean pixel accuracy (mPA) were dynamically monitored. The optimal model parameter file was saved for subsequent inference. The improved model achieved an overall mIoU improvement of nearly 3% compared to the original Unet model, while reducing the number of parameters by 40%. Its mIoU reached 77.31%, with only 14.81M parameters (compared to the original Unet model's mIoU of 74.21% and 24.69M parameters).

[0164] Next, inference and post-processing optimization are performed. The trained model parameters are loaded to perform segmentation inference on the unlabeled electron microscope image. Then, an adaptive area filtering algorithm is applied (the threshold is typically set to 1 μm2 equivalent pixel area) to eliminate specular noise, dust impurities, and semantically unclear micro-fragments. The optimized mask is superimposed and fused with the original image through bitwise_and operations in the OpenCV library, preserving the original texture features while highlighting the mineral phase distribution.

[0165] Finally, a fused image is generated to visually demonstrate the segmentation effect. For example... Figure 4 The image shown is the improved prediction output image of Unet, where the yellow area represents mica, the green area represents quartz, and the red area represents feldspar. Figure 4 It is evident that sub-second image analysis was achieved in an industrial environment, meeting the real-time requirements of the mineral processing site.

[0166] As can be seen from the above technical solutions, the lithium ore micro-image segmentation method and system based on the improved Unet model provided in this invention have the following beneficial effects: First, an adaptive feature extraction mechanism based on mineral physical properties. Breaking through the geometric rigidity constraints of traditional convolution kernels, it innovatively uses the cleavage angle parameters of lithium mica sheets and the curvature features of quartz serrated boundaries as prior physical knowledge to guide the deformable kernel offset learning of Dynamic Snake Convolution. This mechanism dynamically corrects the convolution path through the cleavage surface orientation detection unit, achieving pixel-level fitting modeling of meandering boundaries and solving the problem of structural information loss in morphologically abrupt regions. Second, a robust architecture for multimodal interference. Addressing the dual interference of pearly luster reflection and shadow texture confusion: a channel-space dual-path attention mechanism is constructed to suppress high-brightness artifacts in the channel dimension (reflection noise blocking the path) and enhance discriminative features in low-light areas in the spatial dimension (shadow compensation path); a multi-scale feature aggregation module is designed to improve the separation capability of adherent particles and the accuracy of multi-scale target recognition, breaking through the scale adaptability limitations of standard U-Net. Third, an industrial-grade lightweight topology reconstruction system. To achieve synergistic optimization of sub-second processing and high-precision reconstruction: depthwise separable convolution is used to replace conventional convolution operations, compressing the number of parameters to less than 60% of traditional models while maintaining boundary modeling capabilities; an adaptive area filtering operator is integrated, dynamically balancing micro-fragment retention and noise filtering based on prior knowledge of mineral particle size distribution. These three technical layers form a perception-decision-optimization closed loop, realizing the dynamic co-evolution of mineral physical properties and deep learning models, providing a new approach to autonomous evolution for intelligent mineral processing.

[0167] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed, and is not intended to limit the scope of the claimed invention, but merely to illustrate preferred embodiments of the invention. Those skilled in the art should understand that the scope of the invention is not limited to the specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

Claims

1. A method for segmenting lithium ore microscopic images based on an improved Unet model, characterized in that, The method includes the following steps: Step S1: Construct a lithium ore microscopic image dataset and acquire microscopic images of the lithium ore samples to be tested; preprocess all images to ensure that the input format and size of the images meet the predetermined segmentation requirements. Step S2: Pixel-level annotation is performed on the preprocessed microscopic image dataset to generate corresponding mineral category mask images, which are used as training ground values. The training ground values ​​are divided into training set, validation set and test set, and the sample diversity is expanded through data augmentation operations; Step S3: Construct a framework for a microscopic image segmentation model based on the Unet algorithm; Step S4: Within the framework of the microscopic image segmentation model, the Unet algorithm is improved by constructing a cascaded structure of depthwise convolution and pointwise convolution in the downsampling path, embedding an anti-adhesion dynamic serpentine convolution module in the skip connection part, introducing a channel-space dual-path adaptive attention mechanism module in the skip connection part, and constructing a multi-scale feature aggregation module in the upsampling path. The channel-space dual-path adaptive attention mechanism module includes channel attention branches and spatial attention branches. The channel-space dual-path adaptive attention mechanism in the module consists of two levels: The first level refers to the adaptive optimization of the number of channels in the channel attention branch. For the channel attention branch, a learnable log compression ratio parameter is introduced. The log compression ratio parameter is dynamically optimized during the training process of the channel attention branch, thereby further dynamically optimizing the number of channels. This enables the network to adaptively learn the optimal channel compression intensity according to the characteristics of feature maps at different levels, thus focusing more flexibly on key feature channels. train The formula for dynamically optimizing the number of channels during the process is as follows: (4) (5) In equations (4)-(5), This represents the proposed dynamic compression ratio learned by the channel attention branch; This indicates the preset minimum compression ratio lower limit. This means taking the maximum of the two values. This indicates the final effective compression ratio. Indicates the number of input channels. This represents the number of channels obtained after theoretical compression based on the effective actual compression ratio, and s represents the lower limit of the number of channels; The second level refers to the feature extraction and fusion of the input feature map by the channel attention branch and the spatial attention branch; and, in the second level, the extraction of the input feature map by the channel attention branch is based on the adaptively optimized number of channels in the first level. At the second level, the channel attention branch and the spatial attention branch extract features from the input feature map X respectively, and finally fuse them into a comprehensive attention weight; specifically including: In the channel attention branch, the input feature map X first undergoes average pooling and max pooling operations, as shown in the following formulas: (6) (7) In equations (6)-(7), This represents the average pooling result. This represents the result of max pooling. This represents average pooling, MaxPool() represents max pooling, and X represents the input feature map. Secondly, learnable fusion weight parameters are used. And through the Sigmoid function Constrained learnable parameters The range is within [0,1], and the fusion weights are obtained. The formula is as follows: (8) Employing fusion weights The average pooling result and the max pooling result obtained separately are weighted and fused together, as shown in the following formula: (9) In equations (8)-(9), Indicates the fusion weight. This represents the features after weighted fusion; Then, the above results Then, feature transformation is performed, and channel attention maps are generated through a multilayer perceptron. The formula is as follows: (10) (11) (12) In equations (10)-(12), This represents the weight matrix of the first fully connected layer. Represents the bias vector of the first fully connected layer, and ReLU represents the ReLU activation function. This represents the weight matrix of the second fully connected layer. This represents the bias vector of the second fully connected layer. This represents the output obtained after passing through the first fully connected layer. This represents the output obtained after passing through the second fully connected layer; The spatial attention branch generates a spatial attention graph by fusing spatial dimensional features. ; Finally, the two attention maps are fused by element-wise multiplication to obtain a comprehensive attention weight map. This comprehensive attention weight map is then applied to the original input feature X to obtain the output result, as shown in the following formula: (13) In equation (13), This represents a channel attention map. Represents a spatial attention map; This represents the Sigmoid function, used to constrain the parameters within [0,1]. This represents the characteristics of the final output. This represents an element-wise multiplication operation; Furthermore, a multi-scale feature aggregation module is constructed within the upsampling path, using convolutional kernels with different dilation rates. This module comprises three core components: a multi-scale feature extraction layer, a dual-path attention mechanism layer, and a residual feature reconstruction layer. The multi-scale feature extraction layer employs multiple parallel dilated convolutional modules with different dilation rates to extract multi-scale features with different effective receptive fields, mathematically expressed as: (14) In equation (14), The input feature map of the multi-scale feature aggregation module is represented by D={d1,d2,...,d...}. k } represents a preset set of void ratios. This indicates a splicing operation along the channel dimension. This represents a convolution operation with a dilation rate of d. Indicates multi-scale fusion features; The dual-path attention mechanism layer combines convolutional feature extraction at different scales with channel attention and spatial attention branches. It then fuses the channel and spatial attention maps through element-wise multiplication to obtain a comprehensive importance weight map. This comprehensive importance weight map is used to modulate the multi-scale fused features. ; The residual feature reconstruction layer corrects structural distortion through boundary reconstruction and extracts residual features T. Modulation multi-scale fusion features The obtained features are then integrated and reduced in dimensionality through 1×1 convolution, and then added to the residual features T to finally produce the enhanced output features; the formula is expressed as follows: T(15) In equation (15), This represents a channel attention map. This represents a spatial attention map, where T represents the residual feature. Represents element-wise multiplication, C 1×1 This represents a 1×1 convolution operation. This represents the final output feature of the multi-scale feature aggregation module; Step S5: Train the improved microscopic image segmentation model using the training set to obtain a mature model; Step S6: Input the microscopic image of the lithium ore sample to be tested into the mature model and output the preliminary segmentation image; Step S7: Perform adaptive area filtering on the initially segmented image and output the final image segmentation result.

2. The method according to claim 1, characterized in that, In step S4, a cascaded structure of depthwise convolution and pointwise convolution is constructed in the downsampling path. The standard convolution operation is decoupled into depthwise convolution and pointwise convolution through depthwise separable convolution. The depthwise convolution performs spatial filtering independently on each input channel, and the pointwise convolution is responsible for reducing the dimensionality of the output channel of the depthwise convolution.

3. The method according to claim 1, characterized in that, In step S4, after embedding an anti-adhesion dynamic serpentine convolution module in the skip connection part, the dynamic serpentine convolution dynamically adjusts the sampling point position according to the feature map content through a deformable convolution kernel structure, so that the sampling point position can flexibly fit the meandering, discontinuous or highly curved contour trajectory to adapt to the meandering boundary features of the lepidolite sheet cleavage surface and the quartz sawtooth contour, retain the key structural information of the particle morphology change region, and accurately fit the irregular boundary.

4. The method according to claim 1, characterized in that, Step S7 involves adaptive area filtering of the initially segmented image, including: Step S71: Perform connected component analysis to identify all connected components in the segmentation mask. That is, an independent region composed of adjacent pixels; Step S72: Set a minimum area threshold. The area refers to the number of pixels within a connected region. Step S73, calculate each connected component area ;like > Then retain that area. ;like ≤ Then filter the region. .

5. A lithium ore microscopic image segmentation system based on an improved Unet model, characterized in that, The system includes: an image acquisition module, an image preprocessing module, an annotation module, a model framework construction module, a Unet algorithm improvement module, a model training module, a preliminary segmentation module, an area filtering module, and a final result output module; wherein, The image acquisition module is used to construct a lithium ore microscopic image dataset and acquire microscopic images of the lithium ore sample to be tested. The image preprocessing module is used to preprocess all images to ensure that the input format and size of the images meet the predetermined segmentation requirements. The annotation module is used to perform pixel-level annotation on the preprocessed microscopic image dataset, generate corresponding mineral category mask images as training ground values, divide the training ground values ​​into training set, validation set and test set, and expand sample diversity through data augmentation operations; The model framework construction module is used to construct a framework for a microscopic image segmentation model based on the Unet algorithm; The Unet algorithm improvement module is used to improve the Unet algorithm within the framework of the microscopic image segmentation model. It constructs a cascaded structure of depthwise convolution and pointwise convolution in the downsampling path, embeds an anti-adhesion dynamic serpentine convolution module in the skip connection part, introduces a channel-space dual-path adaptive attention mechanism module in the skip connection part, and constructs a multi-scale feature aggregation module in the upsampling path. The channel-space dual-path adaptive attention mechanism module includes channel attention branches and spatial attention branches. The channel-space dual-path adaptive attention mechanism in the module includes two levels: The first level refers to the adaptive optimization of the number of channels in the channel attention branch. For the channel attention branch, a learnable logarithmic compression ratio parameter is introduced. This logarithmic compression ratio parameter is dynamically optimized during the training process of the channel attention branch, thereby further dynamically optimizing the number of channels. This allows the network to adaptively learn the optimal channel compression strength based on the characteristics of feature maps at different levels, thus focusing more flexibly on key feature channels. The formula for dynamically optimizing the number of channels during training is as follows: (4) (5) In equations (4)-(5), This represents the proposed dynamic compression ratio learned by the channel attention branch; This indicates the preset minimum compression ratio lower limit. This means taking the maximum of the two values. This indicates the final effective compression ratio. Indicates the number of input channels. This represents the number of channels obtained after theoretical compression based on the effective actual compression ratio, and s represents the lower limit of the number of channels; The second level refers to the feature extraction and fusion of the input feature map by the channel attention branch and the spatial attention branch; moreover, the extraction of the input feature map by the channel attention branch in the second level is based on the adaptively optimized number of channels in the first level; in the second level, the channel attention branch and the spatial attention branch respectively extract features from the input feature map X, and finally fuse them into a comprehensive attention weight; specifically including: In the channel attention branch, the input feature map X first undergoes average pooling and max pooling operations, as shown in the following formulas: (6) (7) In equations (6)-(7), This represents the average pooling result. This represents the result of max pooling. This represents average pooling, MaxPool() represents max pooling, and X represents the input feature map. Secondly, learnable fusion weight parameters are used. And through the Sigmoid function Constrained learnable parameters The range is within [0,1], and the fusion weights are obtained. The formula is as follows: (8) Employing fusion weights The average pooling result and the max pooling result obtained separately are weighted and fused together, as shown in the following formula: (9) In equations (8)-(9), Indicates the fusion weight. This represents the features after weighted fusion; Then, the above results Then, feature transformation is performed, and channel attention maps are generated through a multilayer perceptron. The formula is as follows: (10) (11) (12) In equations (10)-(12), This represents the weight matrix of the first fully connected layer. Represents the bias vector of the first fully connected layer, and ReLU represents the ReLU activation function. This represents the weight matrix of the second fully connected layer. This represents the bias vector of the second fully connected layer. This represents the output obtained after passing through the first fully connected layer. This represents the output obtained after passing through the second fully connected layer; The spatial attention branch generates a spatial attention graph by fusing spatial dimensional features. ; Finally, the two attention maps are fused by element-wise multiplication to obtain a comprehensive attention weight map. This comprehensive attention weight map is then applied to the original input feature X to obtain the output result, as shown in the following formula: (13) In equation (13), This represents a channel attention map. Represents a spatial attention map; This represents the Sigmoid function, used to constrain the parameters within [0,1]. This represents the characteristics of the final output. This represents an element-wise multiplication operation; Furthermore, a multi-scale feature aggregation module is constructed within the upsampling path, using convolutional kernels with different dilation rates. This module comprises three core components: a multi-scale feature extraction layer, a dual-path attention mechanism layer, and a residual feature reconstruction layer. The multi-scale feature extraction layer employs multiple parallel dilated convolutional modules with different dilation rates to extract multi-scale features with different effective receptive fields, mathematically expressed as: (14) In equation (14), The input feature map of the multi-scale feature aggregation module is represented by D={d1,d2,...,d...}. k } represents a preset set of void ratios. This indicates a splicing operation along the channel dimension. This represents a convolution operation with a dilation rate of d. Indicates multi-scale fusion features; The dual-path attention mechanism layer combines convolutional feature extraction at different scales with channel attention and spatial attention branches. It then fuses the channel and spatial attention maps through element-wise multiplication to obtain a comprehensive importance weight map. This comprehensive importance weight map is used to modulate the multi-scale fused features. ; The residual feature reconstruction layer corrects structural distortion through boundary reconstruction and extracts residual features T. Modulation multi-scale fusion features The obtained features are then integrated and reduced in dimensionality through 1×1 convolution, and then added to the residual features T to finally produce the enhanced output features; the formula is expressed as follows: T(15) In equation (15), This represents a channel attention map. This represents a spatial attention map, where T represents the residual feature. Represents element-wise multiplication, C 1×1 This represents a 1×1 convolution operation. This represents the final output feature of the multi-scale feature aggregation module; The model training module is used to train the improved microscopic image segmentation model using the training set to obtain a mature model; The preliminary segmentation module is used to input the microscopic image of the lithium ore sample to be tested into the mature model and output the preliminary segmentation image; The area filtering module is used to perform adaptive area filtering on the preliminary segmented image to obtain the final image segmentation result; The final result output module is used to output the final image segmentation result.