A lithium battery pole piece surface defect detection method based on machine vision

CN122887786APending Publication Date: 2026-10-09HUNAN YANKE NEW ENERGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610939847.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-26
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0003]传统极片表面检测多依赖固定角度光源和统一灰度分割,极片连续输送中的抖动,涂层周期纹理,辊压压痕和光照衰减会共同改变局部灰度,微小划痕与涂布纹理容易形成相近边界,孔洞露箔与反光斑点容易混淆,掉粉颗粒与异物附着在低对比区域内轮廓断裂,涂覆不均区域受背景纹理影响易被切分,人工复核依赖屏幕截图和批次记录,缺陷位置与输送距离关联不连续,异常预警滞后,质量追溯需要逐段比对生产记录

Benefits of technology

本发明中,通过将工业相机行图像与编码器脉冲同步绑定,按极片涂覆方向建立行亮度基准和纹理相位基准,使输送抖动,光照衰减和周期纹理对缺陷灰度的干扰被分层消除,通过同相位邻域残差分布生成随行号变化的缺陷判定边界,使微小划痕,裂纹,露箔和掉粉在低对比区域内保持连续轮廓,通过缺陷形态向量区分孔洞,反光斑点,异物附着和涂覆不均,通过缺陷等级与输送位置坐标关联,使异常预警和质量追溯直接对应生产段位,支撑缺陷复核时按坐标回看对应图像区域。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122887786A_ABST
    Figure CN122887786A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of image detection, in particular to a lithium battery pole piece surface defect detection method based on machine vision, comprising the following steps: collecting surface image sequences in the continuous conveying of pole pieces through an industrial camera, calculating row brightness reference matrix according to adjacent row gray median, edge margin gray difference and camera exposure state, constructing texture phase reference map, generating dynamic defect threshold map, screening defect candidate area, generating defect type sequence according to morphological characteristics and texture recognition model, and combining with encoder pulse to generate defect grade sequence. In the present application, the brightness and texture reference are established according to the coating texture phase, so that the calendering texture, coating cycle texture and illumination drift are separated, the residual quantile is used to generate the judgment boundary changing with the image row, the situation that weak scratches, foil exposure and powder falling are submerged by texture noise is reduced, the defect grade is associated with the position coordinates, and the alarm and traceability are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image detection technology, and in particular to a method for detecting surface defects of lithium battery electrodes based on machine vision. Background Technology

[0002] Image detection technology encompasses computer vision processing that utilizes optical imaging equipment to acquire images of target surfaces and identifies target states based on pixel grayscale, texture contours, edge morphology, and spatial location. Image detection is a key term in this field. Traditional lithium battery electrode surface defect detection methods involve arranging a linear array industrial camera, a bar light source, an encoder, an image acquisition card, and an industrial computer on the electrode conveyor line after coating or rolling. A motor pulls the electrode continuously along the rollers, the bar light source illuminates the coated surface at a fixed angle, the industrial camera captures images line by line according to encoder pulses, the industrial computer filters the grayscale images, extracts edges, and performs threshold segmentation. Operators then verify the images based on spots, cracks, exposed foil, or foreign matter areas displayed on the screen and record the defect locations in the production log.

[0003] Traditional electrode surface inspection relies heavily on fixed-angle light sources and uniform grayscale segmentation. However, vibrations during continuous electrode transport, coating cycle textures, roller indentations, and light attenuation can all alter local grayscale. Minor scratches and coating textures can easily form similar boundaries, and holes exposing foil can be easily confused with reflective spots. Powder particles and foreign matter adhering to low-contrast areas can cause outline breaks, and unevenly coated areas are easily segmented due to background textures. Manual verification relies on screenshots and batch records, and the correlation between defect location and transport distance is discontinuous. Anomaly warnings are delayed, and quality traceability requires segmented comparison of production records. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings of existing technologies and propose a machine vision-based method for detecting surface defects in lithium battery electrodes.

[0005] To achieve the above objectives, the present invention adopts the following technical solution: a method for detecting surface defects of lithium battery electrode sheets based on machine vision, comprising the following steps: The surface image sequence is directly acquired by an industrial camera during continuous electrode conveying and the camera exposure state is recorded. The row brightness reference matrix is ​​calculated based on the median gray level of adjacent rows, the gray level difference of edge white space and the camera exposure state. The brightness of the surface image sequence is corrected using the row brightness reference matrix, and a texture phase reference map is constructed according to the gray level period of the coating direction. The grayscale dispersion of the in-phase texture in the texture phase reference map is analyzed, the texture residual of each pixel position relative to the in-phase neighborhood is calculated, a dynamic defect threshold map is generated based on the distribution quantile of the texture residual, and connected regions exceeding the dynamic defect threshold map are selected to generate defect candidate regions. Based on the aspect ratio, boundary curvature, hole surrounding gray level, exposed foil reflection peak, powder particle density, foreign object edge shadow, and coating thickness gray level fluctuation of the defect candidate region, a defect morphology vector is constructed. The defect morphology vector is compared with the texture recognition model formed by the electrode sample annotation to generate a defect type sequence. The transport position coordinates are calculated based on the correspondence between encoder pulses and image row numbers. The defect level is determined based on the defect type sequence, defect area, and grayscale difference. The defect level sequence is generated by associating the transport position coordinates with the defect level.

[0006] As a further aspect of the present invention, the calculation process of the row brightness reference matrix specifically includes: Acquire surface image sequences and camera exposure status, extract the median gray level of adjacent rows in the order of image rows, and perform row alignment for image rows with transmission jitter to generate a row gray level statistical sequence; The edge area of ​​the electrode and the blank area of ​​the background are detected, the gray difference of the blank area at the edge is calculated, and abnormal exposure frames are removed and filled in according to the camera exposure status to obtain the exposure verification sequence. Analyze the brightness offset relationship between the line grayscale statistical sequence and the exposure verification sequence, map the edge white space grayscale difference to the correction weight in the line direction of the image, and establish a line brightness reference matrix.

