Pole piece black spot detection method and device, equipment and storage medium

Through interactive labeling, the black spot semantic segmentation model is trained, and the number and area proportion of black spots in the pole film are directly calculated, which solves the problems of high cost and low efficiency of black spot detection in the existing technology, and achieves efficient black spot detection.

CN120047523APending Publication Date: 2025-05-27CONTEMPORARY AMPEREX TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311607879.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-27
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

The existing technology has a high cost to identify the area of ​​black spots through object detection, and it is necessary to check the black spots one by one in large-face active film detection, which is inefficient.

Method used

Interactive annotation is used to train the black spot semantic segmentation model, and the number and area proportion of black spots in the pole are directly calculated through the model to avoid identification and verification one by one.

Benefits of technology

It significantly improves the efficiency of black spot detection, and can quickly determine the quality of the pole sheet by the proportion of black spots, reducing detection cost and time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120047523A_ABST
    Figure CN120047523A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of image processing, and discloses a pole piece black spot detection method and device, equipment and a storage medium. The method comprises the steps that a pole piece image is input into a black spot semantic segmentation model, a pixel matrix label in the pole piece image is obtained, and the black spot semantic segmentation model is obtained by training a sample image obtained through interactive labeling and the pixel matrix label in the sample image; and obtaining a black spot area proportion according to the pixel matrix label in the pole piece image. According to the scheme, before the black spot detection process, the black spot region in the black spot model is labeled by using an interactive labeling mode, and the pixel number of the black spots in the whole pole piece can be directly calculated through the spot semantic segmentation model, so that the area occupied by the black spots is calculated; whether the quality of the pole piece meets the actual requirement or not can be directly determined through the proportion of the black spots, the black spots do not need to be checked one by one, and the black spot detection efficiency is improved in the quality checking stage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and particularly to a method, device, equipment and storage medium for detecting black spots on a pole piece. Background Art

[0002] Lithium-ion batteries are widely used in the field of power batteries for new energy vehicles due to their characteristics such as safety, long life and low cost. As the most core component of a lithium battery, once there are defects in the electrode sheet of the battery cell, it will greatly affect the safety performance of the battery.

[0003] The severity level of black spot defects is an important reference standard for whether a lithium battery can leave the factory. However, in actual applications, target detection of black spots is very time-consuming, and it is also very time-consuming and costly to calculate the area of each black spot one by one after identifying each black spot.

[0004] The above content is only used to assist in understanding the technical solution of the present invention, and does not represent an admission that the above content is prior art. Summary of the Invention

[0005] The main object of the present invention is to provide a method, device, equipment and storage medium for detecting black spots on a pole piece, aiming to solve the technical problem of high cost in identifying the area of black spots through target detection in the prior art. In a first aspect, to achieve the above object, the present invention provides a method for detecting black spots on a pole piece, the method comprising the following steps: obtaining a pole piece image; inputting the pole piece image into a black spot semantic segmentation model to obtain a pixel matrix label in the pole piece image, the black spot semantic segmentation model being trained by using a pole piece image sample obtained through interactive annotation and the pixel matrix label in the pole piece image sample; and obtaining the proportion of the black spot area according to the pixel matrix label in the pole piece image.

[0006] Through the above solution, before the process of black spot detection, the black spot area in the black spot model is marked by using the interactive annotation method. The pixel number of black spots in the entire pole piece can be directly calculated through the black spot semantic segmentation model, so as to calculate the area occupied by the black spots, without the need to identify them one by one through target detection technology. In the process of detecting a large-area pole piece, it is possible to directly determine whether the quality of the pole piece meets the actual requirements through the proportion of black spots, without the need to check each black spot one by one, which greatly improves the efficiency of black spot detection in the quality verification stage.

[0007] In some embodiments, before inputting the pole piece image into the black spot semantic segmentation model to obtain the labels of each pixel point in the pole piece image, it further includes: obtaining a pole piece image sample; determining training image information and sample labels according to the pole piece image sample; inputting the training image information into an image semantic segmentation model to obtain predicted output data; and adjusting the image semantic segmentation model according to the predicted output data and the sample labels to obtain the black spot semantic segmentation model.

[0008] Through the above solution, the image semantic segmentation model can be effectively trained to obtain the black spot semantic segmentation model. The image semantic segmentation model assigns a semantic label to each pixel in the image. This means that each pixel is assigned a label to indicate which object or region in the image it belongs to. The image semantic segmentation model is usually constructed based on a deep learning convolutional neural network (CNN). These models are trained to learn the features and context information of different objects in the image in order to segment the image into semantically meaningful regions. Applying it to black spot detection has a better effect on discrete black spot images, improving the accuracy and fine-grainedness of black spot detection.

[0009] In some embodiments, the image semantic segmentation model is the UperNet model, and the backbone network in the image semantic segmentation model is the SwinTransformer network.

[0010] By modifying the model, the model main body more suitable for the black spot detection of this solution can be further obtained. When segmenting the black spot defects on the surface of the pole piece, the decoding structure of Upernet is selected as the main model because Upernet is sensitive to small targets and object textures. In the current black spot detection scenario, the black spots are very likely not to exist in patches, but scattered like fine black dots. Therefore, the characteristics of Upernet being sensitive to small targets and object textures can capture all the black spots better than traditional object detection models. However, the backbone network of Upernet uses a convolutional neural network (CNN), and the receptive field size is limited. It often expands the receptive field by stacking convolutional layers. Along with the increase in the depth of the network, the long-term dependence of features will weaken. Therefore, the convolutional neural network often cannot fully utilize the global information to affect the segmentation effect, resulting in problems such as missed detection of small targets and blurred edges of target segmentation. The Transformer architecture can capture the long-range dependence of the entire feature map through the attention mechanism, thereby realizing the construction of a global information model. And SwinTransformer (a hierarchical vision transformer using shifted windows) not only has the global modeling ability of the Transformer, but its hierarchical network structure and information interaction method of moving windows also expand the receptive field of the model to a certain extent, while reducing the computational amount of the model, and is suitable for feature extraction of different scale targets.

[0011] In some embodiments, inputting the training image information into the image semantic segmentation model to obtain predicted output data includes: obtaining a local feature vector according to the training image information; performing a pooling operation on the local feature vector to obtain an image semantic vector; and performing pixel prediction according to the image semantic vector to obtain the predicted output data.

[0012] Performing a pooling operation on the local feature vector to determine the semantic vector, and using the semantic vector for pixel prediction can effectively combine the context content at a longer distance to predict whether the pixel is the location of the black spot, avoid the model falling into a local optimum, and improve the accuracy of black spot detection.

