CN115937195A - Surface defect detection method and device and computer equipment - Google Patents
Surface defect detection method and device and computer equipment Download PDFInfo
- Publication number
- CN115937195A CN115937195A CN202211740858.2A CN202211740858A CN115937195A CN 115937195 A CN115937195 A CN 115937195A CN 202211740858 A CN202211740858 A CN 202211740858A CN 115937195 A CN115937195 A CN 115937195A
- Authority
- CN
- China
- Prior art keywords
- detected
- image
- feature
- standard
- defect detection
- 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
Links
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02E—REDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
- Y02E60/00—Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation
- Y02E60/10—Energy storage using batteries
Landscapes
- Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
Abstract
The application provides a surface defect detection method, a device and computer equipment, wherein the method comprises the following steps: acquiring a plurality of to-be-detected surface image blocks of a to-be-detected battery; performing feature extraction on each image block of the surface to be detected by adopting a preset feature extraction network to obtain the corresponding features of the surface to be detected of each image block of the surface to be detected; according to a pre-constructed good product characteristic memory library, performing defect detection on the to-be-detected surface characteristics corresponding to each to-be-detected surface image block, and correspondingly obtaining a defect detection result of each to-be-detected surface image block; the good product characteristic memory base comprises standard surface characteristics of a plurality of good product batteries; and determining whether the battery to be detected has surface defects according to the defect detection result of each image block of the surface to be detected. Therefore, based on the standard surface characteristics, the method and the device can be used for comprehensively and effectively detecting various surface defects of the battery to be detected, and the detection efficiency of the surface defects of the battery and the reliability of a detection result are improved.
Description
Technical Field
The present application relates to the field of battery inspection technologies, and in particular, to a method and an apparatus for inspecting surface defects, and a computer device.
Background
As the market demand for automotive power batteries continues to increase, the quality requirements for lithium batteries are also more stringent. In the production process of the lithium battery square battery (also called square lithium battery), the quality of the lithium battery square battery is affected and even personal safety hazards are brought because various factors can cause defects such as surface burrs, scratches, concave-convex parts, damage and the like. Therefore, it becomes more important to perform defect detection on the surface of the battery during the production process.
The surface defect detection of the square lithium battery usually adopts a manual detection mode, namely, whether the blue film surface of the square lithium battery has defects is manually observed. However, manual detection has the problems of low accuracy, poor real-time performance, low efficiency, high labor intensity and the like.
Disclosure of Invention
The application provides a surface defect detection method, a surface defect detection device and computer equipment, which can improve the detection efficiency of battery surface defects.
In a first aspect, the present application provides a surface defect detection method, comprising:
acquiring a plurality of surface image blocks to be detected of a battery to be detected;
performing feature extraction on each image block of the surface to be detected by adopting a preset feature extraction network to obtain the corresponding features of the surface to be detected of each image block of the surface to be detected;
according to a pre-constructed good product characteristic memory base, defect detection is carried out on the to-be-detected surface characteristics corresponding to each to-be-detected surface image block, and a defect detection result of each to-be-detected surface image block is correspondingly obtained; the good product characteristic memory library comprises standard surface characteristics of a plurality of good product batteries;
and determining whether the battery to be detected has surface defects according to the defect detection result of each image block of the surface to be detected.
In one possible implementation, constructing a good product characteristic memory library includes:
acquiring standard surface images of a plurality of good batteries;
extracting the features of each standard surface image by using a feature extraction network to obtain a plurality of standard surface features;
and constructing a good product characteristic memory library according to the plurality of standard surface characteristics.
In one possible implementation, the special extraction network includes an initial convolution layer, a first convolution residual module, a second convolution residual module, and a third convolution residual module that are cascaded;
carrying out feature extraction on each standard surface image by adopting a preset feature extraction network to obtain a plurality of standard surface features, wherein the method comprises the following steps:
inputting the standard surface image into an initial convolution layer aiming at any standard surface image, and acquiring initial characteristics of the standard surface image through the initial convolution layer;
inputting the initial features into a first convolution residual module, and acquiring first scale features of the standard surface image through the initial features and the image features extracted by the first convolution residual module;
inputting the first scale feature into a second convolution residual error module, and acquiring a second scale feature of the standard surface image through the first scale feature and the image feature extracted by the second convolution residual error module;
inputting the second scale features into a third convolution residual error module, and acquiring third scale features of the standard surface image through the second scale features and the image features extracted by the third convolution residual error module;
and performing multi-level feature fusion on the second multi-scale features and the third multi-scale features to obtain standard surface features.
In one possible implementation, constructing a good product characteristic memory library according to a plurality of standard surface characteristics includes:
constructing a full quantity characteristic library corresponding to a plurality of good batteries according to the standard surface characteristics; the full-quantity feature library comprises all standard surface features corresponding to the standard surface images of the plurality of good batteries;
and carrying out sparse sampling on the standard surface features in the full-scale feature library to generate a good product feature memory library.
In one possible implementation, acquiring a standard surface image of a plurality of good cells includes:
acquiring original surface images of a plurality of good batteries;
performing image preprocessing on the original surface image of each good battery to obtain at least one standard surface image corresponding to each good battery;
wherein the image preprocessing comprises at least one of image scale random change, image cropping and image normalization processing.
In a possible implementation manner, the defect detection of the surface features to be detected corresponding to each image block of the surface to be detected is performed according to a pre-constructed good product feature memory library, including:
aiming at the surface characteristics to be detected corresponding to any surface image block to be detected, acquiring target surface characteristics corresponding to the surface characteristics to be detected from a good product characteristic memory base through a preset classification search algorithm; the target surface characteristic is a standard surface characteristic with the maximum deviation between the target surface characteristic and the surface characteristic to be detected in the good product characteristic memory library;
and performing defect detection on the surface feature to be detected corresponding to the image block of the surface to be detected according to the surface feature to be detected and the surface feature of the target.
In one possible implementation manner, the defect detection of the to-be-detected surface feature corresponding to the to-be-detected surface image block according to the to-be-detected surface feature and the target surface feature includes:
calculating a characteristic deviation value between the surface characteristic to be detected and the target surface characteristic;
if the characteristic deviation value is smaller than a preset deviation threshold value, determining that the defect detection result of the image block of the surface to be detected corresponding to the surface characteristic to be detected is that no surface defect exists;
and if the characteristic deviation value is larger than or equal to the deviation threshold value, determining that the defect detection result of the image block of the surface to be detected corresponding to the surface characteristic to be detected is the existence of the surface defect.
In one possible implementation, obtaining a plurality of image blocks of a to-be-inspected surface of a to-be-inspected battery comprises:
acquiring an original surface image of a battery to be detected;
and according to a preset segmentation strategy, carrying out image segmentation on the original surface image of the battery to be detected to obtain a plurality of image blocks of the surface to be detected of the battery to be detected.
In a second aspect, the present application provides a surface defect detecting apparatus comprising:
the first image acquisition module is used for acquiring a plurality of image blocks of the surface to be detected of the battery to be detected;
the first feature extraction module is used for extracting features of each to-be-detected surface image block by adopting a preset feature extraction network to obtain the to-be-detected surface features corresponding to each to-be-detected surface image block;
the defect detection module is used for carrying out defect detection on the to-be-detected surface features corresponding to the to-be-detected surface image blocks according to a pre-constructed good product feature memory library to correspondingly obtain defect detection results of the to-be-detected surface image blocks; the good product characteristic memory library comprises standard surface characteristics of a plurality of good product batteries;
and the determining module is used for determining whether the battery to be detected has surface defects according to the defect detection result of each image block of the surface to be detected.
In a third aspect, the present application provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor, when calling from the memory and executing the computer program, implements the steps of the surface defect detection method shown in any one of the above first aspects.
In a fourth aspect, the present application provides a computer storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the surface defect detection method of any one of the first aspect described above.
In a fifth aspect, the present application provides a computer program product comprising a computer program that, when executed by a processor, performs the steps of the surface defect detection method of any one of the first aspects described above.
The technical scheme provided by the application can at least achieve the following beneficial effects:
according to the surface defect detection method, the surface defect detection device and the computer equipment, a plurality of image blocks of the surface to be detected of the battery to be detected are obtained firstly; then, performing feature extraction on each image block of the surface to be detected by adopting a preset feature extraction network to obtain the corresponding features of the surface to be detected of each image block of the surface to be detected; then, according to a pre-constructed good product characteristic memory library, defect detection is carried out on the to-be-detected surface characteristics corresponding to each to-be-detected surface image block, and a defect detection result of each to-be-detected surface image block is correspondingly obtained; and finally, determining whether the battery to be detected has surface defects or not according to the defect detection result of each surface image block to be detected. The good product characteristic memory library comprises standard surface characteristics of a plurality of good product batteries. Therefore, the image blocks of the surface to be detected are divided, so that the characteristic extraction efficiency of the characteristic extraction network can be improved, and a plurality of surface characteristics to be detected of the battery to be detected can be rapidly acquired. Secondly, based on the standard surface characteristics, various surface defects can be comprehensively and effectively detected, and the accuracy of the detection result is improved. Furthermore, the defect detection result of each image block on the surface to be detected of the battery to be detected is integrated, so that whether the battery to be detected has surface defects can be quickly judged. Therefore, the detection efficiency of the battery surface defects and the reliability of the detection result are improved.
Drawings
FIG. 1 is a schematic diagram illustrating a computer device according to an exemplary embodiment of the present application;
FIG. 2 is a schematic flow chart diagram illustrating a method for surface defect detection in accordance with an exemplary embodiment of the present application;
FIG. 3 is a schematic diagram illustrating an image segmentation in accordance with an exemplary embodiment of the present application;
fig. 4 is a schematic structural diagram of a Resnet18 network according to an exemplary embodiment of the present application;
FIG. 5 is a schematic flow chart illustrating a method for constructing a good product feature memory library according to an exemplary embodiment of the present application;
FIG. 6 is a schematic view of a defect detection process shown in an exemplary embodiment of the present application;
FIG. 7 is a schematic flow chart diagram illustrating another method of surface defect detection according to an exemplary embodiment of the present application;
FIG. 8 is a schematic diagram of a surface defect inspection apparatus according to an exemplary embodiment of the present application;
fig. 9 is a schematic structural diagram of another surface defect detecting apparatus according to an exemplary embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Before explaining the surface defect detection method provided by the present application, an application scenario and an implementation environment of the embodiment of the present application are introduced.
Therefore, in the production process, the defect detection needs to be carried out on the surface of the battery so as to judge whether the defects such as surface burrs, scratches, concave-convex parts, damage and the like exist, and the production quality of the battery is improved.
Because the production capacity of the battery is huge and the reject ratio of the product is about one ten thousandth, large-scale detection personnel are invested to carry out human eye detection, and a large amount of human resources are consumed.
With the development of visual algorithms and deep learning technologies, a neural network model can be trained by acquiring a large amount of labeled data, and then the trained neural network model is adopted to replace manual work to detect the surface defects of the battery. Specifically, a large number of defective battery surface samples are acquired, and the positions of the defects are manually marked pixel by pixel to make a training data set. And then, repeatedly and iteratively training the neural network model by adopting the training data set and the loss function to finally obtain the trained neural network model, and further carrying out surface defect detection on the battery to be detected by adopting the neural network model.
However, when the neural network model detects surface defects, the following disadvantages may exist:
(1) Model training is a supervised learning process, which consumes a lot of time to collect defective cell surface samples and perform manual pixel level labeling. The production of the training data set consumes a lot of manpower, material resources and time.
Moreover, the appearance defect form of the lithium battery is not fixed, the defect generation rate is low, and it is difficult to collect all kinds of defects for the deep learning network to learn.
(2) In the training process of deep learning segmentation or detection of the network model, more than 3 hours are usually required to obtain an available neural network model, and the iteration time of the model is long.
In the battery production process, the model of the production line is often changed. After the model of the production line is changed, if the surface defect detection is performed on a new model of battery, the original neural network model needs to be adjusted, and the production line may not wait for the long time for updating the original neural network model.
(3) The generalization of the trained neural network model is poor, and the defects are easy to miss detection aiming at the surface defects which are not collected because the deep learning network is not learned in advance.
Based on the above, the application provides a surface defect detection method, device and computer equipment, which usually perform feature extraction on a to-be-detected surface image block of a to-be-detected battery, and compare the extracted to-be-detected surface feature with a standard surface feature to judge whether a surface defect exists in the to-be-detected surface image block, so as to determine whether the to-be-detected battery has the surface defect, and improve the detection efficiency of the battery surface defect and the accuracy of a detection result.
And training a defect segmentation model by adopting a deep learning technology in cooperation with proper data enhancement processing and training strategies, and performing comparative analysis on the to-be-detected image block and the standard image block which are subjected to image preprocessing through the defect segmentation model during actual detection so as to determine whether the to-be-detected product has surface defects. So, the defect segmentation model that this application training obtained possesses very strong stability, generalization nature and high efficiency, consequently, combines image preprocessing and defect segmentation model, can improve the detection efficiency of waiting to examine product surface defect, and the homoenergetic can reach stable detection effect under multiple product, the multi-scene.
In an exemplary embodiment, the present application may utilize a computer device to perform feature extraction and defect detection on a to-be-detected surface image block of a to-be-detected battery, so as to determine whether the to-be-detected battery has surface defects.
In one possible implementation, the computer device is configured as shown in FIG. 1, and the computer device 100 includes at least one processor 110, a memory 120, a communication bus 130, and at least one communication interface 140.
The Processor 110 may be a general-purpose Central Processing Unit (CPU), a Network Processor (NP), a microprocessor, or one or more Integrated circuits for implementing the present invention, such as an Application-Specific Integrated Circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a Field-Programmable Gate Array (FPGA), general Array Logic (GAL), or any combination thereof.
Alternatively, processor 110 may include one or more CPUs. The computer device 100 may include a plurality of processors 110. Each of the processors 110 may be a single-Core Processor (CPU) or a multi-Core Processor (CPU).
It should be noted that processor 110 may refer to one or more devices, circuits, and/or processing cores configured to process data (e.g., computer program instructions).
The Memory 120 may be a Read-Only Memory (ROM) or other type of static storage device that can store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that can store information and instructions, an Electrically Erasable Programmable Read-Only Memory (EEPROM), a Compact Disc Read-Only Memory (CD-ROM) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these.
Alternatively, the memory 120 may be stand-alone and coupled to the processor 110 via the communication bus 130; memory 120 may also be integrated with processor 110.
The communication interface 140 is used for the computer device 100 to communicate with other devices or communication networks. The communication interface 140 includes a wired communication interface or a wireless communication interface. The wired communication interface may be an ethernet interface, for example. The ethernet interface may be an optical interface, an electrical interface, or a combination thereof. The Wireless communication interface may be a Wireless Local Area Network (WLAN) interface, a cellular network communication interface, a combination thereof, or the like.
In some embodiments, the computer device 100 may also include output devices and input devices (not shown in FIG. 1). An output device is in communication with the processor 110 and may display information in a variety of ways. For example, the output device may be a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) Display device, a Cathode Ray Tube (CRT) Display device, a projector (projector), or the like. The input device is in communication with the processor 110 and may receive user input in a variety of ways. For example, the input device may be a mouse, a keyboard, a touch screen device, a sensing device, or the like.
In some embodiments, the memory 120 is used to store computer programs for performing aspects of the present application, and the processor 110 may execute the computer programs stored in the memory 120. For example, the computer device 100 may call and execute a computer program stored in the memory 120 through the processor 110 to implement the steps of the surface defect detection method provided by the embodiment of the present application.
It should be understood that the surface defect detecting method provided in the present application may be applied to a surface defect detecting apparatus, which may be implemented as part or all of the processor 110 by software, hardware or a combination of software and hardware, and integrated in the computer device 100.
Next, the technical solutions of the present application and how to solve the above technical problems will be specifically described by embodiments with reference to the accompanying drawings. Various embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. It is to be understood that the embodiments described are only a subset of the embodiments in the present application and not all embodiments.
In an exemplary embodiment, as shown in fig. 2, the present application provides a surface defect detection method, which is exemplified by being applied to the computer device 100 shown in fig. 1, and may include the following steps:
step 210: and acquiring a plurality of surface image blocks to be detected of the battery to be detected.
Wherein, the battery of examining can be any lithium cell of production on the production line, and this lithium cell coats blue membrane, and the surface defect of this application embodiment detects whether have defects such as mar, unsmooth, breakage in blue membrane surface for the essence.
Of course, the technical solution of the present application may also be used to perform defect detection on the surfaces of other batteries or products, and only a good product characteristic memory library of the corresponding product is constructed, which is not limited in the embodiment of the present application.
In one possible implementation manner, the implementation process of step 210 may be: acquiring an original surface image of a battery to be detected; and according to a preset segmentation strategy, carrying out image segmentation on the original surface image of the battery to be detected to obtain a plurality of image blocks of the surface to be detected of the battery to be detected.
The division strategy comprises division according to the target size of the image block, or division according to the number of the divided image blocks.
It should be noted that, if the battery to be detected is a directional lithium battery, the surface of the blue film needs to be subjected to defect detection by 5 surfaces, and the obtained original surface image may be 5 surface images corresponding to the 5 surfaces, may also be a surface image obtained by splicing the 5 surface images, and may also be a surface image of any one of the 5 surfaces, and the number and the size of the original surface images are not limited in the embodiment of the present application.
Theoretically, for an original surface image, the more the number of the image blocks of the surface to be detected obtained after segmentation is, the faster the speed of processing one image block of the surface to be detected by the feature extraction network is; however, the image block of the surface to be examined cannot be made infinitely small, or it may be difficult to extract valid feature information from the image block.
As an example, referring to fig. 3, h represents the ordinate of the original surface image, w represents the abscissa of the original surface image, and the original surface image is segmented with (h, w) as the origin and p as the diameter.
The segmentation result can be expressed by the following formula (1):
in the formula, (a, b) are the image blocks to be inspected after division.
Step 220: and (3) performing feature extraction on each surface image block to be detected by adopting a preset feature extraction network to obtain the corresponding surface feature to be detected of each surface image block to be detected.
The special extraction network comprises an initial convolution layer, a first convolution residual module, a second convolution residual module and a third convolution residual module which are cascaded.
In one possible implementation manner, the implementation procedure of step 220 may be: aiming at any surface image block to be detected, inputting the surface image block to be detected into an initial convolution layer, and acquiring initial characteristics of a standard surface image through the initial convolution layer; inputting the initial features into a first convolution residual module, and acquiring first scale features of the image block of the surface to be detected through the initial features and the image features extracted by the first convolution residual module; inputting the first scale features into a second convolution residual error module, and acquiring second scale features of the surface image block to be detected through the first scale features and the image features extracted by the second convolution residual error module; inputting the second scale features into a third convolution residual error module, and acquiring third scale features of the surface image block to be detected through the second scale features and the image features extracted by the third convolution residual error module; and performing multi-level feature fusion on the second multi-scale feature and the third multi-scale feature to obtain the surface feature to be detected. By analogy, after the above feature extraction operation is performed on each surface image block to be detected, the surface features to be detected corresponding to each surface image block to be detected are obtained.
As an example, the feature extraction network may employ an existing Resnet18 network and pre-train the Resnet18 network with ImageNet data sets to enable feature extraction by the Resnet18 network.
Referring to the Resnet18 network shown in fig. 4, stages 1 to 4 are 4 convolution residual modules, and each convolution residual module includes 2 groups of residual blocks and different numbers of output channels.
The multi-level feature fusion of the present application is to connect (concat) the output results of stage2 and stage3 together.
For the segmented image block to be detected, the features of the surface to be detected extracted through the feature extraction network can be represented by the following formulas (2) and (3):
in the formula (I), the compound is shown in the specification,the representative extraction network inputs an image block to be detected Np (h, w) and outputs a feature vector of the image block to be detected; fagg represents an aggregation function that aggregates all information for each node, with Ps representing the full-scale feature set with step size s.
Step 230: and performing defect detection on the surface features to be detected corresponding to the image blocks of the surface to be detected according to a pre-constructed good product feature memory library, and correspondingly obtaining the defect detection results of the image blocks of the surface to be detected.
The good product characteristic memory library comprises standard surface characteristics of a plurality of good product batteries; the types and industrial production parameters of the good product battery and the battery to be detected are the same.
Referring to fig. 5, before the step 230, a good product characteristic memory library is constructed, which includes the following steps:
step 510: and acquiring standard surface images of a plurality of good batteries.
It should be noted that, for a good battery, one standard surface image may be acquired, and multiple standard surface images may also be acquired.
In one possible implementation manner, the implementation process of step 510 may be: acquiring original surface images of a plurality of good batteries; and performing image preprocessing on the original surface image of each good battery to obtain at least one standard surface image corresponding to each good battery.
Wherein the image preprocessing comprises at least one of image scale random change, image cropping and image normalization processing.
As one example, the image normalization process includes mean subtraction and variance division. And subtracting the mean value of all pixel values in the image from the pixel value of each pixel point in the image, and then dividing the mean value by the variance of all pixel values. The image is actually in a stable distribution, the statistical average value of the corresponding dimensionality of the data is subtracted to highlight the difference and the characteristics of the individual, and then the variance is removed, namely the pixel value range with larger difference of black and white pixels of the original image is fixed between-1 and 1, so that all pixel values of the image accord with the normal distribution.
Step 520: and (4) performing feature extraction on each standard surface image by adopting a feature extraction network to obtain a plurality of standard surface features.
The special extraction network comprises an initial convolution layer, a first convolution residual module, a second convolution residual module and a third convolution residual module which are cascaded.
It should be noted that the feature extraction network in step 520 is the same as the feature extraction network mentioned in step 220, and the feature extraction can be implemented by using the existing Resnet18 network.
In one possible implementation manner, the implementation procedure of step 520 may be: inputting the standard surface image into an initial convolution layer aiming at any standard surface image, and acquiring initial characteristics of the standard surface image through the initial convolution layer; inputting the initial features into a first convolution residual module, and acquiring first scale features of the standard surface image through the initial features and the image features extracted by the first convolution residual module; inputting the first scale feature into a second convolution residual error module, and acquiring a second scale feature of the standard surface image through the first scale feature and the image feature extracted by the second convolution residual error module; inputting the second scale features into a third convolution residual error module, and acquiring third scale features of the standard surface image through the second scale features and the image features extracted by the third convolution residual error module; and performing multi-level feature fusion on the second multi-scale feature and the third multi-scale feature to obtain the standard surface feature. By analogy, after the characteristic extraction operation is performed on each standard surface image, the standard surface characteristic corresponding to each standard surface image is obtained.
Step 530: and constructing a good product characteristic memory library according to the plurality of standard surface characteristics.
It should be noted that, if the good product characteristic memory library is directly constructed according to the plurality of standard surface characteristics, the generated good product characteristic memory library is too large, and when defect detection is subsequently performed based on the good product characteristic memory library, each image block to be detected needs to be contrasted and analyzed with all standard surface characteristics in the good product characteristic memory library, so that the characteristic contrast amount is very large.
Therefore, in order to reduce the complexity of feature comparison and the comparison reasoning time during defect detection, after a plurality of standard surface features are obtained, the plurality of standard surface features need to be screened, and then a non-defective product feature memory base is constructed according to the screening result.
In one possible implementation manner, the implementation procedure of step 530 may be: constructing a full-scale feature library corresponding to a plurality of good batteries according to the standard surface features; and carrying out sparse sampling on the standard surface characteristics in the full-quantity characteristic library to generate a good product characteristic memory library.
The full-quantity feature library comprises all standard surface features corresponding to the standard surface images of the good batteries.
As an example, sparse sampling may be represented by the following equation (4):
in the formula, M is marked as a good product characteristic memory library; u stands for greedy search covariance sampling method. The greedy search collaborative resetting sampling method comprises the steps of firstly taking any subset from a full-scale feature library, calculating the distance from each standard surface feature in the full-scale feature library to the subset, and finally obtaining the subset which is closest to each feature in a distance set.
Further, based on the constructed good product characteristic memory library, referring to fig. 6, the implementation process of performing defect detection on the to-be-detected surface characteristics corresponding to each to-be-detected surface image block in the step 230 to correspondingly obtain the defect detection result of each to-be-detected surface image block may include the following steps:
step 231: and aiming at the surface feature to be detected corresponding to any surface image block to be detected, acquiring the target surface feature corresponding to the surface feature to be detected from a good product feature memory base through a preset classification search algorithm.
Wherein the target surface characteristic is a standard surface characteristic with the largest deviation from the surface characteristic to be detected in the good product characteristic memory base.
In one possible implementation, the classification search algorithm may be a Neighbor/K-Nearest Neighbor (KNN) classification algorithm.
The KNN classification algorithm is to describe the calculation of the distance from a test sample point to each other sample point, sequence each distance, select the K points with the minimum distance, compare the categories of the K points, and classify the test sample point into the category with the highest ratio among the K points according to the principle that a minority obeys majority.
That is, in the embodiment of the present application, for each surface feature to be inspected, a KNN classification algorithm is used to sequentially calculate distances between the surface feature to be inspected and each standard surface feature in a good product feature memory library, and the calculated distances are arranged in a descending order, where the standard surface feature with the largest distance is the target surface feature.
It should be noted that the smaller the distance between the inspected surface feature and the standard surface feature is, the smaller the deviation between the inspected surface feature and the standard surface feature is, and the smaller the possibility of the surface defect is, the higher the possibility that the inspected surface feature is a good product feature is; conversely, the greater the distance between the surface feature to be inspected and the standard surface feature, the greater the deviation therebetween, and the greater the probability of having a surface defect, the less likely the surface feature to be inspected is a good product feature.
As an example, when acquiring target surface features corresponding to the surface features to be inspected of a plurality of image blocks of the surface to be inspected of the battery to be inspected by using the KNN classification algorithm, the target surface features may be obtained by the following formulas (5) and (6).
s * =||m test,* -m * || 2 (6)
In the formula, m test Representing features of the surface to be inspected of the image block of the surface to be inspected to be compared, argmax and argmin representing the calculation m test The distance between the standard surface features m in the good product feature memory base is obtained, and then the standard surface feature m of the farthest point is found test,* As a target surface feature.
Step 233: and performing defect detection on the surface feature to be detected corresponding to the image block of the surface to be detected according to the surface feature to be detected and the surface feature of the target.
In one possible implementation manner, the implementation procedure of step 233 may be: calculating a characteristic deviation value between the surface characteristic to be detected and the target surface characteristic; if the characteristic deviation value is smaller than a preset deviation threshold value, determining that the defect detection result of the image block of the surface to be detected corresponding to the surface characteristic to be detected is that no surface defect exists; and if the characteristic deviation value is greater than or equal to the deviation threshold value, determining that the defect detection result of the image block of the surface to be detected corresponding to the surface characteristic to be detected is the existence of the surface defect.
Wherein after the distance between the target surface feature and the surface feature to be detected is determined by the KNN classification algorithm, the characteristic deviation value can pass through 1-softmax(s) * ) To calculate.
It should be noted that the deviation threshold may be set according to a process manufacturing error, and the numerical value of the deviation threshold is not limited in the embodiment of the present application.
Step 240: and determining whether the battery to be detected has surface defects or not according to the defect detection result of each surface image block to be detected.
Specifically, if the defect detection results of the plurality of to-be-detected surface image blocks of the to-be-detected battery do not have surface features, determining that the to-be-detected battery has no surface defects and is a good battery; and if the defect detection result of one image block to be detected, which is hi less than one image block to be detected, in the plurality of image blocks to be detected of the battery to be detected is that the surface characteristics exist, determining that the battery to be detected has the surface defects.
Further, under the condition that the battery to be detected has the surface defect, the specific position of the surface defect can be determined according to the position area of the corresponding image block to be detected in the original surface image of the battery to be detected.
In the embodiment of the application, a plurality of surface image blocks to be detected of a battery to be detected are obtained; then, performing feature extraction on each image block of the surface to be detected by adopting a preset feature extraction network to obtain the corresponding features of the surface to be detected of each image block of the surface to be detected; then, according to a pre-constructed good product characteristic memory library, defect detection is carried out on the to-be-detected surface characteristics corresponding to each to-be-detected surface image block, and a defect detection result of each to-be-detected surface image block is correspondingly obtained; and finally, determining whether the battery to be detected has surface defects or not according to the defect detection result of each image block of the surface to be detected. The good product characteristic memory base comprises standard surface characteristics of a plurality of good product batteries. Therefore, the image blocks of the surface to be detected are divided, so that the characteristic extraction efficiency of the characteristic extraction network can be improved, and a plurality of surface characteristics to be detected of the battery to be detected can be quickly acquired. Secondly, based on the standard surface characteristics, various surface defects can be comprehensively and effectively detected, and the accuracy of the detection result is improved. Furthermore, the defect detection results of all the to-be-detected surface image blocks of the to-be-detected battery are integrated, so that whether the to-be-detected battery has surface defects or not can be quickly judged. Therefore, the detection efficiency of the surface defects of the battery and the reliability of the detection result are improved.
In addition, compared with the traditional method for detecting the surface defects by using the neural network model, firstly, the method is unsupervised learning, and a large amount of time is not needed to be consumed for collecting the defective battery surface samples. In the actual production process, standard surface images of a large number of good batteries are used for constructing/enriching a good characteristic memory library every day, and the standard surface characteristics of the good batteries can be extracted without manually marking defects. Secondly, the existing feature extraction network is adopted, the model iteration time is short, the model training is not required to be carried out through back propagation, and even if the product model change is changed greatly or the lighting mode is changed, the feature extraction network can still be updated within dozens of seconds. Further, the good product characteristic memory library is constructed, a good product characteristic memory library is good in detection effect on the unseen battery surface defects, and the problem that supervised learning of defect types is uneven in long tail distribution is not needed to be considered. Therefore, the method and the device have the advantages that the characteristic extraction network and the non-defective product characteristic memory library are adopted, various surface defects of the battery to be detected can be comprehensively and effectively detected, and the detection efficiency of the surface defects of the battery and the reliability of the detection result are improved.
Based on the above embodiments, in an exemplary embodiment, as shown in fig. 7, the present application further provides another surface defect detection method for detecting defects of a surface blue film of a battery. Similarly, as an example, the method is applied to the computer device 100 shown in fig. 1, and the implementation process of the surface defect detection method is as follows:
firstly, acquiring a plurality of non-defective blue film images, performing feature extraction through a Resnet18 network, and constructing a full-scale feature library according to the features of the fused stage2 and stage 3. In order to reduce the KNN search quantity and shorten the reasoning time, the standard surface features in the full-quantity feature library can be sparsely sampled to obtain a good-quality feature memory library.
During actual detection, for any blue film image to be detected, feature extraction is performed by using the Resnet18 network, and local features obtained after stage2 and stage3 are fused are obtained.
Further, for the local features of a single blue film image to be detected, measuring the distance between the local features and each standard surface feature in a good product feature memory library by KNN, and acquiring the standard surface feature with the largest distance as the target surface feature. And calculating a characteristic deviation value between the target surface characteristic and the local characteristic, and judging whether the blue film image to be detected has surface defects or not according to the characteristic deviation value and a preset deviation threshold value.
It should be noted that, when the above defect detection method is implemented in the embodiment of the present application, the implementation principle and technical effect of the method may refer to the relevant contents of step 210 to step 240 in the above embodiment, and are not described herein again.
It should be understood that, although the steps in the flowcharts related to the above embodiments are shown in sequence as indicated by the arrows, the steps are not necessarily executed in sequence as indicated by the arrows. The steps are not limited to being performed in the exact order illustrated and, unless explicitly stated herein, may be performed in other orders. Moreover, at least a part of the steps in the flowcharts related to the above embodiments may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
Based on the surface defect detection method and adopting the same technical concept, the embodiment of the application also provides a surface defect detection device corresponding to the surface defect detection method. The implementation of the solution provided by the apparatus is similar to the implementation described in the above method embodiments.
In an exemplary embodiment, as shown in fig. 8, the surface defect detecting apparatus 800 includes:
the first image acquisition module 810 is configured to acquire a plurality of to-be-detected surface image blocks of a to-be-detected battery;
the first feature extraction module 820 is configured to perform feature extraction on each to-be-detected surface image block by using a preset feature extraction network to obtain to-be-detected surface features corresponding to each to-be-detected surface image block;
the defect detection module 830 is configured to perform defect detection on the to-be-detected surface features corresponding to the to-be-detected surface image blocks according to a pre-constructed good product feature memory library, and correspondingly obtain defect detection results of the to-be-detected surface image blocks; the good product characteristic memory library comprises standard surface characteristics of a plurality of good product batteries;
the determining module 840 is configured to determine whether the battery to be tested has surface defects according to the defect detection result of each image block of the surface to be tested.
In one possible implementation, as shown in fig. 9, the apparatus 800 further includes:
a second image obtaining module 850, configured to obtain standard surface images of a plurality of good batteries;
a second feature extraction module 860, configured to perform feature extraction on each standard surface image by using a feature extraction network to obtain a plurality of standard surface features;
the memory bank constructing module 870 is configured to construct a non-defective product characteristic memory bank according to the plurality of standard surface characteristics.
In one possible implementation, the special extraction network includes an initial convolution layer, a first convolution residual module, a second convolution residual module, and a third convolution residual module that are cascaded;
a second feature extraction module 860, comprising:
the first extraction unit is used for inputting the standard surface image into the initial convolution layer aiming at any standard surface image and acquiring the initial characteristic of the standard surface image through the initial convolution layer;
the second extraction unit is used for inputting the initial features into the first convolution residual module and acquiring the first scale features in the standard surface image through the initial features and the image features extracted by the first convolution residual module;
the third extraction unit is used for inputting the first scale features to the second convolution residual error module and acquiring the second scale features in the standard surface image through the first scale features and the image features extracted by the second convolution residual error module;
the fourth extraction unit is used for inputting the second scale features to the third convolution residual error module and acquiring the third scale features in the standard surface image through the second scale features and the image features extracted by the third convolution residual error module;
and the feature fusion unit is used for performing multi-level feature fusion on the second multi-scale feature and the third multi-scale feature to obtain a standard surface feature.
In one possible implementation, the memory bank building module 870 includes:
the base building unit is used for building a full-quantity characteristic base corresponding to a plurality of good batteries according to the standard surface characteristics; the full-quantity feature library comprises all standard surface features corresponding to the standard surface images of the plurality of good batteries;
and the screening unit is used for carrying out sparse sampling on the standard surface characteristics in the full-scale characteristic library to generate a good product characteristic memory library.
In one possible implementation, the second image obtaining module 850 includes:
the good product image acquisition unit is used for acquiring original surface images of the good product batteries;
the image processing unit is used for carrying out image preprocessing on the original surface images of all good batteries to obtain at least one standard surface image corresponding to each good battery;
wherein the image preprocessing comprises at least one of image scale random variation, image cropping and image normalization processing.
In one possible implementation, the defect detecting module 830 includes:
the characteristic screening unit is used for acquiring target surface characteristics corresponding to the surface characteristics to be detected from a good product characteristic memory base through a preset classification searching algorithm aiming at the surface characteristics to be detected corresponding to any surface image block to be detected; the target surface characteristic is a standard surface characteristic with the maximum deviation between the target surface characteristic and the surface characteristic to be detected in the good product characteristic memory library;
and the defect detection unit is used for carrying out defect detection on the surface characteristics to be detected corresponding to the image blocks of the surface to be detected according to the surface characteristics to be detected and the target surface characteristics.
In a possible implementation manner, the defect detection unit is specifically configured to:
calculating a characteristic deviation value between the surface characteristic to be detected and the target surface characteristic;
if the characteristic deviation value is smaller than a preset deviation threshold value, determining that the defect detection result of the image block of the surface to be detected corresponding to the surface characteristic to be detected is that no surface defect exists;
and if the characteristic deviation value is larger than or equal to the deviation threshold value, determining that the defect detection result of the image block of the surface to be detected corresponding to the surface characteristic to be detected is the existence of the surface defect.
In one possible implementation, the first image obtaining module 810 includes:
the device comprises an image acquisition unit to be detected, a detection unit and a control unit, wherein the image acquisition unit is used for acquiring an original surface image of a battery to be detected;
and the image segmentation unit is used for carrying out image segmentation on the original surface image according to a preset segmentation strategy to obtain a plurality of to-be-detected surface image blocks of the to-be-detected battery.
For the specific definition of the surface defect detecting device, reference may be made to the above definition of the surface defect detecting method, which is not described herein again. The modules in the surface defect detecting device can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
Further, it should be understood that embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product comprises a computer program. The procedures or functions shown in the embodiments according to the present application are wholly or partially generated when the computer program is loaded and run on a computer device.
The computer program may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, and for example, the computer program may be transmitted from one website, terminal, server, or data center to another website, terminal, server, or data center by wire or wirelessly.
The computer-readable storage medium can be any available medium that can be accessed by a computing device or a data storage device, such as a server, a data center, etc., that includes one or more of the available media.
It should be understood that the above description is only a specific implementation of the embodiments of the present application, and is not intended to limit the scope of the embodiments of the present application. Any modification, equivalent replacement, improvement and the like made on the basis of the technical solutions of the embodiments of the present application should be included in the protection scope of the embodiments of the present application.
Claims (10)
1. A method of surface defect detection, comprising:
acquiring a plurality of surface image blocks to be detected of a battery to be detected;
performing feature extraction on each image block of the surface to be detected by adopting a preset feature extraction network to obtain the corresponding features of the surface to be detected of each image block of the surface to be detected;
according to a pre-constructed good product characteristic memory base, defect detection is carried out on the to-be-detected surface characteristics corresponding to the to-be-detected surface image blocks, and defect detection results of the to-be-detected surface image blocks are correspondingly obtained; the good product characteristic memory base comprises standard surface characteristics of a plurality of good product batteries;
and determining whether the battery to be detected has surface defects according to the defect detection result of each image block of the surface to be detected.
2. The method of claim 1, wherein constructing the good characteristic memory library comprises:
acquiring standard surface images of a plurality of good batteries;
performing feature extraction on each standard surface image by using the feature extraction network to obtain a plurality of standard surface features;
and constructing a good product characteristic memory library according to the plurality of standard surface characteristics.
3. The method of claim 2, wherein the bit extraction network comprises a concatenation of an initial convolutional layer, a first convolutional residual block, a second convolutional residual block, and a third convolutional residual block;
the method for extracting the features of the standard surface images by adopting a preset feature extraction network to obtain a plurality of standard surface features comprises the following steps:
inputting the standard surface image into the initial convolution layer aiming at any standard surface image, and acquiring initial characteristics of the standard surface image through the initial convolution layer;
inputting the initial features into the first convolution residual module, and acquiring first scale features of the standard surface image through the initial features and the image features extracted by the first convolution residual module;
inputting the first scale feature into the second convolution residual module, and acquiring a second scale feature of the standard surface image through the first scale feature and the image feature extracted by the second convolution residual module;
inputting the second scale feature into the third convolution residual module, and acquiring a third scale feature of the standard surface image through the second scale feature and the image feature extracted by the third convolution residual module;
and performing multi-level feature fusion on the second multi-scale features and the third multi-scale features to obtain the standard surface features.
4. The method as claimed in claim 2 or 3, wherein said constructing a good product characteristic memory library according to said plurality of standard surface characteristics comprises:
constructing a full-scale feature library corresponding to the good batteries according to the standard surface features; the full-quantity feature library comprises all standard surface features corresponding to the standard surface images of the plurality of good batteries;
and carrying out sparse sampling on the standard surface features in the full-scale feature library to generate the good product feature memory library.
5. The method according to claim 2 or 3, wherein the obtaining of the standard surface image of a plurality of good batteries comprises:
acquiring original surface images of a plurality of good batteries;
performing image preprocessing on the original surface image of each good battery to obtain at least one standard surface image corresponding to each good battery;
wherein the image preprocessing comprises at least one of image scale random variation, image cropping and image normalization processing.
6. The method as claimed in any one of claims 1 to 3, wherein the defect detection of the surface feature to be inspected corresponding to each image block of the surface to be inspected according to a pre-constructed good product feature memory library comprises:
aiming at the surface feature to be detected corresponding to any surface image block to be detected, acquiring a target surface feature corresponding to the surface feature to be detected from the good product feature memory base through a preset classification search algorithm; the target surface characteristic is a standard surface characteristic with the largest deviation with the surface characteristic to be detected in the good product characteristic memory base;
and carrying out defect detection on the surface feature to be detected corresponding to the image block of the surface to be detected according to the surface feature to be detected and the surface feature of the target.
7. The method as claimed in claim 6, wherein the defect detection of the surface feature to be inspected corresponding to the image block of the surface to be inspected according to the surface feature to be inspected and the target surface feature comprises:
calculating a feature deviation value between the surface feature to be inspected and the target surface feature;
if the characteristic deviation value is smaller than a preset deviation threshold value, determining that the defect detection result of the to-be-detected surface image block corresponding to the to-be-detected surface characteristic is surface defect-free;
and if the characteristic deviation value is greater than or equal to the deviation threshold value, determining that the defect detection result of the to-be-detected surface image block corresponding to the to-be-detected surface characteristic is the existence of the surface defect.
8. The method according to any one of claims 1 to 3, wherein the obtaining a plurality of image blocks of the inspected surface of the battery to be inspected comprises:
acquiring an original surface image of a battery to be detected;
and according to a preset segmentation strategy, carrying out image segmentation on the original surface image of the battery to be detected to obtain a plurality of image blocks of the surface to be detected of the battery to be detected.
9. A surface defect detecting apparatus, comprising:
the first image acquisition module is used for acquiring a plurality of image blocks of the surface to be detected of the battery to be detected;
the first feature extraction module is used for extracting features of the image blocks of the surface to be detected by adopting a preset feature extraction network to obtain the features of the surface to be detected corresponding to the image blocks of the surface to be detected;
the defect detection module is used for carrying out defect detection on the to-be-detected surface features corresponding to the to-be-detected surface image blocks according to a pre-constructed good product feature memory library to correspondingly obtain defect detection results of the to-be-detected surface image blocks; the good product characteristic memory base comprises standard surface characteristics of a plurality of good product batteries;
and the determining module is used for determining whether the battery to be detected has surface defects or not according to the defect detection result of each image block of the surface to be detected.
10. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when retrieving from the memory and executing the computer program implements the steps of the method of any of the preceding claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211740858.2A CN115937195A (en) | 2022-12-29 | 2022-12-29 | Surface defect detection method and device and computer equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211740858.2A CN115937195A (en) | 2022-12-29 | 2022-12-29 | Surface defect detection method and device and computer equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115937195A true CN115937195A (en) | 2023-04-07 |
Family
ID=86556114
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211740858.2A Pending CN115937195A (en) | 2022-12-29 | 2022-12-29 | Surface defect detection method and device and computer equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115937195A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116385444A (en) * | 2023-06-06 | 2023-07-04 | 厦门微图软件科技有限公司 | Blue film appearance defect detection network for lithium battery and defect detection method thereof |
-
2022
- 2022-12-29 CN CN202211740858.2A patent/CN115937195A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116385444A (en) * | 2023-06-06 | 2023-07-04 | 厦门微图软件科技有限公司 | Blue film appearance defect detection network for lithium battery and defect detection method thereof |
CN116385444B (en) * | 2023-06-06 | 2023-08-11 | 厦门微图软件科技有限公司 | Blue film appearance defect detection network for lithium battery and defect detection method thereof |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109977808B (en) | Wafer surface defect mode detection and analysis method | |
KR102110755B1 (en) | Optimization of unknown defect rejection for automatic defect classification | |
US10043264B2 (en) | Integration of automatic and manual defect classification | |
CN111815564B (en) | Method and device for detecting silk ingots and silk ingot sorting system | |
CN117670820B (en) | Plastic film production defect detection method and system | |
CN117152484B (en) | Small target cloth flaw detection method based on improved YOLOv5s | |
WO2024002187A1 (en) | Defect detection method, defect detection device, and storage medium | |
CN110544231A (en) | lithium battery electrode surface defect detection method based on background standardization and centralized compensation algorithm | |
CN112258459A (en) | Lithium battery defect detection method based on integrated deep learning | |
CN116128839A (en) | Wafer defect identification method, device, electronic equipment and storage medium | |
CN115937195A (en) | Surface defect detection method and device and computer equipment | |
Buratti et al. | Half and full solar cell efficiency binning by deep learning on electroluminescence images | |
CN117434082A (en) | Quality detection method and system for silica gel product production line | |
CN118053027A (en) | Defect identification method and device, electronic equipment and storage medium | |
CN117689646A (en) | High-precision defect detection method, system and medium for positive and negative sample fusion | |
CN112668365A (en) | Material warehousing identification method, device, equipment and storage medium | |
CN115908295A (en) | Power grid insulator defect detection method and system based on deep learning | |
CN114861771A (en) | Industrial CT image defect classification method based on feature extraction and deep learning | |
Xia et al. | A multi-target detection based framework for defect analysis of electrical equipment | |
KR102686135B1 (en) | Method of inspecting defect using artificial intelligence and apparatus for inspecting defect using artificial intelligence | |
CN116486178B (en) | Defect detection method and device, electronic equipment and storage medium | |
Amodu et al. | Revolutionizing Vehicle Damage Inspection: A Deep Learning Approach for Automated Detection and Classification. | |
CN116958086B (en) | Metal surface defect detection method and system with enhanced feature fusion capability | |
US20220189005A1 (en) | Automatic inspection using artificial intelligence models | |
CN114863426B (en) | Micro target detection method for coupling target feature attention and pyramid |
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 |