[0007] As a further aspect of the present invention, the process of generating the defect candidate region specifically includes: Obtain the texture phase reference map, divide the neighborhood of the same phase texture according to the gray-scale period of the coating direction, and count the gray-scale dispersion of the same phase texture around each pixel position to obtain the same phase gray-scale dispersion map. Compare the gray value of each pixel position with the corresponding neighborhood gray center value in the in-phase gray-level discrete map, calculate the texture residual, and set the pixel-level threshold based on the distribution quantile value of the texture residual in the row and column directions to generate a dynamic defect threshold map. Filter the set of pixels whose texture residual exceeds the dynamic defect threshold map, merge adjacent pixels according to the 8-neighbor connectivity relationship, and remove regions whose area is lower than the minimum resolvable defect area under the camera spatial resolution to generate defect candidate regions.

[0008] As a further aspect of the present invention, the process of generating the defect type sequence specifically includes: Acquire grayscale data of candidate defect regions and corresponding surface images, measure aspect ratio and boundary curvature, analyze grayscale surrounding holes, peak reflection of exposed foil and grayscale fluctuations of coating thickness, and obtain contour reflection feature set; The distribution of powder particles and the shadow of foreign object edges in the defect candidate region are detected. The contour reflection feature set is corrected according to the number of particles, the spacing between particles and the width of the shadow to generate a defect morphology vector. The defect morphology vector is compared with the type feature center formed by the polar sample annotation in the texture recognition model. Low-confidence types are filtered out according to similarity, and a defect type sequence is generated based on the consistency of consecutive frames of the retained types.

[0009] As a further aspect of the present invention, the process of generating the defect level sequence specifically includes: Obtain encoder pulse, image row number and defect type sequence, verify the row spacing continuity of image row numbers according to the pulse interval corresponding to the electrode conveying speed, and perform position compensation for missing pulse intervals and repeated pulse intervals to obtain row number pulse mapping table; Based on the row number pulse mapping table, the row and column positions of the defect candidate region are converted into the transport position coordinates, the defect area and gray level difference are calculated, and the defect area and gray level difference are converted into area level items and gray level items respectively to generate a defect intensity record. The defect type sequence is compared with the defect intensity record according to the level determination rules. Duplicate defect records are merged according to the principle of prioritizing higher levels corresponding to the same delivery position coordinates, and the defect level sequence is generated by associating the delivery position coordinates.

[0010] As a further aspect of the present invention, the process of constructing the texture phase reference map specifically includes: Obtain the brightness-corrected surface image sequence, statistically analyze the gray-scale periodic variation curve along the coating direction, and remove local periodic segments affected by scratches and stains based on the stability of adjacent periodic peak and valley positions to obtain the coating period reference sequence. The phase drift of the coating period reference sequence in the electrode width direction is analyzed, each image row position is mapped to the phase interval within the corresponding gray period, and the row positions with phase jumps exceeding the tolerance of adjacent periods are smoothed and corrected to generate a phase index map. By associating the phase index map with the brightness-corrected surface image sequence, the grayscale statistical values ​​within the same phase range are written to the corresponding pixel positions, and background constraint correction is performed according to the edge blank area to construct a texture phase reference map.

[0011] As a further aspect of the present invention, the process of generating the dynamic defect threshold map specifically includes: Obtain texture residuals and in-phase grayscale discrete maps, statistically analyze the residual stability intervals of each pixel position in the continuous image, and mark the points with sudden residual increases but no spatial connectivity as noise points to obtain a stable residual record. Based on the quantile distribution of the residual stable record in the electrode width direction and the transport direction, the background texture fluctuation amplitude and the periodic coating fluctuation amplitude are calculated respectively, and the higher amplitude is used as the threshold base value of the pixel position to generate a threshold base map. By comparing the discrete enhancement relationship between the threshold base map and the in-phase grayscale discrete map, local threshold lifting is performed on the coating edge, dark texture area and high reflectivity area, and a dynamic defect threshold map is output.

[0012] As a further aspect of the present invention, the formation process of the texture recognition model specifically includes: Obtain electrode sample annotations, sample surface images, and defect morphology vectors. Group the sample regions according to defect type and remove sample regions whose annotation boundaries deviate from the actual gray-scale abrupt boundary by more than the camera spatial resolution to obtain the annotation verification sample set. Analyze the aspect ratio, boundary curvature, reflection peak, particle density and shadow width distribution of each defect type in the labeled verification sample set, associate the distribution center with the degree of distribution dispersion and store it to establish a type feature center library; By comparing the overlapping regions of features among different defect types in the feature center library, and setting conflict discrimination boundaries based on the grayscale fluctuation differences of the samples corresponding to the overlapping regions, a texture recognition model is generated.

[0013] As a further aspect of the present invention, the process for determining the consistency of consecutive frames specifically includes: Obtain the positional overlap area, morphological vector similarity, and type confidence records of the same defect candidate regions in consecutive image frames. Align the candidate regions in adjacent image frames according to the pixel displacement in the transport direction to obtain cross-frame corresponding records. Compare the type confidence records of adjacent image frames in the cross-frame corresponding records, mark the candidate regions whose confidence changes are lower than the preset fluctuation tolerance and whose morphological vector similarity reaches the same type judgment limit as stable type regions, and generate stable type records; Analyze the difference in the number of consecutive frames between the stable type records and the isolated high-confidence records, delete the isolated high-confidence records whose number of consecutive frames is lower than the shortest defect visibility time corresponding to the camera sampling frequency, and output the consistency result of consecutive frames.

[0014] As a further aspect of the present invention, the defect level determination process specifically includes: Obtain the defect type sequence, defect area, grayscale difference, and transport position coordinates; set area judgment limits and grayscale judgment limits according to the grade judgment rules; and compare the defect area with the area judgment limits to obtain the area judgment record. By comparing the deviation between the grayscale difference and the grayscale judgment limit, and combining the area judgment record, the priority of the levels corresponding to foil exposure, powder fallout, foreign matter and coating thickness abnormality is sorted to generate level candidate records. The candidate records of the grade are associated with the coordinates of the transport position. Records with the same grade and type in adjacent transport position coordinates are merged, and the maximum defect area and the maximum gray level difference of the merged area are retained to generate a defect grade sequence.