[0013] In some embodiments, adjusting the image semantic segmentation model according to the predicted output data and the sample label to obtain the black spot semantic segmentation model includes: calculating a loss value according to the predicted output data and the sample label; updating the weight parameters in the image semantic segmentation model according to the loss value to obtain the trained image semantic segmentation model; determining test image information according to the tab image, and testing the trained image semantic segmentation model according to the test image information to obtain a test result; when the test result converges, determining the black spot semantic segmentation model according to the trained image semantic segmentation model.

[0014] Through the above method, rapid training of the image semantic segmentation model is achieved. By calculating the loss value to adjust the weights, the training of the black spot semantic segmentation model is completed, and the output efficiency of the model is improved.

[0015] In some embodiments, calculating the loss value according to the predicted output data and the sample label includes: generating a result index matrix according to the sample label; determining a pixel result matrix according to the predicted output data; and substituting the result index matrix and the pixel result matrix into the cross-entropy function to obtain the loss value.

[0016] Through the above method, the cross-entropy function is introduced to calculate the loss value. In the multi-class problem of classification, the cross-entropy loss function encourages the model to learn to distinguish the boundaries between different classes. By minimizing the cross-entropy loss, the model can better distinguish each class and improve the accuracy of classification.

[0017] In some embodiments, obtaining the tab image sample includes: obtaining the tab image; performing interactive annotation on the tab image to obtain a labeled image; generating a label matrix according to the labeled image; generating a pixel matrix according to the tab image; and generating the tab image sample according to the label matrix and the pixel matrix.

[0018] Since the purpose of the solution is to calculate the proportion of black spots in the image, it is necessary to perform more refined annotation on the samples to determine which parts of the image are black spot pixels and which are other pixels. By using an interactive annotation algorithm for interactive annotation and then digitizing the obtained black-and-white image, the annotation time can be greatly reduced, and a relatively accurate and natural target boundary can be given.

[0019] In some embodiments, the interactive annotation of the pole piece image to obtain a labeled image includes: obtaining an initial marked area in the pole piece image; determining an initial black spot target according to the initial marked area; and responding to a black spot target confirmation instruction to confirm the labeled image according to the initial black spot target.

[0020] When the number of samples is small, in order to obtain more refined samples, an interface for manual intervention can be introduced during the automatic annotation process. An interface for confirming the black spot target can be added to provide conditions for inputting the black spot target confirmation instruction. Through manual intervention, the annotation accuracy of the samples can be improved, and finally, the labeled image is confirmed according to the initial black spot target, improving the annotation accuracy of the labeled image.

[0021] In some embodiments, the determining the initial black spot target according to the initial marked area includes: determining a target pixel label according to the initial marked area; inputting the target pixel label into a Gaussian mixture model to obtain a set of pixel black spot probabilities in the pole piece image; calculating an energy function according to the set of pixel black spot probabilities to obtain a calculation result; updating the Gaussian mixture model according to the calculation result and inputting the target pixel into the updated Gaussian mixture model until the calculation result of calculating the energy function according to the set of pixel black spot probabilities converges; and determining the initial black spot target according to the converged calculation result.

[0022] Through the Gaussian mixture model, a set of pixel black spot probabilities in the pole piece image can be obtained, but the accuracy of this set of black spot probabilities is not necessarily precise enough. Therefore, in this solution, an energy function is introduced to iterate the calculation result of the model, continuously improving the prediction accuracy of the set of pixel black spot probabilities, and finally determining the initial black spot target to improve the accuracy of the samples.

[0023] In some embodiments, the interactive annotation of the pole piece image to obtain a labeled image includes: performing interactive annotation on the pole piece image according to the Grabcut algorithm to obtain a labeled image.

[0024] In this solution, the Grabcut algorithm is used for interactive annotation, and the Grabcut algorithm is used for automatic foreground and background segmentation. If the segmentation effect is good, the segmentation result can be saved. If the segmentation effect is not good, the steps of black spot and background marking and segmentation are repeated until the segmentation effect meets the expectation. The Grabcut algorithm is used for interactive annotation. This algorithm can quickly and accurately find the natural boundary between the black spot and the background according to a certain pattern, thereby greatly improving the annotation efficiency and accuracy.

[0025] In some embodiments, obtaining the proportion of the black spot area according to the pixel matrix label in the pole piece image includes: determining the black spot pixel set according to the pixel matrix label; determining the proportion of the black spot area according to the black spot pixel set and the pixel matrix label.

[0026] Since the output result of the model generally appears as a feature vector in matrix form, the black spot pixel set can be directly determined according to the pixel matrix label, the number of pixels of the black spot can be determined, and then the proportion of the black spot area can be calculated according to the total number of pixels in the pixel matrix label.

[0027] In a second aspect, to achieve the above object, the present invention also proposes a black spot detection device for a pole piece. The black spot detection device for the pole piece includes: an acquisition module for acquiring a pole piece image; a processing module for inputting the pole piece image into a black spot semantic segmentation model to obtain a pixel matrix label in the pole piece image, where the black spot semantic segmentation model is trained by the pole piece image samples obtained through interactive annotation and the pixel matrix labels in the pole piece image samples; a processing module for obtaining the proportion of the black spot area according to the pixel matrix label in the pole piece image.

[0028] Through the above solution, before the process of black spot detection, the black spot area in the black spot model is marked by using the method of interactive annotation. The number of pixels of the black spot in the entire pole piece can be directly calculated through the black spot semantic segmentation model, so as to calculate the area occupied by the black spot. It is not necessary to identify each one through the object detection technology. In the process of detecting a large-area pole piece, the quality of the pole piece can be directly determined according to the proportion of the black spot, without having to check each black spot one by one. In the quality verification stage, the efficiency of black spot detection is greatly improved.

[0029] In a third aspect, to achieve the above object, the present invention also proposes a black spot detection device for a pole piece. The black spot detection device for the pole piece includes: a memory, a processor, and a black spot detection program for the pole piece stored on the memory and executable on the processor. The black spot detection program for the pole piece is configured to implement the steps of the black spot detection method for the pole piece as described above.

[0030] Fourthly, to achieve the above object, the present invention further provides a storage medium, on which a black spot detection program for the pole piece is stored. When the black spot detection program for the pole piece is executed by a processor, the steps of the black spot detection method for the pole piece as described above are implemented. Description of the Drawings

[0031] By reading the following detailed description of the preferred embodiments, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present application. Moreover, in all the drawings, the same reference numerals are used to represent the same components. In the drawings:

