Battery defect detection method and system, electronic equipment and storage medium
By combining preprocessing the battery image and combining a variety of image data, the trained defect detection model is used for feature extraction, fusion and enhancement, and the type of detection results is determined in combination with the post-processing model, the problem of low accuracy of traditional battery defect detection methods is solved, and higher detection accuracy and fewer overkill and manslaughter phenomena are achieved.
Patent Information
- Application Number
- CN202411847985.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-05-16
AI Technical Summary
Traditional battery defect detection methods rely on a single type of battery image data, have low detection accuracy, and the existing technology has overkill and manslaughter.
By preprocessing the collected battery images, the data set to be detected is obtained, combined with grayscale maps, outline maps or depth maps, the trained defect detection model is used for feature extraction, fusion and enhancement, and finally the type of detection result is determined based on the preset post-processing model.
It improves the accuracy of battery defect detection, reduces overkill and manslaughter phenomena, and enhances the ability to identify diverse and dynamically changing battery defects.
Smart Images

Figure CN120013853A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of detection technology, and in particular to a battery defect detection method, system, electronic equipment and storage medium. Background Art
[0002] The surface defects of lithium batteries directly affect the life and safety of batteries. During the production process of lithium batteries, lithium batteries need to be defect detected. However, there are many types of battery defects, which are diverse and dynamically changing. Traditional detection methods rely on a single type of battery image data for defect identification, and the detection accuracy is low. The existing technology uses detection models to identify defects in multiple collected battery image data, which has the phenomenon of over-killing and false killing, and the detection accuracy is low. Summary of the invention
[0003] The main purpose of the embodiments of the present invention is to provide a battery defect detection method, system, electronic device and storage medium, which can improve the detection accuracy.
[0004] To achieve the above object, an embodiment of the present invention provides a battery defect detection method, the method comprising:
[0005] Preprocessing the collected battery image set to obtain an image data set to be detected;
[0006] The image data set to be detected is processed according to the trained defect detection model to determine the detection result; wherein the image data set to be detected includes any one or more of a grayscale image, a contour image or a depth image of the battery to be detected;
[0007] The detection result is detected according to a preset post-processing model to determine the type of the detection result; and the detection result of the type of true defect is regarded as a battery defect.
[0008] In some embodiments, the processing of the to-be-detected image dataset according to the trained defect detection model to determine the detection result specifically includes:
[0009] Performing feature extraction on the image data set to be detected to determine a plurality of first feature data;
[0010] Performing feature fusion on a plurality of the first feature data to obtain second feature data;
[0011] Performing feature enhancement on the second feature data to determine third feature data;
[0012] Segmentation is performed according to the third feature data to determine the detection result.
[0013] In some embodiments, the extracting features of the image data set to be detected to determine a plurality of first feature data specifically includes:
[0014] Extracting features from the image data set to be detected according to a plurality of preset convolution channels to obtain a plurality of second sub-feature map data;
[0015] A plurality of the second sub-feature map data are weightedly processed according to a plurality of preset attention channels to obtain a plurality of the first feature data.
[0016] In some embodiments, the performing feature fusion on a plurality of the first feature data to obtain the second feature data specifically includes:
[0017] Performing feature concatenation on a plurality of the first feature data to obtain first sub-feature data;
[0018] The first sub-feature data is convolved according to a preset convolution kernel to obtain the second feature data.
[0019] In some embodiments, the performing feature enhancement on the second feature data to determine the third feature data specifically includes:
[0020] Capturing the features of the second feature data according to a plurality of preset convolution kernels to obtain a plurality of context feature information;
[0021] Performing feature concatenation on a plurality of the context feature information to obtain third sub-feature data; performing convolution on the third sub-feature data according to a preset dimensionality reduction convolution kernel to obtain fourth sub-feature data;
[0022] The third feature data is obtained by performing a residual connection on the fourth sub-feature data and the second feature data.
[0023] In some embodiments, the detecting the detection result according to a preset post-processing model to determine the type of the detection result specifically includes:
[0024] Calculating based on a preset mean vector and the characteristic data of the detection result to determine a first distance; comparing the first distance with a first preset threshold; wherein the preset mean vector is determined based on the characteristic data of a known defect;
[0025] If the first distance is less than or equal to the first preset threshold, determining that the type of the battery defect is a true defect;
[0026] If the first distance is greater than the first preset threshold, a grayscale parameter of the detection result is calculated according to the characteristic data, and the grayscale parameter is compared with a preset range; wherein the grayscale parameter includes any one or more of a grayscale mean value, a grayscale maximum value, or a grayscale minimum value;
[0027] If the grayscale parameter falls within the preset range, the type of the detection result is determined to be overkill; otherwise, the detection result is determined to be an unknown defect.
[0028] In some embodiments, the method further comprises:
[0029] Calculating a confidence score of the detection result, and comparing the confidence score with a second preset threshold;
[0030] Marking the battery defects whose confidence scores are less than the second preset threshold, and using the marked detection results as sample data;
[0031] The defect detection model is trained according to the sample data to determine the defect detection model after parameter update.
[0032] To achieve the above object, another aspect of an embodiment of the present invention provides a battery defect detection system, comprising:
[0033] The first module is used to preprocess the collected battery image set to obtain an image data set to be detected;
[0034] The second module is used to process the image data set to be detected according to the trained defect detection model to determine the detection result; wherein the image data set to be detected includes any one or more of the grayscale image, contour image or depth image of the battery to be detected;
[0035] The third module is used to detect the detection result according to a preset post-processing model to determine the type of the detection result; and to treat the detection result of the type of true defect as a battery defect.
[0036] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above-mentioned method when executing the computer program.
[0037] To achieve the above objective, another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.
[0038] Implementation of the embodiments of the present invention includes the following beneficial effects: The embodiments provide a battery defect detection method, system, electronic device and storage medium, which obtains a data set of images to be detected by preprocessing the collected battery images, and the data set of images to be detected includes a battery grayscale image, a contour image or a depth image; then the obtained data set of images to be detected is subjected to defect recognition processing by a trained defect detection model to determine the detection result of the image to be detected; then the detection result output by the defect detection model is detected according to a preset post-processing model to determine the type of the detection result; the detection result of the type of true defect is regarded as a battery defect; the defect detection model is constructed to perform defect recognition detection on the preprocessed image data set to be detected, and the accuracy of defect detection is improved by combining multiple image data; a post-processing model is set to detect the detection result, determine the type of the detection result, reduce over-killing and false killing, and improve detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 is a schematic flow chart of the steps of a battery defect detection method provided by an embodiment of the present invention;
[0040] Figure 2 It is a schematic flow chart of the steps of determining a detection result in a battery defect detection method provided by an embodiment of the present invention;
[0041] Figure 3 It is a schematic flow chart of the steps of feature extraction in a battery defect detection method provided by an embodiment of the present invention;
[0042] Figure 4 It is a schematic flow chart of the steps of feature fusion in a battery defect detection method provided by an embodiment of the present invention;
[0043] Figure 5 It is a schematic flow chart of the steps of multi-scale feature enhancement in a battery defect detection method provided by an embodiment of the present invention;
[0044] Figure 6 It is a schematic flow chart of the steps of performing detection by a post-processing model in a battery defect detection method provided by an embodiment of the present invention;
[0045] Figure 7 It is a schematic flow chart of active learning steps in a battery defect detection method provided by an embodiment of the present invention;
[0046] Figure 8 is a structural block diagram of a defect detection system in a specific embodiment provided by an embodiment of the present invention;
[0047] Fig. 9 is a schematic diagram of a battery to be tested in a specific embodiment provided by an embodiment of the present invention;
[0048] Figure 10(a)-Figure 10(b) It is a schematic diagram of performing end face scanning and cylindrical scanning on a battery to be inspected in a specific embodiment provided by an embodiment of the present invention;
[0049] Fig.11 It is a structural block diagram of a deep learning module in a specific embodiment provided by an embodiment of the present invention;
[0050] Fig.12 It is a structural block diagram of a feature fusion module in a specific embodiment provided by an embodiment of the present invention;
[0051] Fig.13 is a structural block diagram of a multi-scale feature enhancement module in a specific embodiment provided by an embodiment of the present invention;
[0052] Fig.14 It is a schematic diagram of known defect image data of a post-processing screening module in a specific embodiment provided by an embodiment of the present invention;
[0053] Fig.15 It is a schematic diagram of the workflow of a post-processing screening module in a specific embodiment provided by an embodiment of the present invention;
[0054] Fig.16 is a schematic diagram of a workflow of an active learning module in a specific embodiment provided by an embodiment of the present invention;
[0055] Fig.17 is a structural block diagram of a battery defect detection system provided by an embodiment of the present invention;
[0056] Fig.18 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention;
[0057] Among them, 1 is the end face, 2 is the cylinder, 3 is the camera, 4 is the lens, 5 is the light source, and 6 is the battery. DETAILED DESCRIPTION
[0058] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. The step numbers in the following embodiments are only provided for the convenience of explanation and description, and the order between the steps is not limited in any way. The execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.
[0059] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0060] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present invention described herein can be implemented in an order other than that illustrated or described herein.
[0061] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present invention have the same meanings as those commonly understood by those skilled in the art of the present invention. The terms used in the embodiments of the present invention are only for the purpose of describing the embodiments of the present invention and are not intended to limit the present invention.
[0062] Figure 1 is an optional flow chart of a battery defect detection method provided by an embodiment of the present invention. Figure 1 The method may include but is not limited to steps S101 to S103.
[0063] Step S101, preprocessing the collected battery image set to obtain an image data set to be detected;
[0064] Step S102, processing the image data set to be detected according to the trained defect detection model to determine the detection result; wherein the image data set to be detected includes any one or more of a grayscale image, a contour image or a depth image of the battery to be detected;
[0065] Step S103, testing the test result according to a preset post-processing model to determine the type of the test result; and treating the test result of the true defect type as a battery defect.
[0066] In steps S101 to S106 shown in the embodiment of the present application, image data of the lithium battery to be inspected is collected through an image acquisition module, including a grayscale image, a contour image and a depth image, and defects existing in the lithium battery are presented as much as possible through image data of different spectra and types, so as to improve the accuracy of subsequent defect detection; the collected image data is preprocessed to unify the size parameters of the image data, and then input into a pre-trained defect detection model for feature extraction and analysis, and the detection result of the defect detection is output; then, a post-processing model is set to perform a secondary detection on the defect detection model to determine whether the detection result is one of the known defects, and then determine the type of the detection result, thereby reducing over-killing and false positives in defect detection and improving the accuracy of defect detection.
[0067] In step S101 of some embodiments, a 2.5D camera may be used to scan the lithium battery to be inspected, and different types of image data may be obtained simultaneously. Different image acquisition devices may also be used to acquire data from the lithium battery to be inspected, but are not limited thereto.
[0068] See also Figure 2 In some embodiments, step S102 may include but is not limited to steps S201 to S204:
[0069] Step S201, extracting features from the image data set to be detected, and determining a plurality of first feature data;
[0070] Step S202, performing feature fusion on a plurality of first feature data to obtain second feature data;
[0071] Step S203, performing feature enhancement on the second feature data to determine third feature data;
[0072] Step S204: segmentation is performed according to the third characteristic data to determine the detection result.
[0073] In step S201 of some embodiments, a defect detection model is established based on a deep learning network model to perform feature extraction on an input battery image data set to be detected; since the battery image data set to be detected includes different types of image data, different network backbones are correspondingly arranged in the defect detection model for feature extraction, and each backbone is independent of each other; and an attention mechanism is used to weight the feature map data extracted by different backbones, and the importance of different channels is adjusted to retain the unique features of different channels and improve the accuracy of defect detection; in this embodiment, a grayscale map channel, a contour map channel and a depth map channel are arranged in the defect detection model to perform feature extraction on the input image data set, and an SE attention mechanism is arranged after the channel to perform weighted processing on the feature map extracted by the channel to obtain a weighted independent feature map.
[0074] In step S202 of some embodiments, the defect detection model splices the weighted feature maps of the outputs of different backbones, and then convolves the spliced feature map data to fuse the feature map data of different channels into feature map data of a single channel, and performs dimensionality reduction processing on the spliced feature map data to integrate the features of different types of image data, reduce the amount of data calculation, and improve the efficiency of defect detection.
[0075] In step S203 of some embodiments, the defect detection model fuses feature data of different types of image data to obtain a single-channel feature map, and then performs feature enhancement on the fused feature map before segmenting the battery defects in the battery image to be detected according to the feature map, so as to capture features at different scales, improve the feature expression of the fused feature map to the original image, re-extract feature information that may be lost when the feature maps are fused, improve the detail expression of the feature map, and improve the accuracy of defect detection.
[0076] In step S204 of some embodiments, the defect detection model performs defect framing and category prediction based on the fused feature map after feature enhancement to segment the battery defects; performs ROI extraction on the fused feature map after feature enhancement through the bounding box information to obtain ROI features; and then performs convolution and upsampling processing on the extracted ROI features to generate a mask for each battery to be inspected.
[0077] See also Figure 3 In some embodiments, step S201 may include but is not limited to steps S301 to S302:
[0078] Step S301, performing feature extraction on the image data set to be detected according to a plurality of preset convolution channels, to obtain a plurality of second sub-feature map data;
[0079] Step S302: weighted processing is performed on a plurality of second sub-feature map data according to a plurality of preset attention channels to obtain a plurality of first feature data.
[0080] In step S301 of some embodiments, a plurality of independent channels are provided in the defect detection model, and features of different types of image data in the input data are extracted through the independent channels; in this embodiment, the defect detection model sets an independent EfficientNet backbone in each independent channel to obtain unique features of the input image data and output respective feature maps.
[0081] In step S302 of some embodiments, an attention mechanism module is provided after each channel to weight the feature map data output by the channel and adjust the importance of different channels. The defect detection model learns the feature information in the battery image data to be detected in a targeted manner according to the weight of the feature map, thereby improving the accuracy of defect detection. In this embodiment, the SE attention model generates adaptive weights for the feature map data extracted from each channel according to the following formula:
[0082] F′ gray =ω gray ·F gray
[0083] F′ ir =ω ir ·F ir
[0084] F′ shape =ω shape ·F shape
[0085] Among them, F gray 、F ir and F shape They are the grayscale feature map before weighting, the depth feature map before weighting, and the contour feature map before weighting, ωgray ,ω ir and ω shape are the weights of the grayscale channel, the depth channel, and the contour channel, respectively. g ′ ray 、F i ′ r and F s ′ hape They are the weighted grayscale feature map, the weighted depth feature map and the weighted contour feature map respectively.
[0086] See also Figure 4 In some embodiments, step S202 may include but is not limited to steps S401 to S402:
[0087] Step S401, performing feature splicing on a plurality of first feature data to obtain first sub-feature data;
[0088] Step S402: Convolve the first sub-feature data according to a preset convolution kernel to obtain second feature data.
[0089] In step S401 of some embodiments, the defect detection model concatenates the weighted feature map data output by each channel along the channel dimension to form a new feature map, which contains different types of feature data.
[0090] In step S402 of some embodiments, after splicing the feature maps of different channels, the defect detection model uses a convolution kernel to perform convolution processing on the spliced feature map, fuses the feature data of different channels, and reduces the dimension of the spliced feature map, and outputs the fused feature map; in this embodiment, the defect detection model uses a convolution kernel of size 1×1 to perform channel compression on the spliced feature map, reduces the spliced feature map channel data from 3C to C, and generates a feature map with feature fusion.
[0091] See also Figure 5 In some embodiments, step S203 may include but is not limited to steps S501 to S503:
[0092] Step S501, capturing features of the second feature data respectively according to a plurality of preset convolution kernels to obtain a plurality of context feature information;
[0093] Step S502, performing feature concatenation on a plurality of context feature information to obtain third sub-feature data; performing convolution on the third sub-feature data according to a preset dimensionality reduction convolution kernel to obtain fourth sub-feature data;
[0094] Step S503: Perform residual connection on the fourth sub-feature data and the second feature data to obtain third feature data.
[0095] In step S501 of some embodiments, after the defect detection model generates a feature fusion feature map by convolution on the splicing model, a multi-scale feature enhancement module is set to capture features of the feature fusion feature map from different scales to improve the defect detection model's detection capability for different types of defects and improve the defect detection capability; in this embodiment, different sizes of hole convolution kernels are set to process the feature fusion feature map to generate context feature information of different scales;
[0096] In step S502 of some embodiments, the defect detection model captures features of the feature map after feature fusion from different scales to generate feature data of different scales of the feature map; then, the feature data of different scales are spliced, and the spliced feature map is convolved to reduce the channel dimension of the spliced feature map; in this embodiment, the defect detection model uses dilated convolution kernels with different dilation rates to capture contextual feature information of different scales of the feature map of feature fusion, splices the contextual feature information of different scales, and uses a convolution kernel of size 1×1 to reduce the dimension of the spliced contextual feature information to obtain a multi-scale feature map.
[0097] In step S503 of some embodiments, the defect detection model performs residual connection based on the feature map of feature fusion and the multi-scale feature map obtained by feature enhancement processing, retains the feature information of the original feature fusion feature map, enriches the detail expression of the features, and improves the accuracy of subsequent defect detection; at the same time, the defect detection model reduces the gradient vanishing and gradient explosion problems of feature extraction at different scales through residual connection, thereby improving the accuracy and efficiency of subsequent defect detection.
[0098] See also Figure 6 In some embodiments, step S103 may include but is not limited to steps S601 to S604:
[0099] Step S601, calculating based on a preset mean vector and characteristic data of the detection result to determine a first distance; comparing the first distance with a first preset threshold; wherein the preset mean vector is determined based on characteristic data of a known defect;
[0100] Step S602, if the first distance is less than or equal to the first preset threshold, determining the type of the detection result is a true defect;
[0101] Step S603, if the first distance is greater than the first preset threshold, calculate the grayscale parameter of the detection result according to the characteristic data, and compare the grayscale parameter with the preset range; wherein the grayscale parameter includes any one or more of the grayscale mean value, the grayscale maximum value or the grayscale minimum value;
[0102] Step S604: if the grayscale parameter falls within the preset range, the type of the detection result is determined to be overkill; otherwise, the detection result is determined to be an unknown defect.
[0103] In step S601 of some embodiments, the defect detection model collects defect feature data of known battery defects, illustratively including depth map data of inclusion and scratch defect features, contour map data of bubble defect features, and grayscale map data of pit and stain defect features; the defect detection model counts the mean vector and covariance matrix of the defect area, grayscale mean, aspect ratio, and grayscale extreme value in the collected known defect feature data to construct a model of the defect feature range; at the same time, the defect detection model counts the grayscale mean and grayscale extreme value of defect-free batteries to construct a defect-free feature range model; after the defect detection model detects the input image data and outputs the detection result, the Mahalanobis distance is calculated based on the feature data of the detection result and the mean vector obtained by the statistics of the known battery defect, and whether the detection result is a known battery defect is determined based on the Mahalanobis distance; wherein the Mahalanobis distance is calculated according to the following formula:
[0104]
[0105] Among them, X is the feature vector of the detection result, is the Mahalanobis distance between the test result and the feature vector of the known defect, μ is the matrix vector of the feature vector of the known defect, k is different defect categories, is the inverse matrix of the covariance mean.
[0106] In step S602 of some embodiments, the defect detection model determines a judgment threshold based on the characteristic data of the known defect, and compares the magnitude of the Mahalanobis distance calculated based on the characteristic data of the detection result and the mean vector of the known defect with the judgment threshold; if the Mahalanobis distance is less than or equal to the judgment threshold, the defect detection model can determine that the detection result is a known battery defect and regard the detection result as a true defect.
[0107] In step S603 of some embodiments, if the Mahalanobis distance is greater than the judgment mean, the defect detection model can determine that the detection result deviates from the defect feature statistical range, and the defect detection model determines that the area where the current battery defect is located is an abnormal area, and further detection and identification of the area is required to improve the accuracy of defect detection; in this embodiment, the defect detection model calculates the grayscale parameters of the area determined to be abnormal, determines the grayscale value and grayscale extreme value of the abnormal area, and compares the grayscale value and grayscale extreme value of the abnormal area with the defect-free feature range model constructed by the defect detection model to further determine the type of the abnormal area.
[0108] In step S604 of some embodiments, if the grayscale value and grayscale extreme value of the abnormal area fall within the defect-free feature range model, it means that the defect detection model has over-killed and the originally defect-free battery area is identified and detected as a battery defect; the defect detection model updates the detection result according to the comparison result to improve the defect detection accuracy; if the grayscale value and grayscale extreme value of the abnormal area do not fall within the defect-free feature range model, it means that the detection result is not a defect-free area, and there is a defect on the outer surface of the battery to be detected, but it is not a known defect, and the defect detection model marks the defect as an unknown defect.
[0109] See also Figure 7 In some embodiments, a battery defect detection method provided by an embodiment of the present invention may also include but is not limited to steps S701 to S703:
[0110] Step S701, calculating the confidence score of the detection result, and comparing the confidence score with a second preset threshold;
[0111] Step S702, marking the detection results whose confidence scores are less than a second preset threshold, and using the marked detection results as sample data;
[0112] Step S703, training the defect detection model according to the sample data to determine the defect detection model after parameter update.
[0113] In step S701 of some embodiments, before the defect detection model performs actual detection, it is necessary to annotate the collected data, and then train the constructed model based on the annotated data to obtain the defect detection model; in actual applications, many new battery defects may appear, and the defect detection model may not be able to detect the newly emerged battery defects, resulting in insufficient overall accuracy; therefore, it is necessary to retrain the defect detection model regularly to improve the model's ability to recognize defects; in this embodiment, an active learning model is set in the defect detection system, and a confidence score is calculated for the detection results output by the defect detection model. According to the confidence score, the most informative feature data is selected from the output detection results as samples for annotation, and the defect detection model is retrained based on the newly annotated sample data and the existing annotated samples, so as to reduce the number of annotated samples and reduce costs; at the same time, the most informative sample data is selected to train the defect detection model to improve the accuracy of defect detection.
[0114] In step S702 of some embodiments, the active learning model calculates a confidence score for the detection result output by the defect detection model, and compares the confidence score with a preset judgment threshold to determine the prediction accuracy of the defect detection model for the sample data when the detection result is used as sample data. In this embodiment, the active learning model automatically saves the detection results with a confidence score lower than 0.6 to an unlabeled sample pool, and after manual labeling, uses them as sample data and existing labeled sample data as training samples for the defect detection model.
[0115] In step S703 of some embodiments, the active learning model periodically retrains the defect detection model based on the updated sample data, optimizes the model parameters of the current defect detection model, and learns the defect feature information in the sample data to improve the defect detection model's ability to identify different defects, thereby improving the accuracy of defect detection.
[0116] The following is a detailed description and explanation of the solution of the embodiment of the present invention in conjunction with a specific application example:
[0117] See also Figure 8 , Figure 8 is a system structure block diagram of a battery defect detection method provided by an embodiment of the present invention in a specific embodiment, including a 2.5D imaging system module, a deep learning detection module, a post-processing screening module, an active learning module and a final output; the 2.5D imaging system module uses a 2.5D camera with an intelligent light source to detect Fig. 9 The battery to be tested is photographed at the end face as shown in FIG10(a) and at the cylindrical face as shown in FIG10(b), and a grayscale image, a contour image, and a depth image of the battery to be tested are output in one shot; the image data obtained by the shooting is input into the Fig.11 Defect detection is performed in the deep learning module shown in the figure. Features are extracted through independent channels of each branch, and weighted through the SE attention mechanism to output weighted feature maps. The weighted feature maps output by each channel are input Fig.12 The feature fusion module shown in the figure performs feature concatenation and dimensionality reduction fusion to obtain a fused feature map; then the fused feature map is input into Fig.13 The multi-scale feature enhancement module shown in FIG. performs feature enhancement, outputs the enhanced fusion feature map, performs segmentation recognition based on the enhanced fusion feature map, and outputs the detection results and masks; the deep learning module outputs the detection results to the post-processing screening module, and the post-processing screening module collects the following information: Fig.14 The known defect image data shown in the figure is used to obtain the defect feature range module and the non-defect feature range module through statistical calculation. The post-processing screening module is based on the following Fig.15 The processing flow shown in the figure judges the detection result to determine whether the detection result is a real defect, an over-detection defect, or an unknown defect; the deep learning module also outputs the detection result to the active learning module. The active learning module Fig.16 The processing procedure shown processes the detection results and uses the detection results that meet the conditions as samples to optimize the parameters of the deep learning module.
[0118] Implementation of the embodiments of the present invention includes the following beneficial effects: The embodiments provide a battery defect detection method, system, electronic device and storage medium, which obtains a data set of images to be detected by preprocessing the collected battery images, and the data set of images to be detected includes a battery grayscale image, a contour image or a depth image; then the obtained data set of images to be detected is subjected to defect recognition processing by a trained defect detection model to determine the detection result of the image to be detected; then the detection result output by the defect detection model is detected according to a preset post-processing model to determine the type of the detection result; the detection result of the type of true defect is regarded as a battery defect; the defect detection model is constructed to perform defect recognition detection on the preprocessed image data set to be detected, and the accuracy of defect detection is improved by combining multiple image data; a post-processing model is set to detect the detection result, determine the type of the detection result, reduce over-killing and false killing, and improve detection accuracy.
[0119] like Fig.17 As shown, an embodiment of the present invention further provides a battery defect detection system, which can implement the above-mentioned battery defect detection method, and the system includes:
[0120] The first module is used to preprocess the collected battery image set to obtain an image data set to be detected;
[0121] The second module is used to process the image data set to be detected according to the trained defect detection model to determine the detection result; wherein the image data set to be detected includes any one or more of the grayscale image, contour image or depth image of the battery to be detected;
[0122] The third module is used to detect the detection result according to a preset post-processing model to determine the type of the detection result; and to treat the detection result of the type of true defect as a battery defect.
[0123] It can be seen that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0124] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned battery defect detection method when executing the computer program. The electronic device can be any smart terminal including a tablet computer, a car computer, etc.
[0125] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0126] See also Fig.18 , Fig.18 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0127] The processor 1801 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0128] The memory 1802 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1802 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1802, and the processor 1801 calls and executes a battery defect detection method in the embodiment of this application;
[0129] Input / output interface 1803, used to implement information input and output;
[0130] The communication interface 1804 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0131] A bus 1805 that transmits information between the various components of the device (e.g., the processor 1801, the memory 1802, the input / output interface 1803, and the communication interface 1804);
[0132] The processor 1801 , the memory 1802 , the input / output interface 1803 and the communication interface 1804 are connected to each other in communication within the device via the bus 1805 .
[0133] Among them, the memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. The memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a remote memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0134] In addition, the embodiment of the present application also discloses a computer program product or a computer program, and the computer program product or the computer program is stored in a computer-readable storage medium. The processor of the computer device can read the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device performs the above method. Similarly, the contents in the above method embodiment are all applicable to the storage medium embodiment, and the functions specifically implemented by the storage medium embodiment are the same as those in the above method embodiment, and the beneficial effects achieved are also the same as those achieved by the above method embodiment.
[0135] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned battery defect detection method is implemented.
[0136] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0137] It is understood that all or some steps and systems in the disclosed method above can be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, and the computer-readable medium can include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassette, magnetic tape, disk storage or other magnetic storage device, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0138] The above is a specific description of the preferred implementation of the present invention, but the invention is not limited to the embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A battery defect detection method, characterized in that: The method comprises: Preprocessing the collected battery image set to obtain an image data set to be detected; The image data set to be detected is processed according to the trained defect detection model to determine the detection result; wherein the image data set to be detected includes any one or more of a grayscale image, a contour image or a depth image of the battery to be detected; The detection result is detected according to a preset post-processing model to determine the type of the detection result; and the detection result of the type of true defect is regarded as a battery defect.
2. The method according to claim 1, characterized in that The processing of the image data set to be detected according to the trained defect detection model to determine the detection result specifically includes: Performing feature extraction on the image data set to be detected to determine a plurality of first feature data; Performing feature fusion on a plurality of the first feature data to obtain second feature data; Performing feature enhancement on the second feature data to determine third feature data; Segmentation is performed according to the third feature data to determine the detection result.
3. The method according to claim 2, characterized in that The step of extracting features from the image data set to be detected to determine a plurality of first feature data specifically includes: Extracting features from the image data set to be detected according to a plurality of preset convolution channels to obtain a plurality of second sub-feature map data; A plurality of the second sub-feature map data are weightedly processed according to a plurality of preset attention channels to obtain a plurality of the first feature data.
4. The method according to claim 2, characterized in that: The performing feature fusion on a plurality of the first feature data to obtain the second feature data specifically includes: Performing feature concatenation on a plurality of the first feature data to obtain first sub-feature data; The first sub-feature data is convolved according to a preset convolution kernel to obtain the second feature data.
5. The method according to claim 2, characterized in that: The step of enhancing the feature of the second feature data to determine the third feature data specifically includes: Capturing the features of the second feature data according to a plurality of preset convolution kernels to obtain a plurality of context feature information; Performing feature concatenation on a plurality of the context feature information to obtain third sub-feature data; performing convolution on the third sub-feature data according to a preset dimensionality reduction convolution kernel to obtain fourth sub-feature data; The third feature data is obtained by performing a residual connection on the fourth sub-feature data and the second feature data.
6. The method according to claim 1, characterized in that The detecting the detection result according to the preset post-processing model to determine the type of the detection result specifically includes: Calculating based on a preset mean vector and the characteristic data of the detection result to determine a first distance; comparing the first distance with a first preset threshold; wherein the preset mean vector is determined based on the characteristic data of a known defect; If the first distance is less than or equal to the first preset threshold, determining that the type of the detection result is a true defect; If the first distance is greater than the first preset threshold, a grayscale parameter of the detection result is calculated according to the characteristic data, and the grayscale parameter is compared with a preset range; wherein the grayscale parameter includes any one or more of a grayscale mean value, a grayscale maximum value, or a grayscale minimum value; If the grayscale parameter falls within the preset range, the type of the detection result is determined to be overkill; otherwise, the detection result is determined to be an unknown defect.
7. The method according to claim 1, characterized in that The method further comprises: Calculating a confidence score of the detection result, and comparing the confidence score with a second preset threshold; Annotating the detection results whose confidence scores are less than the second preset threshold, and using the annotated detection results as sample data; The defect detection model is trained according to the sample data to determine the defect detection model after parameter update.
8. A battery defect detection system, characterized in that: include: The first module is used to preprocess the collected battery image set to obtain an image data set to be detected; The second module is used to process the image data set to be detected according to the trained defect detection model to determine the detection result; wherein the image data set to be detected includes any one or more of the grayscale image, contour image or depth image of the battery to be detected; The third module is used to detect the detection result according to a preset post-processing model to determine the type of the detection result; and to treat the detection result of the type of true defect as a battery defect.
9. An electronic device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to perform the method according to any one of claims 1 to 7 when executed by the processor.