[0015] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In this invention, by binding the row images of an industrial camera with the encoder pulses synchronously, and establishing row brightness and texture phase references according to the electrode coating direction, the interference of conveyor jitter, light attenuation, and periodic texture on defect grayscale is eliminated in layers. The defect judgment boundary that varies with the row number is generated by the residual distribution of the same phase neighborhood, so that micro-scratches, cracks, exposed foil, and powder fallout maintain continuous contours in low contrast areas. Holes, reflective spots, foreign matter attachment, and uneven coating are distinguished by defect morphology vectors. By associating the defect level with the conveyor position coordinates, abnormal warnings and quality traceability are directly corresponding to the production stage, supporting the review of the corresponding image area by coordinates during defect verification. Attached Figure Description

[0016] Figure 1 This is a flowchart of the electrode surface defect detection process of the present invention; Figure 2 This is a schematic diagram illustrating the application scenario of continuous electrode conveying and detection according to the present invention; Figure 3 This is a schematic diagram comparing the brightness correction and texture phase reference of the present invention; Figure 4 This is a schematic diagram of the dynamic defect threshold map and defect candidate region of the present invention; Figure 5 This is a schematic diagram illustrating the association between the defect type sequence and the defect level sequence of the present invention. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of this invention clearer, the software-based technical solution is described in detail below with reference to system architecture diagrams and embodiments. It should be understood that the specific embodiments described herein are only for explaining the technical solutions of this invention and do not constitute a limitation on the scope of protection.

[0018] In the description of this invention, the system architecture relationships or data processing flows indicated by terms such as "layer," "module," "interface," "data flow," "client," and "server" are all defined based on the architecture diagram or flowchart corresponding to the embodiments. This way of describing is only used to clearly illustrate the logical relationships between the elements in the technical solution, and not to limit the physical deployment form. The term "multiple" includes two or more technical units, including but not limited to multiple data nodes, processing threads, service instances, or functional components and other scalable elements. The specific number is determined according to the actual business scenario and needs to be specifically specified.

[0019] Please see Figures 1 to 5 This embodiment provides a machine vision-based method for detecting surface defects in lithium battery electrodes. In practical applications, such as on a continuous conveying and inspection line after lithium battery electrode coating, the electrode is driven by a conveyor roller through the field of view of an industrial camera. The industrial camera captures a grayscale image of the coated surface of the electrode, and the encoder synchronously generates pulses to record the image. The image processing continuously receives the surface image, camera exposure status, and encoder pulses, and writes the defect identification result into the production line traceability record. The method includes the following steps: S1: A surface image sequence is directly acquired using an industrial camera during continuous electrode transport, and the camera exposure status is recorded. A row brightness reference matrix is ​​calculated based on the median grayscale value of adjacent rows, the edge white space grayscale difference, and the camera exposure status. This matrix is ​​then used to correct the brightness of the surface image sequence, and a texture phase reference map is constructed according to the grayscale period of the coating direction. The surface image sequence consists of grayscale image data objects of the electrode surface arranged in the order of acquisition, containing image row number, column position, pixel grayscale value, and exposure status identifier. The camera exposure status is the exposure control record formed by the industrial camera when acquiring the frame or row of images, including exposure execution status, exposure stability identifier, and abnormal exposure identifier. The row brightness reference matrix is ​​a brightness correction reference data object arranged by row and column position, carrying a brightness reference field formed by row grayscale statistics, edge white space grayscale difference, and exposure verification status, and serves as input for the brightness correction stage. The texture phase reference map is a reference image data object formed by aligning the brightness-corrected image sequence within the grayscale period of the coating direction, outputting pixel-level reference grayscale values ​​to subsequent texture residual calculation steps.

[0020] S101: Acquire surface image sequences and camera exposure status, extract the median grayscale value of adjacent rows in image row order, and perform row alignment for image rows with transport jitter to generate a row grayscale statistical sequence. The median grayscale value of adjacent rows is the grayscale center field after suppressing abnormal bright and dark spots within the same image row. This field is extracted from pixel grayscale values ​​row by row and written to the row grayscale statistical buffer. Transport jitter is jointly verified by the drift of edge positions of adjacent image rows and the drift of peak and valley positions of coated texture. The row alignment process uses the continuity of edge positions and coated texture phases as a benchmark, adjusts the row index of image rows that have shifted when participating in the statistics, and the adjusted row grayscale statistical sequence continues to retain the original row number and the aligned row number for use in exposure verification and brightness shift analysis. In the initial operation phase, when a stable historical row statistical record has not yet been formed, the image row that has completed exposure verification is used to establish the initial benchmark; when continuous row data is insufficient, the alignment status of the previous valid row is used and written into the row position compensation record.

[0021] S102: Detect the electrode edge region and the background blank region, calculate the grayscale difference between the edge and blank regions, and remove and fill in abnormal exposure frames according to the camera exposure status to obtain the exposure verification sequence. The electrode edge region is the band-shaped position where the grayscale changes are concentrated between the electrode coated area and the background blank region in the image. The background blank region is the image area occupied by the uncoated surface outside the electrode edge. The edge detection process first finds stable grayscale change boundaries in the width direction, then writes the continuous background pixels outside the boundary into the blank grayscale field, and writes the coated edge pixels inside the boundary into the edge grayscale field. The edge blank grayscale difference is the difference between the edge grayscale field and the blank grayscale field in the same image row. The exposure verification process reads the exposure execution status and exposure stability flag. Abnormal exposure frames are not included in the brightness reference statistics. The row position corresponding to the abnormal exposure frame is filled in by the row grayscale statistics of adjacent valid frames and the edge blank grayscale difference. The filling record carries the filling source flag. When the exposure status is missing or the format is inconsistent, the image row enters the pending verification state. After filling is completed, it enters the brightness correction link.