[0032] Figure 1 is a schematic flowchart of some embodiments of the present application;

[0033] Figure 2 is a schematic flowchart of the model training process of some embodiments of the present application;

[0034] Figure 3 is a schematic flowchart of the sample processing process of some embodiments of the present application;

[0035] Figure 4 is a structural block diagram of some embodiments of the present application.

[0036] The implementation, functional features and advantages of the object of the present invention will be further described with reference to the embodiments and the accompanying drawings. Detailed Embodiments

[0037] The embodiments of the technical solutions of the present application will be described in detail below with reference to the accompanying drawings. The following embodiments are only used to illustrate the technical solutions of the present application more clearly, and therefore are only examples and cannot be used to limit the protection scope of the present application.

[0038] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above description of the drawings are intended to cover non-exclusive inclusion.

[0039] In the description of the embodiments of the present application, technical terms such as "first" and "second" are only used to distinguish different objects and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity, specific order or primary-secondary relationship of the indicated technical features. In the description of the embodiments of the present application, "a plurality of" means more than two unless otherwise specifically defined.

[0040] References to "embodiments" in this specification mean that the particular features, structures, or characteristics described in connection with the embodiments can be included in at least one embodiment of the present application. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive of other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0041] In the description of the embodiments of the present application, the term "and / or" is merely a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. Additionally, the character " / " in this text generally represents an "or" relationship between the associated objects before and after.

[0042] In the description of the embodiments of the present application, the term "plurality" refers to two or more (including two). Similarly, "multiple groups" refers to two or more groups (including two groups), and "multiple pieces" refers to two or more pieces (including two pieces).

[0043] In the description of the embodiments of the present application, the orientation or positional relationship indicated by technical terms such as "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the embodiments of the present application 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 on the embodiments of the present application.

[0044] In the description of the embodiments of the present application, unless otherwise clearly specified and limited, technical terms such as "install", "connect", "couple", "fix", etc. should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or integrated; it can also be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the internal communication of two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to specific circumstances.

[0045] This solution is applied to the application scenario of anode sheet black spot detection. Lithium-ion batteries are widely used in the field of power batteries for new energy vehicles due to their characteristics such as safety, long life, and low cost. As the most core component of lithium batteries, defects in the anode sheet of the battery cell will greatly affect the safety performance of the battery. The severity level of black spot defects is an important reference standard for whether lithium batteries can leave the factory. If you want to quantify the severity of black spot defects, you need to obtain the area ratio of the black spots on the anode sheet. Therefore, image segmentation of black spot defects is required. This embodiment mainly focuses on the black spot segmentation step of the anode sheet defect detection task. Since we want to calculate the area ratio of black spots, it is only necessary to separate the pixel points belonging to the black spot class and the pixel points belonging to the background class on the anode sheet, and it is not necessary to distinguish each black spot. Therefore, only semantic segmentation (Semantic Segmentation) of the black spot anode sheet image is required, and finally its ratio is obtained to detect each batch of products. Therefore, the traditional object detection method is too cumbersome and inefficient.

[0046] In some embodiments, a semantic segmentation model is introduced. Semantic segmentation is a typical computer vision problem, which involves taking some images as input and converting them into masks with highlighted regions of interest. Early computer vision problems only detected elements such as edges or gradients, but never provided pixel-level image understanding in the way humans perceive. Semantic segmentation groups together the parts of an image that belong to the same object, thus expanding its application field.

[0047] For the above reasons, this embodiment proposes a method for processing the image information of the battery cell anode sheet to obtain the area ratio of black spots. In addition to being used in the black spot defect segmentation step of anode sheet defect detection, this method can also be used in the lithium deposition segmentation step of anode sheet defect detection, and the segmentation method will not be very different. This embodiment does not limit the use of the model.

[0048] The battery cell disclosed in the embodiments of the present application can be used in electrical devices that use the battery as a power source or various energy storage systems that use the battery as an energy storage element. The electrical device can be, but is not limited to, mobile phones, tablets, laptop computers, electric toys, power tools, battery cars, electric vehicles, ships, spacecraft, and so on. Among them, electric toys can include fixed or mobile electric toys, such as game consoles, electric vehicle toys, electric ship toys, and electric aircraft toys, etc. Spacecraft can include airplanes, rockets, space shuttles, and spaceships, etc.

[0049] Please refer to Figure 1 , Figure 1 For some embodiments of the present application, a method for detecting black spots on an anode sheet is provided. The method includes the following steps:

[0050] S10 Obtain the electrode sheet image; S20 Input the electrode sheet image into the black spot semantic segmentation model to obtain the pixel matrix labels in the electrode sheet image, where the black spot semantic segmentation model is trained by the electrode sheet image samples obtained through interactive annotation and the pixel matrix labels in the electrode sheet image samples; S30 Obtain the proportion of the black spot area according to the pixel matrix labels in the electrode sheet image.

[0051] It should be noted that the execution subject of this embodiment is an intelligent terminal, and the intelligent terminal can be a server, a computer, or other devices with the same or similar functions as the server. This embodiment does not limit this, and only takes the server as an example for illustration.

[0052] It can be understood that the electrode sheet image is a kind of material in the battery production process. Among them, the black spots on the electrode sheet are the spots existing on the electrode sheet. In the battery production process, the appearance of black spots on the electrode sheet may be caused by various reasons. For example: during the battery manufacturing process, the distribution of the electrolyte may be uneven, resulting in the formation of black spots on the electrode sheet. This may be caused by factors such as uneven electrolyte concentration, uneven application or flow during the coating process, or there may be impurities or contaminants in the electrolyte, and these impurities may form black spots on the electrode sheet. These impurities may be caused by factors such as the quality problem of raw materials, unclean production equipment or pollution during the processing process; and overreaction or incomplete electrolysis reaction may cause the reaction in the battery manufacturing process to be incomplete or overreact, resulting in the formation of black spots on the electrode sheet. This may be caused by factors such as inaccurate reaction conditions, too long reaction time or inappropriate reactant concentration. Or there is pollution of raw materials, mechanical loss, etc. The problems of the appearance of black spots are very diverse, and there is no fixed manifestation in terms of size and shape. Therefore, this also brings difficulties to the detection of black spots. The above are some common reasons that may cause black spots on the battery electrode sheet.

