Lithium battery material intelligent quality inspection method based on scanning electron microscope image
By constructing a visual segmentation model and combining multiple feature extraction modules, the electron microscope images of lithium battery materials are automatically segmented and particle size calculations are solved, and the existing quality inspection methods are inefficient and insufficient accuracy are achieved, and efficient and accurate quality inspection results are achieved.
Patent Information
- Application Number
- CN202411981774.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-30
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When facing the growing production demand and increasing quality standards, existing lithium battery material quality inspection methods have problems such as low efficiency, insufficient accuracy and low automation, which are difficult to meet the requirements of mass production for quality inspection efficiency and accuracy.
Using an intelligent quality inspection method based on scanning electron microscope images, the electron microscope images of lithium battery materials are automatically divided and masked by constructing a visual segmentation model, and combined with an image encoder, prompt encoder, mask decoder, edge feature extraction module and multi-particle denoising feature fusion module, efficient image segmentation and particle size calculation are achieved.
It greatly shortens the quality inspection time and can process a large amount of image data in a short time, improves the efficiency and accuracy of quality inspection, reduces the uncertainty and error caused by manual operations, and improves the stability and reliability of the quality inspection process.
Smart Images

Figure CN120070313A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of quality inspection of lithium battery materials, and particularly to an intelligent quality inspection method for lithium battery materials based on scanning electron microscope images. Background Art
[0002] As an important energy storage device, lithium batteries have been widely used in many fields such as electric vehicles and mobile electronic devices. The performance and safety of lithium batteries directly depend on the quality of their raw materials and intermediate products. Among them, the particle size distribution and microstructure of the materials are one of the key factors affecting the battery performance.
[0003] In the manufacturing process of lithium batteries, it is crucial to precisely control the particle size of raw materials and intermediate products. A suitable particle size distribution can significantly affect performance indicators such as the energy density, charge-discharge efficiency, and cycle life of the battery. For example, smaller particle sizes can provide a larger specific surface area, which is beneficial to the diffusion and insertion of lithium ions, thereby improving the charge-discharge performance of the battery; while a uniform particle size distribution helps to increase the packing density of the battery material, and thus enhances the energy density of the battery. At the same time, the microstructure of the material, such as the integrity of the crystal structure and the morphology of the particles, also has an important impact on the performance and safety of the battery. For example, crystal structure defects may lead to local stress concentration, which in turn affects the cycle stability of the battery and even causes safety problems.
[0004] At present, the scanning electron microscope (SEM) is a commonly used tool for analyzing the microstructure of lithium battery materials. With the help of SEM, high-resolution images of the materials can be obtained, so as to observe information such as the size, shape, and distribution of the particles. However, for the analysis of SEM images, traditional methods mainly rely on manual annotation and semi-automatic software. The manual annotation method is not only time-consuming and laborious, but also has limited accuracy due to the influence of human factors, and it is difficult to meet the requirements for quality inspection efficiency and accuracy in large-scale production. Although the semi-automatic software improves the efficiency to a certain extent, it usually requires cumbersome parameter settings and has high requirements for the particle distribution in the image. When dealing with complex SEM images of lithium battery materials, the effect is not satisfactory.
[0005] In summary, the existing quality inspection methods for lithium battery materials expose many limitations when facing the increasing production demands and continuously improving quality standards. There is an urgent need for an efficient, accurate, and highly automated quality inspection method to achieve rapid and precise analysis of the particle size distribution and microstructure of lithium battery materials, so as to effectively control the battery quality and promote the further development of the lithium battery industry. Summary of the Invention
[0006] An intelligent quality inspection method for lithium battery materials based on scanning electron microscope images proposed by the present invention is used to solve the problems mentioned in the above prior art.
[0007] To achieve the above object, the present invention adopts the following technical solutions: An intelligent quality inspection method for lithium battery materials based on scanning electron microscope images, comprising the following steps:
[0008] S1: Image acquisition: Using a scanning electron microscope to acquire electron microscope images of lithium battery materials, generating a picture file containing a scale bar, the picture file containing microscopic structure information of the lithium battery materials, and the microscopic structure showing an irregular granular distribution;
[0009] S2: Image segmentation and mask extraction: Constructing a visual segmentation model to automatically globally segment the picture file, and extracting mask information of each non-overlapping segmentation region, the mask information including pixel area, and the visual segmentation model includes:
[0010] An image encoder, whose backbone network is a ViT trained using MAE, for encoding information and extracting features from the picture file, the ViT performing image chunking on the input image, and the calculation method being x i = Flatten(Patch(I, P)), where i = 1...N, x i is the vector after flattening the i-th small block, I is the input image, P is the size of each patch, P takes a value of 16×16 pixels, and then adding a position encoding vector PosEmbed i to generate an input sequence with position information Finally, using a standard Transformer encoder to process the embedded vector sequence where l = 1...L, L is 12 layers, is the output of the l-th layer;
[0011] A prompt encoder, divided into two categories: sparse prompts and dense prompts. Sparse prompts use learnable position encodings to represent point prompts and box prompts, and use the text encoder of CLIP to represent any form of text prompts; dense prompts use the mask encoded by convolution added to the output of the image encoder as the final mask representation;
[0012] A mask decoder, used to decode and output the image encoding and prompt encoding, performing cross-attention on the image encoding and prompt encoding, and the calculation formula is where q Ai is the query vector of sequence A, k Bj is the key vector of sequence B, d k is the dimension of the key vector, taking a value of 64, and finally outputting a mask and related mask information through an MLP layer;
[0013] An edge feature extraction module GSEFE, including Sobel convolution and Gabor convolution, and the Gabor convolution passes through Extract texture information in different directions and scales in the image, where σ takes the value of 2.0, γ takes the value of 0.5, λ takes the value of 5.0, ψ takes the value of 0, (x, y) and (x′, g′) represent the original coordinates and rotated coordinates respectively, enhance the local features in the image, and the Sobel convolution passes through the horizontal operator and the vertical operator Combining the gradient information in the horizontal and vertical directions to obtain the edge intensity of the image, where I(i, j) is the pixel value at position (i, j) in the image, and K x (i, j) and K y (i, j) represent the Sobel operators in the horizontal and vertical directions respectively. The Sobel convolution kernel size is 3×3 pixels. The GSEFE module extraction network combines the Sobel convolution and the Gabor convolution. The extracted features pass through a feature enhancement network composed of global average pooling, 1×1 convolution, normalization, and the ReLU activation function;
[0014] The multi-granularity denoising feature fusion module MDFF decomposes the feature map output by each layer in the image encoder ViT using the Daubechies wavelet db4 into two layers, decomposing the feature map into low-frequency components and high-frequency components at multiple scales. Soft threshold processing is introduced in the high-frequency components, and the noise area is smoothed through a non-linear function while retaining key detail information such as edges and textures. After denoising, the feature map is reconstructed using the inverse wavelet transform, and then the wavelet denoising feature maps output by different layers are fused;
[0015] The method for extracting the mask information of non-overlapping segmentation regions includes:
[0016] Sort the segmented mask data according to their area sizes and remove the minimum and maximum values at the beginning and end by 10%-20%;
[0017] Perform a bounding box overlap judgment on any pair of remaining segmentation regions;
[0018] If the bounding boxes of two segmentation regions overlap, then by modifying the mask boolean values in the segmentation regions that overlap in area, remove the overlapping regions;
[0019] Perform a connectivity analysis on the mask information of the modified segmentation regions, and retain the largest connected region as the new segmentation mask;
[0020] Remove the segmentation regions with an area less than 10 pixels, perform an area sorting again, remove the minimum and maximum values by 10%-20% again, and perform an area sorting again;
[0021] S3: Particle size calculation: convert the mask area attribute into uint8 type, and multiply its pixel value by 255 to generate a binary image, use the contour detection algorithm to find the external contour in the binary image, calculate the minimum circumscribed circle for the detected contour, and the diameter of the circumscribed circle is the maximum particle size of the particle. The binary image is stored in the form of an array. When calculating the minimum circumscribed circle, the least squares fitting method based on geometric distance calculation is adopted;
[0022] S4: Quality inspection and evaluation: Take the average value of the maximum particle sizes of all mask blocks to obtain the average particle size of the material corresponding to the image file, compare the average particle size with the preset standard particle size, and obtain the overall size evaluation and quality evaluation of the material corresponding to the image file. At the same time, obtain the particle size distribution of all non-overlapping segmented areas based on the standard particle size. The preset standard interval has a small threshold of 1.7 microns and a large threshold of 2.2 microns. If the average particle size is between the two thresholds, the material corresponding to the electron microscope image is deemed qualified. If it is outside the two thresholds, it is deemed unqualified.
[0023] Furthermore, in the S2 image segmentation and mask extraction step, the data set used by the visual segmentation model in the training process is a labeled data set containing at least 1,000 electron microscope images of different types of lithium battery materials. The images in the data set are labeled by at least 3 professionals, and the annotation content includes the exact position of the particles, particle size range, and shape feature information. The stochastic gradient descent algorithm is used during training, and data enhancement technology is used to expand the data set to prevent model overfitting.
[0024] Furthermore, this method can also be applied to the quality inspection and analysis of lead-acid batteries, nickel-metal hydride battery materials, or ceramic materials and catalyst materials with similar microstructures. By properly adjusting and training the visual segmentation model, it can be adapted to the characteristics of different materials and expand its application scope. According to the characteristics of different materials, the parameters of the model can be adjusted, the corresponding data sets can be re-collected and labeled, and the model can be optimized by transfer learning or retraining.
[0025] Furthermore, in the S2 image segmentation and mask extraction step, the parameters of the Sobel convolution and Gabor convolution in the GSEFE module are adaptively adjusted according to the characteristics of the electron microscope image of the lithium battery material, as follows:
[0026] For Sobel convolution, when the edges of particles in the image are blurred, the convolution kernel size is adjusted to 5×5 pixels to enhance the edge detection capability. When the edges are clear, the convolution kernel size is maintained at 3×3 pixels to reduce the amount of calculation. At the same time, the weights of the horizontal and vertical operators are adjusted according to the direction of the particle texture. If the horizontal texture is obvious, the weight of the horizontal operator is increased to 1.5-2.0 times. Conversely, if the vertical texture is obvious, the weight of the vertical operator is increased to 1.5-2.0 times.
[0027] For Gabor convolution, when the particle texture in the image is irregular, the range of the added value is increased to 6.0 - 8.0; when the texture is simple, the range of the value is reduced to 4.0 - 6.0; at the same time, according to the particle shape characteristics, the value of is adjusted. If the particles are slender, the convolution kernel is more inclined to detect the texture in the long axis direction; if the particles are close to circular, it is maintained at about 0.5. And, according to the image noise level, the value of is dynamically adjusted. When the noise is large, it is increased to 2.5 - 3.0 to enhance the filtering effect; when the noise is small, it is maintained at about 2.0; the direction of Gabor convolution is adjusted according to the distribution of the particle texture direction. If the texture direction is relatively single, the number of directions is reduced to 3 - 4 to concentrate on detecting the main texture direction; if the texture direction is complex and diverse, the number of directions is increased to 6 - 8 to comprehensively capture the texture information.
[0028] Furthermore, in the S2 image segmentation and mask extraction step, the method for determining the threshold of the soft threshold processing in the MDFF module is based on the estimation of the image noise level, and the specific steps are as follows:
[0029] First, the image is divided into multiple non - overlapping sub - regions, and the size of the sub - regions is from 8×8 pixels to 16×16 pixels. For each sub - region, the variance and gradient amplitude of its pixel values are calculated.
[0030] Then, according to the distribution of the variance and gradient amplitude, the noise level estimation value is determined. If the distribution of the variance and gradient amplitude is relatively concentrated and the values are small, it indicates that the noise level is low. At this time, a smaller threshold range is taken, the low - frequency component threshold is 0.2 - 0.3, and the high - frequency component threshold is 0.05 - 0.1; if the distribution of the variance and gradient amplitude is more dispersed and the values are large, it means that the noise level is high, and a larger threshold range is taken, the low - frequency component threshold is 0.3 - 0.5, and the high - frequency component threshold is 0.1 - 0.2.
[0031] Finally, according to the noise level estimation value, soft threshold processing is performed on the high - frequency components of the wavelet decomposition in each sub - region. The soft threshold function is used where x is the pixel value of the high - frequency component, and λ is the threshold determined according to the above method. During the processing, for high - frequency components of different scales, different threshold adjustment strategies are adopted according to their frequency characteristics.
[0032] Furthermore, in the S3 particle size calculation step, the contour detection algorithm is the findContours function in OpenCV. When calculating the minimum circumscribed circle, the least - squares fitting based on geometric distance calculation is adopted, and the specific implementation process is as follows:
[0033] For the detected contour point set, let the coordinates of the points on the contour be (x i , y i(i = 1, 2, …, n), the center coordinates of the minimum circumscribed circle are (a, b), and the radius is r;
[0034] According to the least squares principle, establish the objective function
[0035] By taking partial derivatives and and setting them equal to 0, a system of three - variable equations is obtained;
[0036] Solve this system of equations to obtain the values of the center coordinates and the radius, thereby determining the maximum particle size. During the solution process, the Newton - Raphson method or the gradient descent method is used to accelerate convergence.
[0037] Furthermore, in the S4 quality inspection and evaluation step, in addition to comparing the average particle size with the preset standard particle size, the particle size distribution can also be combined for comprehensive evaluation. The specific operations are as follows:
[0038] Calculate the standard deviation of the particle size distribution where d i is the particle size of each mask block, is the average particle size, N is the total number of mask blocks. When the standard deviation is less than 3 microns, it indicates that the particle size distribution is uniform; when the standard deviation is between 3 - 5 microns, it indicates that the particle size distribution is relatively uniform; when the standard deviation is greater than 5 microns, it indicates that the particle size distribution is non - uniform.
[0039] Calculate the skewness of the particle size distribution The skewness within the range of [-0.5, 0.5] indicates that the particle size distribution is close to symmetric; the skewness less than -0.5 indicates that the particle size distribution is skewed to the left, that is, there are more small - sized particles; the skewness greater than 0.5 indicates that the particle size distribution is skewed to the right, that is, there are more large - sized particles.
[0040] Compared with the existing technologies, the beneficial effects of the present invention are:
[0041] In terms of quality inspection efficiency, it takes 20 - 30 minutes to process one electron microscope image by traditional manual annotation, while the segmentation model in this method only takes 20 - 30 seconds, greatly shortening the quality inspection time and being able to process a large amount of image data in a short time to meet the requirements of large - scale production.
[0042] In terms of accuracy, this method realizes more accurate image segmentation and particle size calculation by constructing a visual segmentation model including an image encoder, a prompt encoder, a mask decoder, a GSEFE module, and an MDFF module, using the powerful feature extraction ability of ViT, the effective capture of edge and texture features by the GSEFE module, and the precise denoising and feature fusion by the MDFF module. Compared with traditional methods and existing software, it can provide more accurate quality inspection results and effectively avoid material quality problems caused by quality inspection errors.
[0043] Innovatively solved the problems of many adhesive particles and uneven distribution in the electron microscope images of lithium battery materials. Through the self-developed method of extracting non-overlapping segmentation region mask information, the mask data is sorted, extreme values are removed, the coincidence of bounding boxes is judged, connectivity analysis and other processes are carried out, ensuring the accuracy of the segmentation region and laying a solid foundation for subsequent particle size calculation and quality assessment.
[0044] In addition, this method has a high degree of automation, reduces the uncertainty and error brought by manual operation, reduces the dependence on the professional skills of operators, improves the stability and reliability of the quality inspection process, helps lithium battery production enterprises improve product quality, reduce production costs, enhance market competitiveness, and promotes the development of the lithium battery industry towards higher quality and higher efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a schematic block diagram of an intelligent system for efficient error prevention and precise control of manufacturing production materials proposed by the present invention;
[0046] Figure 2 It is a framework diagram of a visual segmentation model for scanning electron microscope images of lithium battery materials;
[0047] Figure 3 It is a comparison diagram of segmentation effects;
[0048] Figure 4 It is a schematic flow diagram for extracting non-overlapping segmentation regions;
[0049] Figure 5 It is a schematic diagram for calculating the maximum particle size of the mask block. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0050] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0051] In the description of the present invention, it should be understood that the orientation or positional relationship indicated by the terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention.
[0052] In addition, the terms "first" and "second" are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of the said features. In the description of the present invention, "a plurality of" means two or more, unless otherwise specifically defined. In addition, the terms "mounted", "connected" and "coupled" should be understood in a broad sense. For example, it may be a fixed connection, a detachable connection, or an integral connection; it may be a mechanical connection or an electrical connection; it may be directly connected or indirectly connected through an intermediate medium, and it may be the communication inside two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances. The present invention will be further described in detail below with reference to the accompanying drawings.
[0053] Referring to Figure 1-2 : An intelligent quality inspection method for lithium battery materials based on scanning electron microscope images, comprising the following steps:
[0054] S1: Image acquisition: Use a scanning electron microscope to acquire the electron microscope image of the lithium battery material, generate a picture file containing a scale bar, and the picture file contains the microstructural information of the lithium battery material, and the microstructure shows an irregular granular distribution. The resolution of the scanning electron microscope is not less than 1 nanometer. When acquiring the image, the electron beam current intensity is controlled at 0.5 - 2 nanoamperes, the acceleration voltage is 5 - 20 kilovolts, and the working distance is 5 - 15 millimeters to ensure that a clear, high-quality electron microscope image that can reflect the microstructural characteristics of the material is acquired, meeting the requirements for subsequent precise analysis.
[0055] S2: Image segmentation and mask extraction: Construct a visual segmentation model to automatically globally segment the picture file and extract the mask information of each non-overlapping segmentation region. The mask information includes but is not limited to pixel area. The visual segmentation model includes:
[0056] An image encoder whose backbone network is a ViT trained with MAE, used for encoding information and feature extraction of the picture file. ViT performs image chunking on the input image, and the calculation method is x i = Flatten(Patch(I, P)), where i = 1...N, x i is the vector after flattening the i-th small block, I is the input image, P is the size of each patch, P takes a value of 16×16 pixels, and then a position encoding vector PosEmbed i is added to generate an input sequence with position information Finally, the standard Transformer encoder is used to process the embedded vector sequence where \(l = 1,\cdots,L\), and \(L = 12\) layers, is the output of the \(l\)-th layer).
[0057] The prompt encoder is divided into two categories: sparse prompts and dense prompts. Sparse prompts use learnable position encoding to represent point prompts and box prompts, and use the text encoder of CLIP to represent any form of text prompts; dense prompts use the mask encoded by convolution and the output of the image encoder added together as the final mask representation.
[0058] The mask decoder is used to decode the image encoding and prompt encoding outputs, perform cross-attention on the image encoding and prompt encoding, and the calculation formula is where \(q\) Ai is the query vector of sequence \(A\), \(k\) Bj is the key vector of sequence \(B\), \(d\) k is the dimension of the key vector, with a value of 64. Finally, the mask and related mask information are output through the MLP layer.
[0059] The edge feature extraction module (GSEFE) includes Sobel convolution and Gabor convolution. Gabor convolution extracts texture information of different directions and scales in the image through where \(\sigma = 2.0\), \(\gamma = 0.5\), \(\lambda = 5.0\), \(\psi = 0\), \((x,y)\) and \((x',y')\) represent the original coordinates and rotated coordinates respectively, enhancing the local features in the image. Sobel convolution passes through the horizontal operator and the vertical operator to combine the gradient information in the horizontal and vertical directions to obtain the edge intensity of the image, where \(I(i,j)\) is the pixel value at position \((i,j)\) in the image, \(K\) x (i,j) and \(K\) y (i,j) represent the Sobel operators in the horizontal and vertical directions respectively, and the Sobel convolution kernel size is \(3\times3\) pixels). The GSEFE module extraction network combines Sobel convolution and Gabor convolution, and the extracted features pass through a feature enhancement network composed of global average pooling (window size \(7\times7\) pixels), \(1\times1\) convolution (number of kernels 64), batch normalization (momentum 0.9), and ReLU activation function (slope 0.2).
[0060] Multi - Granularity Denoising Feature Fusion Module (MDFF) decomposes the feature maps output by each layer in the image encoder ViT using the Daubechies wavelet (db4) for two - layer decomposition, decomposing the feature maps into low - frequency components and high - frequency components of multiple scales. Soft - threshold processing is introduced in the high - frequency components, and the noise area is smoothed through a non - linear function while preserving key detail information such as edges and textures. After denoising, the feature maps are reconstructed using the inverse wavelet transform to generate high - quality denoised features, and then the wavelet - denoised feature maps output by different layers are fused. The threshold for the low - frequency components after wavelet decomposition is set to 0.2 - 0.5, and the threshold for the high - frequency components is set to 0.05 - 0.2.
[0061] The method for extracting the mask information of non - overlapping segmentation regions includes:
[0062] Sort the segmented mask data according to their area sizes and remove the minimum and maximum values at the beginning and end by 10% - 20% to reduce errors.
[0063] Judge the bounding box overlap for any pair of remaining segmentation regions.
[0064] If the bounding boxes of two segmentation regions overlap, then by modifying the mask boolean values that coincide with the smaller area in the larger segmentation region, the overlapping region is removed.
[0065] Perform connectivity analysis on the mask information of the modified segmentation regions and retain the largest connected region as the new segmentation mask.
[0066] Remove the segmentation regions with an area less than 10 pixels, perform area sorting again, remove the minimum and maximum values by 10% - 20% again to reduce errors, and perform area sorting again to ensure that all segmentation regions are non - overlapping regions.
[0067] S3: Particle size calculation: Convert the mask area attribute to the uint8 type, multiply its pixel value by 255 to generate a binary image, use a contour detection algorithm (such as the findContours function in OpenCV) to find the external contours in the binary image, calculate the minimum circumscribed circle for the detected contours, and the diameter of this circumscribed circle is the maximum particle size. The binary image is stored in the form of an array. When calculating the minimum circumscribed circle, the least - squares method based on geometric distance calculation is used for fitting to improve the calculation accuracy and reduce the calculation error.
[0068] S4: Quality inspection and evaluation: Take the average value of the maximum particle size of all mask blocks to obtain the average particle size of the material corresponding to the image file, compare the average particle size with the preset standard particle size, and obtain the overall size evaluation and quality evaluation of the material corresponding to the image file. At the same time, the particle size distribution of all non-overlapping segmented areas is obtained based on the standard particle size. The preset standard interval has a small threshold of 1.7 microns and a large threshold of 2.2 microns. If the average particle size is between the two thresholds, the material corresponding to the electron microscope image is deemed qualified. If it is outside the two thresholds, it is unqualified. In addition to comparing the average particle size with the preset standard particle size, a comprehensive evaluation can also be performed in combination with the particle size distribution, such as calculating the standard deviation of the particle size distribution (a standard deviation of less than 3 microns indicates a uniform particle size distribution), skewness (skewness in the range of [-0.5, 0.5] indicates that the particle size distribution is close to symmetry) and other statistical parameters, further analyzing the uniformity and stability of the material, and providing a more comprehensive basis for the quality control of lithium battery materials. At the same time, a detailed quality inspection report is generated based on the quality inspection results, including image information, particle size statistics, quality assessment conclusions, etc., for easy traceability and analysis.
[0069] In the S2 image segmentation and mask extraction step, the data set used by the visual segmentation model during the training process is a labeled data set containing at least 1,000 electron microscope images of different types of lithium battery materials. The images in the data set are labeled by at least 3 professionals, and the annotation content includes information such as the exact location of the particles, the particle size range, and the shape characteristics to improve the accuracy and generalization ability of the model. The stochastic gradient descent algorithm is used during training, the learning rate is set to 0.001-0.01, the number of iterations is 10,000-50,000 times, and data enhancement technology (such as rotation angle between -30° and 30°, flip probability of 0.3-0.5, and scaling ratio between 0.8-1.2) is used to expand the data set to prevent model overfitting.
[0070] This method can also be applied to the quality inspection and analysis of other types of battery materials (such as lead-acid batteries, nickel-metal hydride batteries, etc.) or materials with similar microstructures (such as certain ceramic materials, catalyst materials, etc.). By properly adjusting and training the visual segmentation model, it can be adapted to the characteristics of different materials and expand its application scope. According to the characteristics of different materials, adjust the parameters of the model (such as the number of layers of ViT is adjusted to 8-16 layers, the number of heads is adjusted to 4-8 heads, and the convolution kernel parameters are optimized according to the texture characteristics of the material), re-collect and annotate the corresponding data sets, and optimize the model by transfer learning or retraining to improve the accuracy of quality inspection.
[0071] In the S2 image segmentation and mask extraction step, the parameters of the Sobel convolution and Gabor convolution in the GSEFE module can be adaptively adjusted according to the characteristics of the electron microscope image of the lithium battery material, as follows:
[0072] For Sobel convolution, when the edges of the particles in the image are blurred, the size of the convolution kernel is adjusted to 5×5 pixels to enhance the edge detection ability; when the edges are clear, the size of the 3×3 pixel convolution kernel is maintained to reduce the computational load. At the same time, according to the particle texture direction, the weights of the horizontal and vertical operators are adjusted. If the horizontal texture is obvious, the weight of the horizontal operator is increased to 1.5 - 2.0 times; conversely, if the vertical texture is obvious, the weight of the vertical operator is increased to 1.5 - 2.0 times.
[0073] For Gabor convolution, when the particle texture in the image is complex, the range of the added value is increased to 6.0 - 8.0 to capture a wider range of texture frequencies; when the texture is simple, the range is reduced to 4.0 - 6.0. At the same time, according to the particle shape characteristics, the value of is adjusted. If the particles are slender, is increased to 0.8 - 1.0 to make the convolution kernel more inclined to detect the texture in the long-axis direction; if the particles are close to circular, it is maintained at about 0.5. And, according to the image noise level, the value of is dynamically adjusted. When the noise is large, it is increased to 2.5 - 3.0 to enhance the filtering effect; when the noise is small, it is maintained at about 2.0. The direction of Gabor convolution is adjusted according to the distribution of the particle texture direction. If the texture direction is relatively single, the number of directions is reduced to 3 - 4 to concentrate on detecting the main texture direction; if the texture direction is complex and diverse, the number of directions is increased to 6 - 8 to comprehensively capture the texture information.
[0074] In the S2 image segmentation and mask extraction step, the method for determining the threshold of the soft threshold processing in the MDFF module is based on the estimation of the image noise level. The specific steps are as follows:
[0075] First, the image is divided into multiple non-overlapping sub-regions, and the size of the sub-regions is 8×8 pixels to 16×16 pixels. For each sub-region, the variance and gradient magnitude of its pixel values are calculated.
[0076] Then, according to the distribution of the variance and gradient magnitude, the noise level estimation value is determined. If the distribution of the variance and gradient magnitude is relatively concentrated and the values are small, it indicates that the noise level is low. At this time, a smaller threshold range is taken, the low-frequency component threshold is 0.2 - 0.3, and the high-frequency component threshold is 0.05 - 0.1; if the distribution of the variance and gradient magnitude is more dispersed and the values are large, it means that the noise level is high, and a larger threshold range is taken, the low-frequency component threshold is 0.3 - 0.5, and the high-frequency component threshold is 0.1 - 0.2.
[0077] Finally, according to the noise level estimation value, soft threshold processing is performed on the high-frequency components of the wavelet decomposition in each sub-region. The soft threshold function uses Among them, x is the pixel value of the high-frequency component, and λ is the threshold determined according to the above method. During the processing, for high-frequency components of different scales, different threshold adjustment strategies are adopted according to their frequency characteristics. The higher the frequency of the high-frequency component, the relatively smaller the threshold, so as to better retain the detail information.
[0078] In the S3 particle size calculation step, the contour detection algorithm is the findContours function in OpenCV. This algorithm has high accuracy and efficiency in processing irregular shape contours, and can quickly and accurately detect the external contour of the particle and calculate the maximum particle size. When calculating the minimum circumscribed circle, the least squares method based on geometric distance calculation is used for fitting. The specific implementation process is as follows:
[0079] For the detected contour point set, let the coordinates of the points on the contour be (x i , y i )(i = 1, 2,..., n), the center coordinates of the minimum circumscribed circle are (a, b), and the radius is r.
[0080] According to the principle of the least squares method, establish the objective function
[0081] By taking the partial derivatives and and setting them equal to 0, a system of three equations is obtained.
[0082] Solve this system of equations to obtain the values of the center coordinates and the radius, so as to determine the maximum particle size of the particle. During the solution process, an iterative optimization algorithm (such as Newton's iterative method or gradient descent method) is used to accelerate convergence, improve the calculation efficiency, and reduce the calculation error.
[0083] In the S4 quality inspection and evaluation step, in addition to comparing the average particle size with the preset standard particle size, the particle size distribution can also be combined for comprehensive evaluation. The specific operation is as follows:
[0084] Calculate the standard deviation of the particle size distribution where d i is the particle size of each mask block, is the average particle size, and N is the total number of mask blocks. When the standard deviation is less than 3 microns, it means that the particle size distribution is uniform; when the standard deviation is between 3 - 5 microns, it means that the particle size distribution is relatively uniform; when the standard deviation is greater than 5 microns, it means that the particle size distribution is non-uniform.
[0085] Calculate the skewness of the particle size distribution The skewness in the range of [-0.5, 0.5] indicates that the particle size distribution is close to symmetric; the skewness less than -0.5 indicates that the particle size distribution is skewed to the left, that is, there are more small particle size particles; the skewness greater than 0.5 indicates that the particle size distribution is skewed to the right, that is, there are more large particle size particles.
[0086] According to the values of the standard deviation and skewness, the quality inspection results are divided into different grades. For example, when the standard deviation is less than 3 microns and the skewness is within the range of [-0.5, 0.5], the quality inspection result is excellent; when the standard deviation is between 3 - 5 microns or the skewness is within the range of [-1.0, -0.5) or (0.5, 1.0], the quality inspection result is good; when the standard deviation is greater than 5 microns or the skewness is less than -1.0 or greater than 1.0, the quality inspection result is unqualified. At the same time, a detailed quality inspection report is generated according to the quality inspection results, including image information, particle size statistical data (such as average particle size, particle size distribution histogram, etc.), quality assessment conclusions (such as qualified or not, grade assessment, etc.), analysis suggestions (such as improvement directions for unqualified products, etc.), etc., which is convenient for traceability and analysis.
[0087] The above is only the preferred specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention, according to the technical solution and inventive concept of the present invention, makes equivalent substitutions or changes, and should be covered by the protection scope of the present invention.
Claims
1. An intelligent quality inspection method for lithium battery materials based on scanning electron microscope images, characterized in that: The following steps are involved: S1: Image acquisition: A scanning electron microscope is used to acquire an electron microscope image of the lithium battery material, and a picture file containing a scale bar is generated. The picture file contains microstructure information of the lithium battery material, and the microstructure presents an irregular granular distribution; S2: Image segmentation and mask extraction: Construct a visual segmentation model to automatically segment the image file globally and extract mask information of each non-overlapping segmented area. The mask information includes pixel area. The visual segmentation model includes: The image encoder, whose backbone network is ViT trained with MAE, is used to encode information and extract features from the image file. ViT performs image block processing on the input image, and the calculation method is x i = Flatten(Patch(I, P)), where i = 1...N, x i is the vector after flattening the i-th small block, I is the input image, P is the size of each patch, P is 16×16 pixels, and then the position encoding vector PosEmbed is added i Generate input sequence with position information Finally, the standard Transformer encoder is used to process the embedding vector sequence Where l = 1...L, L is 12 layers, is the output of the lth layer; Hint encoder, which is divided into sparse hints and dense hints. Sparse hints use learnable position encoding to represent point hints and box hints, and use CLIP's text encoder to represent arbitrary text hints. Dense hints use the convolutional encoding mask and the output of the image encoder added as the final mask representation. The mask decoder is used to decode the image code and the prompt code and output them, and perform cross-attention on the image code and the prompt code. The calculation formula is: where q Ai is the query vector of sequence A, k Bj is the key vector of sequence B, d k is the dimension of the key vector, which takes a value of 64. Finally, the mask and related mask information are output through the MLP layer; The edge feature extraction module GSEFE includes Sobel convolution and Gabor convolution. Gabor convolution is performed through Extract texture information of different directions and scales from the image, where σ is taken as 2.0, γ is taken as 0.5, λ is taken as 5.0, ψ is taken as 0, (x, y) and (x′, y′) represent the original coordinates and the rotated coordinates respectively, enhance the local features in the image, and Sobel convolution is performed through the horizontal operator and vertical operator The edge strength of the image is obtained by combining the horizontal and vertical gradient information, where I(i, j) is the pixel value at position (i, j) in the image, and K x (i, j) and K y (i, j) represent the Sobel operator in the horizontal and vertical directions respectively. The Sobel convolution kernel size is 3×3 pixels. The GSEFE module extraction network combines Sobel convolution and Gabor convolution. The extracted features are subjected to a feature enhancement network consisting of global average pooling, 1×1 convolution, normalization, and ReLU activation function. The multi-granularity denoising feature fusion module MDFF uses Daubechies wavelet db4 to perform two-layer decomposition on the feature map output by each layer in the image encoder ViT, decomposing the feature map into low-frequency components and high-frequency components of multiple scales. Soft threshold processing is introduced in the high-frequency components, and the noise area is smoothed by a nonlinear function while retaining key detail information such as edges and textures. After denoising, the feature map is reconstructed using inverse wavelet transform, and then the wavelet denoising feature maps output by different layers are fused; Methods for extracting mask information of non-overlapping segmented regions include: The segmented mask data are sorted according to their area size and the minimum and maximum values at the head and tail are removed by 10%-20%; Perform bounding box coincidence check on any pair of retained segmented regions; If the bounding boxes of two segmented regions overlap, the overlapping area is removed by modifying the mask Boolean value of the segmented region that coincides with the area; Perform connectivity analysis on the mask information of the modified segmented area, and retain the largest connected area as the new segmentation mask; Remove the segmented areas with an area less than 10 pixels, and sort them again by area. Remove the minimum and maximum values again according to 10%-20%, and sort them again by area. S3: Particle size calculation: convert the mask area attribute into uint8 type, and multiply its pixel value by 255 to generate a binary image, use the contour detection algorithm to find the external contour in the binary image, calculate the minimum circumscribed circle for the detected contour, and the diameter of the circumscribed circle is the maximum particle size of the particle. The binary image is stored in the form of an array. When calculating the minimum circumscribed circle, the least squares fitting method based on geometric distance calculation is adopted; S4: Quality inspection and evaluation: Take the average value of the maximum particle sizes of all mask blocks to obtain the average particle size of the material corresponding to the image file, compare the average particle size with the preset standard particle size, and obtain the overall size evaluation and quality evaluation of the material corresponding to the image file. At the same time, obtain the particle size distribution of all non-overlapping segmented areas based on the standard particle size. The preset standard interval has a small threshold of 1.7 microns and a large threshold of 2.2 microns. If the average particle size is between the two thresholds, the material corresponding to the electron microscope image is deemed qualified. If it is outside the two thresholds, it is deemed unqualified.
2. The method according to claim 1, characterized in that In the S2 image segmentation and mask extraction step, the data set used by the visual segmentation model during the training process is a labeled data set containing at least 1,000 electron microscope images of different types of lithium battery materials. The images in the data set are labeled by at least 3 professionals, and the annotation content includes the exact position of the particles, particle size range, and shape feature information. The stochastic gradient descent algorithm is used during training, and data enhancement technology is used to expand the data set to prevent model overfitting.
3. The method according to claim 1, characterized in that This method can also be applied to quality inspection and analysis of lead-acid batteries, nickel-metal hydride battery materials, or ceramic materials and catalyst materials with similar microstructures. By properly adjusting and training the visual segmentation model, it can be adapted to the characteristics of different materials and expand its scope of application. According to the characteristics of different materials, the parameters of the model can be adjusted, the corresponding data sets can be recollected and labeled, and the model can be optimized by transfer learning or retraining.
4. The method according to claim 1, characterized in that In the S2 image segmentation and mask extraction step, the parameters of the Sobel convolution and Gabor convolution in the GSEFE module are adaptively adjusted according to the characteristics of the electron microscope image of the lithium battery material, as follows: For Sobel convolution, when the edge of the particles in the image is blurred, the convolution kernel size is adjusted to 5×5 pixels to enhance the edge detection capability; when the edge is clear, the convolution kernel size is maintained at 3×3 pixels to reduce the amount of calculation. At the same time, the weights of the horizontal and vertical operators are adjusted according to the direction of the particle texture. If the horizontal texture is obvious, the weight of the horizontal operator is increased to 1.5-2.0 times. Conversely, if the vertical texture is obvious, the weight of the vertical operator is increased to 1.5-2.0 times. For Gabor convolution, when the particle texture in the image is irregular, the value range is increased to 6.0-8.0; when the texture is simple, the value range is reduced to 4.0-6.0; at the same time, the value is adjusted according to the shape characteristics of the particles. If the particles are elongated, the convolution kernel is more inclined to detect the texture in the long axis direction; if the particles are close to a circle, it is kept at around 0.5, and the value is dynamically adjusted according to the image noise level. When the noise is large, it is increased to 2.5-3.0 to enhance the filtering effect; when the noise is small, it is kept at around 2.0; the direction of Gabor convolution is adjusted according to the distribution of particle texture directions. If the texture direction is relatively simple, the number of directions is reduced to 3-4, and the main texture direction is detected; if the texture direction is complex and diverse, the number of directions is increased to 6-8 to fully capture the texture information.
5. The method according to claim 1, characterized in that In the S2 image segmentation and mask extraction step, the threshold determination method of the soft threshold processing in the MDFF module is based on the image noise level estimation, and the specific steps are as follows: First, the image is divided into multiple non-overlapping sub-regions with a size of 8×8 pixels to 16×16 pixels. For each sub-region, the variance and gradient amplitude of its pixel values are calculated. Then, the noise level estimate is determined based on the distribution of the variance and gradient amplitude. If the variance and gradient amplitude are concentrated and the values are small, it means the noise level is low. In this case, a smaller threshold range is used, with the low-frequency component threshold being 0.2-0.3 and the high-frequency component threshold being 0.05-0.
1. If the variance and gradient amplitude are dispersed and the values are large, it means the noise level is high. In this case, a larger threshold range is used, with the low-frequency component threshold being 0.3-0.5 and the high-frequency component threshold being 0.1-0.
2. Finally, according to the noise level estimation value, the high-frequency components of wavelet decomposition in each sub-region are subjected to soft threshold processing. The soft threshold function adopts Where x is the pixel value of the high-frequency component, and λ is the threshold value determined according to the above method. During the processing, for high-frequency components of different scales, different threshold adjustment strategies are adopted according to their frequency characteristics.
6. The method according to claim 1, characterized in that In the particle size calculation step S3, the contour detection algorithm is the findContours function in OpenCV. When calculating the minimum circumscribed circle, the least squares fitting based on geometric distance calculation is adopted. The specific implementation process is as follows: For the detected contour point set, let the point coordinates on the contour be (x i ,y i ) (i=1,2,…,n), the coordinates of the center of the smallest circumscribed circle are (a, b) and the radius is r; According to the principle of least squares method, the objective function is established By taking partial derivatives and And set it equal to 0, and get a three-variable equation system; By solving the equations, the coordinates of the center of the circle and the radius are obtained, thereby determining the maximum particle size of the particles. In the solution process, the Newton iteration method or the gradient descent method is used to accelerate convergence.
7. The method according to claim 1, characterized in that In the S4 quality inspection and evaluation step, in addition to comparing the average particle size with the preset standard particle size, a comprehensive evaluation can also be performed based on the particle size distribution. The specific operations are as follows: Calculate the standard deviation of the particle size distribution where d i is the particle size of each mask block, is the average particle size, N is the total number of mask blocks, when the standard deviation is less than 3 microns, it means that the particle size distribution is uniform; when the standard deviation is between 3-5 microns, it means that the particle size distribution is relatively uniform; when the standard deviation is greater than 5 microns, it means that the particle size distribution is uneven; Calculating the skewness of the particle size distribution A skewness in the range of [-0.5, 0.5] indicates that the particle size distribution is nearly symmetrical; a skewness less than -0.5 indicates that the particle size distribution is skewed to the left, that is, there are more small-sized particles; a skewness greater than 0.5 indicates that the particle size distribution is skewed to the right, that is, there are more large-sized particles.