[0022] S103: Analyze the brightness offset relationship between the row grayscale statistical sequence and the exposure verification sequence, map the edge white space grayscale difference to the correction weights in the row direction of the image, and establish a row brightness reference matrix. The correction weights are dimensionless configuration fields, whose sources include camera calibration records, production line lighting calibration records, and stable row statistical records of the current batch. The field boundaries are defined by the equipment calibration rule table, and the field is updated with the exposure status and stored in the brightness correction rule table. The mapping process first reads the valid exposure rows in the exposure verification sequence, then reads the continuous change status of the edge white space grayscale difference in the row direction, writes the brightness compensation corresponding to the lighting change to the corresponding row position, and writes the local constraint corresponding to the coating edge change to the corresponding column position, finally forming the row brightness reference matrix. After the row brightness reference matrix is ​​generated, it is matched with the surface image sequence by row number. Image rows that match successfully enter the brightness correction, and image rows that fail to match retain their original grayscale and write a reference missing mark. In the subsequent candidate region screening stage, the region corresponding to the mark is manually reviewed and output as a path.

[0023] S104: Obtain the brightness-corrected surface image sequence, statistically analyze the gray-level periodic variation curve along the coating direction, and remove local periodic segments affected by scratches and blemishes based on the stability of adjacent periodic peak and valley positions to obtain the coating period reference sequence. The brightness-corrected surface image sequence is formed by correcting the original gray-level values ​​and row brightness reference matrix according to their row and column positions. After correction, the original image row number, correction status, and exposure verification source are retained. The gray-level periodic variation curve is a record of coating texture undulations extracted along the electrode transport direction, and the record includes peak position identifiers, valley position identifiers, periodic continuity identifiers, and local contamination identifiers. Local periodic segments affected by scratches and blemishes are jointly determined by spatial connectivity anomalies, gray-level abrupt boundary changes, and cross-row discontinuities. After entering the removal queue, they do not participate in phase reference statistics, and the original image data is stored in the traceback cache. The coating period reference sequence is a record of gray-level periodic states after the removal of local anomaly segments.

[0024] S105: Analyze the phase drift of the coating cycle reference sequence in the electrode width direction, map each image row position to the phase interval within the corresponding grayscale period, and smooth the row positions where the phase jump exceeds the tolerance of adjacent periods, generating a phase index map. The phase interval is a text-type index field divided within the grayscale period according to the peak and valley positions and texture continuity state, used to identify that the pixel position is in the same stage of the same texture period. The adjacent period tolerance is a configurable boundary field read from the equipment coating process calibration record, historical stable period record, and current valid period record, stored in the phase correction rule table. The smoothing correction process updates the phase index for row positions where the phase jump does not conform to the continuity state of adjacent periods. The correction record carries the original phase index, the corrected index, and the rule source. The generated phase index map is passed to the texture phase reference map construction process.

[0025] S106: Associate the phase index map with the brightness-corrected surface image sequence, write the grayscale statistics within the same phase interval to the corresponding pixel position, and perform background constraint correction according to the edge blank area to construct a texture phase reference map. The grayscale statistics within the same phase interval are generated from the pixel set that has passed exposure verification and local anomaly removal. The data content includes phase index, row and column position, grayscale center state, and grayscale discrete state. Background constraint correction uses the brightness stability state of the edge blank area as a boundary reference. When the coated area is close to the edge, the background texture field in the reference map is constrained by the change in blank brightness to prevent edge illumination changes from being written into the coated texture reference. After the texture phase reference map is written to the reference map cache, it corresponds to the row and column position of the surface image sequence. Subsequent texture residual calculations read the reference grayscale field at the same pixel position.

[0026] S2: Analyze the grayscale dispersion of in-phase textures in the texture phase reference map, calculate the texture residual of each pixel position relative to its in-phase neighborhood, generate a dynamic defect threshold map based on the distribution quantile of the texture residuals, and filter connected regions exceeding the dynamic defect threshold map to generate defect candidate regions. The in-phase texture neighborhood is a set of pixels with the same phase index and within the same coating texture continuation range. The texture residual represents the deviation between the current pixel's grayscale and the grayscale center of its in-phase neighborhood, carrying row and column positions, phase index, residual direction, and residual stability indicators. The dynamic defect threshold map is a defect filtering boundary data object stored by pixel position; its threshold field originates from texture residual stability records, the in-phase grayscale dispersion map, background texture fluctuations, and periodic coating fluctuations. The defect candidate region is a set of pixels whose texture residuals exceed the dynamic defect threshold map and are spatially continuous.

[0027] S201: Obtain the texture phase reference map, divide the in-phase texture neighborhood according to the gray-level period of the coating direction, and statistically analyze the gray-level dispersion of the in-phase texture around each pixel location to obtain the in-phase gray-level dispersion map. The in-phase texture neighborhood is read from both the phase index map and the texture phase reference map. Pixel locations with low confidence indicators for exposure padding, scratch contamination, and missing reference indicators are excluded during division. The gray-level dispersion records the dispersion of gray levels around the center state within the same phase neighborhood. The field is derived from the brightness-corrected surface image sequence and the texture phase reference map and is stored in the dispersion map cache. Valid pixel boundaries are jointly determined by acquisition integrity, exposure state validity, row and position alignment status, and phase index continuity. Pixel locations that fail the validity determination are written with an invalid statistical label. This map is output to the texture residual calculation and dynamic threshold base generation process.

[0028] S202: Compare the grayscale value of each pixel location with the corresponding neighborhood grayscale center value in the in-phase grayscale discrete map, calculate the texture residual, and set a pixel-level threshold based on the distribution quantile values ​​of the texture residual in the row and column directions to generate a dynamic defect threshold map. The comparison process reads the current pixel grayscale field, the in-phase neighborhood grayscale center field, and the discrete state field. First, it confirms that the pixel location is within the valid statistical range, then writes the residual direction identifier and residual strength category. The distribution quantile value is a sorting boundary field generated from the current batch of stable residual records and historical stable texture records. This field is stored in the threshold rule cache and updated with the coating state and illumination verification state. The pixel-level threshold is the defect screening boundary field for the corresponding pixel location, and its sources include the residual stable interval, in-phase grayscale discrete state, edge position state, and reflection state. The dynamic defect threshold map and the residual map are associated by row and column position for use in the candidate region screening process.