[0053] However, currently, the calculation of the position and connected area of the defect points in the image electrode sheet area is very simple. For example: the position and connected area of the defect point image are obtained through the BLOB analysis operator (spot analysis operator); then, for the defective product image, it is input into the trained deep learning residual network model to automatically calculate the defect category and confidence level of the defective product image, so as to determine the defect category of the defective product image. However, the traditional computer vision-based method for calculating the position and connected area of defect points has high requirements for the designer's experience, and also has poor performance in terms of segmentation accuracy, speed, and applicability.

[0054] In this embodiment, a deep learning model is used to solve this problem. During the model iteration process, the model parameters will be automatically optimized, and then the features that can best represent the characteristics of the image will be automatically extracted, without the need for manual design of the feature extraction process. A deep learning semantic segmentation model is also used to obtain the category of each pixel point, and then the positions and sizes of the defect areas belonging to different categories can be obtained. Moreover, the model proposed in this patent performs better in terms of high detection and segmentation accuracy, speed, and applicability.

[0055] Among them, the black spot semantic segmentation model is to detect black spots through the semantic segmentation model. The image semantic segmentation model is a computer vision model aiming to segment the input image into different regions with semantic meanings. Different from the image classification model, it not only predicts the categories of objects in the image, but assigns a semantic label to each pixel in the image. This means that each pixel is assigned a label to indicate which object or region in the image it belongs to. The image semantic segmentation model is usually constructed based on the deep learning convolutional neural network (CNN). These models are trained to learn the features and context information of different objects in the image in order to segment the image into semantically meaningful regions. Common image semantic segmentation models include U-Net, FCN (Fully Convolutional Network), DeepLab, etc. It can help the computer better understand and interpret the content in the image.

[0056] Furthermore, the black spot semantic segmentation model can finally output the semantic feature vector in the form of a matrix. In this embodiment, it can be characterized as a pixel matrix label, and each element in the matrix corresponds to a label value. For example, the pixels where the black spots are located are 1 and other pixels are 0, and the proportion of the black spot area is obtained by calculating the proportion of the black spot pixels.

[0057] In this embodiment, the processing of the sample is carried out through interactive annotation. This is because in this example, it is not necessary to know the specific type of black spot, the cause of the black spot or other information. Only the area of the black spot in the image needs to be known. Therefore, only attention needs to be paid to accurately finding the pixel points where the black spot is located. At this time, the annotation work only needs to accurately determine which pixels are the pixels where the black spot is located, rather than identifying the black spot classification. So there are only two types of sample labels, namely black spot and background (which can be identified by 1 and 0). Using interactive annotation can just meet the above requirements. Interactive annotation is a method of data annotation. It combines the interactive process of manual annotation and machine learning algorithms. From the unlabeled dataset, a part of the samples are selected for initial annotation. These samples can be manually annotated by experts or annotators to establish an initial training set. Then, using the initially annotated dataset, an initial machine learning model is trained. This model may have certain limitations in the annotation accuracy at the initial stage. The model will predict the samples according to the current annotation accuracy and give the confidence or probability. The results predicted by the model are fed back to the annotators or experts. They will carry out further annotation according to the prediction results of the model. In this process, the annotators can make decisions according to the confidence or probability of the model to improve the annotation accuracy. Use the new annotated data to iterate continuously and retrain. With the iterative process of annotation, the model will gradually improve the accuracy and generalization ability and finally complete the accurate annotation process.

[0058] Since the resolution level of the black spot in this embodiment needs to be very high (such as pixel level), therefore, using interactive annotation can greatly improve the annotation accuracy and save the annotation time.

[0059] Through the above solution, before the process of black spot detection, using the method of interactive annotation, the black spot area in the black spot model is annotated. Through the black spot semantic segmentation model, the pixel number of the black spot in the entire pole piece can be directly calculated, so as to calculate the area occupied by the black spot. It is not necessary to identify one by one through the object detection technology. In the process of detecting a large-area pole piece, the quality of the pole piece can be directly determined according to the proportion of the black spot, rather than verifying each black spot one by one. In the quality verification stage, the efficiency of black spot detection is greatly improved.

[0060] Please refer to Figure 2 , Figure 2 For the method provided in some embodiments of this application, the method includes the following steps:

[0061] In some embodiments, S01 obtains a pole piece image sample; S02 determines training image information and a sample label according to the pole piece image sample; S03 inputs the training image information into an image semantic segmentation model to obtain predicted output data; S04 adjusts the image semantic segmentation model according to the predicted output data and the sample label to obtain a black spot semantic segmentation model.

[0062] It should be noted that the pole piece image sample is the sample data, which includes the pixel point information (training image information) of each pole piece image and the label 1 or 0 corresponding to the pixel point (sample label). For example: divide the generated VOC format pole piece image samples into a training set, a test set, and a validation set. Read the file names of the training set, test set, and validation set in sequence and write them into train.txt, val.txt, and test.txt. Here, the suffix ".jpg" of the file name needs to be removed. Store the data in the specified storage directory according to the requirements of the semantic segmentation model. Then the division of the pole piece image samples can be completed, and the image information in the file is extracted and input into the image semantic segmentation model to obtain the predicted output data, completing the input of the training image information.

[0063] In a specific implementation, by comparing the probability that each pixel point predicted by the model is a black spot pixel point with the sample label, the model can be adjusted, and finally the model training is completed.

[0064] This embodiment proposes an optimized training process for the image input black spot semantic segmentation model. For example: First, it is necessary to prepare a semantic segmentation dataset with annotations. These datasets usually contain images and corresponding pixel-level labels, and the labels indicate the category or the semantic region (black spot or background) to which each pixel belongs. Initialize the selected network architecture, which can use pre-trained model weights or random initialization. Select an appropriate loss function to measure the difference between the model prediction result and the true label. Common loss functions such as Dice loss, etc. Divide the dataset into small batch samples, and through stochastic gradient descent (SGD) or other optimization algorithms, input each batch of images into the model for forward propagation and backward propagation to update the model parameters. Repeat the batch training until a predetermined number of training epochs is reached or the convergence condition is met. In each round of training, the model gradually adjusts the parameters to minimize the loss function and improve the accuracy of semantic segmentation. Use the validation set or the test set to evaluate the trained model, calculate semantic segmentation metrics such as pixel accuracy, mean intersection over union (IoU), etc., to evaluate the performance of the model. After the training is completed, use the trained model to perform semantic segmentation prediction on the data in the new prediction set or the validation set to generate pixel-level labels or prediction results.

[0065] Through the above solution, the image semantic segmentation model can be effectively trained to obtain a black spot semantic segmentation model. The image semantic segmentation model assigns a semantic label to each pixel in the image. This means that each pixel is assigned a label to indicate which object or region in the image it belongs to. The image semantic segmentation model is usually constructed based on a deep learning convolutional neural network (CNN). These models are trained to learn the features and context information of different objects in the image in order to segment the image into semantically meaningful regions. Applying it to black spot detection has a better effect on discrete black spot images, improving the accuracy and fine-grainedness of black spot detection.

