A method and system for detecting hidden cracks in battery cells based on deep learning
Through deep learning technology and adaptive image processing, a battery cell hidden crack detection network is built, which solves the problems of low efficiency and poor accuracy of traditional detection methods, and realizes efficient and automated battery cell hidden crack detection, which is suitable for large-scale production needs.
Patent Information
- Application Number
- CN202410884562.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-07-03
AI Technical Summary
Traditional battery cell cryptographic detection methods are inefficient and are susceptible to manual operations. In addition, automated image processing technology has low detection rate and accuracy when processing images with complex backgrounds or hidden cracks, making it difficult to meet the needs of large-scale production.
Using deep learning-based cell hijack crack detection method, a deep learning network for cell hijack crack detection is constructed through adaptive image enhancement, multi-scale morphological operation and principal component analysis, a deep learning network for cell hijack crack detection is defined, and loss functions are carried out and parameter training is performed to achieve automated detection.
It significantly improves the accuracy and detection efficiency of hidden crack identification, reduces the subjective error of manual detection, meets the needs of modern industry for high efficiency and high accuracy, and is suitable for real-time or near-real-time online detection.
Smart Images

Figure CN118691590B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of hidden crack detection, and in particular to a method and system for detecting hidden cracks in battery cells based on deep learning. Background Art
[0002] As a common defect, cell cracking has a significant adverse effect on the performance and life of solar panels. Traditional cell cracking detection methods mainly rely on manual visual inspection or simple image processing technology, which have multiple limitations. First, manual detection methods are inefficient and easily affected by operator fatigue and subjective judgment, resulting in low consistency and accuracy of detection results. In addition, with the rapid development of the solar industry, the requirements for cell output and quality are constantly increasing, and manual detection methods can no longer meet the needs of large-scale production. Secondly, although some automated image processing techniques have been proposed, they are usually based on simple threshold operations or morphological processing, lacking a deep understanding and analysis of image features. These methods often show low detection rates and accuracy when processing cell images with complex backgrounds or unclear cracking features. Summary of the invention
[0003] In view of this, the present invention provides a battery cell hidden crack detection method based on deep learning, the purpose of which is to automate the battery cell hidden crack detection process through deep learning technology, reduce the need for manual detection, reduce labor costs, and improve detection speed.
[0004] To achieve the above object, the present invention provides a method for detecting hidden cracks in a battery cell based on deep learning, comprising the following steps:
[0005] S1: Input the cell image to be inspected, grayscale and contrast enhance the image through an adaptive image enhancement algorithm to obtain a preprocessed image;
[0006] S2: Apply multi-scale morphological operations to the preprocessed image to extract the edge features of the battery cell;
[0007] S3: Fusing the preprocessed image with the edge features of the cell, and performing feature dimensionality reduction through principal component analysis to obtain a reduced-dimensional image;
[0008] S4: Build a deep learning network for cell crack detection and set the network input and output;
[0009] S5: define the loss function of the deep learning network for detecting hidden cracks in battery cells and perform parameter training, and use the trained deep learning network for detecting hidden cracks in battery cells to detect undetected battery cell images;
[0010] As a further improvement method of the present invention:
[0011] Optionally, in step S1, the cell image to be inspected is input, and the image is grayed and contrast enhanced by an adaptive image enhancement algorithm to obtain a preprocessed image, including:
[0012] S11: Image grayscale:
[0013] The cell image I to be detected is grayed using the adaptive weights to obtain a grayed image I′, specifically:
[0014] I′(x,y)= red · red (x,y)+ green · green (x,y)+ blue · blue (x,y)
[0015] Where (x, y) is the pixel position; I′(x, t) is the value of I′ at (x, y); I red ,I green and I blue I is the red, green and blue channel images of the battery cell image to be detected; red (x,y),I green (x,y) and I blue (x,y) is I red ,I green and I blue The value at (x,y); ω red ,ω green and ω blue are the weights of the red, green and blue channels;
[0016] S12: Local contrast enhancement:
[0017] Perform local contrast enhancement on I′ to obtain a contrast-enhanced image Specifically:
[0018]
[0019] in, for The value at (x,y); μ local (x,y) and σ local (x, y) are the mean and standard deviation of the pixels in the 5×5 local area centered at (x, y); δ is a constant;
[0020] S13: Global contrast adjustment:
[0021] Adjusting contrast-enhanced images The global contrast of the image I is obtainedglobal , specifically:
[0022]
[0023] Among them, I global (x,y) is I global The value at (x, y); a and b are global contrast adjustment parameters; globalmax(I′) and globalmin(I′) are the maximum and minimum values of the grayscale image I′ respectively; and The contrast-enhanced images are The maximum and minimum values of ;
[0024] Final preprocessed image for:
[0025]
[0026] Among them, the clip function is used to limit the pixel value to the range of 0 to 255;
[0027] Optionally, in step S2, multi-scale morphological operations are applied to the pre-processed image to extract edge features of the cell, including:
[0028] S21: Define structural elements and morphological corrosion and dilation operations:
[0029] Define the square structure element, the expression is:
[0030]
[0031] Among them, B s is a square structural element with side length s and center at the origin;
[0032] The preprocessed image is subjected to morphological erosion and dilation operations, and the expressions of the morphological erosion and dilation operations are:
[0033]
[0034] Among them, the max and min functions return the maximum and minimum values in the set; eroded (x,y) is a pair The value of the eroded image at (x, y), which is the structural element B s The maximum value of all pixels in I dilated (x,y) is a pair The value of the expanded image at (x, y), which is the structural element B s The minimum value of all pixels in ;
[0035] S22: Opening and closing operations:
[0036] After preprocessing, the image Perform opening and closing operations, the opening and closing operations are:
[0037]
[0038] Among them, I opend (x,y) is a pair The value of the image after the opening operation at (x, y); I closed (x,y) is a pair The value of the image after the closing operation at (x, y);
[0039] S23: Multi-scale morphological operations:
[0040] After preprocessing, the image Apply square structural elements of different sizes Perform the operations and calculations in S21 and S22 to obtain s i Results of open and close operations under scale and s i represents the size of the square structure element, i = 1, 2, 3;
[0041] S24: Edge feature extraction:
[0042] Use the opening and closing operation results at different scales to extract edge features and obtain the cell edge feature I edges , specifically:
[0043]
[0044] Among them, I edges (x,y) is I edges The value at (x,y); and They are s i The value of the open and closed operation results at (x, y) under the scale;
[0045] Optionally, in step S3, the preprocessed image is fused with the edge features of the cell, and feature dimensionality reduction is performed through principal component analysis to obtain a reduced-dimensional image, including:
[0046] S31: Construct feature matrix and center it:
[0047] After preprocessing, the image The weighted average fusion process is performed with the edge features of the battery cell to obtain the fused image I combined , specifically:
[0048]
[0049] The cell image to be detected is concatenated with the fused image in the channel dimension to obtain the image I to be reduced in dimension. full ;
[0050] Use I full Construct the feature matrix X, where each row represents a pixel and each column represents a channel;
[0051] Centralize the feature matrix to obtain the centralized matrix X cen :
[0052]
[0053] in, is the mean vector of each column of the feature matrix;
[0054] S32: Calculate the covariance matrix and regularize it:
[0055] Calculate the covariance matrix Ψ of the centered matrix as follows:
[0056]
[0057] Where M is the number of image pixels to be reduced; X cen Trans For X cen The transposed matrix of
[0058] Introduce the regularization term λΓ to the covariance matrix, where λ is the regularization parameter and Γ is the identity matrix:
[0059] Ψ reg =Ψ+λΓ
[0060] S33: Eigenvalue decomposition and feature dimensionality reduction:
[0061] Perform eigenvalue decomposition on the regularized covariance matrix to obtain eigenvectors and eigenvalues, specifically:
[0062] Ψ reg V=VΛ
[0063] Among them, V is the eigenvector matrix; Λ is the eigenvalue matrix;
[0064] Select the eigenvectors corresponding to the first k principal components according to the eigenvalues and construct the projection matrix V k , and use the regularized eigenvector to reduce the feature dimension and obtain the reduced feature matrix X reduced :
[0065]
[0066] Among them, Λ l is the eigenvalue matrix corresponding to the selected principal component, is the square root of its inverse matrix;
[0067] Convert the reduced feature matrix back to a two-dimensional feature map to obtain the reduced image I reduced ;
[0068] Optionally, in step S4, a deep learning network for detecting hidden cracks in a battery cell is constructed, and input and output of the network are set, including:
[0069] The reduced image I reduced Input to the deep learning network for cell crack detection, the structure of which is consistent with the target detection network FasterRCNN, specifically:
[0070] Prob,Box=FasterRCNN(I reduced )
[0071] Wherein, Prob is the probability of hidden cracks in the battery cell predicted by the deep learning network for hidden crack detection of the battery cell; Box is the bounding box of hidden cracks in the battery cell predicted by the deep learning network for hidden crack detection of the battery cell, Box = (x1, y1, x2, y2), (x1, y1) and (x2, y2) are the coordinates of the upper left corner and the lower right corner of the bounding box respectively;
[0072] Optionally, in step S5, the loss function of the deep learning network for detecting hidden cracks in battery cells is defined and parameter training is performed, and the trained deep learning network for detecting hidden cracks in battery cells is used to detect undetected battery cell images, including:
[0073] S51: Define the loss function:
[0074] The loss function of the deep learning network for cell crack detection consists of classification loss L1 and bounding box loss L2. The classification loss is:
[0075] L1=-(Prob * ln(Prob)+(1-rob * )ln(1-rob))
[0076] Among them, Prob * is the probability of actual hidden cracks in the cell, 1 if there is hidden cracks, otherwise 0;
[0077] The bounding box loss is specifically:
[0078] L2=1-Ω
[0079] Among them, Ω is the improved intersection-over-union ratio, specifically:
[0080]
[0081] Q=|x2-x1)·(y2-y1)|
[0082]
[0083] in, and are the upper left corner coordinates and lower right corner coordinates of the real bounding box respectively; IoU is the intersection over union ratio of the real and predicted bounding boxes of the cell crack; Condition 1 is and min and max are minimum and maximum selection functions; Q, Q1, Q2 and Q3 are four temporary area variables;
[0084] The final loss function is:
[0085] L=L1+L2
[0086] S52: Parameter training and application:
[0087] Based on the final loss function, the parameters of the deep learning network for detecting hidden cracks in the battery cell are trained using stochastic gradient descent; the undetected battery cell images are input into the trained deep learning network for detecting hidden cracks in the battery cell to obtain the bounding box of the detected hidden cracks;
[0088] The present invention also discloses a battery sheet hidden crack detection system based on deep learning, comprising:
[0089] Preprocessing module: input the cell image to be inspected, and grayscale and enhance the contrast of the image through the adaptive image enhancement algorithm;
[0090] Edge feature extraction module: applies multi-scale morphological operations to the preprocessed image to extract the edge features of the battery cell;
[0091] Dimensionality reduction module: fuses the preprocessed image with the edge features of the cell and performs feature dimensionality reduction through principal component analysis;
[0092] Network construction module: construct a deep learning network for cell crack detection and set the network input and output;
[0093] Network training and application module: define the loss function of the deep learning network for battery cell hidden crack detection and perform parameter training, and use the trained deep learning network for battery cell hidden crack detection to detect undetected battery cell images;
[0094] Beneficial effects:
[0095] The present invention uses deep learning technology to construct a deep learning network for cell crack detection. Through adaptive image enhancement and multi-scale morphological operations, it significantly improves the ability to extract crack features from complex image backgrounds. This advanced data processing method not only greatly improves the accuracy of crack recognition, but also greatly improves the detection efficiency through automated detection processes, reduces subjective errors and fatigue factors in manual detection, and meets the dual needs of modern industrial production for high efficiency and high precision.
[0096] The present invention uses principal component analysis to perform feature dimensionality reduction after feature extraction, effectively reducing the data dimension while retaining the most representative information. This optimized feature processing flow not only improves the training efficiency and detection speed of the subsequent deep learning model, but also reduces the computational complexity, making the method of the present invention more suitable for real-time or near real-time online detection needs, and enhancing the feasibility and response speed of the model in practical applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0097] Figure 1 A schematic diagram of a process of detecting hidden cracks in a battery cell based on deep learning according to an embodiment of the present invention;
[0098] Figure 2 Schematic diagram of battery cell hidden crack detection results according to an embodiment of the present invention. DETAILED DESCRIPTION
[0099] The present invention is further described below in conjunction with the accompanying drawings, but the present invention is not limited in any way. Any changes or substitutions made based on the teachings of the present invention belong to the protection scope of the present invention.
[0100] Embodiment 1: A method for detecting hidden cracks in a battery cell based on deep learning, such as Figure 1 As shown, the following steps are included:
[0101] S1: Input the cell image to be inspected, grayscale and contrast enhance the image through the adaptive image enhancement algorithm to obtain the preprocessed image:
[0102] S11: Image grayscale:
[0103] The cell image I to be detected is grayed using the adaptive weights to obtain a grayed image I′, specifically:
[0104] I′(x,y)= red · red (x,y)+ green · green (x,y)+ blue · blue (x,y)
[0105] Where (x, y) is the pixel position; I′(x, y) is the value of I′ at (x, y); I red ,I green and I blue I is the red, green and blue channel images of the battery cell image to be detected; red (x,y),I green (x,y) and I blue (x,y) is I red ,I green and I blue The value at (x,y); ω red ,ω green and ω blue are the weights of the red, green, and blue channels, calculated as:
[0106]
[0107] Among them, color∈{red,green,blue};σ red , σ green and σ blue is the standard deviation of the red, green and blue channel images;
[0108] S12: Local contrast enhancement:
[0109] Perform local contrast enhancement on I′ to obtain a contrast-enhanced image Specifically:
[0110]
[0111] in, for The value at (x,y); μ local (x,y) and σ local (x, y) are the mean and standard deviation of the pixels in a 5×5 local area centered at (x, y); δ is a small constant, which is 0.000001 in this embodiment;
[0112] S13: Global contrast adjustment:
[0113] Adjusting contrast-enhanced images The global contrast of the image I is obtained global , specifically:
[0114]
[0115] Among them, I global (x,y) is I globalThe value at (x, ya; a and b are global contrast adjustment parameters; globalmax(I′) and globalmin(I′) are the maximum and minimum values of the grayscale image I′ respectively; and The contrast-enhanced images are The maximum and minimum values of ;
[0116] Final preprocessed image for:
[0117]
[0118] Among them, the clip function is used to limit the pixel value to the range of 0 to 255;
[0119] By using adaptive weights calculated based on the standard deviation of each channel for grayscale, the algorithm can dynamically adjust the contribution according to the activity of different image channels, so as to maintain good visual effects and feature recognizability under different lighting and color backgrounds. Local contrast enhancement can enhance the local details of the image while maintaining the natural look and feel of the image, making the tiny cracks and defects on the battery cell more obvious. This is crucial for subsequent feature extraction and defect identification. By combining local contrast enhancement and global contrast adjustment, the algorithm not only enhances the details of the image, but also takes into account the overall visual effect, avoids image distortion caused by excessive enhancement, and ensures that the image has balanced contrast on a global scale.
[0120] S2: Apply multi-scale morphological operations to the preprocessed image to extract the edge features of the battery cell:
[0121] S21: Define structural elements and morphological corrosion and dilation operations:
[0122] Define the square structure element, the expression is:
[0123]
[0124] Among them, B s is a square structural element with side length s and center at the origin;
[0125] The preprocessed image is subjected to morphological erosion and dilation operations, and the expressions of the morphological erosion and dilation operations are:
[0126]
[0127] Among them, the max and min functions return the maximum and minimum values in the set; eroded (x,y) is a pair The value of the eroded image at (x, y), which is the structural element Bs The maximum value of all pixels in I dilated (x,y) is a pair The value of the expanded image at (x, y0, which is the structural element B s The minimum value of all pixels in ;
[0128] S22: Opening and closing operations:
[0129] After preprocessing, the image Perform opening and closing operations, the opening and closing operations are:
[0130]
[0131] Among them, I opend (x,y) is a pair The value of the image after the opening operation at (x, y); I closed (x,y) is a pair The value of the image after the closing operation at (x, y);
[0132] S23: Multi-scale morphological operations:
[0133] After preprocessing, the image Apply square structural elements of different sizes Perform the operations and calculations in S21 and S22 to obtain s i Results of open and close operations under scale and s i represents the size of the square structure element, i=1, 2, 3. In this embodiment, the side lengths of s1, s2 and s3 are 3, 5 and 7 respectively;
[0134] S24: Edge feature extraction:
[0135] Use the opening and closing operation results at different scales to extract edge features and obtain the cell edge feature I edges , specifically:
[0136]
[0137] Among them, I edges (x,y) is I edges The value at (x,y); and They are s i The value of the open and closed operation results at (x, y) under the scale;
[0138] By using structural elements of different sizes, morphological operations can capture edge features of different sizes. This multi-scale analysis is effective for identifying both tiny cracks and larger defects that may appear on the cell, improving the comprehensiveness of the detection method. Morphological erosion and dilation operations help to strengthen the edge features of the image. The erosion operation can eliminate the noise around the edge, while the dilation operation can enhance the continuity and significance of the edge, making the edge of the hidden crack more prominent. The opening operation helps to remove small noise points and broken edges through the process of first erosion and then dilation, thereby reducing false detections. The closing operation helps to connect adjacent edge fragments, fill small gaps, and make the edge more complete through the process of first dilation and then erosion.
[0139] S3: The preprocessed image is fused with the edge features of the cell, and feature dimensionality reduction is performed through principal component analysis to obtain a reduced-dimensional image:
[0140] S31: Construct feature matrix and center it:
[0141] After preprocessing, the image The weighted average fusion process is performed with the edge features of the battery cell to obtain the fused image I combined , specifically:
[0142]
[0143] The cell image to be detected is concatenated with the fused image in the channel dimension to obtain the image I to be reduced in dimension. full :
[0144] I full =[I red ,I green ,I blue ,I combined ]
[0145] Use I full Construct the feature matrix X, where each row represents a pixel and each column represents a channel;
[0146] Centralize the feature matrix to obtain the centralized matrix X cen :
[0147]
[0148] in, is the mean vector of each column of the feature matrix;
[0149] S32: Calculate the covariance matrix and regularize it:
[0150] Calculate the covariance matrix Ψ of the centered matrix as follows:
[0151]
[0152] Where M is the number of image pixels to be reduced; X cen Trans For X cen The transposed matrix of
[0153] Introduce the regularization term λΓ to the covariance matrix, where λ is the regularization parameter and Γ is the identity matrix:
[0154] Ψ red =∑+λΓ
[0155] S33: Eigenvalue decomposition and feature dimensionality reduction:
[0156] Perform eigenvalue decomposition on the regularized covariance matrix to obtain eigenvectors and eigenvalues, specifically:
[0157] Ψ reg V=VΛ
[0158] Among them, V is the eigenvector matrix; Λ is the eigenvalue matrix;
[0159] Select the eigenvectors corresponding to the first k principal components according to the eigenvalues and construct the projection matrix V k , and use the regularized eigenvector to reduce the feature dimension and obtain the reduced feature matrix X reduced :
[0160]
[0161] Among them, Λ k is the eigenvalue matrix corresponding to the selected principal component, is the square root of its inverse matrix;
[0162] Convert the reduced feature matrix back to a two-dimensional feature map to obtain the reduced image I reduced ;
[0163] By weighted averaging the fusion of preprocessed images and edge features, the generated fused image can simultaneously reflect the overall visual information and local edge details of the battery cell, providing more comprehensive input data for the deep learning model. Principal component analysis is a classic linear dimensionality reduction technique that can effectively reduce feature dimensions while retaining most of the variance in the data set, thereby reducing the computational complexity of the model and avoiding overfitting. Introducing regularization terms in the calculation of the covariance matrix helps to improve the stability and generalization ability of the algorithm, especially when processing high-dimensional small sample data, which can prevent overfitting during model training. The feature matrix after dimensionality reduction is more suitable for the training of deep learning models, which helps to improve the training speed and detection accuracy of the model.
[0164] S4: Build a deep learning network for cell crack detection and set the network input and output:
[0165] The reduced image I reduced Input to the deep learning network for cell crack detection, the structure of which is consistent with the target detection network FasterRCNN, specifically:
[0166] Prob,Box=FasterRCNN(I reduced )
[0167] Wherein, Prob is the probability of hidden cracks in the battery cell predicted by the deep learning network for hidden crack detection of the battery cell; Box is the bounding box of hidden cracks in the battery cell predicted by the deep learning network for hidden crack detection of the battery cell, Box = (x1, y1, x2, y2), (x1, y1) and (x2, y2) are the coordinates of the upper left corner and the lower right corner of the bounding box respectively;
[0168] Using a deep learning model such as FasterRCNN, you can automatically learn the complex mapping of extracting effective features from the reduced-dimensional image without manually designing a feature extractor, which greatly improves the ability of feature extraction. As an advanced target detection framework, FasterRCNN can effectively identify hidden cracks in battery cells in images and predict the precise bounding box of the hidden crack area, which improves the accuracy and reliability of detection.
[0169] S5: Define the loss function of the deep learning network for detecting hidden cracks in battery cells and perform parameter training. Use the trained deep learning network for detecting hidden cracks in battery cells to detect undetected battery cell images:
[0170] S51: Define the loss function:
[0171] The loss function of the deep learning network for cell crack detection consists of classification loss L1 and bounding box loss L2. The classification loss is:
[0172] L1=-(Prob * ln(Prob)+(1-rob * )ln(1-rob))
[0173] Among them, Prob * is the probability of actual hidden cracks in the cell, 1 if there is hidden cracks, otherwise 0;
[0174] The bounding box loss is specifically:
[0175] L2=1-Ω
[0176] Among them, Ω is the improved intersection-over-union ratio, specifically:
[0177]
[0178] Q=|x2-x1)·(y2-y1)|
[0179]
[0180] in, and are the upper left corner coordinates and lower right corner coordinates of the real bounding box respectively; IoU is the intersection over union ratio of the real and predicted bounding boxes of the cell crack; Condition 1 is and min and max are minimum and maximum selection functions; Q, Q1, Q2 and Q3 are four temporary area variables;
[0181] The final loss function is:
[0182] L=L1+2
[0183] S52: Parameter training and application:
[0184] Based on the final loss function, the parameters of the deep learning network for detecting hidden cracks in the battery cell are trained using random gradient descent. The undetected battery cell images are input into the trained deep learning network for detecting hidden cracks in the battery cell to obtain the bounding box of the detected hidden cracks, such as Figure 2 As shown;
[0185] By combining classification loss and bounding box loss, the loss function can comprehensively measure the difference between the model prediction and the true label, including the accuracy of category prediction and the precision of bounding box positioning. Considering the loss of classification and positioning at the same time ensures that the model can be optimized in both aspects, avoiding the performance bias that may be caused by a single optimization goal. Using the improved intersection-over-union as part of the bounding box loss can more accurately measure the overlap between the predicted bounding box and the true bounding box, thereby guiding the model to learn more accurate bounding box predictions.
[0186] Embodiment 2: The present invention also discloses a battery cell hidden crack detection system based on deep learning, comprising the following five modules:
[0187] Preprocessing module: input the cell image to be inspected, and grayscale and enhance the contrast of the image through the adaptive image enhancement algorithm;
[0188] Edge feature extraction module: applies multi-scale morphological operations to the preprocessed image to extract the edge features of the battery cell;
[0189] Dimensionality reduction module: fuses the preprocessed image with the edge features of the cell and performs feature dimensionality reduction through principal component analysis;
[0190] Network construction module: construct a deep learning network for cell crack detection and set the network input and output;
[0191] Network training and application module: define the loss function of the deep learning network for battery cell hidden crack detection and perform parameter training, and use the trained deep learning network for battery cell hidden crack detection to detect undetected battery cell images;
[0192] It should be noted that the serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. And the terms "including", "comprising" or any other variants thereof in this article are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "including a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.
[0193] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0194] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for detecting hidden cracks in battery cells based on deep learning. It is characterized in that The following steps are involved: S1: Input the cell image to be inspected, grayscale and contrast enhance the image using an adaptive image enhancement algorithm to obtain a preprocessed image; including the following steps: S11: Image grayscale: The cell image to be inspected is grayed using the adaptive weights to obtain a grayed image I′, specifically: I′(x,y)=ω red ·I red (x,y)+ω green ·I green (x,y)+ω blue ·I blue (x,y) Where (x, y) is the pixel position; I′(x, y) is the value of I′ at (x, y); I red ,I green and I blue I is the red, green and blue channel images of the battery cell image to be detected; red (x, y), I green (x, y) and I blue (x, y) is I red ,I green and I blue The value at (x, y); ω red ,ω green and ω blue are the weights of the red, green and blue channels; S12: Local contrast enhancement: Perform local contrast enhancement on I′ to obtain a contrast-enhanced image Specifically: in, for The value at (x, y); μ local (x, y) and σ local (x, y) are the mean and standard deviation of the pixels in the 5×5 local area centered at (x, y); δ is a constant; S13: Global contrast adjustment: Adjusting contrast-enhanced images The global contrast of the image I is obtained after adjustment. global , specifically: Among them, I global (x, y) is I global The value at (x, y); a and b are global contrast adjustment parameters; globalmax(I′) and globalmin(I′) are the maximum and minimum values of the grayscale image I′ respectively; and The contrast-enhanced images are The maximum and minimum values of ; Final preprocessed image for: Among them, the clip function is used to limit the pixel value to the range of 0 to 255; S2: Apply multi-scale morphological operations to the preprocessed image to extract the edge features of the battery cell; including the following steps: The following steps are involved: S21: Define structural elements and morphological corrosion and dilation operations: Define the square structure element, the expression is: Among them, B s is a square structural element with side length s and center at the origin; The preprocessed image is subjected to morphological erosion and dilation operations, and the expressions of the morphological erosion and dilation operations are: Among them, the max and min functions return the maximum and minimum values in the set; eroded (x, y) is a pair The value of the eroded image at (x, y), which is the structural element B s The maximum value of all pixels in I dilated (x, y) is a pair The value of the expanded image at (x, y), which is the structural element B s The minimum value of all pixels in ; S22: Opening and closing operations: After preprocessing, the image Perform opening and closing operations, the opening and closing operations are: Among them, I opend (x, y) is the preprocessed image The value of the image after the opening operation at (x, y); I closed (x, y) is a pair The value of the image after the closing operation at (x, y); S23: Multi-scale morphological operations: After preprocessing, the image Apply square structural elements of different sizes Perform the operations and calculations in S21 and S22 to obtain s i Results of open and close operations under scale and s i represents the size of the square structure element, i = 1, 2, 3; S24: Edge feature extraction: Use the opening and closing operation results at different scales to extract edge features and obtain the cell edge feature I edges , specifically: Among them, I edges (x, y) is I edges The value at (x, y); and They are s i The value of the result of the open and close operations under the scale at (x, y); S3: Fusing the preprocessed image with the edge features of the cell, and performing feature dimensionality reduction through principal component analysis to obtain a reduced-dimensional image; S4: Build a deep learning network for cell crack detection and set the network input and output; S5: Define the loss function of the deep learning network for detecting hidden cracks in battery cells and perform parameter training, and use the trained deep learning network for detecting hidden cracks in battery cells to detect undetected battery cell images.
2. According to the deep learning-based battery cell hidden crack detection method of claim 1, It is characterized in that The step S3 includes the following steps: S31: Construct feature matrix and center it: After preprocessing, the image The weighted average fusion process is performed with the edge features of the battery cell to obtain the fused image I combined , specifically: The cell image to be detected is concatenated with the fused image in the channel dimension to obtain the image I to be reduced in dimension. full ; Use I full Construct the feature matrix X, where each row represents a pixel and each column represents a channel; Centralize the feature matrix to obtain the centralized matrix X cen : in, is the mean vector of each column of the feature matrix; S32: Calculate the covariance matrix and regularize it: Calculate the covariance matrix Ψ of the centered matrix as follows: Where M is the number of image pixels to be reduced; X cen Trans For X cen The transposed matrix of Introduce the regularization term λΓ to the covariance matrix, where λ is the regularization parameter and Γ is the identity matrix: P reg =Ψ+λΓ S33: Eigenvalue decomposition and feature dimensionality reduction: Perform eigenvalue decomposition on the regularized covariance matrix to obtain eigenvectors and eigenvalues, specifically: P reg V=VΛ Among them, V is the eigenvector matrix; Λ is the eigenvalue matrix; Select the eigenvectors corresponding to the first k principal components according to the eigenvalues and construct the projection matrix V k , and use the regularized eigenvector to reduce the dimension of the feature to obtain the reduced-dimensional feature matrix X reduced : Among them, Λ k is the eigenvalue matrix corresponding to the selected principal component, is the square root of its inverse matrix; Convert the reduced feature matrix back to a two-dimensional feature map to obtain the reduced image I reduced .
3. According to the deep learning-based battery cell hidden crack detection method of claim 2, It is characterized in that The step S4 includes the following steps: The reduced image I reduced Input to the deep learning network for cell crack detection, the structure of which is consistent with the target detection network FasterRCNN, specifically: Prob,Box=FasterRCNN(I reduced ) Where Prob is the probability of battery cell hidden cracks predicted by the deep learning network for battery cell hidden crack detection; Box is the bounding box of battery cell hidden cracks predicted by the deep learning network for battery cell hidden crack detection, Box = (x 1 ,y 1 , x 2 ,y 2 ), (x 1 ,y 1 ) and (x 2 ,y 2 ) are the upper left corner and lower right corner coordinates of the bounding box respectively.
4. According to the deep learning-based battery cell hidden crack detection method of claim 3, It is characterized in that The step S5 includes the following steps: S51: Define the loss function: The loss function of the deep learning network for cell crack detection is composed of the classification loss L 1 and the bounding box loss L 2 The classification loss is specifically: L 1 =-(Prob*ln(Prob)+(1-Prob*)ln(1-Prob)) Among them, Prob* is the probability of actual cell hidden cracks, which is 1 if there is hidden cracks, and 0 otherwise; The bounding box loss is specifically: L 2 =1-Ω Among them, Ω is the improved intersection-over-union ratio, specifically: Q=|(x 2 -x 1 )·(and 2 -and 1 )| in, and are the upper left corner coordinates and lower right corner coordinates of the real bounding box respectively; IoU is the intersection over union ratio of the real and predicted bounding boxes of the cell crack; Condition 1 is and min and max are minimum and maximum selection functions; Q, Q 1 , Q 2 and Q 3 are four temporary area variables; The final loss function is: L=L 1 +L 2 S52: Parameter training and application: Based on the final loss function, random gradient descent is used to train the parameters of the deep learning network for battery cell hidden crack detection. The undetected battery cell images are input into the trained deep learning network for battery cell hidden crack detection to obtain the bounding box of the detected hidden crack.
5. A battery cell hidden crack detection system based on deep learning, It is characterized in that include: Preprocessing module: input the cell image to be inspected, and grayscale and enhance the contrast of the image through the adaptive image enhancement algorithm; Edge feature extraction module: applies multi-scale morphological operations to the preprocessed image to extract the edge features of the battery cell; Dimensionality reduction module: fuses the preprocessed image with the edge features of the cell and performs feature dimensionality reduction through principal component analysis; Network construction module: construct a deep learning network for cell crack detection and set the network input and output; Network training and application module: define the loss function of the deep learning network for battery cell crack detection and perform parameter training, and use the trained deep learning network for battery cell crack detection to detect undetected battery cell images; To realize a battery cell hidden crack detection method based on deep learning as described in any one of claims 1-4.