[0029] S203: Obtain texture residuals and in-phase grayscale discrete images, statistically analyze the residual stability intervals of each pixel position in continuous images, and mark points with residual spikes but no spatial connectivity as noise points, thus obtaining a residual stability record. The residual stability interval is a record where the residual category of the same row and column position in continuous images remains within a stable background range, derived from the current image cache and the previous valid image cache. When continuous images are insufficient, a temporary stable record is established using the current continuous row that has passed exposure verification. The temporary record carries a startup phase identifier and is replaced by a complete continuous record after stable operation conditions are met. Noise points are determined by both residual spike states and spatial connectivity states. Spatial connectivity states are based on the shared boundary or corner points of adjacent pixels; residual spike points that do not form adjacent extensions are written into the noise record. Noise records are not included in the defect candidate region merging but are retained in the detection log for use in exposure and lens contamination investigation.

[0030] S204: Based on the quantile distribution of residual stable records in the electrode width and transport directions, calculate the background texture fluctuation amplitude and the periodic coating fluctuation amplitude respectively, and use the higher amplitude as the threshold base value for the pixel position to generate a threshold base map. The background texture fluctuation amplitude comes from the residual change state of normal texture in the in-phase stable neighborhood, and the periodic coating fluctuation amplitude comes from the repeated fluctuation state of the coating cycle reference sequence in the transport direction. Both types of amplitudes are written into the threshold base cache as dimensionless state fields, and the field boundaries are derived from historical stable coating records, production line process rule tables, and valid image records of the current batch. The selection order of the threshold base value is to first confirm the validity of the pixel position, then compare the background texture fluctuation state and the periodic coating fluctuation state, and use the state with stricter constraints on background changes as the screening basis for the pixel position. The generated threshold base map is output to the local threshold lifting process.

[0031] S205: Compare the discrete enhancement relationship between the threshold base map and the in-phase grayscale discrete map, perform local threshold lifting on coated edges, dark texture areas, and high-reflectivity areas, and output a dynamic defect threshold map. The discrete enhancement relationship is a record of the consistency of changes between the threshold base state and the in-phase grayscale discrete state at the same pixel location, used to identify the locations where background texture undulations are amplified by illumination, edges, or reflections. Coated edges are determined by edge region detection records, dark texture areas are determined by the low grayscale stable range in the texture phase reference map, and high-reflectivity areas are jointly determined by the exposed foil reflection peak pre-detection record and the grayscale brightening state after brightness correction. The local threshold lifting rules come from the edge process rule table, dark texture background rule table, and reflective area rule table. The lifted threshold field is written into the dynamic defect threshold map, and the rule source identifier is retained. The dynamic defect threshold map is output to the connected component filtering process.

[0032] S206: Filter the set of pixels whose texture residuals exceed the dynamic defect threshold map, merge adjacent pixels according to neighborhood connectivity, and remove regions with areas smaller than the minimum resolvable defect area under the camera spatial resolution to generate defect candidate regions. The filtering process reads the texture residual field and dynamic threshold field pixel by pixel. Pixels whose residual states enter the defect category boundary are written to the candidate pixel cache. The connectivity merging process merges candidate pixels sharing boundaries or corners into the same candidate region and records the region's outer contour, internal holes, grayscale peaks and valleys, and phase index coverage. The minimum resolvable defect area is a configurable field jointly defined by the camera spatial resolution, lens calibration records, and inspection process rule table. This field is stored in the inspection specification table. Connected regions below the boundary of this field are written to low-resolution records and are not included in the defect morphology vector construction. The defect candidate region, carrying row and column positions, region contours, grayscale differences, texture residual sources, and threshold rule sources, is passed to the defect type identification step.

[0033] S3: Based on the aspect ratio, boundary curvature, hole-surrounding grayscale, exposed foil reflection peak, powder particle density, foreign object edge shadow, and coating thickness grayscale fluctuation of the defect candidate region, a defect morphology vector is constructed. This vector is then compared with a texture recognition model formed by electrode sample annotations to generate a defect type sequence. The defect morphology vector is a data object describing the morphology, reflection, particle size, and coating fluctuation state of a single defect candidate region. The texture recognition model is a regularized recognition data object formed by electrode sample annotations, sample surface images, and verified defect morphology vectors, including a type feature center library, discrete distribution records, conflict discrimination boundaries, and type confidence rules. The defect type sequence consists of type records arranged according to the image acquisition order and transport location order, used for grade determination.

[0034] S301: Acquire electrode sample annotations, sample surface images, and defect morphology vectors. Group sample regions according to defect type and remove sample regions whose annotation boundaries deviate from the actual gray-scale abrupt boundary by more than the camera's spatial resolution, resulting in an annotation verification sample set. Electrode sample annotations are defect type records generated through manual review or production line re-inspection, including sample region location, defect type, boundary contour, and review status. Sample surface images and online acquired images use the same brightness correction, phase reference, and texture residual processing paths to ensure that the field meanings of the sample defect morphology vectors are consistent with the online candidate regions. Boundary deviation verification is based on the correspondence between sample annotation boundaries and sample gray-scale abrupt boundary boundaries. When the deviation exceeds the boundary resolution distinguishable by the camera's spatial resolution, the sample region is written into the boundary inconsistency record and not included in the type feature center library. The annotation verification sample set is stored in the model sample library.

[0035] S302: Analyze the aspect ratio, boundary curvature, reflection peak, particle density, and shadow width distribution corresponding to each defect type in the labeled verification sample set. Link the distribution centers with the distribution dispersion to establish a type feature center library. Compare the overlapping regions of features between different defect types in the type feature center library. Set conflict discrimination boundaries based on the grayscale fluctuation differences of the samples corresponding to the overlapping regions to generate a texture recognition model. The type feature center library consists of feature reference data objects grouped and stored according to defect type. The distribution centers represent the stable morphological state of samples of the same type, and the distribution dispersion represents the permissible variation state of this type in different polarimetric images. The conflict discrimination boundary is a rule field for priority judgment when features of different defect types overlap. The field originates from the grayscale fluctuation differences, reflection state differences, and particle shadow state differences of overlapping samples in the labeled verification sample set. After the texture recognition model is generated, it is written to the model version library. During online recognition, only the type feature centers, conflict discrimination boundaries, and type confidence rules that have passed verification are read. When the model version is updated, applicable batch records are retained for the defect type sequence to trace the model's origin.

[0036] S303: Acquire grayscale data of the candidate defect region and its corresponding surface image, measure the aspect ratio and boundary curvature, analyze the grayscale surrounding the hole, the peak reflection of exposed foil, and the grayscale fluctuation of coating thickness to obtain the contour reflection feature set. The aspect ratio is generated by the extension state of the outer contour of the candidate defect region in the transport direction and width direction, and the boundary curvature is generated by the turning state of the candidate region contour line. The grayscale surrounding the hole is the surrounding state of the coating grayscale around the low grayscale hole inside the candidate region, the peak reflection of exposed foil is the reflection category of the local high reflectivity area in the candidate region relative to the background texture, and the grayscale fluctuation of coating thickness is the grayscale fluctuation category between the candidate region and its neighboring in-phase background. The contour reflection feature set is written into the candidate region feature cache and used in the particle shadow correction process.

[0037] S304: Detects the distribution of powder particles and the shadow of foreign object edges in the candidate defect region. Based on the number of particles, particle spacing, and shadow width, the contour reflection feature set is corrected to generate a defect morphology vector. The powder particle distribution represents the spatial aggregation of small, abrupt grayscale abrupt changes within the candidate region. During detection, the connected sub-regions within the candidate region, particle grayscale boundaries, and particle spacing are read. The foreign object edge shadow represents the grayscale gradient band formed at the edge of the candidate region due to foreign object occlusion or surface protrusions. During detection, continuous records of grayscale decreases and recoveries on both sides of the edge are read. The number of particles, particle spacing, and shadow width are all entered as state fields into the correction rule table. These fields originate from the connected sub-region records and edge shadow records of the candidate region, and the field boundaries are derived from the annotation verification sample set and the detection process rule table. The corrected defect morphology vector writes the contour reflection features, particle distribution features, foreign object shadow features, and thickness fluctuation features into the vector cache in a unified field order. Subsequent type comparison processes read these fields in that order.

[0038] S305: Compare the defect morphology vector with the type feature centers formed by the polar sample annotations in the texture recognition model. Sort by similarity to eliminate low-confidence types, and generate a defect type sequence based on the continuous frame consistency of the retained types. Similarity refers to the proximity of the defect morphology vector and type feature centers within the same field caliber. Before comparison, hierarchical processing is performed on fields from different sources. The sorting process first matches the defect morphology vector with each type feature center, then reads the conflict discrimination boundary. When features overlap, grayscale fluctuation difference and reflection particle difference are used preferentially for type filtering. Low-confidence types are those that do not reach the type confidence rule boundary and cannot be retained through the conflict discrimination boundary; these records are eliminated and written to the recognition log. The retained types, carrying candidate region identifiers and confidence states, enter the continuous frame consistency determination. After completion, they are written into the defect type sequence according to the acquisition order.

[0039] S306: Obtain the positional overlap area, morphological vector similarity, and type confidence records of the same defect candidate regions in consecutive image frames. Align the candidate regions in adjacent image frames according to the pixel displacement in the transport direction to obtain cross-frame corresponding records. Compare the type confidence records of adjacent image frames in the cross-frame corresponding records. Mark the candidate regions whose confidence changes are lower than the preset fluctuation tolerance and whose morphological vector similarity reaches the same type judgment limit as stable type regions and generate stable type records. Analyze the difference in the number of consecutive frames between stable type records and isolated high-confidence records. Delete isolated high-confidence records whose number of consecutive frames is lower than the shortest defect visibility time corresponding to the camera sampling frequency, and output the consistency results of consecutive frames. Positional overlap area, morphological vector similarity, and type confidence records are all cross-frame judgment fields, which are derived from the defect candidate region cache, defect morphological vector cache, and type comparison records. The preset fluctuation tolerance, same type judgment limit, and shortest defect visibility time are all provided by the camera sampling configuration, transport speed configuration, model version rule table, and detection process rule table. They are stored as configurable boundary fields and updated with process batches. When there are insufficient consecutive frames or missing image frames, the candidate region enters the pending confirmation state. After subsequent valid frames are used to fill the gap, cross-frame correspondence is performed again. Isolated records that cannot be filled are kept in the review queue.

[0040] S4: Calculate the conveyor position coordinates based on the correspondence between encoder pulses and image row numbers. Defect levels are determined according to the defect type sequence, defect area, and grayscale difference. A defect level sequence is generated by associating the conveyor position coordinates with the defect level. Encoder pulses are displacement records generated by the rotation of the conveyor rollers. Image row numbers are the sequential identifiers written by row during camera acquisition. Conveyor position coordinates are the electrode length and width positions converted from the row number pulse mapping table. The defect level sequence is a result data object for production line traceability and sorting control, carrying defect type, level, area status, grayscale difference status, conveyor position coordinates, and review status. The level judgment rules are derived from the inspection process rule table, which establishes a priority relationship based on defect type, area level, and grayscale level.

[0041] S401: Obtain encoder pulses, image row numbers, and defect type sequences. Verify the row spacing continuity of image row numbers according to the pulse interval corresponding to the electrode conveying speed. Perform position compensation on missing pulse intervals and repeated pulse intervals to obtain a row number pulse mapping table. The row number pulse mapping table is a mapping data object connecting image row numbers and electrode conveying positions, containing image row numbers, pulse states, compensation states, and validity identifiers. The pulse interval field is derived from encoder configuration, conveying speed control records, and production line calibration records, and is stored as a lookupable configuration field in the conveying position rule table. Missing pulse intervals are determined by the state of continuous image row numbers but interrupted pulse records, and repeated pulse intervals are determined by the state of repeated pulse states within the same row number range. The position compensation process prioritizes reading the continuous conveying states of the preceding and following valid pulse intervals, and then combines this with the image row spacing continuity to generate a compensation identifier. Positions that still cannot be confirmed after compensation are written as "position pending verification," which is passed to the defect level sequence and prevents the automatic sorting instruction output.