[0066] In some embodiments, the image semantic segmentation model is the UperNet model, and the backbone network in the image semantic segmentation model is the SwinTransformer network.

[0067] To better meet the requirements of the black spot detection scenario, this embodiment proposes to transform the model. In the task of segmenting black spot defects on the surface of the pole piece, the decoding structure of Upernet, which is more sensitive to small targets and object textures, is selected as the decoder of the black spot semantic segmentation model. However, the backbone network of Upernet uses a convolutional neural network (CNN), and the receptive field size is limited. It often expands the receptive field by stacking convolutional layers. Along with the increase in the depth of the network, the long-term dependence of features will weaken. Therefore, convolutional neural networks often cannot fully utilize global information to affect the segmentation effect, resulting in problems such as missed detection of small targets and blurred target segmentation edges. The Transformer architecture can capture the long-range dependence relationship of the entire feature map through the attention mechanism, and then realize the construction of a global information model. The SwinTransformer (hierarchical vision transformer using shifted windows) not only has the global modeling ability of the Transformer, but its hierarchical network structure and information interaction method of moving windows also expand the receptive field of the model to a certain extent, while reducing the computational amount of the model, and is suitable for feature extraction of different scale targets.

[0068] Therefore, in order to achieve a better feature extraction effect and thus obtain a more accurate segmentation effect in this embodiment, the SwinTransformer (hierarchical vision transformer based on shifted windows) backbone network with better deep and shallow layer feature fusion is used to replace the ResNet (residual network) backbone network of Upernet. The innovation lies in using the SwinTransformer backbone network with better deep and shallow layer feature fusion to replace the ResNet backbone network of Upernet.

[0069] In the specific implementation, this patent selected DeepLabV3, DeepLabV3+, PSPNet and UPerNet models for model training and testing under the same experimental conditions. According to the black spot defect segmentation effect from good to bad, they are ST-UPerNet (this embodiment), UPerNet, DeepLabV3+, DeepLabV3 and PSPNet models, among which the black spot class pixel accuracy, class average pixel accuracy, black spot class intersection and union ratio and class average intersection and union ratio of ST-UPerNet are as high as 77.53%, 88.61%, 68.53% and 83.85% respectively, which are 9.39%, 3.03%, 2% and 0.99% higher than the corresponding indicators of the UPerNet baseline model. Compared with other methods, the ST-UPerNet proposed in this embodiment not only improves the segmentation accuracy of black spot defects, but also reduces the situation of missed segmentation of small targets, and can also make the segmentation mask of irregular targets more accurate and complete.

[0070] By modifying the model, we can further obtain a model body that is more suitable for black spot detection in this scheme. In the task of segmenting black spot defects on the surface of the pole piece, the decoding structure of Upernet is selected as the main model because Upernet is more sensitive to small targets and object textures. In the current black spot detection scenario, black spots are likely not present in pieces, but scattered like tiny black dots. Therefore, Upernet is more sensitive to small targets and object textures, and can better capture all black spots compared to traditional target detection models. However, the backbone network of Upernet uses a convolutional neural network (CNN), and the receptive field size is limited. The receptive field is often expanded by stacking convolutional layers. As the depth of the network increases, the long-term dependence of the features will weaken, so the convolutional neural network often cannot fully utilize the global information to affect the segmentation effect, resulting in the problem of missed detection of small targets and blurred target segmentation edges. The Transformer architecture can capture the long-distance dependencies of the entire feature map with the help of the attention mechanism, thereby building a global information model. The SwinTransformer (hierarchical visual transformer using shifted windows) not only has the global modeling capability of the Transformer, but its hierarchical network structure and the information interaction method of the moving window also expand the receptive field of the model to a certain extent, while reducing the computational complexity of the model, and is suitable for feature extraction of targets of different scales.

[0071] In some embodiments, inputting the training image information into an image semantic segmentation model to obtain predicted output data includes: obtaining a local feature vector based on the training image information; performing a pooling operation on the local feature vector to obtain an image semantic vector; and performing pixel prediction based on the image semantic vector to obtain predicted output data.

[0072] It should be noted that after inputting the training image information into the image semantic segmentation model, through feature extraction, local feature vectors can be determined for each part segmented in the training image information. However, the local feature vectors may cause local optimal solutions, resulting in a relatively low generalization ability of the model. Therefore, a global pooling operation should be further performed, where average pooling or max pooling is carried out for each channel of the feature map to obtain a global feature vector with a fixed length. The global feature vector undergoes a dimensionality transformation through a fully connected layer to match the number of channels of the high-level feature map. The high-level feature map fuses the global feature vector with itself, which can be achieved through methods such as adding at the feature level or concatenating at the feature level. The image semantic vector obtained through global pooling contains global feature information and can capture global context information by connecting context-related feature content, helping the model understand the semantic information of the entire image.

[0073] By performing a pooling operation on the local feature vectors to determine the semantic vector, and using the semantic vector for pixel prediction, it is possible to effectively combine context content over a longer distance to predict whether a pixel is the location of a black spot, avoid the model falling into a local optimal solution, and improve the accuracy of black spot detection.

[0074] In some embodiments, the method of adjusting the image semantic segmentation model according to the predicted output data and the sample label to obtain the black spot semantic segmentation model includes: calculating a loss value based on the predicted output data and the sample label; updating the weight parameters in the image semantic segmentation model according to the loss value to obtain a trained image semantic segmentation model; determining test image information based on the pole piece image and testing the trained image semantic segmentation model according to the test image information to obtain a test result; when the test result converges, determining the black spot semantic segmentation model according to the trained image semantic segmentation model.

[0075] It can be understood that this embodiment proposes an optimized training process for the image input black spot semantic segmentation model. For example: First, it is necessary to prepare a semantic segmentation dataset with annotations. These datasets usually contain images and corresponding pixel-level labels, where the labels indicate the category or the semantic region (black spot or background) to which each pixel belongs. Initialize the selected network architecture, which can use pre-trained model weights or random initialization. Select an appropriate loss function to measure the difference between the model prediction results and the true labels. Divide the dataset into small batches of samples, and through stochastic gradient descent (SGD) or other optimization algorithms, input the images of each batch into the model for forward propagation and backpropagation to update the model parameters. Repeat the batch training until a predetermined number of training epochs is reached or the convergence condition is met. In each round of training, the model gradually adjusts the parameters to minimize the loss function and improve the accuracy of semantic segmentation. Use the validation set or the test set to evaluate the trained model. After batch training until a predetermined number of training epochs is reached or the convergence condition is met, based on the trained image semantic segmentation model at this time, make adjustments to obtain the black spot semantic segmentation model.

