CN115147405A - Rapid nondestructive testing method for new energy battery - Google Patents

Rapid nondestructive testing method for new energy battery Download PDF

Info

Publication number
CN115147405A
CN115147405A CN202210957962.0A CN202210957962A CN115147405A CN 115147405 A CN115147405 A CN 115147405A CN 202210957962 A CN202210957962 A CN 202210957962A CN 115147405 A CN115147405 A CN 115147405A
Authority
CN
China
Prior art keywords
new energy
image
energy battery
index
algorithm
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210957962.0A
Other languages
Chinese (zh)
Inventor
吴宇航
李泽坤
耿连忠
杨伯青
李达兴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen City Waitley Power Co ltd
Original Assignee
Shenzhen City Waitley Power Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen City Waitley Power Co ltd filed Critical Shenzhen City Waitley Power Co ltd
Priority to CN202210957962.0A priority Critical patent/CN115147405A/en
Publication of CN115147405A publication Critical patent/CN115147405A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/273Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion removing elements interfering with the pattern to be recognised
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/30Noise filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/36Applying a local operator, i.e. means to operate on image points situated in the vicinity of a given point; Non-linear local filtering operations, e.g. median filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details
    • G06T2207/20028Bilateral filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20048Transform domain processing
    • G06T2207/20064Wavelet transform [DWT]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20172Image enhancement details
    • G06T2207/20182Noise reduction or smoothing in the temporal domain; Spatio-temporal filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Quality & Reliability (AREA)
  • Nonlinear Science (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to the technical field of battery detection, and discloses a rapid nondestructive detection method for a new energy battery, which comprises the following steps: carrying out filtering and denoising processing on the acquired new energy battery image by using an improved bilateral filtering algorithm; segmenting the denoised new energy battery image by using an optimal support plane; carrying out image enhancement on the extracted target region image by using an improved wavelet transform algorithm; constructing a new energy battery defect detection index system, and extracting index features of the enhanced target area image; and carrying out optimization classification on the new energy battery by using an improved random forest optimization algorithm, and detecting and identifying whether the new energy battery has surface defects and defect positions. The method disclosed by the invention can be used for rapidly realizing the detection and identification of whether the new energy battery has surface defects and the defect positions based on the image of the new energy battery, and optimizing the detection method based on various heuristic algorithms, thereby effectively improving the algorithm speed and improving the timeliness of the detection and identification.

Description

Rapid nondestructive testing method for new energy battery
Technical Field
The invention relates to the technical field of battery detection, in particular to a rapid nondestructive testing method for a new energy battery.
Background
With the increase of the yield of the new energy battery, the new energy battery with surface defects can be produced, and the value and the safety of the new energy battery can be seriously influenced by the surface defects of the new energy battery. Because the output of the new energy battery is large, the traditional battery detection method based on manual work needs to consume a large amount of manpower, and the requirement of rapid nondestructive detection cannot be met.
Disclosure of Invention
In view of the above, the present invention provides a fast new energy battery nondestructive testing method, which aims to (1) quickly realize the detection and identification of whether a new energy battery has surface defects and defect positions based on an image of the new energy battery; (2) The detection method is optimized based on various heuristic algorithms, so that the algorithm speed is effectively improved, and the timeliness of detection and identification is improved.
The invention provides a rapid nondestructive testing method for a new energy battery, which comprises the following steps:
s1: acquiring a new energy battery image, and carrying out filtering and denoising treatment on the acquired new energy battery image by using an improved bilateral filtering algorithm to obtain a denoised new energy battery image;
s2: segmenting the denoised new energy battery image by using an optimal support plane, removing a background image in the new energy battery image, and extracting to obtain a target area image;
s3: carrying out image enhancement on the extracted target region image by utilizing an improved wavelet transform algorithm to obtain an enhanced target region image and improve the identification degree of the defect part;
s4: constructing a new energy battery defect detection index system, and extracting index features of the enhanced target area image based on the constructed index system to obtain the index features of the new energy battery to be detected;
s5: and based on the index characteristics of the new energy battery to be detected, the new energy battery is optimized and classified by using an improved random forest optimization algorithm, and whether the new energy battery has surface defects or not and the defect position is detected and identified.
As a further improvement of the method of the invention:
optionally, acquiring a new energy battery image in the step S1 includes:
the method comprises the following steps of collecting a new energy battery image I by utilizing a camera device, wherein the collected new energy battery image is a gray level image, and the gray level processing flow of the new energy battery image is as follows:
solving the maximum value of three color channel components of any pixel point I (I, j) in the new energy battery image I, and setting the maximum value as the gray value of the pixel point, wherein (I, j) is the coordinate of the pixel point, repeating the step until the gray values of all pixels in the new energy battery image I are obtained, and taking the gray values of the pixels as the pixel values of the pixels, wherein the formula of the graying processing is as follows:
gray(i,j)=max{R(I(i,j)),G(I(i,j)),B(I(i,j))}
wherein:
gray (I, j) is the gray value of the pixel point I (I, j);
r (I (I, j)), G (I (I, j)), B (I (I, j)) are the values of pixel point I (I, j) in the three color channels R, G, B, respectively.
Optionally, in the step S1, performing filtering and denoising processing on the acquired new energy battery image by using an improved bilateral filtering algorithm, including:
the method comprises the following steps of constructing a bilateral filter based on an improved bilateral filtering algorithm, inputting a new energy battery image I into the bilateral filter, and carrying out filtering and denoising processing on pixels in the new energy battery image by the bilateral filter, wherein the formula of the filtering processing is as follows:
Figure BDA0003792108920000011
Figure BDA0003792108920000012
wherein:
Figure BDA0003792108920000021
is the filter weight;
(I ', j') is the neighboring pixel coordinate of the pixel point I (I, j) in the 4 × 4 pixel neighborhood S (I, j);
σ 1 ,σ 2 for Gaussian standard deviation, in the embodiment of the present invention, σ is 1 Set to 1, σ 2 Set to 2;
h (I, j) is the filtered pixel value of the pixel point I (I, j).
Optionally, the constructing a support plane for foreground-background image segmentation in S2 step includes:
the constructed support plane for foreground and background image segmentation is C; and taking the pixel area with the pixel value larger than C as a background image, and taking the pixel area with the pixel value smaller than C as a target area image.
Optionally, in the step S2, the support plane is optimized and solved based on a heuristic algorithm, and the optimal support plane is used to perform foreground and background segmentation on the denoised new energy battery image to obtain a target area image, where the method includes:
optimizing and solving a support plane based on a heuristic algorithm, wherein the optimizing and solving process of the support plane comprises the following steps:
1) Constructing a fitness function supporting plane optimization solution:
F(c)=p b (c)p q (c)[μ b (c)-μ q (c)] 2
c∈[0,L-1]
Figure BDA0003792108920000022
Figure BDA0003792108920000023
wherein:
f (c) denotes a fitness value, μ, for segmenting an image into foreground and background regions in accordance with the support plane c b (c) Is the pixel mean value of the corresponding background area, mu q (c) The corresponding foreground area pixel mean value is obtained;
[0,L-1] represents the range of pixel gray levels, L-1 represents the maximum gray level;
p k representing the probability of the occurrence of a pixel with a gray level k;
p b (c) Representing the distribution probability, p, of background pixels q (c) Representing the distribution probability of foreground pixels;
2) Initializing n 1 Only pigeons and randomly initializing the position and speed of each pigeon, wherein the position and speed of any ith pigeon are as follows:
(x s ,v s )
wherein:
x s position of the s-th pigeon, x s ∈[0,L-1]By mixing x s Substituting the value into the fitness function to obtain the fitness value F (x) of the s-th pigeon s );v s The flying speed of the s-th pigeon is obtained;
3) Setting the iteration number of the current algorithm as n g And n is g Initializing to 0, and setting the maximum iteration times of the algorithm to Max;
4) Judging whether the iteration number of the current algorithm meets n g And if not, updating the positions and the speeds of all pigeons by using the following formula, updating the positions which are greater than L-1 into L-1, and updating the positions which are less than 0 into 0 in an iteration process:
Figure BDA0003792108920000024
Figure BDA0003792108920000025
wherein:
Figure BDA0003792108920000026
is at the n-th g After the iteration, the pigeon position with the maximum fitness value in the population is determined;
Figure BDA0003792108920000027
the second pigeon in the population is at the nth g The speed of the sub-iteration;
rand (0,1) is a random number between 0 and 1;
Figure BDA0003792108920000028
the second pigeon in the population is at the nth g The location of the secondary iteration;
and let n g =n g +1, repeating the step;
if n is satisfied g If the current fitness value is not less than Max, the pigeon position with the maximum current fitness value is determined
Figure BDA0003792108920000029
As an optimal support plane C * Using the optimum support plane C * And carrying out foreground and background segmentation on the denoised new energy battery image to obtain a target area image.
Optionally, the image enhancement of the extracted target region image by using the improved wavelet transform algorithm in the step S3 includes:
for the extracted target area image G, carrying out image enhancement on the target area image G by using an improved wavelet transform algorithm, wherein the image enhancement process comprises the following steps:
1) Converting a target area image G into an image signal G (t), wherein the image signal conversion method comprises the steps of expanding pixels of the target area image line by line to obtain a line of pixels, mapping pixel coordinates to horizontal coordinates to serve as time domain information of the image signal, and the pixel value is the signal value;
2) Fixing a scale factor a, performing wavelet transform processing on an image signal G (t) by using a wavelet function omega (t), wherein the adopted wavelet function is a Haar wavelet function, and the wavelet transform processing formula is as follows:
Figure BDA0003792108920000031
wherein:
b represents a displacement factor of the wavelet function;
q a,b (t) wavelet coefficients with a scale a shifted by b;
2) Changing the displacement factor of the wavelet function and repeating the step 1) to obtain a wavelet coefficient set under the scale factor a;
3) Changing the scale factor a, and repeating the step 1) 2) to obtain the wavelet coefficient q of the image signal G (t) under different scale factors and displacement factors a,b (t) up to
Figure BDA0003792108920000032
4) Determining a wavelet threshold value as sigma;
5) Deleting the wavelet coefficient smaller than the wavelet threshold value sigma, and reserving the wavelet coefficient larger than the wavelet threshold value sigma, wherein the reserved wavelet coefficient is q' a,b (t) reconstructing the wavelet coefficients into G' (t) by using the wavelet inverse transformation method, wherein the formula of the wavelet inverse transformation method is as follows:
Figure BDA0003792108920000033
wherein:
g' (t) is the enhanced image signal after reconstruction;
6) And converting the enhanced signal G '(t) into an image to obtain an enhanced target area image G'.
Optionally, the step S4 is to construct a new energy battery defect detection index system, including:
the constructed new energy battery defect detection index system is as follows:
{Robert,Sobel,Canny,HOG}
wherein:
the Robert is the Robert operator index characteristic of the new energy battery image;
sobel is a Sobel operator index characteristic in the new energy battery image;
canny is Canny operator index characteristics in the new energy battery image;
and HOG is HOG operator index characteristics in the new energy battery image.
Optionally, the performing, in the step S4, index feature extraction on the enhanced target area image based on the constructed index system includes:
performing index feature extraction on the enhanced target area image based on the constructed new energy battery defect detection index system, wherein the index feature extraction process comprises the following steps:
selecting a Robert operator template, a Sobel operator template, a Canny operator template and an HOG operator template according to the new energy battery defect detection index system;
carrying out feature detection on the target area image to be subjected to feature extraction by utilizing an operator template;
taking the result of the feature detection as an index feature of the target area image, wherein the index feature set comprises the following components:
f G′ ={Robert G′ ,Sobel G′ ,Canny G′ ,HOG G′ }
wherein:
f G′ the target area image G' is subjected to enhancement;
Robert G′ the Robert operator index characteristics of the enhanced target region image G' are obtained;
Sobel G′ the target region image G' is subjected to Sobel operator index characteristic enhancement;
Canny G′ the Canny operator index characteristic of the enhanced target area image G';
HOG G′ the HOG operator index characteristics of the enhanced target area image G' are obtained.
Optionally, in the step S5, based on the index features of the new energy battery to be detected, the new energy battery is optimized and classified by using an improved random forest optimization algorithm, including:
acquiring a new energy battery image with a defect mark as a training set, carrying out filtering denoising processing based on an improved bilateral filtering algorithm, segmentation processing based on an optimal support plane and image enhancement processing based on an improved wavelet transform algorithm on the new energy battery image in the training set, extracting the index features of the enhanced image, and obtaining an index feature training set:
{data m =(f m ,y m )|m∈[1,M]}
wherein:
data m the data is the mth group of data in the index characteristic training set, and M is the number of data groups in the index characteristic training set;
f m is data to m The index characteristic of (1);
y m ={0,1},y m =0 denotes data m Absence of defects, y m =1 expression data m The existence of defects;
constructing a random forest model, wherein the random forest model comprises n 2 The input of each decision tree is index characteristics of a new energy battery image, the output is {0,1},0 represents that the new energy battery has no defects, 1 represents that the new energy battery has defects, wherein non-leaf nodes of each decision tree are operator characteristics in the index characteristics, and leaf nodes are output results {0,1};
for the weight of the non-leaf node in each decision tree, carrying out weight optimization by using the following method, wherein the method comprises the following steps:
1) Constructing a fitness function of weight solving:
Figure BDA0003792108920000041
wherein:
r represents a weight vector of a non-leaf node in the decision tree;
Figure BDA0003792108920000042
training the central index feature f for the index feature based on the decision tree constructed by the weight vector r m The defect detection result of (1);
y m training a central index feature f for index features m The actual defect condition of;
2) Generating n 'fish, and initializing the position x' and speed l of each fish, so that the position of the d-th fish is:
x′ d =[w 1,d ,w 2,d ,w 3,d ,w 4,d ]
w 1,d +w 2,d +w 3,d +w 4,d =1
wherein:
w 1,d weighting the Robert operator index features in the decision tree;
w 2,d weighting the Sobel operator index features in the decision tree;
w 3,d weighting the Canny operator index characteristics in the decision tree;
w 4,d weighting the HOG operator index features in the decision tree;
3) Setting the iteration number of the current algorithm as h, initializing h to be 0, and setting the maximum iteration number of the algorithm as Max';
4) Judging whether the iteration frequency of the current algorithm meets h is larger than or equal to Max, if not, performing position iteration updating on each fish, and returning to the step after the iteration updating, wherein the position iteration updating rule is as follows:
position x 'at h-th iteration for any d-th fish' d (h) Degree of adaptability thereofIs Lo (x' d (h) "position x 'with a smaller fitness value in the visual field' * (h) Then a shift in position is made, where position x' * (h) The fish is not present at the position of (2), the visual field range of the fish is 0.1, and the position moving formula is as follows:
Figure BDA0003792108920000043
wherein:
l d the speed of the d-th fish;
position x 'at h-th iteration for any d-th fish' d (h) If a non-crowded position x' is found in the field of view * (h) Then to position x ″) * (h) Moving:
Figure BDA0003792108920000051
if h is larger than or equal to Max, selecting a position x 'with the minimum fitness value' * (Max') as a weight for non-leaf nodes in the decision tree;
target area image index characteristic f of new energy battery to be detected G′ Inputting the random forest into the constructed random forest;
outputting a defect detection result of the new energy battery to be detected by each decision tree in the random forest;
and adding and averaging the defect detection results of each decision tree, if the result is greater than the threshold value of 0.7, indicating that the new energy battery to be detected has defects, counting the detection results {0,1} of non-leaf nodes in each decision tree, wherein the image area corresponding to the operator feature with the largest number and the detection result of 1 is the defect position.
In order to solve the above problems, the present invention further provides a rapid nondestructive testing apparatus for a new energy battery, wherein the apparatus includes:
the data acquisition processing module is used for carrying out filtering and denoising processing on the acquired new energy battery image by using an improved bilateral filtering algorithm, segmenting the denoised new energy battery image by using an optimal support plane, removing a background image in the new energy battery image, extracting to obtain a target area image, and carrying out image enhancement on the extracted target area image by using an improved wavelet transform algorithm;
the index construction device is used for constructing a new energy battery defect detection index system, and extracting index features of the enhanced target area image based on the constructed index system to obtain the index features of the new energy battery to be detected;
and the battery detection and classification module is used for optimizing and classifying the new energy battery by utilizing an improved random forest optimization algorithm based on the index characteristics of the new energy battery to be detected, and detecting and identifying whether the new energy battery has surface defects and defect positions.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one instruction; and
and the processor executes the instructions stored in the memory to realize the rapid new energy battery nondestructive testing method.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, where at least one instruction is stored in the computer-readable storage medium, and the at least one instruction is executed by a processor in an electronic device to implement the above fast new energy battery nondestructive testing method.
Compared with the prior art, the invention provides a rapid nondestructive testing method for a new energy battery, which has the following advantages:
firstly, the scheme provides a foreground and background image segmentation method based on a support plane, wherein the constructed support plane for foreground and background image segmentation is C; and taking the pixel area with the pixel value larger than C as a background image, and taking the pixel area with the pixel value smaller than C as a target area image. Optimizing and solving a support plane based on a heuristic algorithm, wherein the optimizing and solving process of the support plane comprises the following steps: 1) Constructing a fitness function supporting plane optimization solution:
F(c)=p b (c)p q (c)[μ b (c)-μ q (c)] 2
c∈[0,L-1]
Figure BDA0003792108920000052
Figure BDA0003792108920000053
wherein: f (c) denotes a fitness value, μ, for segmenting an image into foreground and background regions in accordance with the support plane c b (c) Is the pixel mean value of the corresponding background area, mu q (c) The corresponding foreground area pixel mean value is obtained; [0,L-1]Represents the range of pixel gray levels, L-1 represents the maximum gray level; p is a radical of k Representing the probability of the occurrence of a pixel with a gray level k; p is a radical of b (c) Representing the distribution probability, p, of background pixels q (c) Representing the distribution probability of foreground pixels; 2) Initializing n 1 Only pigeons and randomly initializing the position and speed of each pigeon, wherein the position and speed of any ith pigeon are as follows:
(x s ,v s )
wherein: x is the number of s Position of the s-th pigeon, x s ∈[0,L-1]By mixing x s Substituting the value into the fitness function to obtain the fitness value F (x) of the s-th pigeon s );v s The flight speed of the s-th pigeon is obtained; 3) Setting the iteration number of the current algorithm as n g And n is g Initializing to 0, and setting the maximum iteration number of the algorithm to Max; 4) Judging whether the iteration number of the current algorithm meets n g And if not, updating the positions and the speeds of all pigeons by using the following formula, updating the positions larger than L-1 to be L-1 and the positions smaller than 0 to be 0 in an iteration process:
Figure BDA0003792108920000061
Figure BDA0003792108920000062
wherein:
Figure BDA0003792108920000063
is at the n-th g After the iteration, the pigeon position with the maximum fitness value in the population is determined;
Figure BDA0003792108920000064
the second pigeon in the population is at the nth g The speed of the sub-iteration; rand (0,1) is a random number between 0 and 1;
Figure BDA0003792108920000065
the second pigeon in the population is at the nth g The location of the secondary iteration; and let n g =n g +1, repeating the step; if n is satisfied g If the current fitness value is more than or equal to Max, the pigeon position with the maximum current fitness value is determined
Figure BDA0003792108920000066
As an optimal support plane C * Using the optimum support plane C * Compared with the traditional method, the scheme utilizes a heuristic algorithm to solve the supporting plane, rapidly realizes the target area image extraction of the new energy battery, and rapidly realizes the nondestructive testing of the new energy battery.
Meanwhile, the scheme provides a rapid new energy battery nondestructive testing method based on a random forest model, wherein the random forest model comprises n 2 The input of each decision tree is index characteristics of a new energy battery image, the output is {0,1},0 represents that the new energy battery has no defects, 1 represents that the new energy battery has defects, wherein non-leaf nodes of each decision tree are operator characteristics in the index characteristics, and leaf nodes are output results {0,1}; and for the weight of the non-leaf node in each decision tree, performing weight optimization by using a heuristic algorithm, wherein the weight optimization comprises the following steps: 1) Structure of the organizationAnd (3) building a weight solving fitness function:
Figure BDA0003792108920000067
wherein: r represents the weight vector of the non-leaf node in the decision tree;
Figure BDA0003792108920000068
training the central index feature f for the index feature based on the decision tree constructed by the weight vector r m The defect detection result of (1); y is m Training a central index feature f for index features m The actual defect condition of; 2) Generating n 'fish, and initializing the position x' and speed l of each fish, so that the position of the d-th fish is:
x′ d =[w 1,d ,w 2,d ,w 3,d ,w 4,d ]
w 1,d +w 2,d +w 3,d +w 4,d =1
wherein: w is a 1,d Weighting the Robert operator index features in the decision tree; w is a 2,d Weighting the index features of the Sobel operator in the decision tree; w is a 3,d Weighting the Canny operator index characteristics in the decision tree; w is a 4,d Weighting the HOG operator index features in the decision tree; 3) Setting the iteration number of the current algorithm as h, initializing h to be 0, and setting the maximum iteration number of the algorithm as Max'; 4) Judging whether the iteration times of the current algorithm meet h is larger than or equal to Max or not, if not, performing position iteration updating on each fish, and returning to the step after the iteration updating, wherein the position iteration updating rule is as follows: position x 'at h-th iteration for any d-th fish' d (h) And its fitness value is Lo (x' d (h) "if a position x 'with a smaller fitness value is found in the visual field range' * (h) Then a shift of position is made, where position x' * (h) The fish is not present at the position of (2), the visual field range of the fish is 0.1, and the position moving formula is as follows:
Figure BDA0003792108920000069
wherein: l d The speed of the d fish; position x 'at h-th iteration for any d-th fish' d (h) If a non-crowded position x' is found in the field of view * (h) Then to position x ″) * (h) Moving:
Figure BDA0003792108920000071
if h is larger than or equal to Max, selecting a position x 'with the minimum fitness value' * (Max') as a weight for non-leaf nodes in the decision tree; target area image index characteristic f of new energy battery to be detected G′ Inputting the random forest into the constructed random forest; compared with the traditional technology, the scheme utilizes a heuristic algorithm to carry out weight optimization on the decision tree, improves the efficiency of decision tree construction, ensures the timeliness of battery nondestructive testing, and outputs the defect detection result of the new energy battery to be detected by each decision tree in the random forest; and adding and averaging the defect detection results of each decision tree, if the result is greater than the threshold value of 0.7, indicating that the new energy battery to be detected has defects, counting the detection results {0,1} of non-leaf nodes in each decision tree, wherein the image area corresponding to the operator feature with the largest number and the detection result of 1 is the defect position.
Drawings
Fig. 1 is a schematic flow chart of a rapid new energy battery nondestructive testing method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of one step of the embodiment of FIG. 1;
FIG. 3 is a schematic flow chart of another step of the embodiment of FIG. 1;
fig. 4 is a functional block diagram of a nondestructive testing apparatus for a fast new energy battery according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device for implementing a fast new energy battery nondestructive testing method according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides a rapid nondestructive testing method for a new energy battery. The execution subject of the rapid new energy battery nondestructive testing method includes, but is not limited to, at least one of electronic devices, such as a server, a terminal, and the like, which can be configured to execute the method provided by the embodiments of the present application. In other words, the fast new energy battery nondestructive testing method may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Example 1:
s1: and acquiring a new energy battery image, and carrying out filtering and denoising treatment on the acquired new energy battery image by using an improved bilateral filtering algorithm to obtain a denoised new energy battery image.
The step S1 of acquiring new energy battery images comprises the following steps:
the method comprises the following steps of acquiring a new energy battery image I by utilizing camera equipment, wherein the acquired new energy battery image is a gray image, and the gray processing flow of the new energy battery image is as follows:
solving the maximum value of three color channel components of any pixel point I (I, j) in the new energy battery image I, and setting the maximum value as the gray value of the pixel point, wherein (I, j) is the coordinate of the pixel point, repeating the step until the gray values of all pixels in the new energy battery image I are obtained, and taking the gray values of the pixels as the pixel values of the pixels, wherein the formula of the graying processing is as follows:
gray(i,j)=max{R(I(i,j)),G(I(i,j)),B(I(i,j))}
wherein:
gray (I, j) is the gray value of the pixel point I (I, j);
r (I (I, j)), G (I (I, j)), B (I (I, j)) are the values of pixel point I (I, j) in the three color channels R, G, B, respectively.
In the step S1, an improved bilateral filtering algorithm is used to perform filtering and denoising processing on the acquired new energy battery image, including:
the method comprises the following steps of constructing a bilateral filter based on an improved bilateral filtering algorithm, inputting a new energy battery image I into the bilateral filter, and carrying out filtering and denoising processing on pixels in the new energy battery image by the bilateral filter, wherein the formula of the filtering processing is as follows:
Figure BDA0003792108920000072
Figure BDA0003792108920000081
wherein:
Figure BDA0003792108920000082
is the filter weight;
(I ', j') is the neighboring pixel coordinate of the pixel point I (I, j) in the 4 × 4 pixel neighborhood S (I, j);
σ 1 ,σ 2 for Gaussian standard deviation, in the embodiment of the present invention, σ is 1 Set to 1, σ 2 Is set to be 2;
h (I, j) is the filtered pixel value of the pixel point I (I, j).
S2: and segmenting the denoised new energy battery image by using an optimal support plane, removing a background image in the new energy battery image, and extracting to obtain a target area image.
In the step S2, constructing a support plane for foreground-background image segmentation, including:
the constructed support plane for foreground and background image segmentation is C; and taking the pixel area with the pixel value larger than C as a background image, and taking the pixel area with the pixel value smaller than C as a target area image.
And in the step S2, the support plane is optimized and solved based on a heuristic algorithm, and the optimal support plane is utilized to perform foreground and background segmentation on the denoised new energy battery image to obtain a target area image, wherein the method comprises the following steps:
optimizing and solving a support plane based on a heuristic algorithm, wherein the optimizing and solving process of the support plane comprises the following steps:
1) Constructing a fitness function supporting plane optimization solution:
F(c)=p b (c)p q (c)[μ b (c)-μ q (c)] 2
c∈[0,L-1]
Figure BDA0003792108920000083
Figure BDA0003792108920000084
wherein:
f (c) denotes a fitness value, μ, for segmenting an image into foreground and background regions in accordance with the support plane c b (c) Mean value of pixels, mu, for the corresponding background area q (c) The corresponding foreground area pixel mean value is obtained;
[0,L-1] represents the range of pixel gray levels, L-1 represents the maximum gray level;
p k representing the probability of the occurrence of a pixel with a gray level k;
p b (c) Representing the distribution probability, p, of background pixels q (c) Representing the distribution probability of foreground pixels;
2) Initializing n 1 Only pigeons and randomly initializing the position and speed of each pigeon, wherein the position and speed of any ith pigeon are as follows:
(x s ,v s )
wherein:
x s position of the s-th pigeon, x s ∈[0,L-1]By passingx s Substituting into the fitness function to obtain the fitness value F (x) of the s-th pigeon s );v s The flight speed of the s-th pigeon is obtained;
3) Setting the iteration number of the current algorithm as n g And n is g Initializing to 0, and setting the maximum iteration number of the algorithm to Max;
4) Judging whether the iteration number of the current algorithm meets n g And if not, updating the positions and the speeds of all pigeons by using the following formula, updating the positions larger than L-1 to be L-1 and the positions smaller than 0 to be 0 in an iteration process:
Figure BDA0003792108920000085
Figure BDA0003792108920000086
wherein:
Figure BDA0003792108920000087
is at the n-th g After the iteration, the pigeon position with the maximum fitness value in the population is determined;
Figure BDA0003792108920000088
the second pigeon in the population is at the nth g The speed of the sub-iteration;
rand (0,1) is a random number between 0 and 1;
Figure BDA0003792108920000091
the second pigeon in the population is at the nth g The location of the secondary iteration;
and let n g =n g +1, repeating the step;
if n is satisfied g If the current fitness value is not less than Max, the pigeon position with the maximum current fitness value is determined
Figure BDA0003792108920000092
As an optimal support plane C * Using the optimum support plane C * And carrying out foreground and background segmentation on the denoised new energy battery image to obtain a target area image.
S3: and performing image enhancement on the extracted target region image by using an improved wavelet transform algorithm to obtain an enhanced target region image, and improving the identification degree of the defect part.
In the step S3, image enhancement is performed on the extracted target region image by using an improved wavelet transform algorithm, and the method includes:
for the extracted target area image G, carrying out image enhancement on the target area image G by using an improved wavelet transform algorithm, wherein the image enhancement process comprises the following steps:
1) Converting a target area image G into an image signal G (t), wherein the conversion method of the image signal is to expand pixels of the target area image line by line to obtain a line of pixels, map coordinates of the pixels to horizontal coordinates to serve as time domain information of the image signal, and the size of the pixel value is the size of a signal value;
2) Fixing a scale factor a, performing wavelet transform processing on an image signal G (t) by using a wavelet function omega (t), wherein the adopted wavelet function is a Haar wavelet function, and the wavelet transform processing formula is as follows:
Figure BDA0003792108920000093
wherein:
b represents a shift factor of the wavelet function;
q a,b (t) wavelet coefficients with a scale a shifted by b;
2) Changing the displacement factor of the wavelet function and repeating the step 1) to obtain a wavelet coefficient set under the scale factor a;
3) Changing the scale factor a, and repeating the step 1) 2) to obtain the wavelet coefficient q of the image signal G (t) under different scale factors and displacement factors a,b (t) up to
Figure BDA0003792108920000094
4) Determining a wavelet threshold value as sigma;
5) Deleting the wavelet coefficients smaller than the wavelet threshold value sigma, and reserving the wavelet coefficients larger than the wavelet threshold value sigma, wherein the reserved wavelet coefficients are q' a,b (t) reconstructing the wavelet coefficients into G' (t) using the inverse wavelet transform method, the inverse wavelet transform method having the formula:
Figure BDA0003792108920000095
wherein:
g' (t) is the enhanced image signal after reconstruction;
6) And converting the enhanced signal G '(t) into an image to obtain an enhanced target area image G'.
S4: and constructing a new energy battery defect detection index system, and extracting the index features of the enhanced target area image based on the constructed index system to obtain the index features of the new energy battery to be detected.
And S4, constructing a new energy battery defect detection index system, which comprises the following steps:
the constructed new energy battery defect detection index system is as follows:
{Robert,Sobel,Canny,HOG}
wherein:
the Robert is Robert operator index characteristics of the new energy battery image;
sobel is a Sobel operator index characteristic in the new energy battery image;
canny is Canny operator index characteristics in the new energy battery image;
and HOG is HOG operator index characteristics in the new energy battery image.
And in the step S4, performing index feature extraction on the enhanced target area image based on the constructed index system, wherein the index feature extraction comprises the following steps:
performing index feature extraction on the enhanced target area image based on the constructed new energy battery defect detection index system, specifically, referring to fig. 2, the process of index feature extraction is as follows:
s41, selecting a Robert operator template, a Sobel operator template, a Canny operator template and an HOG operator template according to the new energy battery defect detection index system;
s42, carrying out feature detection on the target area image to be subjected to feature extraction by utilizing an operator template;
s43, taking the result of the feature detection as an index feature of the target area image, wherein the index feature set comprises the following components:
f G′ ={Robert G′ ,Sobel G′ ,Canny G′ ,HOG G′ }
wherein:
f G′ the target area image G' is subjected to enhancement;
Robert G′ the Robert operator index features of the enhanced target region image G';
Sobel G′ the Sobel operator index characteristics of the enhanced target area image G' are obtained;
Canny G′ the Canny operator index characteristic of the enhanced target area image G';
HOG G′ and the HOG operator index characteristics of the enhanced target region image G' are obtained.
S5: and based on the index characteristics of the new energy battery to be detected, the new energy battery is optimized and classified by using an improved random forest optimization algorithm, and whether the new energy battery has surface defects or not and the defect position is detected and identified.
And in the step S5, based on the index characteristics of the new energy battery to be detected, the new energy battery is optimized and classified by using an improved random forest optimization algorithm, and the method comprises the following steps:
acquiring a new energy battery image with a defect mark as a training set, carrying out filtering denoising processing based on an improved bilateral filtering algorithm, segmentation processing based on an optimal support plane and image enhancement processing based on an improved wavelet transform algorithm on the new energy battery image in the training set, extracting the index features of the enhanced image, and obtaining an index feature training set:
{data m =(f m ,y m )|m∈[1,M]}
wherein:
data m the data is the mth group of data in the index characteristic training set, and M is the number of data groups in the index characteristic training set;
f m is data m The index characteristic of (1);
y m ={0,1},y m =0 denotes data m Absence of defects, y m =1 expression data m The existence of defects;
constructing a random forest model, wherein the random forest model comprises n 2 The input of each decision tree is index characteristics of a new energy battery image, the output is {0,1},0 represents that the new energy battery has no defects, 1 represents that the new energy battery has defects, wherein non-leaf nodes of each decision tree are operator characteristics in the index characteristics, and leaf nodes are output results {0,1};
for the weight of the non-leaf node in each decision tree, performing weight optimization by using the following method, wherein the method comprises the following steps:
1) Constructing a fitness function of weight solving:
Figure BDA0003792108920000101
wherein:
r represents a weight vector of a non-leaf node in the decision tree;
Figure BDA0003792108920000102
training a central index feature f for the index feature based on a decision tree constructed by the weight vector r m The defect detection result of (1);
y m training a central index feature f for index features m True defect condition of (2);
2) Generating n 'fish, and initializing the position x' and speed l of each fish, so that the position of the d-th fish is:
x′ d =[w 1,d ,w 2,d ,w 3,d ,w 4,d ]
w 1,d +w 2,d +w 3,d +w 4,d =1
wherein:
w 1,d weights of index features of the Robert operator in the decision tree;
w 2,d weighting the Sobel operator index features in the decision tree;
w 3,d weighting the Canny operator index characteristics in the decision tree;
w 4,d weighting the HOG operator index features in the decision tree;
3) Setting the iteration number of the current algorithm as h, initializing h to be 0, and setting the maximum iteration number of the algorithm as Max';
4) Judging whether the iteration frequency of the current algorithm meets h is larger than or equal to Max, if not, performing position iteration updating on each fish, and returning to the step after the iteration updating, wherein the position iteration updating rule is as follows:
position x 'at h-th iteration for any d-th fish' d (h) And its fitness value is Lo (x' d (h) "if a position x 'with a smaller fitness value is found in the visual field range' * (h) Then a shift of position is made, where position x' * (h) The fish is not present at the position of (2), the visual field range of the fish is 0.1, and the position moving formula is as follows:
Figure BDA0003792108920000111
wherein:
l d the speed of the d fish;
position x 'at h-th iteration for any d-th fish' d (h) If a non-crowded position x' is found in the visual field * (h) Then to position x ″) * (h) Moving:
Figure BDA0003792108920000112
if h is larger than or equal to Max, selecting a position x 'with the minimum fitness value' * (Max') as a weight for non-leaf nodes in the decision tree;
in detail, referring to fig. 3, the target area image index feature detection process based on the random forest includes:
s51, inputting target area image index characteristics of the new energy battery to be detected into the constructed random forest;
s52, outputting a defect detection result of the new energy battery to be detected by each decision tree in the random forest;
and S53, adding and averaging the defect detection results of each decision tree, if the result is greater than the threshold value of 0.7, indicating that the new energy battery to be detected has defects, counting the detection results of non-leaf nodes in each decision tree, and taking the image area corresponding to the operator feature with the largest number and the detection result of 1 as the defect position.
Example 2:
fig. 4 is a functional block diagram of a nondestructive testing apparatus for a new energy battery according to an embodiment of the present invention, which can implement the nondestructive testing method for a battery in embodiment 1.
The rapid nondestructive testing apparatus 100 for new energy batteries according to the present invention may be installed in an electronic device. According to the realized function, the rapid new energy battery nondestructive testing device can comprise a data acquisition and processing module 101, an index construction device 102 and a battery detection and classification module 103. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and can perform a fixed function, and are stored in a memory of the electronic device.
The data acquisition processing module 101 is configured to perform filtering and denoising processing on the acquired new energy battery image by using an improved bilateral filtering algorithm, segment the denoised new energy battery image by using an optimal support plane, remove a background image in the new energy battery image, extract a target region image, and perform image enhancement on the extracted target region image by using an improved wavelet transform algorithm;
the index construction device 102 is used for constructing a new energy battery defect detection index system, and extracting the index features of the enhanced target area image based on the constructed index system to obtain the index features of the new energy battery to be detected;
and the battery detection and classification module 103 is used for optimizing and classifying the new energy battery by using an improved random forest optimization algorithm based on the index characteristics of the new energy battery to be detected, and detecting and identifying whether the new energy battery has surface defects and defect positions.
In detail, when the modules in the nondestructive testing apparatus 100 for a new energy battery according to the embodiment of the present invention are used, the same technical means as the nondestructive testing method for a new energy battery described in fig. 1 are adopted, and the same technical effects can be produced, which is not described herein again.
Example 3:
fig. 5 is a schematic structural diagram of an electronic device implementing a fast nondestructive testing method for a new energy battery according to an embodiment of the present invention.
The electronic device 1 may include a processor 10, a memory 11 and a bus, and may further include a computer program, such as a fast new energy battery nondestructive testing program 12, stored in the memory 11 and operable on the processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used to store not only application software installed in the electronic device 1 and various types of data, such as codes of the rapid new energy battery non-destructive inspection program 12, but also temporarily store data that has been output or will be output.
The processor 10 may be formed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be formed of a plurality of integrated circuits packaged with the same function or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 by operating or executing programs or modules (fast new energy battery nondestructive testing programs, etc.) stored in the memory 11 and calling data stored in the memory 11.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Fig. 5 only shows an electronic device with components, and it will be understood by a person skilled in the art that the structure shown in fig. 5 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or a combination of certain components, or a different arrangement of components.
For example, although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used for establishing a communication connection between the electronic device 1 and other electronic devices.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device 1 and for displaying a visualized user interface, among other things.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The fast new energy battery non-destructive inspection program 12 stored in the memory 11 of the electronic device 1 is a combination of instructions that, when executed in the processor 10, enable:
acquiring a new energy battery image, and carrying out filtering and denoising treatment on the acquired new energy battery image by using an improved bilateral filtering algorithm to obtain a denoised new energy battery image;
segmenting the denoised new energy battery image by using an optimal support plane, removing a background image in the new energy battery image, and extracting to obtain a target area image;
carrying out image enhancement on the extracted target region image by utilizing an improved wavelet transform algorithm to obtain an enhanced target region image and improve the identification degree of the defect part;
constructing a new energy battery defect detection index system, and extracting index features of the enhanced target area image based on the constructed index system to obtain the index features of the new energy battery to be detected;
and based on the index characteristics of the new energy battery to be detected, the new energy battery is optimized and classified by using an improved random forest optimization algorithm, and whether the new energy battery has surface defects or not and the defect positions are detected and identified.
Specifically, the specific implementation method of the processor 10 for the instruction may refer to the description of the relevant steps in the embodiments corresponding to fig. 1 to fig. 5, which is not repeated herein.
It should be noted that the above-mentioned numbers of the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments. And the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, apparatus, article, or method that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A rapid nondestructive testing method for a new energy battery is characterized by comprising the following steps:
s1: acquiring a new energy battery image, and carrying out filtering and denoising processing on the acquired new energy battery image by using an improved bilateral filtering algorithm to obtain a denoised new energy battery image;
s2: segmenting the denoised new energy battery image by using an optimal support plane, removing a background image in the new energy battery image, and extracting to obtain a target area image;
s3: carrying out image enhancement on the extracted target region image by utilizing an improved wavelet transform algorithm to obtain an enhanced target region image and improve the identification degree of the defect part;
s4: constructing a new energy battery defect detection index system, and extracting index features of the enhanced target area image based on the constructed index system to obtain the index features of the new energy battery to be detected;
s5: and based on the index characteristics of the new energy battery to be detected, the new energy battery is optimized and classified by using an improved random forest optimization algorithm, and whether the new energy battery has surface defects or not and the defect position is detected and identified.
2. The rapid nondestructive testing method for the new energy battery as claimed in claim 1, wherein the step S1 of acquiring the new energy battery image includes:
the method comprises the following steps of acquiring a new energy battery image I by utilizing camera equipment, wherein the acquired new energy battery image is a gray image, and the gray processing flow of the new energy battery image is as follows:
solving the maximum value of three color channel components of any pixel point I (I, j) in the new energy battery image I, setting the maximum value as the gray value of the pixel point, wherein (I, j) is the coordinate of the pixel point, repeating the steps until the gray values of all pixels in the new energy battery image I are obtained, and taking the gray values of the pixels as the pixel values of the pixels, wherein the formula of the graying processing is as follows:
gray(i,j)=max{R(I(i,j)),G(I(i,j)),B(I(i,j))}
wherein:
gray (I, j) is the gray value of the pixel point I (I, j);
r (I (I, j)), G (I (I, j)), B (I (I, j)) are the values of pixel point I (I, j) in the three color channels R, G, B, respectively.
3. The method for nondestructive testing of a new energy battery as claimed in claim 2, wherein in the step S1, the filtering and denoising process of the acquired new energy battery image using the improved bilateral filtering algorithm includes:
the method comprises the following steps of constructing a bilateral filter based on an improved bilateral filtering algorithm, inputting a new energy battery image I into the bilateral filter, and carrying out filtering and denoising processing on pixels in the new energy battery image by the bilateral filter, wherein the formula of the filtering processing is as follows:
Figure FDA0003792108910000011
Figure FDA0003792108910000012
wherein:
Figure FDA0003792108910000013
is the filter weight;
(I ', j') is the neighboring pixel coordinate of the pixel point I (I, j) in the 4 × 4 pixel neighborhood S (I, j);
σ 1 ,σ 2 is the Gaussian standard deviation;
h (I, j) is the filtered pixel value of the pixel point I (I, j).
4. The method for nondestructive testing of a new energy battery as claimed in claim 1, wherein the constructing a support plane for foreground-background image segmentation in the step S2 includes:
the constructed support plane for foreground and background image segmentation is C; and taking the pixel area with the pixel value larger than C as a background image, and taking the pixel area with the pixel value smaller than C as a target area image.
5. The method according to claim 4, wherein in the step S2, the support plane is optimized and solved based on a heuristic algorithm, and the optimal support plane is used to perform foreground and background segmentation on the de-noised new energy battery image to obtain the target area image, and the method includes:
optimizing and solving a support plane based on a heuristic algorithm, wherein the optimizing and solving process of the support plane comprises the following steps:
1) Constructing a fitness function supporting plane optimization solution:
F(c)=p b (c)p q (c)[μ b (c)-μ q (c)] 2
c∈[0,L-1]
Figure FDA0003792108910000021
Figure FDA0003792108910000022
wherein:
f (c) denotes a fitness value, μ, for segmenting an image into foreground and background regions in accordance with the support plane c b (c) Is the pixel mean value of the corresponding background area, mu q (c) The corresponding foreground area pixel mean value is obtained;
[0,L-1] represents the range of pixel gray levels, L-1 represents the maximum gray level;
p k representing the probability of occurrence of a pixel with a gray level k;
p b (c) Representing the distribution probability, p, of background pixels q (c) Representing the distribution probability of foreground pixels;
2) Initializing n 1 Only pigeons and randomly initializing the position and speed of each pigeon, wherein the position and speed of any ith pigeon are as follows:
(x s ,v s )
wherein:
x s position of the s-th pigeon, x s ∈[0,L-1]By mixing x s Substituting the value into the fitness function to obtain the fitness value F (x) of the s-th pigeon s );v s The flight speed of the s-th pigeon is obtained;
3) Setting the iteration number of the current algorithm as n g And n is g Initializing to 0, and setting the maximum iteration number of the algorithm to Max;
4) Judging whether the iteration number of the current algorithm meets n g And if not, updating the positions and the speeds of all pigeons by using the following formula, updating the positions which are greater than L-1 into L-1, and updating the positions which are less than 0 into 0 in an iteration process:
Figure FDA0003792108910000023
Figure FDA0003792108910000024
wherein:
Figure FDA0003792108910000025
is at the n-th g After the iteration, the pigeon position with the maximum fitness value in the population is determined;
Figure FDA0003792108910000026
the second pigeon in the population is at the nth g The speed of the secondary iteration;
rand (0,1) is a random number between 0 and 1;
Figure FDA0003792108910000027
the second pigeon in the population is at the nth g The location of the secondary iteration;
and let n g =n g +1, repeating the step;
if n is satisfied g If the current fitness value is more than or equal to Max, the pigeon position with the maximum current fitness value is determined
Figure FDA0003792108910000028
As an optimal support plane C * Using the optimum support plane C * And carrying out foreground and background segmentation on the denoised new energy battery image to obtain a target area image.
6. The nondestructive testing method for the new energy battery as claimed in claim 5, wherein the step S3 of performing image enhancement on the extracted target region image by using a modified wavelet transform algorithm includes:
for the extracted target area image G, carrying out image enhancement on the target area image G by using an improved wavelet transform algorithm, wherein the image enhancement process comprises the following steps:
1) Converting a target area image G into an image signal G (t), wherein the image signal conversion method comprises the steps of expanding pixels of the target area image line by line to obtain a line of pixels, mapping pixel coordinates to horizontal coordinates to serve as time domain information of the image signal, and the pixel value is the signal value;
2) Fixing a scale factor a, performing wavelet transform processing on an image signal G (t) by using a wavelet function omega (t), wherein the adopted wavelet function is a Haar wavelet function, and the wavelet transform processing formula is as follows:
Figure FDA0003792108910000031
wherein:
b represents a displacement factor of the wavelet function;
q a,b (t) wavelet coefficients with a scale a shifted by b;
2) Changing the displacement factor of the wavelet function and repeating the step 1) to obtain a wavelet coefficient set under the scale factor a;
3) Changing the scale factor a, and repeating the step 1) 2) to obtain the wavelet coefficient q of the image signal G (t) under different scale factors and displacement factors a,b (t) up to
Figure FDA0003792108910000032
4) Determining a wavelet threshold value as sigma;
5) Deleting the wavelet coefficients smaller than the wavelet threshold value sigma, and reserving the wavelet coefficients larger than the wavelet threshold value sigma, wherein the reserved wavelet coefficients are q' a,b (t) reconstructing the wavelet coefficients into G' (t) using the inverse wavelet transform method, the inverse wavelet transform method having the formula:
Figure FDA0003792108910000033
wherein:
g' (t) is the enhanced image signal after reconstruction;
6) And converting the enhanced signal G '(t) into an image to obtain an enhanced target area image G'.
7. The rapid nondestructive testing method for the new energy battery as claimed in claim 1, wherein the step S4 is to construct a new energy battery defect detection index system, which includes:
the constructed new energy battery defect detection index system is as follows:
{Robert,Sobel,Canny,HOG}
wherein:
the Robert is Robert operator index characteristics of the new energy battery image;
sobel is a Sobel operator index characteristic in the new energy battery image;
canny is Canny operator index characteristics in the new energy battery image;
and the HOG is HOG operator index characteristics in the new energy battery image.
8. The method for nondestructive testing of a new energy battery as claimed in claim 1, wherein the performing index feature extraction on the enhanced target area image based on the constructed index system in step S4 includes:
performing index feature extraction on the enhanced target area image based on the constructed new energy battery defect detection index system, wherein the index feature extraction process comprises the following steps:
selecting a Robert operator template, a Sobel operator template, a Canny operator template and an HOG operator template according to the new energy battery defect detection index system;
carrying out feature detection on the target area image to be subjected to feature extraction by utilizing an operator template;
taking the result of the feature detection as an index feature of the target area image, wherein the index feature set comprises the following components:
f G′ ={Robert G′ ,Sobel G′ ,Canny G′ ,HOG G′ }
wherein:
f G′ the target area image G' is subjected to enhancement;
Robert G′ the Robert operator index features of the enhanced target region image G';
Sobel G′ to enhance the rear target areaSobel operator index characteristics of the domain image G';
Canny G′ the Canny operator index characteristic of the enhanced target area image G';
HOG G′ and the HOG operator index characteristics of the enhanced target region image G' are obtained.
9. The method for nondestructive testing of a new energy battery rapidly as set forth in claim 8, wherein in the step S5, based on the index characteristics of the new energy battery to be tested, the optimizing classification of the new energy battery by using the improved random forest optimization algorithm includes:
acquiring a new energy battery image with a defect mark as a training set, carrying out filtering and denoising processing based on an improved bilateral filtering algorithm, segmentation processing based on an optimal support plane and image enhancement processing based on an improved wavelet transform algorithm on the new energy battery image in the training set, and extracting index features of an enhanced image to obtain an index feature training set:
{data m =(f m ,y m )|m∈[1,M]}
wherein:
data m the data is the mth group of data in the index characteristic training set, and M is the number of data groups in the index characteristic training set;
f m is data m The index characteristic of (1);
y m ={0,1},y m =0 denotes data m Absence of defects, y m =1 denotes data m The existence of defects;
constructing a random forest model, wherein the random forest model comprises n2 decision trees, the input of each decision tree is the index characteristic of the new energy battery image, the output is {0,1},0 represents that the new energy battery has no defects, 1 represents that the new energy battery has defects, the non-leaf node of each decision tree is the operator characteristic in the index characteristic, and the leaf node is the output result {0,1};
for the weight of the non-leaf node in each decision tree, performing weight optimization by using the following method, wherein the method comprises the following steps:
1) Constructing a fitness function of weight solving:
Figure FDA0003792108910000041
wherein:
r represents a weight vector of a non-leaf node in the decision tree;
Figure FDA0003792108910000044
training the central index feature f for the index feature based on the decision tree constructed by the weight vector r m The defect detection result of (1);
y m training a central index feature f for the index features m The actual defect condition of;
2) Generating n 'fish, and initializing the position x' and speed l of each fish, so that the position of the d-th fish is:
x′ d =[w 1,d ,w 2,d ,w 3,d ,w 4,d ]
w 1,d +w 2,d +w 3,d +w 4,d =1
wherein:
w 1,d weighting the Robert operator index features in the decision tree;
w 2,d weighting the index features of the Sobel operator in the decision tree;
w 3,d weighting the Canny operator index characteristics in the decision tree;
w 4,d weighting the HOG operator index features in the decision tree;
3) Setting the iteration number of the current algorithm as h, initializing h to be 0, and setting the maximum iteration number of the algorithm as Max';
4) Judging whether the iteration frequency of the current algorithm meets h is larger than or equal to Max, if not, performing position iteration updating on each fish, and returning to the step after the iteration updating, wherein the position iteration updating rule is as follows:
for any d-th stripLocation x 'of fish at h-th iteration' d (h) And its fitness value is Lo (x' d (h) "if a position x 'with a smaller fitness value is found in the visual field range' * (h) Then a shift in position is made, where position x' * (h) The fish is not present at the position of (2), the visual field range of the fish is 0.1, and the position moving formula is as follows:
Figure FDA0003792108910000042
wherein:
l d the speed of the d fish;
position x 'at h-th iteration for any d-th fish' d (h) If a non-crowded position x' is found in the field of view * (h) Then to position x ″) * (h) Moving:
Figure FDA0003792108910000043
if h is larger than or equal to Max, selecting a position x 'with the minimum fitness value' * (Max') as a weight for non-leaf nodes in the decision tree;
target area image index characteristic f of new energy battery to be detected G′ Inputting the random forest into the constructed random forest;
outputting a defect detection result of the new energy battery to be detected by each decision tree in the random forest;
and adding and averaging the defect detection results of each decision tree, if the result is greater than the threshold value of 0.7, indicating that the new energy battery to be detected has defects, counting the detection results {0,1} of non-leaf nodes in each decision tree, wherein the image area corresponding to the operator feature with the largest number and the detection result of 1 is the defect position.
10. A rapid nondestructive testing device for a new energy battery is characterized by comprising:
the data acquisition processing module is used for carrying out filtering and denoising processing on the acquired new energy battery image by using an improved bilateral filtering algorithm, segmenting the denoised new energy battery image by using an optimal support plane, removing a background image in the new energy battery image, extracting to obtain a target area image, and carrying out image enhancement on the extracted target area image by using an improved wavelet transform algorithm;
the index construction device is used for constructing a new energy battery defect detection index system, and extracting index features of the enhanced target area image based on the constructed index system to obtain the index features of the new energy battery to be detected;
the battery detection and classification module is used for optimizing and classifying the new energy battery by using an improved random forest optimization algorithm based on the index characteristics of the new energy battery to be detected, detecting and identifying whether the new energy battery has surface defects and defect positions, and realizing the rapid new energy battery nondestructive detection method as claimed in claim 1.
CN202210957962.0A 2022-08-11 2022-08-11 Rapid nondestructive testing method for new energy battery Pending CN115147405A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210957962.0A CN115147405A (en) 2022-08-11 2022-08-11 Rapid nondestructive testing method for new energy battery

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210957962.0A CN115147405A (en) 2022-08-11 2022-08-11 Rapid nondestructive testing method for new energy battery

Publications (1)

Publication Number Publication Date
CN115147405A true CN115147405A (en) 2022-10-04

Family

ID=83415203

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210957962.0A Pending CN115147405A (en) 2022-08-11 2022-08-11 Rapid nondestructive testing method for new energy battery

Country Status (1)

Country Link
CN (1) CN115147405A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117058125A (en) * 2023-09-01 2023-11-14 无锡维凯科技有限公司 Detection method and system based on rear cover glass of mobile phone

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117058125A (en) * 2023-09-01 2023-11-14 无锡维凯科技有限公司 Detection method and system based on rear cover glass of mobile phone
CN117058125B (en) * 2023-09-01 2024-03-15 无锡维凯科技有限公司 Detection method and system based on rear cover glass of mobile phone

Similar Documents

Publication Publication Date Title
CN108121991B (en) Deep learning ship target detection method based on edge candidate region extraction
CN110378297B (en) Remote sensing image target detection method and device based on deep learning and storage medium
CN110569738B (en) Natural scene text detection method, equipment and medium based on densely connected network
JP6192271B2 (en) Image processing apparatus, image processing method, and program
CN113283446A (en) Method and device for identifying target object in image, electronic equipment and storage medium
CN111639704A (en) Target identification method, device and computer readable storage medium
CN111695609A (en) Target damage degree determination method, target damage degree determination device, electronic device, and storage medium
CN112580643A (en) License plate recognition method and device based on deep learning and storage medium
CN116168351B (en) Inspection method and device for power equipment
CN112749653A (en) Pedestrian detection method, device, electronic equipment and storage medium
CN111951283A (en) Medical image identification method and system based on deep learning
CN111160114A (en) Gesture recognition method, device, equipment and computer readable storage medium
CN115147405A (en) Rapid nondestructive testing method for new energy battery
CN114049568A (en) Object shape change detection method, device, equipment and medium based on image comparison
CN115345895B (en) Image segmentation method and device for visual detection, computer equipment and medium
CN115601684A (en) Emergency early warning method and device, electronic equipment and storage medium
CN110503627B (en) Building crack detection method and device, storage medium and computer equipment
CN112464946A (en) Garbage image collection method and system based on big data
CN112507903A (en) False face detection method and device, electronic equipment and computer readable storage medium
CN112561893A (en) Picture matching method and device, electronic equipment and storage medium
CN112541899A (en) Incomplete certificate detection method and device, electronic equipment and computer storage medium
CN111382741A (en) Method, system and equipment for detecting text in natural scene picture
Kavitha et al. Text detection based on text shape feature analysis with intelligent grouping in natural scene images
CN114926753B (en) Rapid target scene information extraction method under condition of massive images
CN111274993B (en) Eyebrow recognition method, device, computing equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination