A paper product defect detection method based on artificial intelligence
Through the artificial intelligence-based paper product defect detection method, using image processing and attention mechanism, the shortcomings of traditional detection methods are solved, efficient and accurate paper product defect identification and evaluation are achieved, and economic losses are reduced.
Patent Information
- Application Number
- CN202111524296.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-14
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2041-12-14
AI Technical Summary
Traditional paper product inspection methods cannot meet the requirements of high-speed, high-resolution and non-destructive intelligent inspection in industrial production, resulting in incomplete inspection and easily causing economic losses.
An artificial intelligence-based paper product defect detection method is adopted to achieve accurate identification and evaluation of paper product defects through image preprocessing, defect area extraction, defect image conversion, defect index calculation and defect degree assessment, combined with color and frequency domain attention mechanism.
It improves the detection accuracy and speed, avoids the inefficiency and subjectivity of manual detection, can quickly and accurately evaluate the defect status of paper products, and reduces the defective product rate.
Smart Images

Figure CN114170208B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of paper product defect detection, and in particular to a paper product defect detection method based on artificial intelligence. Background Art
[0002] As a primary form of packaging material for the food and pharmaceutical industries, paper products have become an indispensable raw material for industrial products. During the paper production process, defects such as insects, holes, black spots, lines, and wrinkles can easily appear on the paper surface due to factors such as production processes and on-site environmental factors. These defects not only affect the appearance of the paper product but, more importantly, reduce its performance. The paper industry has long sought to detect paper defects during production, eliminate the root causes, and control and improve paper surface quality.
[0003] Currently, traditional inspection methods, such as manual visual spot checks, are far from meeting the high-speed, high-resolution, and non-destructive intelligent testing requirements of modern industrial production. Furthermore, they cannot guarantee comprehensive paper inspection, which can easily cause significant economic losses to industrial enterprises. To address these issues, the present invention proposes an artificial intelligence-based paper product defect detection method that enables contactless inspection of paper products, avoiding the low efficiency and low accuracy of manual inspection. Summary of the Invention
[0004] In order to overcome the above-mentioned shortcomings of the prior art, the present invention provides a paper product defect detection method based on artificial intelligence.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: a paper product defect detection method based on artificial intelligence, comprising the following steps:
[0006] Preprocessing the collected paper product image to obtain a preprocessed paper product RGB image;
[0007] Extracting defect areas from the pre-processed paper product RGB image, and converting the pre-processed paper product RGB image into a binary defect image using the extracted defect areas;
[0008] Counting the sum of the number of pixels in each defect area in the binary defect image to obtain the area index of each defect area;
[0009] The defect area in the RGB image is extracted using the defect area of the binary defect image to obtain a defect RGB image;
[0010] The defect difference index of each defect area is obtained by the mean grayscale value of each defect area in the defect RGB image and the mean grayscale value of the corresponding position of the standard paper product;
[0011] Slide the window over each defect area in the defect RGB image, count the pixel value of each pixel in the window and the number of times the pixel value appears, and obtain the defect distribution index of each defect area;
[0012] The defect degree of the paper product is calculated by the area index, defect difference index and defect distribution index of each defect area, and the qualification of the paper product is judged according to the size of the defect degree of the paper product.
[0013] Furthermore, in the aforementioned artificial intelligence-based paper product defect detection method, the method for extracting defect areas from the pre-processed paper product RGB image is as follows:
[0014] Obtain R channel, G channel, B channel and brightness channel I images by preprocessing the paper product RGB image;
[0015] The R channel, G channel, B channel and brightness channel I images are analyzed to obtain a color attention binary map containing defect areas and non-defect areas;
[0016] Perform wavelet transform on the pre-processed paper product RGB image to obtain a low-frequency image and three high-frequency images;
[0017] The obtained low-frequency image and three high-frequency images are further processed to obtain a frequency domain attention binary image containing defect areas and non-defect areas;
[0018] The binary defect image is obtained through the color attention binary map and the frequency domain attention binary map.
[0019] Furthermore, the method for detecting paper product defects based on artificial intelligence is to analyze the R channel, G channel, B channel and brightness channel I images to obtain a color attention binary map containing defect areas and non-defect areas as follows:
[0020] The R channel, G channel, B channel and brightness channel I images are divided into multiple sub-blocks respectively;
[0021] Calculate the color contrast and spatial weight factor between every two sub-blocks of the R channel, G channel, B channel and brightness channel I images through multiple sub-blocks corresponding to the R channel, G channel, B channel and brightness channel I images respectively;
[0022] The attention index value of each sub-block of the R channel, G channel, B channel and brightness channel I image is calculated by the color contrast and spatial weight factor between every two sub-blocks of the R channel, G channel, B channel and brightness channel I image;
[0023] The final attention index value of each sub-block is obtained through the attention index value of each sub-block of the R channel, G channel, B channel and brightness channel I image;
[0024] Normalizing the final attention index value to obtain a normalized final attention index value;
[0025] An attention index threshold is set for the normalized final attention index value. If the normalized final attention index value is higher than the attention index threshold, the pixel value of the corresponding sub-block pixel is set to 1; if the normalized final attention index value is lower than the attention index threshold, the pixel value of the corresponding sub-block pixel is set to 0 to obtain a color attention binary map.
[0026] Furthermore, in the paper product defect detection method based on artificial intelligence, the method for reprocessing the obtained low-frequency image and three high-frequency images is as follows:
[0027] First, the wavelet coefficients corresponding to the low-frequency image are normalized, and then the low-frequency image is gamma transformed to obtain the processed low-frequency image;
[0028] Set wavelet coefficient thresholds for the wavelet coefficients corresponding to the three high-frequency images respectively, set the wavelet coefficients below the wavelet coefficient threshold to zero, and retain the wavelet coefficients above the wavelet coefficient threshold to obtain the three processed high-frequency images;
[0029] Performing inverse wavelet transform on the processed low-frequency image and the three high-frequency images to obtain inverse transformed images;
[0030] The pixel values of the pixels in the inverse transformed image that are within the set range are set to 0, and the pixel values of the pixels that are not within the set range are set to 1, and a frequency domain attention binary map is obtained.
[0031] Furthermore, in the paper product defect detection method based on artificial intelligence, the method for obtaining a binary defect image through a color attention binary image and a frequency domain attention binary image is as follows:
[0032] The fused image is obtained by setting different weights for the color attention binary map and the frequency domain attention binary map;
[0033] A pixel threshold is set for the pixel value of each pixel in the fused image. If the pixel value of a pixel is higher than the pixel threshold, the corresponding pixel is judged to be a defective pixel and the pixel value of the corresponding pixel is set to 1; if the pixel value of a pixel is lower than the pixel threshold, the corresponding pixel is judged to be a normal pixel and the pixel value of the corresponding pixel is set to 0 to obtain a binary defect image.
[0034] Furthermore, in the paper product defect detection method based on artificial intelligence, the expression of the defect degree of the paper product is:
[0035]
[0036] Where: Indicates the degree of defects of the paper product to be tested. represents the first parameter of the model, represents the first parameter of the model, represents the area index of the kth defective area, A represents the area index of the paper product image to be detected, k represents the kth defective area, and K represents the number of defective connected domains, that is, the number of defective areas. represents the defect difference index, Represents the distribution index of the k-th defect area.
[0037] Furthermore, in the paper product defect detection method based on artificial intelligence, the distribution index expression of the defect area is:
[0038]
[0039] Where: Indicates the number of window descriptors. The pixel values of three pixels in the window are a window descriptor. t represents the tth window descriptor. Indicates the number of times the t-th window descriptor appears in all window descriptors.
[0040] Furthermore, in the paper product defect detection method based on artificial intelligence, the expression of the defect difference index is:
[0041] ,
[0042] Where: represents the mean grayscale value of the pixel in the k-th defect area, Indicates the mean grayscale value of pixels at corresponding positions of standard paper products.
[0043] Furthermore, in the paper product defect detection method based on artificial intelligence, the expression of color contrast is:
[0044]
[0045] Where: Represents a sub-block and sub-blocks The color contrast between Represents a sub-block Types of R channel value / G channel value / B channel value / luminance channel I value in the image, Represents a sub-block Types of R channel value / G channel value / B channel value / luminance channel I value in the image, Represents a sub-block Middle The channel value in the sub-block The frequency of occurrence in Represents a sub-block Middle The channel value in the sub-block The frequency of occurrence in Represents a sub-block No. Channel values and sub-blocks No. The distance between the channel values in the R channel / G channel / B channel / luminance channel I color space.
[0046] Furthermore, in the paper product defect detection method based on artificial intelligence, the expression of the spatial weight factor is:
[0047]
[0048] Where: Represents a sub-block For sub-blocks The spatial weight factor of Represents a sub-block and sub-blocks The distance between them.
[0049] The present invention has the following beneficial effects: it uses image data to identify defects in paper products, accurately extracting defective areas based on pixel-by-pixel analysis of the image data. Compared to manual visual identification of defective areas, this method offers advantages such as high precision and rapid identification speed. Furthermore, a defect area feature extraction model is established to accurately characterize the defect status of paper products, avoiding the subjectivity of manual assessment. This allows for rapid and accurate assessment and detection of defects in paper products, demonstrating high accuracy and rapid detection speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0051] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION
[0052] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0053] Example 1
[0054] An embodiment of a paper product defect detection method based on artificial intelligence of the present invention is as follows: Figure 1 As shown, including:
[0055] Preprocessing the collected paper product image to obtain a preprocessed paper product RGB image;
[0056] First, an image acquisition device is positioned above the paper product to be inspected. The camera captures images of the paper product using a camera. The camera's position and range are determined by the user based on actual conditions. In this embodiment, the camera is positioned above the paper product to capture a frontal image of the surface of the paper product to facilitate analysis and extraction of abnormal surface characteristics.
[0057] After the camera captures an image of a paper product, given the complex industrial environment of paper product processing and production, a significant amount of image noise will be generated during the image acquisition process, affecting the high-quality acquisition of the paper product image. Therefore, to improve the detection accuracy of the system, the present invention preprocesses the captured image. This preprocessing includes image filtering, denoising, and image enhancement. Specific image denoising and enhancement techniques are well-known and will not be elaborated in this embodiment.
[0058] The purpose of this step is to collect image data to be analyzed and perform preliminary preprocessing operations on the image data to obtain high-quality image data for subsequent detection and analysis of paper product defects.
[0059] At this point, a high-quality paper product image can be obtained according to the method. The image is an RGB image, which is used for subsequent defect recognition and feature extraction of the paper product image to evaluate its surface defect condition.
[0060] Extracting defect areas from the pre-processed paper product RGB image, and converting the pre-processed paper product RGB image into a binary defect image using the extracted defect areas;
[0061] This embodiment takes into account that when defects such as black spots, bright spots, and oil spots appear on the surface of paper products, the color characteristics in the image change more significantly. When defects such as scratches, tears, and wrinkles appear on paper products, the texture characteristics in the image are prominent. Therefore, the present invention will establish a corresponding attention mechanism model based on the feature information of the image to highlight the various defect areas on the surface of the paper product, making the defect features more prominent, accurately identifying the defect areas in the image, and facilitating subsequent feature extraction of the defect areas and analyzing the surface condition of the paper product. The defect area extraction process is specifically as follows:
[0062] First, the present invention establishes a color attention mechanism based on the color feature information of image data to highlight the characteristics of defect areas such as black spots, bright spots, and oil spots in the image, highlight the areas of interest in the image, avoid the influence of irrelevant areas, and improve the accuracy of defect detection. The color attention mechanism is specifically as follows:
[0063] Obtain the image's R, G, and B color channel data and convert the RBG image to HSI space to obtain the corresponding HSI image data. Obtain the image data corresponding to luminance channel I for subsequent luminance channel attention mechanism analysis. It should be noted that the process of converting RGB images to HSI color space is a well-known technique and is not within the scope of this invention, so it will not be elaborated on in detail. Each channel image is processed and analyzed separately to obtain the attention mechanism map corresponding to each channel, avoiding color aliasing and the influence of color brightness on the accurate extraction of the image attention mechanism. Furthermore, an attention mechanism model is established to obtain the attention mechanism map corresponding to each channel image.
[0064] The attention index calculation process is:
[0065] For each channel image data, in order to make the attention index calculation more accurate and fast, the present invention first divides the image into various sub-blocks. In this embodiment, taking the R channel as an example, the R channel image data is evenly divided into multiple sub-blocks, the number of R channel values of each sub-block is counted, and the corresponding histogram is constructed to further obtain the color contrast between each sub-block. The expression is:
[0066]
[0067] Where: Represents a sub-block and sub-blocks The color contrast between Represents a sub-block The type of R channel value in the image, Represents a sub-block The kind of R channel value in the image, For sub-blocks The p-th channel value in the sub-block The frequency of occurrence in For sub-blocks Middle The channel value in the sub-block The frequency of occurrence in For sub-blocks The p-th channel value and sub-block No. The distance between the channel values in the R channel color space. It should be noted that the region range of the R channel is [0, 255]. Then, the attention index value of each sub-block is analyzed based on the channel color contrast. At the same time, in order to reflect the significance of the spatial relationship and enhance the spatial information, the present invention constructs a sub-block spatial weight factor based on the spatial information of each sub-block to reflect the spatial information when calculating the attention index. The spatial weight factor is:
[0068]
[0069] Where: Represents a sub-block For sub-blocks The spatial weight factor of Represents a sub-block and sub-blocks The distance between them can be calculated using metrics such as Euclidean distance and Manhattan distance.
[0070] Finally, an attention index calculation model is constructed based on the sub-block color contrast and spatial information:
[0071]
[0072] Where: is the total number of sub-blocks, R channel image sub-block The attention index value, For sub-blocks To improve the accuracy of the system, the number of sub-blocks is as large as possible to accurately represent the attention index value of each area of the image.
[0073] At this point, the attention index of each sub-block of the R channel image data based on the color feature can be obtained. Similarly, the attention index value of each sub-block corresponding to the G channel, B channel and brightness channel I image data is obtained by the above method of the present invention. Finally, based on the attention index value of each channel sub-block, the final attention index value of each sub-block of the image is calculated:
[0074]
[0075] Where: Represents a sub-block The final attention index value, Sub-blocks The attention index values obtained in the R channel, G channel, B channel and I channel image data.
[0076] This method obtains the final attention index value for each sub-block in the image and normalizes the model to ensure that the attention index model function value is between (0, 1), facilitating the extraction and identification of defect areas in the image. This normalization process is well-known and falls outside the scope of this invention, so it will not be elaborated on here. This embodiment processes each channel separately to obtain the corresponding attention mechanism map, effectively preventing the impact of color aliasing on defect area identification and improving defect extraction accuracy.
[0077] After obtaining the final attention index value corresponding to each sub-block, the present invention will preset the attention index threshold for it. When the final attention index value is higher than the preset threshold, the pixel value of the corresponding sub-block pixel is set to 1. When it is lower than the threshold, the pixel value of the corresponding sub-block pixel is set to 0. It should be noted that the attention index threshold is 0.7. At this point, the color attention mechanism image corresponding to the image data can be obtained according to the color attention index value, which is recorded as ;
[0078] Furthermore, to highlight the texture information in the image and ensure accurate identification of scratches, tears, wrinkles and other defects on the paper product surface, the present invention will obtain the texture feature information of the image based on the frequency domain transform space, so as to extract and identify defect areas with obvious texture changes on the paper product surface. For the paper product image to be analyzed, the present invention performs a wavelet transform on it to obtain a low-frequency image and three high-frequency images, and sets corresponding attention mechanisms for each of them:
[0079] What is directly obtained after the wavelet transform is the wavelet coefficient. The wavelet coefficient is different from the grayscale value of the pixel point, but the wavelet coefficient at each position can reflect the grayscale value of the pixel point at that location. Taking into account the positive and negative situations of the wavelet coefficient, for the low-frequency image, when extracting the frequency domain attention index value, the present invention first normalizes the wavelet coefficient corresponding to the low-frequency image to ensure that the wavelet coefficient value is in [0,1]. There are many existing technologies and methods for normalization, which are not within the scope of protection of the present invention and will not be elaborated on. After obtaining the normalized wavelet coefficient corresponding to the low-frequency image, the present invention will process the low-frequency image through gamma transform, specifically: , is the transformed low-frequency image, is the low-frequency image before transformation, is the gamma transformation constant, which is set to 1 in the present invention. The conversion index can be set by the implementer according to the actual situation. In the present invention, the value is set to , the gamma transform of the low-frequency image can increase the contrast in the image, making the abnormal area in the image more prominent;
[0080] For the three high-frequency images after wavelet transform, the present invention will enhance the attention of image texture information based on the analysis of wavelet coefficients. First, a wavelet coefficient threshold T is set, and the wavelet coefficients below the wavelet coefficient threshold are set to zero, and the wavelet coefficients above the threshold are retained. The setting of the wavelet coefficient threshold T can be set by the implementer. The present invention will adaptively set the threshold to: , where For the A high-frequency image, For the The wavelet coefficient threshold of the high-frequency image, For the The wavelet coefficients corresponding to the high-frequency images are processed based on the method. This method can filter out irrelevant coefficients in the high-frequency images and further increase the attention of the texture information in the image. The processed high-frequency images are recorded as ;
[0081] After processing the low-frequency image and high-frequency image after frequency domain transformation, based on the processed frequency domain image Perform inverse wavelet transform to obtain the image after inverse transform, and further perform binarization processing on it, that is, the pixel value is in The pixels within the range are regarded as normal pixels on the surface of paper products, and the pixel values of the corresponding pixels are set to 0. The pixels outside of the image are taken as pixels of interest, and the pixel values of all pixels of interest are set to 1 to obtain the frequency domain attention mechanism image, which is recorded as , used for subsequent extraction of defective areas;
[0082] Finally, the color attention mechanism image is obtained based on the method described in this embodiment and frequency domain attention mechanism image , are both binary images. A defect area recognition model is further established based on the color attention mechanism image and the frequency domain attention mechanism image to accurately identify the ROI area in the paper product surface image data, that is, the defect area. The defect area recognition model is:
[0083]
[0084] Where: is the weight of the color attention mechanism image, is the weight of the frequency domain attention mechanism image, which can be set by the implementer. To represent the fused image, the present invention sets the model weights based on the frequency domain indicators in the image data, avoiding the subjectivity of manually setting fixed weights for different images and improving the recognition accuracy of the system. The model weight setting is specifically as follows: for each wavelet coefficient after the frequency domain transformation, the wavelet coefficients corresponding to each high-frequency image are filtered based on the wavelet coefficient threshold. The threshold is the mean value of the wavelet coefficients corresponding to each high-frequency image, and the number of non-zero wavelet coefficients in the high-frequency image after filtering is counted and recorded as , based on this, the image weights of the frequency domain attention mechanism are set: , where is the total number of wavelet coefficients after the wavelet transform of the image data, then the weight of the corresponding color attention mechanism graph is: .
[0085] At this point, we can get an image based on the color attention mechanism and frequency domain attention mechanism image Image after fusion processing , further, for the image The pixel values of each point in the image are thresholded by T. When the pixel value is higher than the threshold, the corresponding pixel is considered to be a defective pixel and its pixel value is set to 1. Otherwise, it is a normal pixel and its pixel value is set to 0. The final defect image is obtained. The defect image is a binary image to facilitate subsequent analysis of the degree of defect. The pixel value threshold of the fused image can be set by the implementer. In this invention, it is set to T = 0.3.
[0086] At this point, the defect area on the surface of the paper product can be accurately obtained, and the image data obtained by the final defect recognition model is recorded as the defect image, which serves as the basis for extracting defect feature parameters to achieve accurate detection of defects.
[0087] Defect feature parameters of the paper product surface are extracted based on the defect image, and the feature parameters are specifically:
[0088] Counting the sum of the number of pixels in each defect area in the binary defect image to obtain the area index of each defect area;
[0089] First, statistics are performed on the defect connected domains in the defect image to obtain an area index of each defect region, where the defect area index is the sum of the number of pixels in the corresponding defect region.
[0090] The defect area in the RGB image is extracted using the defect area of the binary defect image to obtain a defect RGB image;
[0091] Then, based on the defect image, it is used as a mask and multiplied with the corresponding original RGB image data to extract the RGB image corresponding to the defect area, which is recorded as the defect RGB image.
[0092] The defect difference index of each defect area is obtained by the mean grayscale value of each defect area in the defect RGB image and the mean grayscale value of the corresponding position of the standard paper product;
[0093] This embodiment obtains the mean grayscale value of the pixels in the defective RGB image: , represents the grayscale mean of the k-th defect area, and further obtains the grayscale mean of the pixel at the corresponding position of the standard paper product , standard paper products are paper products without defects, The defect difference index is obtained by taking the mean grayscale value of the pixels corresponding to the defect area in the standard paper product image: , , K is the number of defect connected domains, that is, the number of defect areas.
[0094] Slide the window over each defect area in the defect RGB image, count the pixel value of each pixel in the window and the number of times the pixel value appears, and obtain the defect distribution index of each defect area;
[0095] At the same time, in order to accurately detect the defect conditions of the defective area, this embodiment will detect the distribution of each defective area. The defective area distribution feature extraction is as follows: for the defective area, first set a 1*3 sliding window, slide the defective area from left to right and from top to bottom with a step size of 3, and use the pixel values of the three pixels in the window as a window descriptor. , Represent the pixel values corresponding to the pixel points at the left, middle and right positions in the window respectively. By traversing the defect area through the sliding window, R window descriptors can be obtained. The number of types of window descriptors extracted is recorded as , then count the number of times each window descriptor appears in all R window descriptors, recorded as , represents the number of times the t-th window descriptor appears in the R obtained window descriptors, and based on this, a defect area distribution index calculation model is established to extract the structural distribution of the defect area. The defect area distribution index model is: , is the distribution index of the kth defect area. The larger the value of the defect distribution index function is, the more serious the defect situation of the corresponding defect area is.
[0096] Thus, characteristic parameters of each defective area of the paper product are obtained according to the method described in this embodiment, which are used to detect and evaluate the defect conditions of the paper product, so that the inspectors can intuitively understand the production efficiency and yield rate of the paper product.
[0097] The defect degree of the paper product is calculated by the area index, defect difference index and defect distribution index of each defect area, and the qualification of the paper product is judged according to the size of the defect degree of the paper product.
[0098] A paper product defect detection model is constructed to evaluate and detect surface defects of paper products, so that relevant inspection personnel can intuitively understand the quality of paper products.
[0099] According to the above steps, the defective areas on the surface of the paper product can be extracted, and the characteristic parameters of each defective area can be extracted. Based on this, this embodiment will detect the defective conditions of the paper product and establish a paper product defect detection model:
[0100]
[0101] Where: is the defect degree of the paper product to be tested, represents the first parameter of the model, Indicates the first parameter of the model, which can be set by the implementer. The present invention sets it to , is the area index of the kth defect area, A is the area index of the paper product image to be detected, that is, the total number of all pixels in the paper product image to be detected. The larger the model function value, the more serious the defect of the paper product to be detected is considered to be, and the worse the corresponding paper product condition is. The model is normalized to ensure that the function value is in [0,1]. Considering that low-level defects of paper products at the time of production are not enough to affect subsequent use, and are not enough to affect the sealing and other effects of paper products during use, when the model value is higher than 0.35, the present invention believes that the defects of the paper product are relatively serious and do not meet the factory requirements and market application conditions, and need to be reprocessed and repaired, thereby reducing the defective rate of paper products and avoiding waste of resources.
[0102] At this point, this embodiment is completed.
[0103] This method uses image data to identify paper product defects. It analyzes each pixel in the image data and accurately extracts defect areas. Compared to manual visual identification of defect areas, this method offers advantages such as high precision and rapid identification speed. Furthermore, a defect area feature extraction model is established to accurately characterize the defect status of paper products, avoiding the subjectivity of manual assessment. This allows for rapid and accurate assessment and detection of paper product defects, demonstrating high accuracy and rapid detection speed.
[0104] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A paper product defect detection method based on artificial intelligence, characterized in that: include: Preprocessing the collected paper product image to obtain a preprocessed paper product RGB image; Extracting defect areas from the pre-processed paper product RGB image, and converting the pre-processed paper product RGB image into a binary defect image using the extracted defect areas; Counting the sum of the number of pixels in each defect area in the binary defect image to obtain the area index of each defect area; The defect area in the RGB image is extracted using the defect area of the binary defect image to obtain a defect RGB image; The defect difference index of each defect area is obtained by the mean grayscale value of each defect area in the defect RGB image and the mean grayscale value of the corresponding position of the standard paper product; Slide the window over each defect area in the defect RGB image, count the pixel value of each pixel in the window and the number of times the pixel value appears, and obtain the defect distribution index of each defect area; The defect degree of the paper product is calculated by the area index, defect difference index and defect distribution index of each defect area, and the quality of the paper product is judged according to the size of the defect degree; The method for extracting defect areas in the pre-processed RGB image of paper products is: Obtain R channel, G channel, B channel and brightness channel I images by preprocessing the paper product RGB image; The R channel, G channel, B channel and brightness channel I images are analyzed to obtain a color attention binary map containing defect areas and non-defect areas; Perform wavelet transform on the pre-processed paper product RGB image to obtain a low-frequency image and three high-frequency images; The obtained low-frequency image and three high-frequency images are further processed to obtain a frequency domain attention binary image containing defect areas and non-defect areas; The binary defect image is obtained through the color attention binary map and the frequency domain attention binary map.
2. The method for detecting paper product defects based on artificial intelligence according to claim 1, characterized in that: The method for analyzing the R channel, G channel, B channel and brightness channel I images to obtain a color attention binary map containing defect areas and non-defect areas is as follows: The R channel, G channel, B channel and brightness channel I images are divided into multiple sub-blocks respectively; Calculate the color contrast and spatial weight factor between every two sub-blocks of the R channel, G channel, B channel and brightness channel I images through multiple sub-blocks corresponding to the R channel, G channel, B channel and brightness channel I images respectively; The attention index value of each sub-block of the R channel, G channel, B channel and brightness channel I image is calculated by the color contrast and spatial weight factor between every two sub-blocks of the R channel, G channel, B channel and brightness channel I image; The final attention index value of each sub-block is obtained through the attention index value of each sub-block of the R channel, G channel, B channel and brightness channel I image; Normalizing the final attention index value to obtain a normalized final attention index value; An attention index threshold is set for the normalized final attention index value. If the normalized final attention index value is higher than the attention index threshold, the pixel value of the corresponding sub-block pixel is set to 1; if the normalized final attention index value is lower than the attention index threshold, the pixel value of the corresponding sub-block pixel is set to 0 to obtain a color attention binary map.
3. The method for detecting paper product defects based on artificial intelligence according to claim 1, characterized in that: The method for reprocessing the obtained low-frequency image and three high-frequency images is as follows: First, the wavelet coefficients corresponding to the low-frequency image are normalized, and then the low-frequency image is gamma transformed to obtain the processed low-frequency image; Set wavelet coefficient thresholds for the wavelet coefficients corresponding to the three high-frequency images respectively, set the wavelet coefficients below the wavelet coefficient threshold to zero, and retain the wavelet coefficients above the wavelet coefficient threshold to obtain the three processed high-frequency images; Performing inverse wavelet transform on the processed low-frequency image and the three high-frequency images to obtain inverse transformed images; The pixel values of the pixels in the inverse transformed image that are within the set range are set to 0, and the pixel values of the pixels that are not within the set range are set to 1, and a frequency domain attention binary map is obtained.
4. The method for detecting paper product defects based on artificial intelligence according to claim 1, characterized in that: The method of obtaining a binary defect image through the color attention binary image and the frequency domain attention binary image is as follows: The fused image is obtained by setting different weights for the color attention binary map and the frequency domain attention binary map; A pixel threshold is set for the pixel value of each pixel in the fused image. If the pixel value of a pixel is higher than the pixel threshold, the corresponding pixel is judged to be a defective pixel and the pixel value of the corresponding pixel is set to 1. If the pixel value of a pixel point is lower than the pixel threshold, the corresponding pixel point is judged to be a normal pixel point, and the pixel value of the corresponding pixel point is set to 0 to obtain a binary defect image.
5. The method for detecting paper product defects based on artificial intelligence according to claim 1, characterized in that: The expression of the defect degree of the paper product is: ; Where: Indicates the degree of defects of the paper product to be tested. represents the first parameter of the model, represents the first parameter of the model, represents the area index of the k-th defective area, A represents the area index of the paper product image to be detected, k represents the k-th defective area, and K represents the number of defective connected domains, that is, the number of defective areas. represents the defect difference index, Represents the distribution index of the k-th defect area.
6. The method for detecting paper product defects based on artificial intelligence according to claim 5, characterized in that: The distribution index expression of the defect area is: ; Where: Indicates the number of window descriptors. The pixel values of three pixels in the window are a window descriptor. t represents the tth window descriptor. Indicates the number of times the t-th window descriptor appears in all window descriptors.
7. The method for detecting paper product defects based on artificial intelligence according to claim 5, characterized in that: The expression of the defect difference index is: , ; Where: represents the mean grayscale value of the pixel in the k-th defect area, Indicates the mean grayscale value of pixels at corresponding positions of standard paper products.
8. The method for detecting paper product defects based on artificial intelligence according to claim 2, characterized in that: The expression of the color contrast is: ; Where: Represents a sub-block and sub-blocks The color contrast between Represents a sub-block Types of R channel value / G channel value / B channel value / luminance channel I value in the image, Represents a sub-block Types of R channel value / G channel value / B channel value / luminance channel I value in the image, Represents a sub-block Middle The channel value in the sub-block The frequency of occurrence in Represents a sub-block Middle The channel value in the sub-block The frequency of occurrence in Represents a sub-block No. Channel values and sub-blocks No. The distance between the channel values in the R channel / G channel / B channel / luminance channel I color space.
9. The method for detecting paper product defects based on artificial intelligence according to claim 2, characterized in that: The expression of the spatial weight factor is: ; Where: Represents a sub-block For sub-blocks The spatial weight factor of Represents a sub-block and sub-blocks The distance between them.
Citation Information
Patent Citations
Visual inspection method for defects of transparent glass material
CN113269727A
Quick online paper flaw detecting system based on machine vision
CN202002894U