[0076] Through the above method, the rapid training of the image semantic segmentation model is achieved. By calculating the loss value to adjust the weights, the training of the black spot semantic segmentation model is completed, and the output efficiency of the model is improved.

[0077] In some embodiments, calculating the loss value according to the predicted output data and the sample label includes: generating a result index matrix according to the sample label; determining a pixel result matrix according to the predicted output data; and substituting the result index matrix and the pixel result matrix into the cross-entropy function to obtain the loss value.

[0078] It can be understood that the index matrix (a matrix in the form of one-hot vectors) contains a large number of unique index values. Each index value corresponds to a permutation result of pixels. According to the index value, the sample label set corresponding to the unique pole piece image sample can be found. For example: A 3*3 pixel image corresponds to a sample label set containing 9 sample labels.

[0079] It should be noted that the pixel result matrix is a matrix containing the predicted labels corresponding to each pixel. Substituting the two into the cross-entropy function can obtain the loss value.

[0080] It should be noted that the calculation process of the loss value has an important impact on model training. During model training, the loss function is used to measure the difference between the model's prediction results and the true labels. The optimization algorithm adjusts the model's parameters by minimizing the loss function, enabling the model to better fit the training data and improve its generalization ability. Different loss functions will have different impacts on model training. Examples of loss functions include: Mean Squared Error (MSE), Cross-Entropy Loss, Kullback-Leibler Divergence, etc. In this embodiment, the cross-entropy function is selected because the cross-entropy loss function can measure the difference between the predicted probability distribution and the true labels. In this embodiment, it has very good results for classification problems. It improves the generalization ability of the model. The image semantic segmentation model is determined by adjusting the weights in the model through cross-entropy until the prediction results converge.

[0081] Through the above method, the cross-entropy function is introduced to calculate the loss value. In the multi-class problem of classification, the cross-entropy loss function encourages the model to learn to distinguish the boundaries between different classes. By minimizing the cross-entropy loss, the model can better distinguish each class and improve the accuracy of classification.

[0082] Please refer to Figure 3 , Figure 3 For the method provided by some embodiments of this application, the method includes the following steps:

[0083] In some embodiments, S001 obtains a pole piece image; S002 performs interactive annotation on the pole piece image to obtain a labeled image; S003 generates a label matrix according to the labeled image; S004 generates a pixel matrix according to the pole piece image; S005 generates a pole piece image sample according to the label matrix and the pixel matrix.

[0084] It should be noted that in order to obtain a more refined sample and improve the training effect of the model after training. Specifically, the pole piece image only contains pixel information, and interactive annotation is mainly to obtain the label corresponding to each pixel. Therefore, for the convenience of subsequent training, the labeled image is respectively used to obtain a pixel matrix and a label matrix, and the mapping relationship between each pixel in the two matrices and the label is established.

[0085] Since the purpose of the solution is to calculate the proportion of black spots in the image, it is necessary to perform more refined annotation on the sample to determine which parts of the image are black spot pixels and which are other pixels. Use the interactive annotation algorithm for interactive annotation, and then numericalize the labeled black and white image, which can greatly reduce the annotation time and can give a more accurate and natural target boundary.

[0086] In some embodiments, the interactive annotation of the pole piece image to obtain a labeled image includes: obtaining an initial marked area in the pole piece image; determining an initial black spot target according to the initial marked area; and responding to a black spot target confirmation instruction to confirm the labeled image according to the initial black spot target.

[0087] It can be understood that the initial marked area is the area where black spots are initially selected. For example, the black spots are marked by a selection box, and then the initial black spot target is determined according to the initial marked area. Through continuous iteration until the technician issues a black spot target confirmation instruction, a labeled image that meets the user's requirements is obtained.

[0088] For the specific interactive annotation process, the present embodiment provides the following preferred interactive scheme for illustration. For example, label the black-spot pole piece image of a lithium battery obtained in the previous patent. First, perform interactive annotation to obtain a black spot MASK. Convert the MASK image into numerical data so that each image can have a json file recording the position and edge of the black spot. Then, convert the json file obtained in the previous step into the VOC format required for model training. Divide the converted dataset into a training set, a test set, and a validation set, and place them according to the directory requirements of the model. Build a black spot image segmentation model. Put the training set into model training, and the validation set monitors the model training status. After the model training is completed, conduct tests, and calculate the proportion of the black spot and lithium deposition area according to the result matrix output by the test.

[0089] Interactive annotation is used to separate the foreground and background in an image. First, the user needs to select a rectangular box containing the foreground and background to initialize the algorithm. The rectangular box should contain the target to be segmented as accurately as possible. The user needs to manually mark some pixel points as the foreground or background. Usually, the foreground pixel points can be painted with one color (such as red) and the background pixel points can be painted with another color (such as blue) using a brush tool. Based on the foreground and background pixel points marked by the user, use the Gaussian Mixture Model (GMM) to learn the color distribution of the image. The GMM model will classify the image pixels into foreground and background according to the pixel points marked by the user. During the iterative process, the GrabCut algorithm will classify each pixel according to the GMM model and update the classification result of the pixel according to the matching degree of the pixel with the foreground / background model. When the algorithm converges, each pixel will be classified as foreground or background. The final segmentation result can be extracted according to the classification result of the pixel.

[0090] Specifically, during the interactive annotation process, the user guides the algorithm for image segmentation by selecting a rectangular area and marking foreground / background in the image. Through iterative optimization, the segmentation result can be automatically adjusted to obtain a more accurate foreground and background segmentation image. This interactive annotation process helps the user better control the segmentation result and improve the segmentation accuracy.

[0091] When the number of samples is small, in order to obtain more refined samples, an interface for manual intervention can be introduced during the automatic annotation process. An interface for black spot target confirmation can be added to provide input conditions for black spot target confirmation instructions. Through manual intervention, the annotation accuracy of the samples can be improved. Finally, the initial black spot target confirmation is used to label the image, improving the annotation accuracy of the labeled image.

