Mylar tape surface defect detection system based on visual recognition

By combining image preprocessing, film background reconstruction, and residual decoupling modules, the instability problem of Mylar tape surface defect detection system under complex backgrounds was solved, and stable identification and accurate judgment of low-contrast defects were achieved.

CN122492718APending Publication Date: 2026-07-31CHONGQING FENGLEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHONGQING FENGLEI TECH CO LTD
Filing Date
2026-07-06
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing Mylar tape surface defect detection systems struggle to maintain both defect detection and false positive suppression capabilities against complex reflective and fine-textured backgrounds, and the output of detection results for location, contour, and category is inconsistent.

Method used

An image preprocessing module is used to normalize the strip orientation and divide the local membrane unit. The membrane background reconstruction module learns the normal membrane visual baseline. The residual decoupling module generates a multi-scale residual map and combines it with the defect discrimination output module to determine the position, contour and category.

Benefits of technology

It effectively identifies low-contrast defects such as shallow scratches, minor indentations, and microbubbles, reducing the chances of normal membrane surfaces being misidentified as dirt or bubbles, and improving the stability and consistency of test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122492718A_ABST
    Figure CN122492718A_ABST
Patent Text Reader

Abstract

This invention relates to a visual recognition-based surface defect detection system for Mylar tape, belonging to the fields of image recognition, visual analysis, and defect segmentation. The system includes an image preprocessing module, a residual decoupling module, and a defect discrimination output module. The image preprocessing module normalizes the tape direction, crops the detection area, and divides local film unit areas in the Mylar tape surface image, generating film surface characterization data. The film surface background reconstruction module learns the normal film surface visual baseline based on qualified Mylar tape samples and generates a normal film surface prediction map. The residual decoupling module forms a multi-scale residual map of pixels, texture direction, and deep semantics based on the image to be inspected and the normal film surface prediction map. The defect discrimination output module outputs the defect location, contour, and category based on the multi-scale residual map and morphological constraints. This system can separate the interference of normal reflection, fine texture, and gradual grayscale changes on defect recognition, improving the detection stability of defects such as low-contrast scratches, indentations, and bubbles.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a visual recognition-based surface defect detection system for Mylar tape, belonging to the fields of image recognition, visual analysis, and defect segmentation technology. Background Technology

[0002] Surface defect detection of Mylar tape typically employs machine vision. The detection object is a continuously unfolded image of the tape surface, which includes surface reflection, film background color, tape texture, edge shadows, and potential defects such as scratches, indentations, bubbles, dirt, wrinkles, and foreign objects. Conventional detection systems, after acquiring the image, perform grayscale conversion, noise reduction, illumination equalization, edge enhancement, and region cropping. They then extract suspected defect areas using fixed thresholds, local thresholds, morphological operations, or connected component analysis. These methods generally assume a high degree of consistency between the normal film surface and the background, and that there is a clear difference in grayscale, edge, or texture between the defect area and the background. Therefore, the detection logic mainly relies on manually set features such as pixel grayscale abrupt changes, region area, aspect ratio, and boundary shape. For materials with stable surface roughness and weak reflectivity variations, this method can perform basic screening. However, Mylar tape is characterized by semi-transparency, local specular reflection, and fine line textures. The normal surface itself will form grayscale fluctuations and edge fragments similar to defects, making it difficult for conventional threshold segmentation to reliably distinguish between normal film surface variations and true defects.

[0003] In deep learning-based visual inspection inventions, existing systems typically use images of Mylar tape surfaces along with manually labeled defect boxes, defect categories, or defect masks as training data. They then utilize object detection networks, semantic segmentation networks, or instance segmentation networks to learn defect image features. After model training, the image to be inspected is directly input into the visual encoding network, which extracts, fuses, and performs classification regression to output the defect location, outline, or category. Compared to traditional thresholding methods, this approach reduces manual feature setting, but its core remains learning the difference between defects and the background directly from the original image. Because the reflectivity, film background color, texture density, and coating thickness of Mylar tape vary with batch, imaging angle, and surface condition, supervised models can easily learn frequently occurring background textures or local bright spots in a particular batch as defect features, or absorb low-contrast defects into the normal background. When the training sample coverage is insufficient, the detection results are highly dependent on the sample distribution, especially in scenarios with shallow scratches, minor indentations, and tiny bubbles. Relying solely on original image features for discrimination can easily lead to detection boundary drift and category confusion.

[0004] Similar conventional improvements involve adding background correction or image enhancement processing before defect detection. For example, flat-field correction can eliminate overall illumination unevenness, filtering operators can weaken the texture of the tape direction, local contrast enhancement can highlight suspected abnormal areas, or an autoencoder network can be trained using normal samples with reconstruction error as the anomaly score. While these inventions can improve grayscale unevenness to some extent, they typically treat background processing as an independent preprocessing step, lacking feature-level coupling between the reconstruction result and the defect discrimination result. Reconstruction error often only represents pixel-level differences and cannot distinguish between brightness deviations caused by normal reflections, changes in normal texture direction, and local structural damage caused by defects. For normal fine textures extending along the length of the Mylar tape surface, filtering may weaken real scratches; for continuous bright areas formed by local reflections, reconstruction error may increase significantly and be misjudged as anomalies. These inventions do not establish a unified discriminant relationship for the normal film surface visual baseline, texture direction residuals, and semantic anomaly residuals, making it difficult to meet the stability requirements of fine defect detection.

[0005] The reflectivity, fine texture, and gradual grayscale variations of the normal surface of Mylar tape do not form a separable visual representation with actual surface defects. When the detection system judges defects based on the original image or a single reconstruction error, background disturbances on the normal film surface overlap with low-contrast defects such as shallow scratches, minor indentations, and microbubbles in the image feature space. The technical reason for this problem is that existing inventions lack a mechanism to establish a visual baseline for the normal film surface of qualified Mylar tape samples, a mechanism to decouple the pixel, texture direction, and deep semantic level residuals between the original image and the predicted normal film surface, and a unified processing method for morphological constraints and confidence correction of candidate abnormal regions. As a result, the detection system struggles to maintain both defect detection capability and false detection suppression capability against complex reflective and fine-textured backgrounds. The same defect may produce different confidence outputs under different background intensities, and the same normal reflective area may be segmented into multiple false defect areas, resulting in insufficient consistency in the output of defect location, contour, and category. Summary of the Invention

[0006] The purpose of this invention is to provide a visual recognition-based surface defect detection system for Mylar tape, which can solve the problems mentioned in the background art.