[0042] S402: Based on the row number pulse mapping table, the row and column positions of the defect candidate region are converted into transport position coordinates. The defect area and grayscale difference are calculated, and the defect area and grayscale difference are converted into area level items and grayscale level items respectively, generating a defect intensity record. The defect area is the region occupancy state formed by the candidate region under the camera spatial resolution calibration relationship, derived from the connected pixel set of the candidate region and the lens calibration record. The grayscale difference is the difference state between the grayscale of the candidate region and the corresponding in-phase background grayscale, derived from the texture residual map, texture phase reference map, and brightness-corrected surface image. Both the area level item and the grayscale level item are status fields in the level judgment rule table. The field boundaries are jointly provided by the detection process rules, sample verification records, and camera resolution. The defect intensity record stores the transport position coordinates, defect type, area level item, grayscale level item, and source validity identifier in association, and outputs them to the level priority judgment process.

[0043] S403: Obtain the defect type sequence, defect area, grayscale difference, and transport position coordinates. Set area and grayscale judgment limits according to the grade judgment rules, and compare the defect area with the area judgment limits to obtain area judgment records. Compare the deviation between grayscale difference and grayscale judgment limits, and sort the grade priorities corresponding to foil exposure, powder shedding, foreign matter, and coating thickness anomalies based on the area judgment records to generate grade candidate records. Both area and grayscale judgment limits are configurable boundary fields in the detection process rule table, derived from equipment calibration records, sample verification records, and production line quality judgment rules. These fields are updated with the electrode material and coating process batches. The execution order of grade priorities is: first read the defect type, then read the area grade item and grayscale grade item. For foil exposure records, priority is given to verifying reflection peak and grayscale difference; for powder shedding records, priority is given to verifying particle density and regional grayscale decrease; for foreign matter records, priority is given to verifying edge shadows and contour abrupt changes; and for coating thickness anomaly records, priority is given to verifying the grayscale fluctuation continuation state. Grade candidate records carry the rule source and judgment field source for use in the duplicate defect merging process.

[0044] S404: Compare the defect type sequence with the defect intensity record according to the level determination rules. Merge duplicate defect records according to the higher-level priority principle corresponding to the same conveyor position coordinates, and generate a defect level sequence by associating the conveyor position coordinates. Associate the candidate level records with the conveyor position coordinates, merge records with the same level and type within adjacent conveyor position coordinates, and retain the maximum defect area and maximum grayscale difference of the merged area to generate a defect level sequence. Duplicate defect records originate from the state where the same defect is identified multiple times in consecutive frames or adjacent candidate areas are identified separately. Before merging, confirm the conveyor position coordinates, defect type, consistency results of consecutive frames, and the validity of row number pulse mapping. The higher-level priority principle is the conflict handling field in the level rule table. When there are different level records at the same conveyor position coordinates, retain the level state with stricter requirements for subsequent production line processing, and write the merged record to the traceability log. After merging records with the same level and type within adjacent conveyor position coordinates, the defect level sequence retains the maximum defect area state and maximum grayscale difference state in the merged area, and outputs it to the production line quality record, review queue, and sorting control interface. When log writing fails, the defect level sequence enters the pending verification state, the review queue receives the image row number, candidate area identifier and rule source, and the production line control interface receives the conservative level status.

[0045] The above embodiments illustrate preferred embodiments of the present invention. Any equivalent adjustments to the technical solution based on software engineering methods are within the scope of protection, including but not limited to: implementing algorithm logic using different programming languages, refactoring functional modules into services, adjusting data interaction protocols, and optimizing resource scheduling strategies. Any implementation scheme derived from reasonable modifications to the data processing flow, service call chain, or system architecture layer without departing from the core technology of the present invention should be considered within the scope of protection defined by the claims of the present invention.

Claims

1. A method for detecting surface defects of lithium battery electrodes based on machine vision, characterized in that, Includes the following steps: The surface image sequence is directly acquired by an industrial camera during continuous electrode conveying and the camera exposure state is recorded. The row brightness reference matrix is ​​calculated based on the median gray level of adjacent rows, the gray level difference of edge white space and the camera exposure state. The brightness of the surface image sequence is corrected using the row brightness reference matrix, and a texture phase reference map is constructed according to the gray level period of the coating direction. The grayscale dispersion of the in-phase texture in the texture phase reference map is analyzed, the texture residual of each pixel position relative to the in-phase neighborhood is calculated, a dynamic defect threshold map is generated based on the distribution quantile of the texture residual, and connected regions exceeding the dynamic defect threshold map are selected to generate defect candidate regions. Based on the aspect ratio, boundary curvature, hole surrounding gray level, exposed foil reflection peak, powder particle density, foreign object edge shadow, and coating thickness gray level fluctuation of the defect candidate region, a defect morphology vector is constructed. The defect morphology vector is compared with the texture recognition model formed by the electrode sample annotation to generate a defect type sequence. The transport position coordinates are calculated based on the correspondence between encoder pulses and image row numbers. The defect level is determined based on the defect type sequence, defect area, and grayscale difference. The defect level sequence is generated by associating the transport position coordinates with the defect level.

2. The method for detecting surface defects of lithium battery electrodes based on machine vision according to claim 1, characterized in that, The calculation process of the row brightness reference matrix specifically includes: Acquire surface image sequences and camera exposure status, extract the median gray level of adjacent rows in the order of image rows, and perform row alignment for image rows with transmission jitter to generate a row gray level statistical sequence; The edge area of ​​the electrode and the blank area of ​​the background are detected, the gray difference of the blank area at the edge is calculated, and abnormal exposure frames are removed and filled in according to the camera exposure status to obtain the exposure verification sequence. Analyze the brightness offset relationship between the line grayscale statistical sequence and the exposure verification sequence, map the edge white space grayscale difference to the correction weight in the line direction of the image, and establish a line brightness reference matrix.

3. The method for detecting surface defects of lithium battery electrodes based on machine vision according to claim 1, characterized in that, The process of generating the defect candidate region specifically includes: Obtain the texture phase reference map, divide the neighborhood of the same phase texture according to the gray-scale period of the coating direction, and count the gray-scale dispersion of the same phase texture around each pixel position to obtain the same phase gray-scale dispersion map. Compare the gray value of each pixel position with the corresponding neighborhood gray center value in the in-phase gray-level discrete map, calculate the texture residual, and set the pixel-level threshold based on the distribution quantile value of the texture residual in the row and column directions to generate a dynamic defect threshold map. Filter the set of pixels whose texture residual exceeds the dynamic defect threshold map, merge adjacent pixels according to the 8-neighbor connectivity relationship, and remove regions whose area is lower than the minimum resolvable defect area under the camera spatial resolution to generate defect candidate regions.