[0092] In some embodiments, determining the initial black spot target according to the initial marked area includes: determining a target pixel label according to the initial marked area; inputting the target pixel label into a Gaussian mixture model to obtain a set of pixel black spot probabilities in the pole piece image; calculating an energy function according to the set of pixel black spot probabilities to obtain a calculation result; updating the Gaussian mixture model according to the calculation result, and inputting the target pixel into the updated Gaussian mixture model until the calculation result of calculating the energy function according to the set of pixel black spot probabilities converges; determining the initial black spot target according to the converged calculation result.

[0093] It should be noted that during the interactive annotation process, the system continuously iteratively performs the segmentation of black spots and the background. By calculating the target pixel labels in the initial marked area through a Gaussian mixture model, the probability that each pixel in the image is a black spot is determined, and all probabilities are collected to obtain a set of pixel black spot probabilities. At this time, in order to verify the segmentation effect, an energy function is introduced in this embodiment to determine the prediction effect of the Gaussian mixture model.

[0094] Among them, the energy function is an index to measure the quality of the segmentation result, and the optimal segmentation result is obtained by minimizing the energy function.

[0095] During the interactive annotation process, the preferred energy function structure can be composed of two parts: data term energy and smooth term energy. Among them, the data term energy measures the consistency between the segmentation result and the original image. It evaluates the possibility that a pixel belongs to the foreground or background based on the color and texture information of the pixel. Usually, a Gaussian distribution is used to model the color distribution of the pixel, and the color of the pixel is compared with the model to calculate the probability that the pixel belongs to the foreground or background. The smooth term energy measures the smoothness of the segmentation result. It encourages adjacent pixels to have similar labels, thereby reducing the noise in the segmentation result. Usually, the spatial relationship between pixels is used to define the smooth term energy. For example, the smooth term energy is measured by calculating the difference or distance between adjacent pixels.

[0096] Combine the pixel labels with the data item energy and the smoothness term energy. The goal is to find a pixel label distribution that minimizes the energy function. This can be achieved through the GraphCut algorithm, which transforms the image segmentation problem into a minimum cut problem and uses the minimum cut algorithm to solve for the optimal segmentation result. By using the energy function in interactive annotation, the data item energy and the smoothness term energy can be utilized to balance color consistency and spatial smoothness, thereby obtaining more accurate foreground and background segmentation results.

[0097] When the calculation result of the energy function converges, that is, when the energy function calculation meets certain requirements or no longer changes, determine the prediction result at this time as the initial black spot target.

[0098] Through the Gaussian mixture model, a set of pixel black spot probabilities in the pole piece image can be obtained. However, the accuracy of this set of black spot probabilities is not necessarily precise enough. Therefore, in this solution, an energy function is introduced to iterate the calculation results of the model, continuously improving the prediction accuracy of the set of pixel black spot probabilities, and finally determining the initial black spot target to improve the accuracy of the samples.

[0099] In some embodiments, the interactive annotation of the pole piece image to obtain a labeled image includes: performing interactive annotation on the pole piece image according to the Grabcut algorithm to obtain a labeled image.

[0100] It should be noted that for the convenience of operation and the accuracy of annotation, this embodiment proposes to use the Grabcut algorithm for annotating the black spot images of the electrode tab. First, select the clearer black spot electrode tab images and use the Grabcut algorithm for interactive annotation. The process is as follows: First, run the Grabcut algorithm code, click the left mouse button to enclose all the black spots, then press "n" for automatic foreground and background segmentation, then press "1" and "0" for black spot marking and background marking respectively, and then press "n" again for automatic foreground and background segmentation. If the segmentation effect is good, the segmentation result can be saved. If the segmentation effect is not good, repeat the black spot and background marking and segmentation steps until the segmentation effect meets the expectation, and the user confirms the black spot target. Preferably, use the Grabcut algorithm for interactive annotation. This algorithm can quickly and accurately find the natural boundary between the black spots and the background according to a certain pattern, thereby greatly improving the annotation efficiency and accuracy. Convert the MASK image obtained in the above steps into numerical data. Here, use the MASK to polygon function (binary_mask_to_polygon) of pycococreatortools, and a json file recording the positions and edges of the black spots can be obtained for each image. The black spot semantic segmentation model requires the dataset to be in VOC format, and the json obtained in the previous step can be converted using the conversion code in the Labelme code library. The converted image is used as the labeled image.

[0101] In this solution, use the Grabcut algorithm for interactive annotation. The Grabcut algorithm performs automatic foreground and background segmentation. If the segmentation effect is good, the segmentation result can be saved. If the segmentation effect is not good, repeat the black spot and background marking and segmentation steps until the segmentation effect meets the expectation. Use the Grabcut algorithm for interactive annotation. This algorithm can quickly and accurately find the natural boundary between the black spots and the background according to a certain pattern, thereby greatly improving the annotation efficiency and accuracy.

[0102] In some embodiments, obtaining the proportion of the black spot area according to the pixel matrix label in the electrode tab image includes: determining the black spot pixel set according to the pixel matrix label; determining the proportion of the black spot area according to the black spot pixel set and the pixel matrix label.

[0103] Specifically, at the end, it is necessary to calculate the proportion of the black spot area based on the pixel matrix labels in the electrode sheet image. The process of calculating the proportion of the black spot (lithium deposition) area can be as follows: After the model training is completed, the model is tested and the test results are visualized. The model will output a result matrix, which is the black spot MASK matrix on a single-fold electrode sheet. Among them, the MASK matrix is a matrix of the same size as the original image, and only the matrix elements corresponding to the positions of the black spots (lithium deposition) are 1, and the others are 0. Summing the number of pixel points with a value of 1 and then dividing by the size of the original image (h×w) gives the proportion of the black spot (lithium deposition) area of this fold of the electrode sheet.

[0104] Since the output results of the model generally appear as eigenvectors in matrix form, the black spot pixel set can be directly determined according to the pixel matrix labels, the number of black spot pixels can be determined, and then the proportion of the black spot area can be calculated based on the total number of pixel points in the pixel matrix labels.

[0105] In addition, an embodiment of the present invention also proposes a storage medium on which a black spot detection program for an electrode sheet is stored. When the black spot detection program for the electrode sheet is executed by a processor, the steps of the black spot detection method for the electrode sheet as described above are implemented.

[0106] Refer to Figure 4 , Figure 4 which is a structural block diagram of an embodiment of the black spot detection device for the electrode sheet of the present invention.

[0107] As Figure 4 shown, the black spot detection device for the electrode sheet proposed in the embodiment of the present invention includes:

[0108] An acquisition module 10, configured to acquire an electrode sheet image;

