Polypropylene film defect detection method, equipment and medium
Through multimodal image processing methods, combined with feature extraction and attention calculation of visible light and infrared images, the problems of insufficient detection stability and generalization ability in polypropylene film inspection are solved, efficient and accurate film defect detection and positioning are achieved, and the intelligent level of industrial quality control is improved.
Patent Information
- Application Number
- CN202510611408.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-13
- Publication Date
- 2025-09-23
AI Technical Summary
Existing technologies for polypropylene film defect detection are limited by lighting variations, material differences, and the diversity of defect types, resulting in insufficient detection stability and generalization capabilities, and making it difficult to adapt to industrial detection needs where abnormal samples are scarce.
A multimodal image processing method is adopted, combining visible light and infrared images, and defect detection and positioning are performed through multi-scale feature extraction, channel attention and spatial attention calculation. Unsupervised learning is used to construct an image dataset, eliminating the dependence on labeled abnormal samples.
It achieves efficient and accurate thin film defect detection, improves detection efficiency and accuracy, reduces missed detection rate and false detection rate, and enhances the intelligent level of industrial quality control.
Smart Images

Figure CN120689273A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to, but are not limited to, the field of image processing, and in particular to a method, device, and medium for detecting defects in polypropylene films. Background Art
[0002] During the production process, polypropylene film is prone to defects such as wrinkles, bubbles, and white spots due to process factors such as extrusion, stretching, and cooling. These defects affect the product's appearance and performance, necessitating defect inspection before shipment. In the field of defect detection, single-modality detection methods are often limited by factors such as lighting variations, material differences, and the diversity of defect types, resulting in limited detection stability and generalization capabilities. Multimodal data has varying feature distributions, and existing supervised methods often rely on a large number of labeled anomaly samples, making them difficult to adapt to the reality of the scarcity of anomaly samples in industrial defect detection. Summary of the Invention
[0003] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
[0004] The embodiments of the present application provide a polypropylene film defect detection method, apparatus, and medium without relying on labeled abnormal samples.
[0005] An embodiment of the first aspect of the present application is a method for detecting defects in a polypropylene film, comprising:
[0006] Acquiring a polypropylene film image, screening normal samples in the polypropylene film image to construct an image data set, wherein the polypropylene film image includes a visible light image and an infrared image;
[0007] extracting multi-scale features of the polypropylene film image in the image dataset;
[0008] Performing channel attention and spatial attention calculation on the multi-scale features to obtain a first feature;
[0009] Convert the first features of different scales into second features of the same channel;
[0010] Performing nonlinear transformation and local spatial feature extraction on the second feature to obtain a third feature;
[0011] Defect detection and defect location are performed based on the third feature to obtain a detection result.
[0012] According to certain embodiments of the first aspect of the present application, after acquiring the polypropylene film image, the method includes:
[0013] detecting corner points as key points from the polypropylene film image based on intensity differences between a pixel point and adjacent pixels;
[0014] Determine the direction of the key point, adapt the key point to rotate according to the direction to generate a binary feature descriptor, and calculate the distance between the key points according to the binary feature descriptor of the visible light image and the binary feature descriptor of the infrared image;
[0015] Feature matching is performed on visible light images and infrared images based on the distance between key points.
[0016] According to certain embodiments of the first aspect of the present application, extracting multi-scale features of the polypropylene film image in the image dataset includes:
[0017] performing convolution and pooling on the polypropylene film image to obtain a first sub-extraction feature;
[0018] The first sub-extracted features are subjected to different residual modules and convolution modules of different sizes to obtain second sub-extracted features of different sizes;
[0019] The second sub-extracted features are concatenated and convolved to obtain multi-scale features.
[0020] According to certain embodiments of the first aspect of the present application, performing channel attention and spatial attention calculation on the multi-scale feature to obtain the first feature includes:
[0021] Performing global maximum pooling of the spatial dimension on the multi-scale features to obtain global maximum pooling features, and performing global average pooling of the spatial dimension on the multi-scale features to obtain global average pooling features;
[0022] Sending the global maximum pooling feature and the global average pooling feature into a shared multi-layer perceptron for learning;
[0023] The output results of the multi-layer perceptron are summed and mapped with the activation function to obtain the channel attention features;
[0024] The channel attention features are sequentially processed with global maximum pooling and global average pooling in the channel dimension;
[0025] The pooling results of the channel attention features are spliced according to the channels, and the splicing results are subjected to convolution operation and activation function mapping to obtain the first feature.
[0026] According to certain embodiments of the first aspect of the present application, converting the first features of different scales into second features of the same channel includes:
[0027] Performing channel alignment on the first features of different scales through convolution to obtain channel alignment results with the same channels;
[0028] Performing channel fusion on the channel alignment result according to a reversible linear transformation matrix to obtain a channel fusion result;
[0029] The channel fusion result is subjected to batch normalization and activation normalization to obtain a second feature.
[0030] According to certain embodiments of the first aspect of the present application, performing nonlinear transformation and local spatial feature extraction on the second feature to obtain the third feature includes:
[0031] Performing a convolution operation and a ReLU activation function on the second feature to obtain a nonlinear transformation result;
[0032] A convolution operation is performed on the nonlinear transformation result to obtain a third feature.
[0033] According to certain embodiments of the first aspect of the present application, the defect detection comprises the following steps:
[0034] Mapping the third feature to a standard Gaussian distribution, and calculating the log-likelihood of the third feature;
[0035] The first anomaly score is obtained by multiplying and aggregating the log likelihoods of different scales;
[0036] A defect detection result is determined according to the first abnormality score.
[0037] According to certain embodiments of the first aspect of the present application, the defect localization comprises the following steps:
[0038] Mapping the third feature to a standard Gaussian distribution, and calculating the log-likelihood of different pixel points of the third feature;
[0039] The log-likelihood of different pixels is added and aggregated to obtain the second anomaly score;
[0040] generating an anomaly heat map according to the second anomaly score;
[0041] The abnormal heat map is binarized according to a preset threshold value and segmented to obtain the abnormal area.
[0042] An embodiment of the second aspect of the present application is an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the polypropylene film defect detection as described in the embodiment of the first aspect of the present application is implemented.
[0043] An embodiment of the third aspect of the present application is a computer storage medium, characterized in that it stores computer-executable instructions, and the computer-executable instructions are used to perform the polypropylene film defect detection as described in the embodiment of the first aspect of the present application.
[0044] The above scheme has at least the following beneficial effects: constructing an image data set by screening normal samples in polypropylene film images; extracting multi-scale features of polypropylene film images; performing channel attention and spatial attention calculations on the multi-scale features to obtain a first feature; converting the first features of different scales into second features of the same channel by channel conversion; performing nonlinear transformation and local spatial feature extraction on the second features to obtain a third feature; performing defect detection and defect location based on the third feature to obtain a detection result; getting rid of the prior need for a large number of defect samples in traditional detection, and being able to achieve efficient defect detection after learning from a large number of normal samples; being suitable for complex industrial links, and being able to detect film defects in real time during the production process, effectively improving the detection accuracy and efficiency on the film production line, reducing the missed detection rate and false detection rate of product quality, thereby ensuring the quality of the film and improving the intelligent level of industrial quality control.
[0045] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings are used to provide a further understanding of the technical solution of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the technical solution of the present invention and do not constitute a limitation to the technical solution of the present invention.
[0047] Figure 1 It is a step diagram of a polypropylene film defect detection method;
[0048] Figure 2 is a step diagram of the image registration steps;
[0049] Figure 3 It is a sub-step diagram of step S200;
[0050] Figure 4 It is a sub-step diagram of step S300;
[0051] Figure 5 It is a sub-step diagram of step S400;
[0052] Figure 6 is a sub-step diagram of step S500;
[0053] Figure 7 It is a step diagram of defect detection;
[0054] Figure 8 It is a step diagram for defect location;
[0055] Figure 9 is a schematic diagram of the defect detection model;
[0056] Figure 10 It is a schematic diagram of the feature extraction network;
[0057] Figure 11 It is a schematic diagram of the residual module;
[0058] Figure 12 is a schematic diagram of the channel space attention network;
[0059] Figure 13 is a schematic diagram of the channel attention module;
[0060] Figure 14 is a schematic diagram of the spatial attention module;
[0061] Figure 15 It is a schematic diagram of the flow model. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0063] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and the like in the specification, claims, or accompanying drawings are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.
[0064] The present invention provides a polypropylene film defect detection method, which is applied to a defect detection model. The structure of the defect detection model is shown in Figure 2. Figure 9 .
[0065] Reference Figure 1 , a polypropylene film defect detection method comprises the following steps:
[0066] Step S100, acquiring a polypropylene film image including a visible light image and an infrared image, screening normal samples in the polypropylene film image to construct an image dataset;
[0067] Step S200, extracting multi-scale features of the polypropylene film image in the image dataset;
[0068] Step S300, performing channel attention and spatial attention calculation on the multi-scale features to obtain a first feature;
[0069] Step S400, converting the first features of different scales into second features of the same channel;
[0070] Step S500, performing nonlinear transformation and local spatial feature extraction on the second feature to obtain a third feature;
[0071] Step S600: perform defect detection and defect location according to the third feature to obtain a detection result.
[0072] In step S100, a high-resolution infrared thermal imager (such as the FLIRA615) and an industrial camera (such as the Basler ac A1920-40gc) are used to capture infrared and visible light images of polypropylene (BOPP) film, respectively. The infrared thermal imager can detect the temperature distribution on the material surface and capture temperature differences caused by anomalies such as thickness variations, wrinkles, or bubbles; while the industrial camera provides high-resolution visible light images to detect physical defects on the film surface, such as white spots, scratches, and foreign matter. To ensure the synchronous acquisition of multimodal data, the system uses a hardware trigger synchronization mechanism to simultaneously activate the exposure of the infrared thermal imager and the industrial camera through an external trigger signal, ensuring the temporal consistency of the two modal images.
[0073] Due to the differences between infrared and visible light imaging, direct comparison may result in pixel mismatches, affecting subsequent anomaly detection. Efficient image registration methods are used to improve the alignment accuracy of cross-modal data and meet the real-time requirements of industrial inspection.
[0074] Reference Figure 2 , the image registration step includes the following steps:
[0075] Step S110 , detecting corner points as key points from the polypropylene film image based on intensity differences between the pixel points and adjacent pixel points;
[0076] Step S120, determining the direction of the key point, adaptively rotating the key point according to the direction to generate a binary feature descriptor, and calculating the distance between the key points based on the binary feature descriptor of the visible light image and the binary feature descriptor of the infrared image;
[0077] Step S130 : performing feature matching on the visible light image and the infrared image according to the distance between the key points.
[0078] Corner points are extracted from infrared and visible light images as key points, and preliminary feature matching is performed. For a pixel point p and its surrounding circular neighborhood, if there is a large intensity difference between the pixel point and its multiple adjacent pixels, the pixel point is considered to be a corner point. The judgment condition for corner point detection can be expressed as: Among them, S is the number of pixels in the area that meet the corner point judgment; I p is the intensity value of the center pixel; I i is the intensity value of the pixel in the area; T is the threshold; δ(·) is the indicator function, which outputs 1 if the condition is met, otherwise 0.
[0079] Since there are differences in texture and grayscale information between infrared images and visible light images, the feature vector is generated by calculating the binary of the key point neighborhood to improve the robustness.
[0080] In order to enhance the rotation invariance, the direction of the key point is calculated by the image moment, and the direction of the key point is expressed as: in, M 01 and M 10 They represent the first-order moments, which are used to determine the orientation of the key points so that the descriptor can adapt to rotation changes.
[0081] In the feature matching stage, let the key point set in the infrared image be A={a1,a2,…,a n}, the key point set in the visible light image is B = {b1,b2,…,b n}, each key point a i and b j Generate binary feature descriptor A i and B j The matching between key points is obtained by calculating the Hamming distance: Among them, A i and B j are the descriptors of key points ai and bj in infrared and visible light images respectively; N is the length of the descriptor; the smaller the Hamming distance, the higher the similarity of feature matching.
[0082] After collecting images of multiple batches of polypropylene film on the production line, a combination of manual screening and automated inspection was used to eliminate samples with obvious defects and establish a high-quality normal dataset. To improve the model's generalization capabilities, during the data augmentation phase, data amplification was performed on normal samples, using techniques such as random rotation, rescaling, and affine transformations to increase sample diversity. Finally, the preprocessed data was divided into a training set and a test set. The training set contained only normal samples, enabling the unsupervised flow model to learn the probability distribution of normal patterns. The test set included both normal and abnormal samples to evaluate the model's defect detection capabilities and ensure its reliability and accuracy in practical applications.
[0083] Reference Figure 3 , for step S200, extracting multi-scale features of the polypropylene film image in the image dataset includes the following steps:
[0084] Step S210, performing convolution and pooling on the polypropylene film image to obtain a first sub-extraction feature;
[0085] Step S220, the first sub-extracted features are processed through different residual modules and convolution modules of different sizes to obtain second sub-extracted features of different sizes;
[0086] Step S230: Concatenate and convolve the second sub-extracted features to obtain multi-scale features.
[0087] Reference Figure 10 In a feature extraction network, there are three stages: Stage 1, Stage 2, and Stage 3, which serve as feature extraction layers. Stage 4 is discarded to retain more spatial detail information and ensure the detection model's sensitivity to small defects. The infrared image and the visible light image are convolved through a convolution layer and then pooled through a pooling layer to obtain the first sub-extracted feature. The first sub-extracted feature is passed through the first residual module and a 5x5 convolution layer to obtain the first second sub-extracted feature; the first sub-extracted feature is passed through the second residual module and a 3x3 convolution layer to obtain the second second sub-extracted feature; the first sub-extracted feature is passed through the third residual module and a 1x1 convolution layer to obtain the third second sub-extracted feature. The three second sub-extracted features are connected and convolved to obtain multi-scale features. The multi-scale features include the infrared feature map corresponding to the infrared image and the visible light feature map corresponding to the visible light image.
[0088] Among them, reference Figure 11 In the residual module, the input features are sequentially convolved through 1x1 convolution, 3x3 convolution, and 1x1 convolution, and the convolution results are connected with the input features. The connection results pass through the ReLU activation function layer to obtain the output features.
[0089] Stage 1 extracts lower-level features such as edges, corners, and fine textures, which are suitable for detecting tiny defects and output y1; Stage 2 further extracts local structural information and appropriately downsamples the spatial resolution to improve the perception of medium-sized defects and input y2; Stage 3 uses a deeper Bottleneck structure, which is mainly used to capture the overall morphology of large-scale defects, improve the global consistency of detection, and output y3.
[0090] A multi-scale feature extraction strategy is adopted to combine high-resolution spatial information and low-resolution global information to improve the robustness of detection.
[0091] Reference Figure 4 , for step S300, performing channel attention and spatial attention calculation on the multi-scale features to obtain the first feature includes the following steps:
[0092] Step S310: performing global maximum pooling of the spatial dimension on the multi-scale features to obtain global maximum pooling features, and performing global average pooling of the spatial dimension on the multi-scale features to obtain global average pooling features;
[0093] Step S320, sending the global maximum pooling feature and the global average pooling feature into a shared multi-layer perceptron for learning;
[0094] Step S330, summing the output results of the multilayer perceptron and performing activation function mapping processing to obtain channel attention features;
[0095] Step S340: performing global maximum pooling and global average pooling on the channel-dimensional channel attention features in sequence;
[0096] In step S350, the pooling results of the channel attention features are spliced according to the channels, and the splicing results are subjected to convolution operation and activation function mapping processing to obtain the first feature.
[0097] Reference Figure 12 、 Figure 13 and Figure 14 In a channel-spatial attention network, after feature extraction of infrared and visible light images, directly concatenating or adding features from different modalities can lead to information redundancy or loss of key features. By combining channel-attention and spatial-attention through feature fusion, the network automatically learns the importance of channels or regions. Channel-attention calculates feature weights through global pooling, enhancing the representation of key features. Spatial-attention extracts spatial information through max-pooling and average-pooling combined with 3×3 convolutions, allowing the network to focus more on abnormal regions. This achieves multimodal attention fusion.
[0098] Before entering the flow model, the flow model needs to ensure that the feature maps have the same spatial resolution for subsequent probability modeling. Therefore, the flow model uses an additional downsampling operation to make y1, y2 and y3 have the same resolution:
[0099] y1 is downsampled to 2×2 twice, y2 is downsampled to 2×2 once, and y3 is not downsampled. Features of all scales are adjusted to the same resolution.
[0100] Reference Figure 5 , for step S400, converting the first features of different scales into second features of the same channel by performing channel conversion, including:
[0101] Step S410, performing channel alignment on the first features of different scales through convolution to obtain a channel alignment result with the same channel;
[0102] Step S420, performing channel fusion on the channel alignment result according to the reversible linear transformation matrix to obtain a channel fusion result;
[0103] Step S430: performing batch normalization and activation normalization on the channel fusion result to obtain the second feature.
[0104] Ensure that features y1, y2, and y3 from different scales can be converted to the same number of channels, and stabilize their distribution through channel transformation to prepare for subsequent feature fusion.
[0105] Reference Figure 15 In the flow model, since the number of channels of y1, y2, and y3 is different, a 1×1 convolution with a fixed number of channels is required to make the number of channels of all features the same. Let the target number of channels be C out , the feature y at each scale i After 1×1 convolution W 1×1 Transformation, expressed as: i=1,2,3; where W 1×1 It is C out× C in The learnable weight matrix ensures Have the same number of channels C out , which is convenient for subsequent fusion and modeling.
[0106] After the features of the same scale are aligned in channels, they need to be further fused through a reversible linear transformation W to increase the information interaction between scales. A reversible matrix W is used for channel transformation, which is expressed as: i=1,2,3; where W is a C out× C out The square matrix ensures the reversibility of the transformation so that subsequent flow modeling does not lose information. This transformation is similar to a 1×1 reversible convolution, but focuses more on mixing between channels rather than dimensionality reduction or dimensionality increase.
[0107] Features after channel fusion They may have different statistical distributions, so they need to be normalized to ensure that they can be correctly fused before the fusion flow. Normalization operations include batch normalization and activation normalization.
[0108] Batch normalization makes the numerical range of features of different scales consistent, avoiding mismatches during fusion stream processing, and also helps accelerate training and improve gradient stability. Batch normalization calculates mini-batch statistics (mean and standard deviation) for normalization, which is expressed as: i=1,2,3; where μ and σ are the mean and standard deviation calculated within the mini-batch.
[0109] Activation normalization directly learns the global mean and standard deviation to stabilize the distribution of features. It is suitable for unsupervised learning tasks with small batch training and further improves the stability of probabilistic modeling. Activation normalization is expressed as: i = 1, 2, 3; where b and s are learnable global mean and standard deviation parameters.
[0110] Reference Figure 6 , for step S500, performing nonlinear transformation and local spatial feature extraction on the second feature to obtain the third feature, including the following steps:
[0111] Step S510, performing a convolution operation and a ReLU activation function processing on the second feature to obtain a nonlinear transformation result;
[0112] Step S520: performing a convolution operation on the nonlinear transformation result to obtain a third feature.
[0113] In order to further enhance the feature expression capability, two layers of 3×3 convolution + ReLU are used to perform channel expansion, mixing and compression, so that the features of each scale are richer in the channel dimension and more adaptable to flow model modeling.
[0114] The first layer of 3×3 convolution (channel expansion + local feature extraction) is expressed as: in, Use 3×3 convolution kernel and expand the channel to C exp (General C exp >C orig ). ReLU activation introduces nonlinearity, which enables features to adaptively fuse channel information and improve the separability of features.
[0115] The second layer of 3×3 convolution (channel compression + information reorganization) is expressed as: in, Use 3×3 convolution again to compress the number of channels back to C orig , ensuring that the output matches the number of input channels; since the first layer of convolution has expanded the number of channels, information between different channels can be shared, and the second layer of convolution reorganizes this information; the final output It has stronger channel expression capabilities and can adapt to flow models for probabilistic modeling.
[0116] In step S600, defect detection and location are performed based on the third feature to obtain a detection result. The core of anomaly detection and location lies in the normalization flow. The main goal of the normalization flow is to learn the probability distribution of normal samples, so that during the inference phase, the degree of abnormality of the sample can be calculated through log-likelihood and the abnormal area can be further located.
[0117] Reference Figure 7 , wherein defect detection includes the following steps:
[0118] Step S611, mapping the third feature to a standard Gaussian distribution, and calculating the log-likelihood of the third feature;
[0119] Step S612, performing multiplication aggregation on the log-likelihoods of different scales to obtain a first anomaly score;
[0120] Step S613: Determine a defect detection result according to the first abnormality score.
[0121] The features z1, z2, and z3 output by the fusion stream are fed into the normalization stream NF, which maps them to a standard Gaussian distribution and calculates the log-likelihood of the input sample. To obtain the final global anomaly score, a multiplicative aggregation method is used to jointly calculate the log-likelihoods of different scales. Multiplicative aggregation can be expressed as follows: Multiplicative aggregation can effectively combine information from multiple scales. If the log-likelihood value of a certain scale is low, the overall score will also decrease, thereby enhancing the robustness of anomaly detection. The final anomaly score S image The higher the value, the more likely the image is an abnormal sample as a whole. This allows for pixel-by-pixel detection.
[0122] Reference Figure 8 , defect localization includes the following steps:
[0123] Step S621, mapping the third feature to a standard Gaussian distribution, and calculating the log-likelihood of different pixel points of the third feature;
[0124] Step S622, performing additive aggregation on the log-likelihoods of different pixel points to obtain a second anomaly score;
[0125] Step S623, generating an anomaly heat map according to the second anomaly score;
[0126] In step S624, the abnormal heat map is binarized according to a preset threshold value, and the abnormal area is obtained by segmentation.
[0127] To determine the location of anomalies, it is necessary to calculate the degree of anomaly at different pixel points in the image. Using the additive aggregation method, the anomaly scores of different scales are accumulated point by point to enhance the ability to detect local anomalies. Additive aggregation can be expressed as follows: Additive aggregation allows the superposition of abnormal information at different scales, making it easier to locate local abnormal areas. The calculated pixel-level abnormality score S pixel (x,y) can be used to generate anomaly heatmaps, visualizing anomaly distribution through color. Finally, a threshold is set to binarize the heatmap to accurately segment the anomaly region, achieving pixel-by-pixel localization.
[0128] The captured infrared and visible light images are preprocessed and fed into a defect detection model. The model then calculates and detects defects in the image and locates them. If a film defect is detected, the film defect management platform immediately integrates relevant information, including the time the film image was captured, the original image, and specific production line information, and feeds it back to the display terminal module for staff. Relevant staff then inspect the specific film production line and implement countermeasures, effectively reducing the probability of film defects in subsequent production and ensuring product quality.
[0129] This polypropylene film defect detection method eliminates the need for traditional testing to rely on a large number of defect samples. Instead, it achieves highly efficient defect detection after learning from a large number of normal samples. This method is suitable for complex industrial processes and can detect film defects in real time during the production process. It effectively improves the accuracy and efficiency of film production lines, reduces missed detection rates and false positive rates, thereby ensuring film quality and enhancing the level of intelligent industrial quality control.
[0130] The present application also provides an electronic device. The electronic device includes a memory and a processor. The memory stores a computer program, and the processor implements the polypropylene film defect detection method described above when executing the computer program. The electronic device can be any smart terminal, including a tablet computer and an in-vehicle computer.
[0131] The processor can be implemented in the form of a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application; the memory can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory and is called by the processor to execute the data analysis method of the embodiments of the present application.
[0132] The input / output interface is used to realize information input and output; the communication interface is used to realize communication interaction between this device and other devices. Communication can be achieved through wired methods (such as USB, network cable, etc.) or wireless methods (such as mobile network, WIFI, Bluetooth, etc.); the bus transmits information between the various components of the device (such as processor, memory, input / output interface and communication interface); among them, the processor, memory, input / output interface and communication interface realize communication connection with each other within the device through the bus.
[0133] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned polypropylene film defect detection method is implemented.
[0134] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0135] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0136] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0137] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0138] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.
[0139] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0140] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0141] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0142] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0143] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0144] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: various media that can store programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0145] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above implementation. Those skilled in the art can also make various equivalent modifications or substitutions under the shared conditions that do not violate the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present invention.
Claims
1. A polypropylene film defect detection method, characterized in that: include: Acquiring a polypropylene film image, screening normal samples in the polypropylene film image to construct an image data set, wherein the polypropylene film image includes a visible light image and an infrared image; extracting multi-scale features of the polypropylene film image in the image dataset; Performing channel attention and spatial attention calculation on the multi-scale features to obtain a first feature; Convert the first features of different scales into second features of the same channel; Performing nonlinear transformation and local spatial feature extraction on the second feature to obtain a third feature; Defect detection and defect location are performed based on the third feature to obtain a detection result.
2. A polypropylene film defect detection method according to claim 1, characterized in that: After acquiring the polypropylene film image, the method includes: detecting corner points as key points from the polypropylene film image based on intensity differences between a pixel point and adjacent pixels; Determine the direction of the key point, adapt the key point to rotate according to the direction to generate a binary feature descriptor, and calculate the distance between the key points according to the binary feature descriptor of the visible light image and the binary feature descriptor of the infrared image; Feature matching is performed on visible light images and infrared images based on the distance between key points.
3. A polypropylene film defect detection method according to claim 1, characterized in that: The extracting multi-scale features of the polypropylene film image in the image dataset includes: performing convolution and pooling on the polypropylene film image to obtain a first sub-extraction feature; The first sub-extracted features are subjected to different residual modules and convolution modules of different sizes to obtain second sub-extracted features of different sizes; The second sub-extracted features are concatenated and convolved to obtain multi-scale features.
4. A polypropylene film defect detection method according to claim 1, characterized in that: The performing channel attention and spatial attention calculation on the multi-scale feature to obtain a first feature includes: Performing global maximum pooling of the spatial dimension on the multi-scale features to obtain global maximum pooling features, and performing global average pooling of the spatial dimension on the multi-scale features to obtain global average pooling features; Sending the global maximum pooling feature and the global average pooling feature into a shared multi-layer perceptron for learning; The output results of the multi-layer perceptron are summed and mapped with the activation function to obtain the channel attention features; The channel attention features are sequentially processed with global maximum pooling and global average pooling in the channel dimension; The pooling results of the channel attention features are spliced according to the channels, and the splicing results are subjected to convolution operation and activation function mapping to obtain the first feature.
5. The method for detecting defects in a polypropylene film according to claim 1, wherein: The converting the first features of different scales into second features of the same channel includes: Performing channel alignment on the first features of different scales through convolution to obtain channel alignment results with the same channels; Performing channel fusion on the channel alignment result according to a reversible linear transformation matrix to obtain a channel fusion result; The channel fusion result is subjected to batch normalization and activation normalization to obtain a second feature.
6. A polypropylene film defect detection method according to claim 1, characterized in that: The step of performing nonlinear transformation and local spatial feature extraction on the second feature to obtain a third feature includes: Performing a convolution operation and a ReLU activation function on the second feature to obtain a nonlinear transformation result; A convolution operation is performed on the nonlinear transformation result to obtain a third feature.
7. The method for detecting defects in a polypropylene film according to claim 1, wherein: The defect detection comprises the following steps: Mapping the third feature to a standard Gaussian distribution, and calculating the log-likelihood of the third feature; The first anomaly score is obtained by multiplying and aggregating the log likelihoods of different scales; A defect detection result is determined according to the first abnormality score.
8. The method for detecting defects in a polypropylene film according to claim 1, wherein: The defect location comprises the following steps: Mapping the third feature to a standard Gaussian distribution, and calculating the log-likelihood of different pixel points of the third feature; The log-likelihood of different pixels is added and aggregated to obtain the second anomaly score; generating an anomaly heat map according to the second anomaly score; The abnormal heat map is binarized according to a preset threshold value and segmented to obtain the abnormal area.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the polypropylene film defect detection method according to any one of claims 1 to 8 is implemented.
10. A computer storage medium, characterized in that Computer-executable instructions are stored, and the computer-executable instructions are used to execute the polypropylene film defect detection method according to any one of claims 1 to 8.
Citation Information
Cited By
Casting polypropylene film production monitoring method based on multi-source data analysis
CN120863034A
A Method for Monitoring the Production of Cast Polypropylene Film Based on Multi-Source Data Analysis
CN120863034B