4. The method for detecting surface defects of lithium battery electrodes based on machine vision according to claim 1, characterized in that, The process of generating the defect type sequence specifically includes: Acquire grayscale data of candidate defect regions and corresponding surface images, measure aspect ratio and boundary curvature, analyze grayscale surrounding holes, peak reflection of exposed foil and grayscale fluctuations of coating thickness, and obtain contour reflection feature set; The distribution of powder particles and the shadow of foreign object edges in the defect candidate region are detected. The contour reflection feature set is corrected according to the number of particles, the spacing between particles and the width of the shadow to generate a defect morphology vector. The defect morphology vector is compared with the type feature center formed by the polar sample annotation in the texture recognition model. Low-confidence types are filtered out according to similarity, and a defect type sequence is generated based on the consistency of consecutive frames of the retained types.

5. The method for detecting surface defects of lithium battery electrodes based on machine vision according to claim 1, characterized in that, The process of generating the defect level sequence specifically includes: Obtain encoder pulse, image row number and defect type sequence, verify the row spacing continuity of image row numbers according to the pulse interval corresponding to the electrode conveying speed, and perform position compensation for missing pulse intervals and repeated pulse intervals to obtain row number pulse mapping table; Based on the row number pulse mapping table, the row and column positions of the defect candidate region are converted into the transport position coordinates, the defect area and gray level difference are calculated, and the defect area and gray level difference are converted into area level items and gray level items respectively to generate a defect intensity record. The defect type sequence is compared with the defect intensity record according to the level determination rules. Duplicate defect records are merged according to the principle of prioritizing higher levels corresponding to the same delivery position coordinates, and the defect level sequence is generated by associating the delivery position coordinates.

6. The method for detecting surface defects of lithium battery electrodes based on machine vision according to claim 2, characterized in that, The process of constructing the texture phase reference map specifically includes: Obtain the brightness-corrected surface image sequence, statistically analyze the gray-scale periodic variation curve along the coating direction, and remove local periodic segments affected by scratches and stains based on the stability of adjacent periodic peak and valley positions to obtain the coating period reference sequence. The phase drift of the coating period reference sequence in the electrode width direction is analyzed, each image row position is mapped to the phase interval within the corresponding gray period, and the row positions with phase jumps exceeding the tolerance of adjacent periods are smoothed and corrected to generate a phase index map. By associating the phase index map with the brightness-corrected surface image sequence, the grayscale statistical values ​​within the same phase range are written to the corresponding pixel positions, and background constraint correction is performed according to the edge blank area to construct a texture phase reference map.

7. The method for detecting surface defects of lithium battery electrodes based on machine vision according to claim 3, characterized in that, The process of generating the dynamic defect threshold map specifically includes: Obtain texture residuals and in-phase grayscale discrete maps, statistically analyze the residual stability intervals of each pixel position in the continuous image, and mark the points with sudden residual increases but no spatial connectivity as noise points to obtain a stable residual record. Based on the quantile distribution of the residual stable record in the electrode width direction and the transport direction, the background texture fluctuation amplitude and the periodic coating fluctuation amplitude are calculated respectively, and the higher amplitude is used as the threshold base value of the pixel position to generate a threshold base map. By comparing the discrete enhancement relationship between the threshold base map and the in-phase grayscale discrete map, local threshold lifting is performed on the coating edge, dark texture area and high reflectivity area, and a dynamic defect threshold map is output.

8. The method for detecting surface defects of lithium battery electrodes based on machine vision according to claim 4, characterized in that, The formation process of the texture recognition model specifically includes: Obtain electrode sample annotations, sample surface images, and defect morphology vectors. Group the sample regions according to defect type and remove sample regions whose annotation boundaries deviate from the actual gray-scale abrupt boundary by more than the camera spatial resolution to obtain the annotation verification sample set. Analyze the aspect ratio, boundary curvature, reflection peak, particle density and shadow width distribution of each defect type in the labeled verification sample set, associate the distribution center with the degree of distribution dispersion and store it to establish a type feature center library; By comparing the overlapping regions of features among different defect types in the feature center library, and setting conflict discrimination boundaries based on the grayscale fluctuation differences of the samples corresponding to the overlapping regions, a texture recognition model is generated.

9. The method for detecting surface defects of lithium battery electrode sheets based on machine vision according to claim 4, characterized in that, The process for determining the consistency of consecutive frames specifically includes: Obtain the positional overlap area, morphological vector similarity, and type confidence records of the same defect candidate regions in consecutive image frames. Align the candidate regions in adjacent image frames according to the pixel displacement in the transport direction to obtain cross-frame corresponding records. Compare the type confidence records of adjacent image frames in the cross-frame corresponding records, mark the candidate regions whose confidence changes are lower than the preset fluctuation tolerance and whose morphological vector similarity reaches the same type judgment limit as stable type regions, and generate stable type records; Analyze the difference in the number of consecutive frames between the stable type records and the isolated high-confidence records, delete the isolated high-confidence records whose number of consecutive frames is lower than the shortest defect visibility time corresponding to the camera sampling frequency, and output the consistency result of consecutive frames.

10. A method for detecting surface defects of lithium battery electrodes based on machine vision according to claim 5, characterized in that, The process for determining the defect level specifically includes: Obtain the defect type sequence, defect area, grayscale difference, and transport position coordinates; set area judgment limits and grayscale judgment limits according to the grade judgment rules; and compare the defect area with the area judgment limits to obtain the area judgment record. By comparing the deviation between the grayscale difference and the grayscale judgment limit, and combining the area judgment record, the priority of the levels corresponding to foil exposure, powder fallout, foreign matter and coating thickness abnormality is sorted to generate level candidate records. The candidate records of the grade are associated with the coordinates of the transport position. Records with the same grade and type in adjacent transport position coordinates are merged, and the maximum defect area and the maximum gray level difference of the merged area are retained to generate a defect grade sequence.