[0109] A processing module 20, configured to input the electrode sheet image into a black spot semantic segmentation model to obtain pixel matrix labels in the electrode sheet image. The black spot semantic segmentation model is trained by using electrode sheet image samples obtained through interactive annotation and pixel matrix labels in the electrode sheet image samples;

[0110] A processing module 30, configured to obtain the proportion of the black spot area according to the pixel matrix labels in the electrode sheet image.

[0111] It should be understood that the above is only for illustration and does not constitute any limitation to the technical solution of the present invention. In specific applications, those skilled in the art can set according to needs, and the present invention does not make any restrictions in this regard.

[0112] In this embodiment, through the above solution, before the process of black spot detection, the interactive annotation method is used to mark the black spot areas in the black spot model. The pixel number of the black spots in the entire electrode can be directly calculated through the spot semantic segmentation model, so as to calculate the area occupied by the black spots, without the need to identify them one by one through the object detection technology. In the process of detecting large-area electrodes, the quality of the electrode can be directly determined by the proportion of the black spots, without the need to check each black spot one by one. In the quality verification stage, the efficiency of black spot detection is greatly improved.

[0113] It should be noted that the above-described work process is only illustrative and does not limit the protection scope of the present invention. In actual applications, those skilled in the art can select some or all of them according to actual needs to achieve the purpose of the solution of this embodiment, and no limitation is made here.

[0114] In addition, for the technical details not described in detail in this embodiment, reference can be made to the black spot detection method of the electrode provided in any embodiment of the present invention, which will not be elaborated here.

[0115] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the various embodiments of the present application, and they should all be covered by the scope of the claims and the description of the present application. In particular, as long as there is no structural conflict, the technical features mentioned in each embodiment can be combined in any way. The present application is not limited to the specific embodiments disclosed in the text, but includes all technical solutions falling within the scope of the claims.

Claims

1. A method for detecting black spots on a pole piece, characterized in that, the method for detecting black spots on the pole piece includes: Obtain a pole piece image; Input the pole piece image into a black spot semantic segmentation model to obtain the pixel matrix labels in the pole piece image, and the black spot semantic segmentation model is trained by the pole piece image samples obtained through interactive annotation and the pixel matrix labels in the pole piece image samples; Obtain the proportion of the black spot area according to the pixel matrix labels in the pole piece image.

2. The method according to claim 1, characterized in that, before inputting the pole piece image into the black spot semantic segmentation model to obtain the labels of each pixel point in the pole piece image, it further includes: Obtain pole piece image samples; Determine training image information and sample labels according to the pole piece image samples; Input the training image information into an image semantic segmentation model to obtain predicted output data; Adjust the image semantic segmentation model according to the predicted output data and the sample labels to obtain a black spot semantic segmentation model.

3. The method according to claim 2, characterized in that, the image semantic segmentation model is a UperNet model, and the backbone network in the image semantic segmentation model is a SwinTransformer network.

4. The method according to claim 2, characterized in that, the inputting the training image information into the image semantic segmentation model to obtain predicted output data includes: Obtain local feature vectors according to the training image information; Perform a pooling operation on the local feature vectors to obtain image semantic vectors; Perform pixel prediction according to the image semantic vectors to obtain predicted output data.

5. The method according to claim 2, characterized in that, the adjusting the image semantic segmentation model according to the predicted output data and the sample labels to obtain a black spot semantic segmentation model includes: Calculate according to the predicted output data and the sample labels to obtain a loss value; Update the weight parameters in the image semantic segmentation model according to the loss value to obtain a trained image semantic segmentation model; Determine test image information according to the pole piece image, and test the trained image semantic segmentation model according to the test image information to obtain a test result; When the test result converges, determine a black spot semantic segmentation model according to the trained image semantic segmentation model.

6. The method according to claim 5, characterized in that, the calculating according to the predicted output data and the sample labels to obtain a loss value includes: Generate a result index matrix according to the sample labels; Determine a pixel result matrix according to the predicted output data; Substitute the result index matrix and the pixel result matrix into a cross-entropy function to obtain a loss value.

7. The method according to claim 1, characterized in that, the method includes: Obtain a pole piece image; Perform interactive annotation on the pole piece image to obtain a labeled image; Generate a label matrix according to the labeled image; Generate a pixel matrix according to the pole piece image; Generate pole piece image samples according to the label matrix and the pixel matrix.

8. The method according to claim 7, characterized in that, Performing interactive annotation on the pole piece image to obtain a labeled image includes: Obtaining an initial marked area in the pole piece image; Determining an initial black spot target according to the initial marked area; Responding to a black spot target confirmation instruction and confirming the labeled image according to the initial black spot target.

9. The method according to claim 8, wherein, the determining an initial black spot target according to the initial marked area includes: Determining a target pixel label according to the initial marked area; Inputting the target pixel label into a Gaussian mixture model to obtain a set of pixel black spot probabilities in the pole piece image; Calculating an energy function according to the set of pixel black spot probabilities to obtain a calculation result; Updating the Gaussian mixture model according to the calculation result, and inputting the target pixel into the updated Gaussian mixture model until the calculation result of calculating the energy function according to the set of pixel black spot probabilities converges; Determining an initial black spot target according to the converged calculation result.

10. The method according to claim 7, wherein, performing interactive annotation on the pole piece image to obtain a labeled image includes: Performing interactive annotation on the pole piece image according to the Grabcut algorithm to obtain a labeled image.

11. The method according to claim 1, wherein, the obtaining the proportion of the black spot area according to the pixel matrix label in the pole piece image includes: Determining a set of black spot pixels according to the pixel matrix label; Determining the proportion of the black spot area according to the set of black spot pixels and the pixel matrix label.

12. A black spot detection device for a pole piece, wherein, the black spot detection device for the pole piece includes: An acquisition module for acquiring a pole piece image; A processing module for inputting the pole piece image into a black spot semantic segmentation model to obtain a pixel matrix label in the pole piece image, and the black spot semantic segmentation model is trained by using a pole piece image sample obtained through interactive annotation and a pixel matrix label in the pole piece image sample; A processing module for obtaining the proportion of the black spot area according to the pixel matrix label in the pole piece image.

13. A black spot detection device for a pole piece, wherein, the device includes: a memory, a processor, and a black spot detection program for the pole piece stored on the memory and executable on the processor, and the black spot detection program for the pole piece is configured to implement the steps of the black spot detection method for the pole piece according to any one of claims 1 to 11.

14. A storage medium, wherein, a black spot detection program for a pole piece is stored on the storage medium, and when the black spot detection program for the pole piece is executed by a processor, the steps of the black spot detection method for the pole piece according to any one of claims 1 to 11 are implemented.