[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows: The Mylar tape surface defect detection system based on vision recognition includes an image preprocessing module, a film surface background reconstruction module, a residual decoupling module, and a defect discrimination output module. The image preprocessing module performs strip orientation normalization, detection area cropping, and local film unit division on the Mylar tape surface image to obtain film surface characterization data including brightness distribution and texture direction. The membrane background reconstruction module learns the normal membrane visual baseline based on qualified Mylar tape samples and generates a normal membrane prediction map based on the membrane characterization data. The residual decoupling module generates a multi-scale residual map based on the Mylar tape surface image and the normal film surface prediction map. The defect discrimination output module determines the location, outline, and category of surface defects on Mylar tape based on the multi-scale residual map, which is a vision-based Mylar tape surface defect detection system.

[0008] Preferably, the image preprocessing module includes a direction reference determination submodule, an illumination equalization submodule, and a film surface unit generation submodule; The orientation reference determination submodule determines the strip length orientation based on the edge texture direction and main texture projection of the Mylar tape. The illumination equalization submodule extracts the gradually varying brightness component along the length of the strip and separates the gradually varying brightness component from the candidate edges of local defects. The film surface unit generation submodule generates overlapping local film surface units according to the length and width directions of the strip, and configures brightness distribution, texture direction, edge sparsity and local uniformity identifiers for each local film surface unit.

[0009] Preferably, the membrane background reconstruction module includes a normal sample encoding submodule, a visual baseline generation submodule, and a prediction map constraint submodule; The normal sample encoding submodule establishes a defect-free membrane surface feature dictionary based on qualified Mylar tape samples; The visual baseline generation submodule performs local matching between the membrane surface characterization data and the defect-free membrane surface feature dictionary to generate a normal membrane surface feature map corresponding to the Mylar tape surface image. The prediction map constraint submodule reconstructs and constrains the normal film surface feature map based on texture direction continuity, brightness gradient continuity, and edge sparsity to obtain the normal film surface prediction map.

[0010] Preferably, the residual decoupling module includes a pixel residual calculation submodule, a texture residual calculation submodule, and a semantic residual fusion submodule; The pixel residual calculation submodule performs corresponding pixel difference analysis on the Mylar tape surface image and the normal film surface prediction image to obtain a pixel residual map. The texture residual calculation submodule generates a directional residual map based on the texture direction changes of local membrane units; The semantic residual fusion submodule performs scale alignment and confidence fusion on the pixel residual map, the orientation residual map, and the deep anomaly features output by the visual coding network to form the multi-scale residual map.

[0011] Preferably, the membrane unit generation submodule further establishes a membrane unit association map according to the differences in texture direction and brightness gradient of adjacent local membrane units; Each node in the membrane unit association graph corresponds to a local membrane unit, and each side records the texture continuity of adjacent local membrane units in the length direction, width direction, and oblique neighborhood. The image preprocessing module marks the reflective continuous region, texture continuous region, and boundary abrupt region according to the film unit association map. The boundary abrupt region includes local film units whose edge direction is inconsistent with the neighborhood texture direction, and the marking results are incorporated into the film characterization data.

[0012] Preferably, the visual baseline generation submodule includes a batch style coding branch and a defect-independent content coding branch; The batch style coding branch extracts the film background color, overall reflectivity and fine texture density from qualified Mylar tape samples to form a style vector; The defect-independent content encoding branch extracts local continuous textures and sparse distributions of normal edges to form a content vector based on the defect-free membrane feature dictionary; The normal membrane feature map is generated by cross-attention matching of the style vector and the content vector, and edge mutation features from candidate abnormal regions are masked during the generation process.

[0013] Preferably, the semantic residual fusion submodule includes a residual consistency gating submodule and a candidate region generation submodule; The residual consistency gating submodule performs spatial correspondence judgment on the pixel residual map, the orientation residual map and the deep anomaly features to form a consistent residual mask; The candidate region generation submodule generates candidate anomalous regions based on the consistent residual mask, and configures length-to-width ratio, boundary closure, grayscale diffusion, and orientation abruptness descriptors for the candidate anomalous regions. The defect discrimination output module forms a category confidence vector based on the descriptive quantity and the multi-scale residual map.

[0014] Preferably, the image preprocessing module further includes an adaptive unit scale selection submodule; The adaptive unit scale selection submodule generates fine-scale, medium-scale, and strip-scale film surface units simultaneously for the same Mylar tape surface image based on the number of continuous nodes in the same direction, the span of the reflective continuous area, and the distribution density of the boundary abrupt area in the film surface unit association diagram. Different scale membrane units share the coordinate references in the length and width directions of the strip, and record the corresponding relationship through cross-scale node index.

[0015] Preferably, the membrane background reconstruction module further includes a normal sample reliable update submodule; The normal sample reliable update submodule selects Mylar tape surface images that do not contain candidate abnormal regions and have stable batch style coding from the detection results as incremental normal samples, and writes the style vector and content vector of the incremental normal samples into the batch style library and the defect-free membrane feature dictionary, respectively. Before writing, the incremental normal samples are sorted by local reconstruction error to remove samples whose reconstruction errors are concentrated in boundary abrupt regions or reflective continuous regions.

[0016] Preferably, the defect discrimination output module further includes a shape constraint discrimination submodule and a contour correction submodule; The morphological constraint discrimination submodule inputs the category confidence vector into the morphological template branches corresponding to scratches, bubbles, dirt, indentations and wrinkles respectively, and forms the target defect category based on the length-to-width ratio, boundary closure, gray-scale diffusion and directional change degree. The contour correction submodule generates defect contours along the connected boundaries of a consistent residual mask within the candidate anomaly region, and splits interconnected regions with different class confidence vectors into multiple defect instances.

[0017] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention uses an image preprocessing module to normalize the tape direction, crop the detection area, and divide the local film unit in the Mylar tape surface image, so that subsequent processing is based on film coordinates with consistent length and width directions; the film background reconstruction module learns the normal film visual baseline based on qualified Mylar tape samples and generates a normal film prediction map corresponding to the image to be inspected, so that the detection process obtains a reference object with normal reflection, normal texture, and gradual grayscale changes; the residual decoupling module forms pixel residuals, texture direction residuals, and deep anomaly features between the image to be inspected and the normal film prediction map, and forms a multi-scale residual map through residual consistency gating, so that the local structural damage caused by real defects is separated from the normal film disturbance. Because the defect discrimination output module uses multi-scale residual maps combined with aspect ratio, boundary closure, grayscale diffusion, and directional abrupt change for category determination and contour generation, low-contrast defects such as shallow scratches, minor indentations, and microbubbles can be identified outside the predicted baseline of the normal film surface. False anomalies caused by localized reflections, continuous fine textures, and gradual brightness variations are suppressed, resulting in a more stable correspondence between defect location, contour, and category output. This processing does not rely solely on grayscale abrupt changes in a single original image, reducing the likelihood of bright areas on the normal film surface being identified as dirt or bubbles, and also reducing the likelihood of low-contrast scratches being absorbed by normal textures.

[0018] 2. This invention also records the texture continuity of local membrane units in the length, width, and oblique neighborhoods through a membrane unit association graph, and incorporates reflective continuity areas, texture continuity areas, and boundary abruptness areas into the membrane characterization data, enabling normal background reconstruction and residual calculation to utilize the inherent directional continuity relationship of the tape surface. Fine-scale, medium-scale, and long-strip-scale membrane units are generated through an adaptive unit scale selection method, and a cross-scale node index is established, allowing for comparable characterization of minute point anomalies, slender scratches, and strip-shaped wrinkles at different scales. Through batch style coding branches, defect-independent content coding branches, and a reliable update mechanism for normal samples, the normal membrane feature dictionary can be updated as qualified samples are added, while samples with reconstruction errors concentrated at boundary abruptness areas or reflective continuity area breakpoints are removed, reducing the risk of abnormal samples entering the normal baseline. Through morphological template branches and contour correction processing, regions with different but connected category confidence vectors can be split into multiple defect instances, making the matching relationship between defect contours and defect categories clearer. The above processing also allows variations in the background color, overall reflectivity, and fine texture density of different batches of film to be incorporated into the background reconstruction process, reducing the interference of batch differences on the normal baseline and keeping the test results controllable during continuous sample updates. Attached Figure Description

[0019] Figure 1 This is a flowchart of the overall inspection process for a vision-based Mylar tape surface defect detection system. Figure 2 Flowchart for preprocessing images of Mylar tape surface and generating film unit association diagrams; Figure 3 Flowchart for normal film surface background reconstruction and batch style decoupling; Figure 4 This is a flowchart for multi-scale residual decoupling and defect identification. Detailed Implementation

[0020] refer to Figure 1In one embodiment, a visual recognition-based Mylar tape surface defect detection system is used to identify scratches, indentations, bubbles, dirt, wrinkles, and foreign objects in images of Mylar tape surfaces. The system includes an image preprocessing module, a film background reconstruction module, a residual decoupling module, and a defect discrimination output module. After receiving the Mylar tape surface image, the image preprocessing module normalizes the tape direction, aligning the tape length direction in the image with the longitudinal reference in a unified coordinate system, and generates a detection area trimming result based on the effective detection area of ​​the tape. The image preprocessing module generates local film units within the detection area, each storing film surface characterization data such as brightness distribution, texture direction, edge sparsity, and local uniformity. The film background reconstruction module does not directly target defect categories for identification; instead, it learns a normal film surface visual baseline using qualified Mylar tape samples. This normal film surface visual baseline includes reflectivity continuity in a defect-free state, fine texture direction of the film surface, local grayscale gradient relationships, and normal edge sparsity distribution. The membrane background reconstruction module generates a normal membrane prediction map corresponding to the position of the surface image of the Mylar tape to be inspected based on the membrane characterization data. The normal membrane prediction map represents the defect-free image representation that should appear under the same membrane coordinates, similar batch style, and similar texture structure. The residual decoupling module aligns the surface image of the Mylar tape to be inspected with the normal membrane prediction map and forms a multi-scale residual map at the levels of pixel grayscale, texture direction, and deep anomaly features. The defect discrimination output module determines candidate anomaly regions in the multi-scale residual map, performs connectivity analysis, category confidence calculation, and contour generation on the candidate anomaly regions, and outputs the defect location, defect contour, and defect category. The basic working logic of this embodiment is as follows: using the normal membrane prediction map as a visual reference for the image to be inspected, the normal reflectivity, normal texture, and normal grayscale gradient of the Mylar tape are separated from the anomaly regions, and then defect discrimination is performed on the remaining residual representation. Compared to directly performing grayscale thresholding on the original image or directly inputting it into a general segmentation model, this embodiment combines normal background modeling and defect residual identification in the same image processing chain, avoiding the detection results from relying solely on local brightness variations in the original image. The advantage of this embodiment is that low-contrast defects are no longer simply considered as grayscale abrupt changes, but rather expressed as deviations from the visual baseline of the normal membrane surface. The interference of normal reflective continuous areas and fine-texture continuous areas on defect discrimination is incorporated into the background reconstruction process, and the output of defect location, contour, and category has a clear data source.

[0021] refer to Figure 2In one embodiment, the image preprocessing module includes a direction reference determination submodule, an illumination equalization submodule, and a film surface unit generation submodule. The direction reference determination submodule determines the tape length direction based on the edge texture direction and main texture projection of the Mylar tape. Specifically, it calculates the local gradient direction distribution within the detection area, uses directions with continuous projection peaks as candidate directions for the tape length direction, and corrects these candidate directions based on the tape edge extension trend. The illumination equalization submodule extracts the gradually varying brightness component along the tape length direction, retains this component as part of normal film surface changes, and separates abrupt edges from the gradually varying component to avoid directly converting overall illumination fluctuations into abnormal residuals. The film surface unit generation submodule generates overlapping local film surface units according to the tape length and width directions. Overlapping areas are retained between adjacent local film surface units, and these overlapping areas are used for subsequent determination of texture continuity and residual connectivity. The texture direction of each local film surface unit can be calculated using the following formula: ; in, Indicates the first Texture direction of each local film unit Indicates the first The set of pixels contained in a local membrane unit Represents pixels Gray-level gradient in the width direction, Represents pixels Gray-level gradient along the length direction, This represents a stable quantity that prevents the denominator from being zero. (Operation symbol) This indicates summing over all pixels within a local membrane unit. This represents the arctangent operation. For example, when a certain local membrane element... , ,and When the value is 0, The calculated value is approximately 28.15 degrees, indicating that the main texture of this local membrane unit has a deviation of approximately 28.15 degrees relative to the width direction. This direction value is not used as a separate defect criterion, but is incorporated into the membrane characterization data for subsequent assessment of the texture direction deviation between the image under inspection and the predicted normal membrane image. The brightness distribution of the local membrane unit can be represented by the gray-level mean and gray-level dispersion. Edge sparsity can be represented by the proportion of pixels whose gradient magnitude exceeds the background gradient level, and local uniformity can be represented by the difference between gray-level dispersion and neighborhood dispersion. To ensure the stability of the meaning between data fields, the generation logic of each field can be adopted as shown in Table 1.

[0022] Table 1. Membrane surface characterization data fields and generation logic

[0023] In this embodiment, illumination equalization does not simply erase brightness variations, but rather incorporates the gradual brightness changes that occur continuously along the strip direction as part of the normal film surface background into the film surface characterization data. Furthermore, film surface unit generation is not fixed block cutting, but rather the creation of associative local units based on the strip direction, allowing subsequent background reconstruction and residual decoupling to be performed within the same coordinate framework. The advantage of this embodiment is that the image preprocessing stage provides subsequent models with directionally consistent, field-complete, and associative film surface characterization data, avoiding the direct impact of directional deviations, brightness drifts, and isolated texture disturbances from the original image on subsequent defect discrimination.

[0024] refer to Figure 3 In a preferred embodiment, the membrane background reconstruction module includes a normal sample encoding submodule, a visual baseline generation submodule, and a prediction map constraint submodule. The normal sample encoding submodule encodes qualified Mylar tape samples to obtain a defect-free membrane feature dictionary. Each dictionary entry in the defect-free membrane feature dictionary corresponds to a local representation of a normal membrane, and the dictionary entry content includes local brightness structure, fine texture direction, reflective continuity features, and sparse distribution of normal edges. The visual baseline generation submodule locally matches the membrane representation data in the image to be inspected with the defect-free membrane feature dictionary, selecting dictionary entries that are close to the current local membrane unit in batch style, texture direction, and brightness gradient relationship to generate a normal membrane feature map. The prediction map constraint submodule applies constraints on texture direction continuity, brightness gradient continuity, and edge sparsity to the normal membrane feature map to form a normal membrane prediction map. The following weighting method can be used during local reconstruction: , ; in, Indicates the first The local membrane unit and the first Matching weights between flawless dictionary entries Indicates the first The membrane surface characterization data of the first local membrane unit and the first The distance between dictionary entries Indicates the first The local membrane unit and the first Distance between dictionary entries ( and Using the same distance metric, and (These are all different index variables of dictionary entries); Indicates the background matching smoothness coefficient. This indicates the number of dictionary items that can participate in the matching. Indicates the first Predicted background grayscale representation of a local membrane unit Indicates the first Normal background grayscale representation corresponding to each dictionary entry. Operators This represents exponential operations with the natural constant as the base, and the denominator represents the sum of the exponents of all candidate dictionary entries. For example, when... , , , , At that time, the three weights were approximately 0.705, 0.259, and 0.036; if , , ,but Approximately 123.4 represents the predicted grayscale representation of the current local membrane unit in a defect-free state. Since dictionary entries with larger distances retain smaller weights, the predicted background will not abruptly change due to a single mismatch. The prediction map constraint submodule can establish continuous constraints between adjacent local membrane units. When the difference in texture direction between adjacent units is within the normal fluctuation range, the corresponding predicted background remains continuous along that direction; when the edge sparsity of a local unit suddenly increases and does not conform to the normal reflective continuity rule, the contribution of the corresponding region to background generation is reduced. The advantage of this embodiment is that the normal membrane prediction map is generated from the defect-free membrane feature dictionary of qualified samples and is jointly constrained by texture, brightness, and edge sparsity relationships, avoiding the direct copying of suspected defects from the image to be inspected into the normal background.

[0025] refer to Figure 4 In another embodiment, the residual decoupling module includes a pixel residual calculation submodule, a texture residual calculation submodule, and a semantic residual fusion submodule. The pixel residual calculation submodule performs corresponding pixel difference analysis on the Mylar tape surface image and the normal film surface prediction image to obtain a pixel residual map. The texture residual calculation submodule generates an orientation residual map based on the texture direction changes of local film surface units. The semantic residual fusion submodule reads the features of the image to be inspected and the features of the normal film surface prediction image from the visual coding network to obtain deep anomaly features, and performs scale alignment on the pixel residual map, orientation residual map, and deep anomaly features. The pixel residual, orientation residual, and deep anomaly features can be represented as local residuals according to the following formula: , , ; in, Indicates the first The pixel residual of a local film surface unit Indicates the pixel of the image to be inspected. grayscale value at that location This indicates the normal film surface prediction map at the pixel point. grayscale value at that location This indicates the number of pixels in a local membrane unit. Indicates texture direction residual. This indicates the predicted texture direction of the corresponding local film unit in the normal film prediction image. Indicates the distance of deep anomaly features. This represents the deep feature vector of the image to be inspected. This represents the deep feature vector of the normal membrane surface prediction map. This represents the L2 norm operation. For example, when the average absolute difference of pixels within a certain local membrane unit is 4.6, and the detected texture direction differs from the predicted texture direction by 12 degrees, The calculated result is approximately 0.022. When the L2 norm of the deep feature vector difference is 0.31, this unit simultaneously exhibits a pixel deviation of 4.6, a directional deviation of 0.022, and a semantic deviation of 0.31. These three types of residuals have different physical meanings: pixel residuals correspond to grayscale deviation, texture direction residuals correspond to local directional disruption, and deep anomaly feature distances correspond to visual structure deviation. In this embodiment, the multi-scale residual map can be formed by weighting normalized residuals. ; in, Indicates the first The fusion residual value of each local membrane unit. , , These represent the fusion weights for pixel residual, texture direction residual, and deep anomaly feature distance, respectively, and the sum of the three is 1; , , These represent the normalized smoothing coefficients for the three types of residuals. For example, when... , , , , , and adopt the aforementioned , , hour, The approximate values ​​are 0.4 × 0.479 + 0.25 × 0.306 + 0.35 × 0.508, with a calculated result of approximately 0.446. This fused residual value is incorporated into the candidate anomaly region generation process and used in conjunction with spatial connectivity relationships. The advantage of this embodiment is that residual judgment is not limited to a single grayscale difference. Overall brightness changes caused by normal reflections, edge fragments caused by normal fine textures, and local structural damage caused by real defects can be expressed separately in different residual channels, reducing confusion caused by single-channel judgments.

[0026] In a preferred embodiment, the semantic residual fusion submodule further includes a residual consistency gating submodule and a candidate region generation submodule. The residual consistency gating submodule performs spatial correspondence judgment on the pixel residual map, orientation residual map, and deep anomaly features to form a consistent residual mask. For the surface of Mylar tape, real scratches usually manifest simultaneously as local gray-level differences, texture orientation disruption, and deep edge structure anomalies; simple reflective areas may have gray-level deviations, but the texture orientation and deep structure remain continuous. Therefore, the residual consistency gating submodule needs to distinguish between single gray-level deviations and multi-channel common anomalies. The gating value can be calculated according to the following formula: ; in, Indicates the first Consistent residual gating value for each local membrane unit , , These represent the normalized pixel residual, texture orientation residual, and deep anomaly feature distance, respectively. Indicates the first The intensity of gradually varying brightness of a local film unit , , , These represent the gating coefficients for the four input items. (Action symbols) It still represents exponential operations, but the fractional structure limits the gate value to between 0 and 1. For example, when , , , ,and , , , At that time, the value inside the parentheses was 1.77. Approximately 0.855; if only grayscale deviation exists, take... , , , The value in parentheses is 0.43. The gating output is approximately 0.606, and decreases as the intensity of the gradual change in brightness increases. The candidate region generation submodule merges highly gated local film units that meet the connectivity conditions into candidate anomalous regions, and configures length-to-width ratio, boundary closure, grayscale diffusion, and directional abruptness descriptors for the candidate anomalous regions. The length-to-width ratio can be calculated from the circumscribed range of the candidate region in the length and width directions of the strip; the boundary closure can be calculated from the proportion of contour breakpoints; the grayscale diffusion can be calculated from the grayscale gradient attenuation from the center to the boundary of the candidate region; and the directional abruptness can be calculated from the difference in texture direction between the inside and outside of the candidate region. The defect discrimination output module forms a category confidence vector based on these descriptors and the multi-scale residual map. Each component in the category confidence vector corresponds to the discrimination result of categories such as scratches, bubbles, dirt, indentations, or wrinkles. The advantage of this embodiment is that the candidate region is not generated by a single threshold, but is jointly determined by the consistency of the multi-channel residuals and the morphological description of the candidate region. The gradual change in normal illumination is canceled out by the gating logic, and the local structural changes of real defects are preserved.

[0027] In one embodiment, the image preprocessing module further processes the continuity relationship between local film units based on the film unit association graph. The film unit generation submodule establishes the film unit association graph according to the texture direction differences and brightness gradient slopes of adjacent local film units. Each node in the association graph corresponds to one local film unit, and each edge records the texture continuity of adjacent local film units in the length direction, width direction, and diagonal neighborhood. The establishment of the association graph enables subsequent processing to distinguish between normal textures that are continuous along the strip direction, normal bright areas that transition slowly along the reflective direction, and anomalous edges that appear suddenly and have inconsistent directions. The texture continuity between adjacent local film units can be calculated using the following formula: ; in, Indicates the first The local membrane unit and the first Texture continuity between adjacent local membrane units and These represent the texture directions of two local film surface units, and These represent the gradient slopes of brightness variation for two local film surface units, Indicates the smoothing coefficient for directional differences. This represents the smoothing coefficient for the difference in brightness slope. For example, when the texture direction difference between two adjacent local film units is 5 degrees and the difference in brightness gradient slope is 0.03, and... , hour, The calculated result is approximately 0.449; as the direction difference and brightness slope difference further increase, the continuity decreases accordingly. The image preprocessing module labels the reflective continuous region, texture continuous region, and boundary abrupt region based on the membrane unit association map. The reflective continuous region consists of multiple nodes with similar brightness gradient slopes and continuous directions; the texture continuous region consists of multiple nodes with similar texture directions and stable edge sparsity; and the boundary abrupt region contains local membrane units whose edge directions are inconsistent with the neighborhood texture directions. The labeling results are written into the membrane characterization data and participate in the generation of the normal membrane prediction map and residual gating processing. For the reflective continuous region, a large grayscale gradient is allowed during background reconstruction; for the texture continuous region, the edge response caused by normal fine texture is reduced during residual calculation; and for the boundary abrupt region, the chance of the candidate region entering the multi-scale residual map is increased during candidate region generation. The advantage of this embodiment is that local membrane units are no longer treated as isolated image blocks, but are entered into the continuous membrane representation through the association map. The reflective extension and texture extension on the normal membrane surface can be identified as background continuity, and local directional abrupt changes are retained as an important source of subsequent candidate regions.

[0028] Furthermore, the image preprocessing module may include an adaptive unit scale selection submodule. This submodule generates fine-scale, medium-scale, and strip-scale unit cells simultaneously for the same Mylar tape surface image based on the number of consecutive nodes in the same direction, the span of the reflective continuous area, and the distribution density of the boundary abrupt change area in the unit cell association graph. Fine-scale unit cells are used to represent microbubbles, dotted dirt, and small foreign objects; medium-scale unit cells are used to represent indentations, local wrinkles, and patchy grayscale diffusion; and strip-scale unit cells are used to represent scratches and strip-like texture abrupt changes extending along the tape direction. Unit cells of different scales share coordinate references in the tape's length and width directions, and their correspondence is recorded through cross-scale node indexing. In the cross-scale node index, one long-scale membrane cell can correspond to multiple medium-scale membrane cells, and one medium-scale membrane cell can correspond to multiple fine-scale membrane cells. When a fine-scale membrane cell contains a high residual but the corresponding medium-scale region still maintains texture continuity, the high residual is temporarily stored as a local candidate. When multiple fine-scale high residuals are arranged along the same long-scale direction, the candidate region generation submodule merges them into a continuous scratch candidate. The fields for adaptive cell scale selection can be organized as shown in Table 2.

[0029] Table 2 Adaptive membrane unit scale and cross-scale index fields

[0030] In this embodiment, adaptive scale selection does not change the image acquisition object or introduce additional structures, but rather establishes a multi-scale data representation on the same Mylar tape surface image. The multi-scale local film surface units share a coordinate reference, which avoids offsets in coordinate transformations caused by different scale detection results. The advantage of this embodiment is that the system can simultaneously preserve the local details of minute defects and the directional continuity of slender defects within the same processing link, avoiding the smoothing of point defects or the fragmentation of long strip defects caused by a single fixed scale.

[0031] In a preferred embodiment, the membrane background reconstruction module includes a batch style coding branch and a defect-independent content coding branch. The batch style coding branch extracts the membrane background color, overall reflectivity, and fine texture density from qualified Mylar tape samples to form a style vector; the defect-independent content coding branch extracts local continuous textures and sparse distribution of normal edges based on the defect-free membrane feature dictionary to form a content vector. The style vector represents the global visual conditions of normal membranes under the same batch or similar visual conditions, while the content vector represents the structural expression that a local membrane should have under defect-free conditions. The normal membrane feature map is generated by cross-attention matching of the style vector and the content vector, and edge abrupt features from candidate anomalous regions are masked during the generation process. To avoid using candidate anomalous regions to disrupt the normal background generation, a masking factor can be set for each local membrane unit before cross-matching. The masking factor is determined by the degree of edge abruptness and the residual gating value. The cross-matching weight between the style vector and the content vector can be calculated according to the following formula: ; in, Indicates the first The style vector of the local membrane unit and the first Matching weights between content vectors Indicates the first Style vectors corresponding to local membrane units Indicates the first A flawless content vector, This represents the dot product of two vectors. Indicates the first The shielding factor of a local membrane unit. Represents the matching smoothing coefficient. This represents the number of content vectors that can participate in the matching. For example, when the shielding factor of a certain local membrane element... When the condition is met, it indicates that the region was not identified as a candidate anomalous region, and the style vector and content vector can be matched normally; when... When this occurs, it indicates the presence of abrupt edge changes or abnormal residuals in the region, compressing the inner product result and reducing the contribution of the abnormal region to the normal membrane surface feature map. If there are two content vectors, the inner product results are 0.8 and 0.4 respectively. ,and Then the two matching weights are approximately 0.881 and 0.119; when At that time, the two matching weights are approximately 0.599 and 0.401, respectively, and the matching differences are compressed to avoid abnormal edges excessively determining background generation. The advantage of this embodiment is that the normal membrane surface prediction map simultaneously contains the batch visual state and the defect-free local structure. Abrupt edges in the candidate abnormal region are not directly absorbed into the background reconstruction result, and batch background color changes and normal texture changes can be processed separately through different coding branches.

[0032] In this embodiment, the membrane background reconstruction module may further include a normal sample reliability update submodule. The normal sample reliability update submodule selects Mylar tape surface images from the detection results that do not contain candidate abnormal regions and have stable batch style coding as incremental normal samples, and writes the style vector and content vector of the incremental normal samples into the batch style library and the defect-free membrane feature dictionary, respectively. Before writing, the normal sample reliability update submodule performs local reconstruction error sorting on the incremental normal samples, removing samples where reconstruction errors are concentrated in boundary abrupt regions or discontinuities in reflective continuity regions. Reliability update does not unconditionally write to all image segments determined to be normal; instead, it determines whether a sample may carry unidentified defects based on the distribution location of local reconstruction errors. The reliability score can be calculated using the following formula: ; in, Indicates the first The reliability score of the sample to be updated. Indicates the first The normalized average reconstruction error of each sample. Indicates the concentration of reconstruction error. Indicates batch style coding stability. Reconstruction error concentration. Batch style coding stability can be represented by the proportion of reconstruction errors located within boundary abrupt change regions or reflective continuity discontinuities. This can be represented by the similarity between the sample style vector and the style center of the current batch. For example, when , , hour, The calculated result is approximately 0.737; while the average reconstruction error of another image segment is 0.10, the error concentration is... When the batch style coding stability is 0.90, The value is approximately 0.243, making this sample unsuitable for inclusion in the defect-free membrane feature dictionary. The writing operation can be performed in a partitioned manner: when writing style vectors to the batch style library, indexes are established based on the membrane background color and overall reflectivity; when writing content vectors to the defect-free membrane feature dictionary, indexes are established based on texture direction, edge sparsity, and local uniformity. The advantage of this embodiment is that the normal membrane visual baseline can be supplemented based on reliable normal samples obtained during the detection process. Simultaneously, the error location distribution prevents image fragments carrying local anomalies from contaminating the defect-free membrane feature dictionary, ensuring a stable data source for subsequent background reconstruction.

[0033] In one embodiment, the defect discrimination output module includes a morphological constraint discrimination submodule and a contour correction submodule. The morphological constraint discrimination submodule inputs the category confidence vector into the morphological template branches corresponding to scratches, bubbles, dirt, indentations, and wrinkles, respectively, and forms the target defect category based on the length-to-width ratio, boundary closure, grayscale diffusion, and directional abrupt change. The scratch template branch focuses on processing connected regions that extend along the strip direction or diagonally and have a narrow width; the bubble template branch focuses on processing regions with relatively closed boundaries and annular or sheet-like differences in internal grayscale; the dirt template branch focuses on processing regions with slow grayscale diffusion and irregular boundaries; the indentation template branch focuses on processing regions where the local grayscale concavity / convexity relationship and directional continuity are locally altered; and the wrinkle template branch focuses on processing regions with abrupt changes in texture direction and extending along local broken lines. Morphological constraint discrimination can adopt the following category scoring method: ; in, Indicates the first The candidate abnormal region belongs to the first Category scoring of class defects Indicates the first The baseline for class defects, to They represent the first The coefficients of the descriptive quantities of each type of defect and the coefficients of the fusion residual. Indicates the first The length-to-width ratio of each candidate anomaly region Indicates the degree of boundary closure. Indicates grayscale diffusion. Indicates the degree of directional abrupt change. This represents the mean of the fusion residuals within the candidate anomaly region. For example, for a given candidate anomaly region, , , , , If the scratch category corresponds , , , , , If the scratch score is approximately 1.875, then the bubble category corresponds to a higher boundary closure coefficient, and the candidate region... If the score is lower, the bubble score is lower than the scratch score, and the candidate region is classified into the scratch branch. The contour correction submodule generates defect contours along the connected boundaries of the consistent residual mask within the candidate anomaly region. When interconnected regions with different class confidence vectors are in the same connected domain, the contour correction submodule splits the connected domain into multiple defect instances based on the class score gradient and residual valley line. During splitting, if the left region of the same connected domain has a higher scratch score and the right region has a higher dirt score, and there is a fusion residual descent band between them, then a segmentation boundary is generated along the descent band, and scratch instances and dirt instances are output separately. The advantage of this embodiment is that the defect category is jointly determined by the residual strength and morphological description, and interconnected but morphologically different anomaly regions can be split, avoiding the mixing of adjacent defects into a single category for output.

[0034] In a preferred embodiment, the candidate region generation submodule, morphological constraint discrimination submodule, and contour correction submodule can exchange data via a candidate region attribute table. The candidate region attribute table stores the spatial index, residual statistics, morphological description, category confidence vector, and contour status of each candidate abnormal region. The system fills in the spatial index and residual statistics during the candidate region generation stage, fills in various defect scores during the morphological constraint discrimination stage, and updates the contour status and instance number during the contour correction stage. This attribute table can adopt the structure shown in Table 3.

[0035] Table 3 Attribute Table of Candidate Anomaly Regions

[0036] In this embodiment, the candidate region attribute table is not used for ordinary data display, but rather to constrain data consistency between different processing modules. Before entering morphological constraint discrimination, a candidate region must have a region index and mean residual value under a unified membrane coordinate system. After morphological constraint discrimination is completed, the category confidence vector is bound to the contour state. Contour correction must not change the source of the candidate region's residuals; it can only adjust the boundaries based on a consistent residual mask and category scoring gradient. When the same candidate region undergoes cross-scale node index merging, the candidate region attribute table saves the indices of each sub-region before merging, enabling the contour correction submodule to trace the position of fine-scale residual peaks. The advantage of this embodiment is that the generation, classification, and contour correction of candidate regions are fixed in the same data structure, reducing data inconsistencies between modules caused by coordinate transformation, scale merging, or category updates.

[0037] In one embodiment, the system's training and inference processes can be implemented using a phased data processing approach. Training data for membrane background reconstruction consists of qualified Mylar tape samples. After the qualified samples are processed by the image preprocessing module to generate membrane surface characterization data, they enter the normal sample encoding submodule to form a dictionary of defect-free membrane features. Training data for defect discrimination consists of Mylar tape surface images with defect annotations, including defect location, defect contour, and defect category. During training, the membrane background reconstruction module first learns the normal membrane visual baseline based on qualified samples, then inputs defect samples into the background reconstruction link to generate a normal membrane prediction map. The residual decoupling module calculates a multi-scale residual map, and the defect discrimination output module adjusts the category discrimination parameters based on the multi-scale residual map and annotation results. During inference, the image to be inspected only needs to undergo image preprocessing, background reconstruction, residual decoupling, and defect discrimination output to obtain the detection result. To ensure consistency in field meaning between training and inference, the same membrane characterization fields, the same coordinate indexing method, and the same candidate region attribute table are used in both the training and inference phases. If batch variations cause changes in the film's background color or reflective style, the system updates the style vector matching relationship through the batch style coding branch. The normal sample reliability update submodule then filters incremental normal samples to enter the batch style library and the defect-free film feature dictionary. The defect discrimination branch does not directly use the batch background color as a defect category feature; instead, it obtains the defect deviation expression through the normal film prediction map and the residual decoupling result. In this embodiment, defect samples in the training data are used to learn the mapping relationship from residual to category, while qualified samples are used to learn the normal film baseline. The boundaries between the two types of data are clear. The advantage of this embodiment is that normal background modeling and defect category discrimination are supported by different data sources. Batch differences mainly enter the background reconstruction link, and defect identification mainly relies on the residual expression relative to the normal film surface, reducing the model's dependence on the original grayscale distribution of a specific batch.

[0038] In a preferred embodiment, the system maintains a unified processing record under uniform film coordinates for continuously input Mylar tape surface images. The image preprocessing module establishes length and width coordinates for each image to be inspected, and the candidate abnormal regions output by the candidate region generation submodule are all written into the unified film coordinates. If the same defect is segmented into adjacent candidate regions in adjacent images, the contour correction submodule can merge them based on the film unit association map and cross-scale node index at the image boundary. This merging does not depend on additional acquisition objects, but is completed using existing tape direction normalization, local film unit index, and candidate region attribute table. For long and thin scratches that cross image boundaries, if the long strip-scale film unit at the end of the previous image and the long strip-scale film unit at the beginning of the next image are consistent in texture direction, fusion residual, and category confidence vector, a common instance number is established in the candidate region attribute table; for bright spot candidates that only appear in a single image and do not match the continuity relationship in the association map, the contour correction submodule maintains its independent instance state and hands it over to the morphological constraint discrimination submodule to recalculate the category score. The unified film surface coordinates can also be used to output the position of defects in the length and width directions of the tape. The defect contour is expressed using these coordinates, avoiding the inability to merge outputs from different image segments. The advantage of this embodiment is that the system uses the same film surface coordinates to describe the residuals within a single image, cross-scale candidate regions, and candidate regions at the boundaries of adjacent images. The continuous contours of slender defects and the local contours of point defects can be represented in the same output format.

[0039] In one embodiment, the system can establish closed-loop verification logic for abnormal and normal samples. Closed-loop verification does not change the basic detection process; instead, after defect discrimination output, the output result is used to check the stability of the membrane background reconstruction. For candidate regions identified as defects, the system prohibits their corresponding local membrane units from being written into the defect-free membrane feature dictionary. For image segments identified as normal but with reconstruction errors concentrated in boundary abrupt change areas, the normal sample confidence update submodule lowers their confidence score. For image segments identified as normal with dispersed reconstruction errors and stable batch style coding, the system uses them as incremental normal samples in the background baseline update. This verification logic establishes a data constraint relationship between the defect discrimination output module and the background reconstruction module, preventing the background dictionary from remaining in the initial qualified sample state for a long time and preventing suspected abnormal regions from entering normal background data. Specifically, when a local membrane unit repeatedly exhibits low residual, low edge abruptness, and high batch style stability in the current batch, its style vector can be written into the batch style library. When a local membrane unit repeatedly shows high residual at the same location in different images and is classified as a defect by the morphological constraint discrimination submodule, its content vector does not participate in the update of the defect-free membrane feature dictionary. The advantage of this embodiment is that the normal membrane baseline remains consistent with the visual state of the current batch as the reliable samples are updated, defective regions are excluded from the normal sample update through candidate anomaly results, and the stability of background reconstruction and the data boundary of defect discrimination are maintained.

[0040] In a preferred embodiment, the functional modules of the system can be deployed within the same image processing flow using a computer program. The membrane surface characterization data output by the image preprocessing module, the normal membrane surface prediction map output by the membrane surface background reconstruction module, the multi-scale residual map output by the residual decoupling module, and the candidate region attribute table output by the defect discrimination output module are all transmitted using a unified data object. This unified data object includes at least image coordinates, membrane surface coordinates, local membrane surface unit numbers, cross-scale node indexes, residual map indexes, and category result indexes. After the image preprocessing module writes the orientation reference and membrane surface unit fields, the membrane surface background reconstruction module reads the same local membrane surface unit number and writes it into the predicted background field; the residual decoupling module reads the image field to be inspected and the predicted background field and writes it into the residual field; the defect discrimination output module reads the residual field and the morphological description field and writes it into the category field and the contour field. This data object eliminates redundant coordinate conversions between modules and avoids different modules generating different numbers for the same image region. If the system performs background reconstruction and defect identification separately in different software processes, a unified data object can be serialized into data records containing field names, field values, and coordinate indices, and the field integrity can be verified before defect identification. Field integrity verification includes checking whether local membrane unit numbers are continuous, whether cross-scale node indices have parent-child node correspondence, whether the normal membrane prediction map covers the detection area, and whether the residual map has the same membrane coordinate range as the image to be inspected. The advantage of this embodiment is that image preprocessing, background reconstruction, residual decoupling, and result output in the visual recognition process are connected by a unified data object, reducing boundary offsets caused by repeated calculations, and enabling defect contours and category results to be traced back to the corresponding membrane characterization, normal background, and residual source.

Claims

1. A visual recognition-based Mylar tape surface defect detection system, characterized in that, It includes an image preprocessing module, a membrane background reconstruction module, a residual decoupling module, and a defect discrimination output module; The image preprocessing module performs strip orientation normalization, detection area cropping, and local film unit division on the Mylar tape surface image to obtain film surface characterization data including brightness distribution and texture direction. The membrane background reconstruction module learns the normal membrane visual baseline based on qualified Mylar tape samples and generates a normal membrane prediction map based on the membrane characterization data. The residual decoupling module generates a multi-scale residual map based on the Mylar tape surface image and the normal film surface prediction map. The defect discrimination output module determines the location, outline, and category of surface defects on Mylar tape based on the multi-scale residual map, which is a vision-based Mylar tape surface defect detection system.

2. The Mylar tape surface defect detection system based on visual recognition according to claim 1, characterized in that, The image preprocessing module includes a direction reference determination submodule, an illumination equalization submodule, and a film surface unit generation submodule; The orientation reference determination submodule determines the strip length orientation based on the edge texture direction and main texture projection of the Mylar tape. The illumination equalization submodule extracts the gradually varying brightness component along the length of the strip and separates the gradually varying brightness component from the candidate edges of local defects. The film surface unit generation submodule generates overlapping local film surface units according to the length and width directions of the strip, and configures brightness distribution, texture direction, edge sparsity and local uniformity identifiers for each local film surface unit.

3. The Mylar tape surface defect detection system based on visual recognition according to claim 1, characterized in that, The membrane background reconstruction module includes a normal sample encoding submodule, a visual baseline generation submodule, and a prediction map constraint submodule; The normal sample encoding submodule establishes a defect-free membrane surface feature dictionary based on qualified Mylar tape samples; The visual baseline generation submodule performs local matching between the membrane surface characterization data and the defect-free membrane surface feature dictionary to generate a normal membrane surface feature map corresponding to the Mylar tape surface image. The prediction map constraint submodule reconstructs and constrains the normal film surface feature map based on texture direction continuity, brightness gradient continuity, and edge sparsity to obtain the normal film surface prediction map.

4. The Mylar tape surface defect detection system based on visual recognition according to claim 1, characterized in that, The residual decoupling module includes a pixel residual calculation submodule, a texture residual calculation submodule, and a semantic residual fusion submodule; The pixel residual calculation submodule performs corresponding pixel difference analysis on the Mylar tape surface image and the normal film surface prediction image to obtain a pixel residual map. The texture residual calculation submodule generates a directional residual map based on the texture direction changes of local membrane units; The semantic residual fusion submodule performs scale alignment and confidence fusion on the pixel residual map, the orientation residual map, and the deep anomaly features output by the visual coding network to form the multi-scale residual map.

5. The Mylar tape surface defect detection system based on visual recognition according to claim 2, characterized in that, The membrane unit generation submodule also establishes a membrane unit association diagram based on the differences in texture direction and the gradual slope of brightness variation between adjacent local membrane units. Each node in the membrane unit association graph corresponds to a local membrane unit, and each side records the texture continuity of adjacent local membrane units in the length direction, width direction, and oblique neighborhood. The image preprocessing module marks the reflective continuous region, texture continuous region, and boundary abrupt region according to the film unit association map. The boundary abrupt region includes local film units whose edge direction is inconsistent with the neighborhood texture direction, and the marking results are incorporated into the film characterization data.

6. The Mylar tape surface defect detection system based on visual recognition according to claim 3, characterized in that, The visual baseline generation submodule includes a batch style coding branch and a defect-independent content coding branch; The batch style coding branch extracts the film background color, overall reflectivity and fine texture density from qualified Mylar tape samples to form a style vector; The defect-independent content encoding branch extracts local continuous textures and sparse distributions of normal edges to form a content vector based on the defect-free membrane feature dictionary; The normal membrane feature map is generated by cross-attention matching of the style vector and the content vector, and edge mutation features from candidate abnormal regions are masked during the generation process.

7. The Mylar tape surface defect detection system based on visual recognition according to claim 4, characterized in that, The semantic residual fusion submodule includes a residual consistency gating submodule and a candidate region generation submodule; The residual consistency gating submodule performs spatial correspondence judgment on the pixel residual map, the orientation residual map and the deep anomaly features to form a consistent residual mask; The candidate region generation submodule generates candidate anomalous regions based on the consistent residual mask, and configures length-to-width ratio, boundary closure, grayscale diffusion, and orientation abruptness descriptors for the candidate anomalous regions. The defect discrimination output module forms a category confidence vector based on the descriptive quantity and the multi-scale residual map.

8. The Mylar tape surface defect detection system based on visual recognition according to claim 2, characterized in that, The image preprocessing module also includes an adaptive unit scale selection submodule; The adaptive unit scale selection submodule generates fine-scale, medium-scale, and strip-scale film surface units simultaneously for the same Mylar tape surface image based on the number of continuous nodes in the same direction, the span of the reflective continuous area, and the distribution density of the boundary abrupt area in the film surface unit association diagram. Different scale membrane units share the coordinate references in the length and width directions of the strip, and record the corresponding relationship through cross-scale node index.

9. The Mylar tape surface defect detection system based on visual recognition according to claim 1, characterized in that, The membrane background reconstruction module also includes a reliable update submodule for normal samples; The normal sample reliable update submodule selects Mylar tape surface images that do not contain candidate abnormal regions and have stable batch style coding from the detection results as incremental normal samples, and writes the style vector and content vector of the incremental normal samples into the batch style library and the defect-free membrane feature dictionary, respectively. Before writing, the incremental normal samples are sorted by local reconstruction error to remove samples whose reconstruction errors are concentrated in boundary abrupt regions or reflective continuous regions.

10. The Mylar tape surface defect detection system based on visual recognition according to claim 7, characterized in that, The defect discrimination output module also includes a shape constraint discrimination submodule and a contour correction submodule; The morphological constraint discrimination submodule inputs the category confidence vector into the morphological template branches corresponding to scratches, bubbles, dirt, indentations and wrinkles respectively, and forms the target defect category based on the length-to-width ratio, boundary closure, gray-scale diffusion and directional change degree. The contour correction submodule generates defect contours along the connected boundaries of a consistent residual mask within the candidate anomaly region, and splits interconnected regions with different class confidence vectors into multiple defect instances.