Paper quality detection method and system
By applying the YOLOV8 model in paper quality detection and combining shallow and deep network feature extraction modules, the problem of insufficient identification of paper defects in the prior art is solved, and a higher accuracy and efficiency detection effect is achieved.
Patent Information
- Application Number
- CN202411713794.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-27
AI Technical Summary
Existing paper quality detection methods rely on manual operations and simple image processing techniques, making it difficult to capture the nuances of paper defects, especially when the morphology is similar between different types of defects, and are prone to misidentification.
The paper quality detection method based on the YOLOV8 model is adopted, and feature extraction and defect detection of paper images are realized through shallow network feature extraction module, adaptive weight downsampling module, reversible feature fusion module and deep network feature extraction module.
It improves the accuracy of paper quality inspection, can better capture defect characteristics at different scales, reduces the loss of detailed information, enhances the ability to identify defects of similar shapes but different types, and achieves higher accuracy and higher efficiency detection.
Smart Images

Figure CN119625409A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of defect detection, and in particular to a paper quality detection method and system. Background Art
[0002] With the rapid development of industrial production, paper has become an indispensable material in daily life and industrial production. Paper quality detection is a crucial link in industrial production, and paper defects need to be detected. Existing paper quality detection methods mainly rely on manual operation and simple image processing technology.
[0003] In the existing technology, manual operation and simple image processing technology have limited ability to identify defects. Defects on the surface of paper have wide variability in shape and size, and traditional detection methods often have difficulty capturing the subtle differences of all types of defects. In addition, traditional deep learning methods are prone to losing detailed information during feature extraction, especially when different types of defects have similar shapes, they are prone to misidentification. At the same time, due to limitations such as image resolution settings, when using traditional image processing technology to detect paper defects, defects with large scale differences are also difficult to effectively identify. Summary of the invention
[0004] The problem solved by the invention is how to improve the accuracy of paper quality detection.
[0005] In order to solve the above problems, the present invention provides a paper quality detection method and system.
[0006] In a first aspect, the present invention provides a paper quality detection method, the method is based on the YOLOV8 model, the YOLOV8 model includes a shallow network feature extraction module, an adaptive weight downsampling module, a reversible feature fusion module and a deep network feature extraction module, the method includes:
[0007] Performing feature extraction operation on the paper image to be tested according to the shallow network feature extraction module to obtain an initial feature map;
[0008] When the deep network feature extraction module performs a downsampling operation on the initial feature map, the initial feature map is divided into a plurality of feature regions, and a weight is assigned to each of the feature regions through the adaptive weight downsampling module, and then a weighted feature map is generated according to the weight of the feature region;
[0009] Through the reversible feature fusion module, the weighted feature map is reversely transferred to the shallow network feature extraction module to obtain a fused weighted feature map;
[0010] The defect information of the paper image to be tested is determined according to the fused weighted feature map through the deep network feature extraction module.
[0011] Optionally, performing a feature extraction operation on the paper image to be tested according to the shallow network feature extraction module to obtain an initial feature map includes:
[0012] Input the paper image to be tested into the YOLOV8 model, and perform feature extraction on the paper image to be tested in sequence through the multi-layer convolutional network of the shallow network feature extraction module;
[0013] The output feature map of the convolutional network of the previous layer of the deep network feature extraction module is used as the initial feature map.
[0014] Optionally, when the deep network feature extraction module performs a downsampling operation on the initial feature map, the initial feature map is divided into a plurality of feature regions, including:
[0015] When the deep network feature extraction module performs a downsampling operation on the initial feature map, determining a grid division specification according to the size data of the initial feature map;
[0016] The initial feature map is divided according to the division grid to obtain a plurality of the feature regions.
[0017] Optionally, the adaptive weight downsampling module includes an average pooling layer and a splicing layer, and the adaptive weight downsampling module is used to divide the weights for each of the feature regions, and then a weighted feature map is generated according to the weights of the feature regions, including:
[0018] Through the average pooling layer, the index statistics of each of the feature regions are performed to obtain the average value corresponding to the pixel value of each of the feature regions;
[0019] Through the concatenation layer, the feature regions are fused according to the average value of each feature region to obtain a fused feature map;
[0020] The fused feature map is weightedly fused through the attention mechanism in the adaptive weight downsampling module to obtain the weighted feature map.
[0021] Optionally, performing weighted fusion on the fused feature map through the attention mechanism in the adaptive weight downsampling module to obtain the weighted feature map includes:
[0022] Dividing the fused feature map to obtain a plurality of non-overlapping sub-regions, wherein each of the sub-regions corresponds to at least one feature map channel;
[0023] Determining an attention value of the sub-region through the feature map channel of the sub-region;
[0024] Determining a weight of the sub-region according to the attention value;
[0025] Weighted fusion is performed according to the weights of the sub-regions to obtain the weighted feature map.
[0026] Optionally, the weighted feature map is reversely transferred to the shallow network feature extraction module through the reversible feature fusion module to obtain a fused weighted feature map, including:
[0027] Determining target sizes of the shallow network feature extraction module and the deep network feature extraction module;
[0028] By means of a reversible gradient method, the size of the weighted feature map of the deep network feature extraction module and the initial feature map output by the shallow network feature extraction module are adjusted to the target size;
[0029] According to the weighted feature map and the shallow network feature map, the fused weighted feature map is obtained.
[0030] Optionally, obtaining the fused weighted feature map according to the weighted feature map and the shallow network feature map includes:
[0031] The weighted feature map and the shallow network feature map are spatially aligned through padding and clipping operations;
[0032] After the weighted feature map and the shallow network feature map are aligned, the weighted feature map and the shallow network feature map are stacked in the channel dimension to obtain an overlapping feature map;
[0033] The weighted feature map and the shallow network feature map are concatenated and fused according to the overlapping feature map to obtain the fused weighted feature map.
[0034] Optionally, determining the defect information of the paper image to be tested according to the fused weighted feature map includes:
[0035] By using the deep network feature extraction module, feature extraction is performed on the fused weighted feature map to obtain detail features of the paper image to be tested;
[0036] Performing target detection according to the detail features to determine whether the paper image to be tested has defect features;
[0037] When the paper to be tested has defect features, category prediction is performed according to the defect features to determine the defect information of the image of the paper to be tested.
[0038] Optionally, the performing target detection according to the detail features to determine whether the image of the paper to be tested has defect features includes:
[0039] Generate a bounding box according to the coordinates of the detail features in the fused weighted feature map;
[0040] The features within the bounding box are predicted through the prediction network of the YOLOV8 model to determine whether the defect features exist.
[0041] In a second aspect, a paper quality detection system is provided, wherein the system is applied to a YOLOV8 model, wherein the YOLOV8 model includes a shallow network feature extraction module, an adaptive weight downsampling module, a reversible feature fusion module, and a deep network feature extraction module, and the system includes:
[0042] Feature extraction unit: used for performing feature extraction operation on the paper image to be tested according to the shallow network feature extraction module to obtain an initial feature map;
[0043] An image generation unit: used for dividing the initial feature map into a plurality of feature regions when the deep network feature extraction module performs a downsampling operation on the initial feature map, and assigning weights to each of the feature regions through the adaptive weight downsampling module, and then generating a weighted feature map according to the weights of the feature regions;
[0044] Image fusion unit: used for reversely transferring the weighted feature map to the shallow network feature extraction module through the reversible feature fusion module to obtain a fused weighted feature map;
[0045] Information processing unit: used to determine the defect information of the paper image to be tested according to the fused weighted feature map through the deep network feature extraction module.
[0046] The paper quality detection method and system of the present invention introduce the YOLOV8 model into paper defect detection, which can quickly and accurately extract the features of paper images; in the downsampling process, by dividing the initial feature map into multiple feature areas and assigning weights to each area, it is possible to better capture defect features of different scales. The adaptive weight mechanism of the present invention enables the model to dynamically adjust the focus according to the importance of the defect features, thereby improving the detection capability of defects of smaller sizes; the feature map of the deep network is reversely transferred to the shallow network through the reversible gradient method, thereby better retaining the detail information extracted from the original image, avoiding the problem of detail information loss in the feature extraction process of the traditional deep learning model; finally, by fusing the feature maps of the deep and shallow networks, it is possible to more comprehensively capture the features of the defects, and further, it is helpful to distinguish defects of similar morphology but belonging to different types. In summary, the present invention can more accurately identify and classify defects on paper, such as defects that are small in size, complex in shape, or difficult to identify in complex backgrounds; and it integrates features and detail information of different scales, so that the model has better generalization ability when processing various types of paper defects; at the same time, the high speed characteristics of the introduced YOLOV8 model enable the present invention to quickly process a large number of paper images, achieving higher precision and higher efficiency paper defect detection.
[0047] Moreover, compared with the existing technology of detecting paper defects by instrument scanning, which requires expensive equipment and maintenance costs, the present invention can be implemented on standard computing devices by using image processing technology and machine learning algorithms, thereby greatly reducing hardware investment and operating costs, while quickly processing a large number of paper images, and can be applied in large-scale production. It also reduces the dependence on special instruments, reduces downtime caused by equipment failure or maintenance, and further improves production efficiency and economic benefits. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 is a flow chart of a paper quality detection method according to an embodiment of the present invention;
[0049] Figure 2 4 is a structural block diagram of a paper quality detection system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be interpreted as being limited to the embodiments described herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not intended to limit the scope of protection of the present invention.
[0051] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0052] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to"; the term "based on" means "based at least in part on"; the term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments"; the term "optionally" means "optional embodiments". The relevant definitions of other terms will be given in the following description. It should be noted that the concepts of "first", "second", etc. mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0053] It should be noted that the modifications of "one" and "plurality" mentioned in the present invention are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0054] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only used for illustrative purposes, and are not used to limit the scope of these messages or information.
[0055] like Figure 1 As shown, the present invention provides a paper quality detection method, which is based on the YOLOV8 model. The YOLOV8 model includes a shallow network feature extraction module, an adaptive weight downsampling module, a reversible feature fusion module and a deep network feature extraction module.
[0056] Specifically, in this application, the shallow network feature extraction module is the front-end part of the YOLOV8 model, which is responsible for extracting preliminary features from the input paper image; wherein the preliminary features include basic visual information such as edges, corners, textures, etc., which provide basic data for subsequent defect detection. The shallow network feature extraction module contains multiple convolutional layers and pooling layers, which are used to capture local features in the image and gradually build a basic understanding of the image. The adaptive weight downsampling module is used to further process the features extracted from the shallow network, and dynamically adjust the weighted combination of feature maps of different scales through an adaptive weight mechanism to achieve comprehensive capture of defect features. The adaptive weight downsampling module uses the attention mechanism to automatically assign weights according to the importance of the features, so that the model can pay more attention to key feature information while suppressing noise and unimportant details. The reversible feature fusion module is the core of the YOLOV8 model. This module uses the reversible gradient method to reversely transfer the feature map information of the deep network to the shallow network to extract the corresponding defect detail information. Through reverse information transmission, the model can combine deep and shallow feature information to enhance the recognition ability of defect features, especially when dealing with defects with similar morphology but belonging to different types. The deep network feature extraction module is located at the back end of the YOLOV8 model and is responsible for extracting higher-level abstract features from the image. Abstract features include more complex patterns and parts of objects, which are crucial for identifying defects in paper images. The deep network gradually extracts and integrates information through multiple convolutional layers and pooling layers to form a deep understanding of the image. Through the joint work of the modules in the YOLOV8 model, the YOLOV8 model can not only quickly process a large number of paper images, but also accurately identify and classify defects. Through this multi-level, multi-scale feature extraction and fusion strategy, the YOLOV8 model achieves high-precision defect detection while ensuring high efficiency.
[0057] The method comprises:
[0058] The shallow network feature extraction module performs feature extraction operation on the paper image to be tested to obtain an initial feature map.
[0059] Specifically, the shallow network feature extraction module in the YOLOV8 model is first used to perform feature extraction operations on the paper image to be tested. Among them, the YOLOV8 model, as an advanced target detection algorithm, can efficiently extract useful feature information from the image; by inputting the paper image to be tested into the shallow network feature extraction module of the YOLOV8 model, wherein the multi-layer convolutional network of the shallow network feature extraction module will process the image in turn, and finally output an initial feature map; and this initial feature map contains the preliminary features of potential defects in the image, which provides a basis for subsequent defect detection.
[0060] When the deep network feature extraction module performs a downsampling operation on the initial feature map, the initial feature map is divided into multiple feature regions, and weights are assigned to each of the feature regions through the adaptive weight downsampling module, and then a weighted feature map is generated according to the weights of the feature regions.
[0061] Specifically, when the deep network feature extraction module of the YOLOV8 model downsamples the initial feature map, the initial feature map is divided into multiple feature regions in order to more carefully analyze and identify the defect features in the image; through the adaptive weight downsampling module of the YOLOV8 model, each feature region is assigned a weight, which reflects the importance of the region in defect detection, and then a weighted feature map is generated based on these weights. This weighted feature map can more prominently display the key defect features in the image, thereby improving the accuracy of defect detection.
[0062] Through the reversible feature fusion module, the weighted feature map is reversely transferred to the shallow network feature extraction module to obtain a fused weighted feature map.
[0063] Specifically, the weighted feature map of the deep network feature extraction module is reversely transferred to the shallow network feature extraction module through the reversible feature fusion module of the YOLOV8 model, which can effectively solve the problem of losing detail information in the feature extraction process of the deep learning model. The defect features extracted from the deep network can be fused with the original image detail information retained in the shallow network through the reversible feature fusion module to obtain a fused weighted feature map. It should be noted that this fused weighted feature map not only contains the high-level features extracted by the deep network, but also retains the original detail information in the shallow network, so that the model can more accurately identify and locate defects.
[0064] The defect information of the paper image to be tested is determined according to the fused weighted feature map through the deep network feature extraction module.
[0065] Specifically, the deep network feature extraction module of the YOLOV8 model is used to further extract features from the fused weighted feature map to obtain the detail features of the paper image to be tested. Then, target detection is performed based on these detail features, defect features are determined, and category prediction is performed to finally determine the defect information of the paper image to be tested.
[0066] For example, suppose there are some defects on a paper image to be inspected, such as holes, scratches, black spots, etc. First, input this image into the YOLOV8 model, which extracts features from the image through a multi-layer convolutional network, identifies various features in the image, such as edges, textures, etc., and summarizes these feature information into an initial feature map; this initial feature map is like a marked "map" with all feature points that may be related to defects marked on it. Then, the initial feature map is downsampled, that is, the spatial size of the feature map is reduced, thereby reducing the amount of data for subsequent processing; in this process, the feature map is divided into multiple small areas, such as 16 small blocks, and then the features of each small block are analyzed through the adaptive weight downsampling module, and a weight is assigned to each small block according to its feature strength; for example, if a small block contains obvious defect features, it will be given a higher weight; and vice versa. According to these weights, a weighted feature map is generated, which will pay more attention to those areas that may contain defects; then, the weighted feature map of the deep network feature extraction module is reversely transferred to the shallow network feature extraction module using the reversible gradient method; assuming that in the deep network, an area that may be a hole is identified, but the precise outline of the hole is not clear enough; through the reversible gradient method, more detailed information is extracted from the shallow network, such as the subtle features of the edge of the hole, and this information is fused into the feature map of the deep network; a fused weighted feature map is obtained, which contains both the high-level features of the deep network and the detailed information of the shallow network. Finally, the defect information of the paper image is determined based on the fused weighted feature map; the target detection network of the YOLOV8 model analyzes the fused feature map, identifies specific defect features, such as holes, scratches, etc., and marks the locations of these defects on the image; then, the model predicts the category based on these features to determine which category each defect belongs to, such as "holes", "scratches", etc.; finally, an image marked with all defects and their categories is obtained, which is the detection result.
[0067] The present invention introduces the YOLOV8 model into paper defect detection, which can quickly and accurately extract the features of paper images; in the downsampling process, by dividing the initial feature map into multiple feature areas and assigning weights to each area, it is possible to better capture defect features of different scales. The adaptive weight mechanism of the present invention enables the model to dynamically adjust the focus according to the importance of the defect features, thereby improving the detection capability of defects of smaller sizes; the feature map of the deep network is reversely transferred to the shallow network through the reversible gradient method, thereby better retaining the detail information extracted from the original image, avoiding the problem of detail information loss in the feature extraction process of the traditional deep learning model; finally, by fusing the feature maps of the deep and shallow networks, it is possible to capture the features of the defects more comprehensively, and further, it is helpful to distinguish defects of similar morphology but belonging to different types. In summary, the present invention can more accurately identify and classify defects on paper, such as defects that are small in size, complex in shape, or difficult to identify in complex backgrounds; and it integrates features and detail information of different scales, so that the model has better generalization ability when processing various types of paper defects; at the same time, the high speed characteristics of the introduced YOLOV8 model enable the present invention to quickly process a large number of paper images, achieving higher precision and higher efficiency paper defect detection.
[0068] Moreover, compared with the existing instrument scanning method for detecting paper defects, which usually requires expensive equipment and maintenance costs, the present invention can be implemented on standard computing devices by using image processing technology and machine learning algorithms, thereby greatly reducing hardware investment and operating costs, while quickly processing a large number of paper images, and can be applied in large-scale production. It also reduces the reliance on special instruments, reduces downtime caused by equipment failure or maintenance, and further improves production efficiency and economic benefits.
[0069] Optionally, performing a feature extraction operation on the paper image to be tested according to the shallow network feature extraction module to obtain an initial feature map includes:
[0070] Input the paper image to be tested into the YOLOV8 model, and perform feature extraction on the paper image to be tested in sequence through the multi-layer convolutional network of the shallow network feature extraction module;
[0071] The output feature map of the convolutional network of the previous layer of the deep network feature extraction module is used as the initial feature map.
[0072] Specifically, the paper image to be tested is input into the YOLOV8 model, and the multi-layer convolution network of the shallow network feature extraction module of the model extracts features of the image in turn; image features are extracted through multiple convolutional layers and downsampling layers. In this process, each layer of the convolutional network processes the image, extracts features at different levels, and passes these feature information to the next layer of the network; the model can gradually abstract high-level semantic information from low-level edge and texture information. Finally, the feature map output by the convolutional network of the YOLOV8 model in the previous layer of the downsampling network is selected as the initial feature map. This feature map contains rich feature information extracted from the original image, which provides a basis for subsequent defect detection.
[0073] In this optional embodiment, through the multi-layer convolutional network of the YOLOV8 model, rich feature information is extracted from the image of the paper to be tested, including feature information such as edges, textures, shapes, etc., and these feature information provides a solid foundation for subsequent defect detection. The YOLOV8 model extracts features layer by layer, from low-level simple features to high-level complex features, which helps the model to better understand and identify defects in the image; and the multi-layer convolutional network of the YOLOV8 model can process image data in parallel, speeding up the feature extraction speed and improving the efficiency of the overall detection process. By selecting the output of the previous convolutional network of the downsampling network as the initial feature map, it is ensured that the feature map retains sufficient detail information while reducing the spatial size, which is particularly important for detecting small-sized defects, thereby improving the accuracy of detection.
[0074] Optionally, when the deep network feature extraction module performs a downsampling operation on the initial feature map, the initial feature map is divided into a plurality of feature regions, including:
[0075] When the deep network feature extraction module performs a downsampling operation on the initial feature map, determining a grid division specification according to the size data of the initial feature map;
[0076] The initial feature map is divided according to the division grid to obtain a plurality of the feature regions.
[0077] Specifically, first, based on the resolution of the feature map and the expected feature area size, according to the size data of the initial feature map, determine the appropriate grid division specification, then, according to the grid division specification, divide the initial feature map into multiple small areas, wherein each small area is a feature area, and they together constitute a subdivision view of the entire feature map; in this embodiment, this division mode helps the model to analyze each part of the feature map more carefully, especially when detecting defects with different scales and complexities, it can improve the accuracy of detection. In this embodiment, by dividing the initial feature map into multiple feature areas, local defects on the paper can be captured more finely, especially when the defect size is small or distributed in different areas, thereby improving the accuracy of defect detection. In addition, each feature area contains local feature information. This embodiment enables the model to better understand and analyze the characteristics of each local area, so as to more accurately identify the location and type of defects. By subdividing the feature map, the model can adapt to defects of different sizes and shapes, improving the model's adaptability to diverse defects. Moreover, during the downsampling of the feature map, the allocation of computing resources can be dynamically adjusted according to the importance of the feature area, which not only improves computing efficiency but also ensures that key areas receive sufficient computing resources. At the same time, through the subdivided feature areas, the model can be better generalized to different paper types and defect types, improving the generalization ability of the model in different application scenarios.
[0078] In this optional embodiment, feature area division not only improves the accuracy and efficiency of paper quality detection, but also enhances the adaptability and generalization ability of the model to defects of different types and sizes, providing richer and more detailed feature information for subsequent defect identification and classification.
[0079] Optionally, the adaptive weight downsampling module includes an average pooling layer and a splicing layer, and the adaptive weight downsampling module is used to divide the weights for each of the feature regions, and then a weighted feature map is generated according to the weights of the feature regions, including:
[0080] Through the average pooling layer, the index statistics of each of the feature regions are performed to obtain the average value corresponding to the pixel value of each of the feature regions;
[0081] Through the concatenation layer, the feature regions are fused according to the average value of each feature region to obtain a fused feature map;
[0082] The fused feature map is weightedly fused through the attention mechanism in the adaptive weight downsampling module to obtain the weighted feature map.
[0083] Specifically, the main function of the average pooling layer is to reduce the spatial dimension of the feature map while retaining important feature information; by calculating the average value of each region, this layer can reduce the noise and redundant information in the feature map while maintaining the statistical characteristics of the feature. In the adaptive weight downsampling module, the average pooling layer calculates the average value of each region of the input feature map to generate a reduced-dimensional feature representation, which not only captures the key information in the original feature map, but also reduces the amount of data, providing convenience for subsequent processing. The average pooling operation is generally performed in the spatial dimension. For example, each 2x2 region can be pooled into a value, which is the average value of all elements in the region. The concatenation layer is used to combine feature maps of different scales or different sources to enhance the feature expression ability of the model. In the adaptive weight downsampling module, the concatenation layer concatenates the feature map processed by the average pooling layer with other feature maps (such as the original feature map that has not been downsampled or the feature map of other layers). This concatenation operation not only increases the number of channels of the feature map, but also enables the model to consider feature information of different scales at the same time.
[0084] This embodiment enhances the representation of important information in the feature map by assigning weights to each feature region; the average pooling layer in the adaptive weight downsampling module performs index statistics on each feature region and calculates the feature average of each region, which is used to reflect the overall feature strength of the region and provides a basis for subsequent weight allocation; then, based on these average values, all feature regions are fused to form a fused feature map; this fused feature map combines the average features of each region and provides a comprehensive feature representation for further processing; finally, the adaptive weight downsampling module uses the attention mechanism to perform weighted fusion on the fused feature map, adjusts the influence of each region in the final feature map according to its weight importance, and generates a weighted feature map. This weighted feature map highlights those areas that are more critical to defect detection, thereby improving the accuracy and efficiency of detection.
[0085] In this optional embodiment, by assigning weights to each feature area, the model can pay more attention to those areas that are more important for defect detection, enhancing the representation of these key features in the feature map; and, by highlighting important features through weighted feature maps, the model can more accurately identify the location and type of defects in subsequent defect detection. The weights of the feature areas are adjusted through the adaptive weight downsampling module, which optimizes the information distribution in the feature map and reduces the interference of noise and unimportant information; through the weighted fusion of the attention mechanism, the model can better adapt to different paper defect types and background conditions, improving the generalization ability of the model. The adaptive weight downsampling module of this embodiment not only improves the accuracy and efficiency of paper quality detection, but also enhances the generalization ability and robustness of the model for defects of different types and in complex backgrounds.
[0086] Optionally, performing weighted fusion on the fused feature map through the attention mechanism in the adaptive weight downsampling module to obtain the weighted feature map includes:
[0087] Dividing the fused feature map to obtain a plurality of non-overlapping sub-regions, wherein each of the sub-regions corresponds to at least one feature map channel;
[0088] Determining an attention value of the sub-region through the feature map channel of the sub-region;
[0089] Determining a weight of the sub-region according to the attention value;
[0090] Weighted fusion is performed according to the weights of the sub-regions to obtain the weighted feature map.
[0091] Specifically, the fused feature map is divided into multiple non-overlapping sub-regions, each of which corresponds to at least one feature map channel of the fused feature map, allowing the model to process different parts of the feature map separately in order to analyze the image more carefully. Next, the model determines the attention value of each sub-region through the feature map channel corresponding to the sub-region, thereby evaluating its importance to the overall goal. Then, based on the calculated attention value, the model assigns a weight to each sub-region. This weight reflects the relative importance of the sub-region in subsequent processing. Normalization methods such as the softmax function are usually used to ensure that the sum of the weights of all sub-regions is 1. Finally, based on the weight of each sub-region, the model performs weighted fusion of all sub-regions to generate a weighted feature map. The weighted feature map places more emphasis on those areas with high attention values, thereby providing more accurate feature information for defect detection.
[0092] In this optional embodiment, by dividing the fused feature map into multiple sub-regions and performing weighted fusion according to the attention value of each sub-region, the model can more accurately identify the characteristics of paper defects. The weighted feature map enhances the model's ability to locate the defect position by emphasizing the characteristics of important areas, which is beneficial to subsequent defect classification and processing; and through the attention mechanism, the model can focus on processing those areas with the most information, thereby improving the information density of the feature map and making the feature map more compact and efficient. In addition, the adaptive weight downsampling module allows the model to dynamically adjust the weights according to the actual feature distribution, so that the model can dynamically adapt to different defect types and paper conditions, improving the adaptability and flexibility of the model. This embodiment not only improves the accuracy and efficiency of paper quality detection, but also enhances the adaptability and robustness of the model to defects of different types and under complex backgrounds, providing an early technical guarantee for efficient and reliable paper quality detection.
[0093] Optionally, the weighted feature map is reversely transferred to the shallow network feature extraction module through the reversible feature fusion module to obtain a fused weighted feature map, including:
[0094] Determining target sizes of the shallow network feature extraction module and the deep network feature extraction module;
[0095] By means of a reversible gradient method, the size of the weighted feature map of the deep network feature extraction module and the initial feature map output by the shallow network feature extraction module are adjusted to the target size;
[0096] According to the weighted feature map and the shallow network feature map, the fused weighted feature map is obtained.
[0097] Specifically, the target size of the shallow network feature extraction module and the deep network feature extraction module is first determined to ensure that the weighted feature map extracted from the deep network can match the feature map of the shallow network in spatial size, so as to facilitate the subsequent fusion operation, wherein the target size is usually pre-set based on the network structure and feature extraction requirements; then, the reversible gradient method is used to resize the weighted feature map of the deep network feature extraction module to make it consistent with the size of the shallow network feature map, and the alignment of the feature map in the spatial dimension is ensured through upsampling and downsampling operations. Finally, the resized weighted feature map of the deep network is fused with the feature map of the shallow network to obtain the fused weighted feature map; this fusion process combines the high-level semantic information of the deep network and the detailed information of the shallow network, providing a more comprehensive feature representation for defect detection.
[0098] In this optional embodiment, the reversible gradient method is used to achieve effective fusion between the deep network feature extraction module and the shallow network feature extraction module. This fusion not only contains high-level semantic information, but also retains low-level detail information, providing a more comprehensive perspective for defect detection; and the fused weighted feature map can more accurately capture the characteristics of paper defects, especially in terms of detail features and contextual information of defects, thereby improving the accuracy of defect detection. Through size adjustment and feature fusion, the representation of feature maps is optimized, making feature maps more consistent in spatial dimensions and reducing information loss caused by size mismatch; the fused weighted feature map can better cope with different detection conditions, such as different lighting, background noise, etc., improving the robustness of the model in complex environments, and also integrating the weighted feature maps of deep and shallow features, so that the model can better generalize to different paper types and defect types, improving the generalization ability of the model.
[0099] Optionally, obtaining the fused weighted feature map according to the weighted feature map and the shallow network feature map includes:
[0100] The weighted feature map and the shallow network feature map are spatially aligned through padding and clipping operations;
[0101] After the weighted feature map and the shallow network feature map are aligned, the weighted feature map and the shallow network feature map are stacked in the channel dimension to obtain an overlapping feature map;
[0102] The weighted feature map and the shallow network feature map are concatenated and fused according to the overlapping feature map to obtain the fused weighted feature map.
[0103] Specifically, accurate spatial alignment of the weighted feature map and the shallow network feature map is achieved through padding and clipping operations. The padding operation is used to adjust the boundary of the feature map to ensure that the two feature maps are completely matched in spatial size, and the clipping operation is used to remove the redundant parts to ensure accurate alignment of the feature maps. After the weighted feature map and the shallow network feature map are aligned in space, they are stacked in the channel dimension to form an overlapping feature map. The stacking operation actually merges the channel information of the two feature maps so that the features at each position contain information from both the deep and shallow networks. Finally, based on the overlapping feature map, the information of the weighted feature map and the shallow network feature map is merged through splicing and fusion to form the final fused weighted feature map. This fusion process ensures that the information of the feature map in both spatial and channel dimensions is fully utilized, providing a richer and more accurate feature representation for subsequent defect detection.
[0104] In this optional embodiment, accurate spatial alignment and channel stacking ensure that feature maps from different network layers are accurately matched during fusion, thereby improving the accuracy of feature fusion. In addition, the fused weighted feature map integrates the high-level semantic information of the deep network and the detailed information of the shallow network, enhancing the richness of feature representation. At the same time, the fused feature map contains more information, and the model can more accurately identify and locate defects on paper, thereby improving the accuracy of defect detection. The weighted feature map that integrates deep and shallow features enables the model to better generalize to different paper types and defect types, thereby improving the generalization ability of the model. This embodiment realizes the effective fusion of weighted feature maps and shallow network feature maps through filling operations, clipping operations, and stacking and splicing fusion in the channel dimension, which not only improves the accuracy and efficiency of paper quality detection, but also enhances the adaptability and robustness of the model to defects of different types and complex backgrounds, providing strong technical support for efficient and reliable paper quality detection.
[0105] Optionally, determining the defect information of the paper image to be tested according to the fused weighted feature map includes:
[0106] By using the deep network feature extraction module, feature extraction is performed on the fused weighted feature map to obtain detail features of the paper image to be tested;
[0107] Performing target detection according to the detail features to determine whether the paper image to be tested has defect features;
[0108] When the paper to be tested has defect features, category prediction is performed according to the defect features to determine the defect information of the image of the paper to be tested.
[0109] Specifically, through the convolutional layer and activation function of the model, the detailed features in the paper image to be tested are further extracted. These features include the local texture, shape and context information of the defect. Based on these detailed features, the model performs target detection and identifies the defect features in the image. By analyzing the feature map, the exact position and range of the defect are located and determined. Finally, based on the detected defect features, the model performs category prediction to determine the specific type of defect, such as holes, scratches, black spots, etc.
[0110] In this optional embodiment, the YOLOV8 model's deep feature extraction and target detection capabilities can accurately identify and locate defects in paper images, improving the accuracy of defect detection; and the fused weighted feature map provides the model with rich detail information, enabling the model to identify more types and more subtle defect features. In this embodiment, the YOLOV8 model is used to perform feature extraction, target detection, and category prediction on the fused weighted feature map, which not only improves the accuracy and efficiency of paper quality detection, but also enhances the model's adaptability and robustness to defects of different types and in complex backgrounds.
[0111] Optionally, the performing target detection according to the detail features to determine whether the image of the paper to be tested has defect features includes:
[0112] Generate a bounding box according to the coordinates of the detail features in the fused weighted feature map;
[0113] The features within the bounding box are predicted through the prediction network of the YOLOV8 model to determine whether the defect features exist.
[0114] Specifically, by identifying the feature points related to the defect on the feature map and generating a bounding box based on the coordinates of these points, the approximate area of the defect is located, providing a clear range for further analysis. Then, the prediction network of the YOLOV8 model is used to predict the features within these bounding boxes to determine whether there are defect features. The prediction network of the YOLOV8 model identifies the existence of defects and classifies them by analyzing the features within the bounding boxes.
[0115] In this optional embodiment, by generating a bounding box on the fused weighted feature map, the model can accurately locate the position of the defect, and the prediction network of the YOLOV8 model performs an in-depth analysis of the features within the bounding box, thereby improving the reliability of defect detection and reducing the possibility of false positives and negatives; and, by performing feature prediction directly within the bounding box, the model can quickly identify defects, thereby improving overall detection efficiency.
[0116] Second, combining Figure 2 As shown, the present invention provides a paper quality detection system, which is applied to the YOLOV8 model. The YOLOV8 model includes a shallow network feature extraction module, an adaptive weight downsampling module, a reversible feature fusion module and a deep network feature extraction module. The system includes:
[0117] Feature extraction unit: used for performing feature extraction operation on the paper image to be tested according to the shallow network feature extraction module to obtain an initial feature map;
[0118] An image generation unit: used for dividing the initial feature map into a plurality of feature regions when the deep network feature extraction module performs a downsampling operation on the initial feature map, and assigning weights to each of the feature regions through the adaptive weight downsampling module, and then generating a weighted feature map according to the weights of the feature regions;
[0119] Image fusion unit: used for reversely transferring the weighted feature map to the shallow network feature extraction module through the reversible feature fusion module to obtain a fused weighted feature map;
[0120] Information processing unit: used to determine the defect information of the paper image to be tested according to the fused weighted feature map through the deep network feature extraction module.
[0121] The paper quality detection system of the present invention introduces the YOLOV8 model into paper defect detection, which can quickly and accurately extract the features of paper images; in the downsampling process, by dividing the initial feature map into multiple feature areas and assigning weights to each area, it is possible to better capture defect features of different scales. The adaptive weight mechanism of the present invention enables the model to dynamically adjust the focus according to the importance of the defect features, thereby improving the detection capability of defects of smaller sizes; the feature map of the deep network is reversely transferred to the shallow network through the reversible gradient method, thereby better retaining the detail information extracted from the original image, avoiding the problem of detail information loss in the feature extraction process of the traditional deep learning model; finally, by fusing the feature maps of the deep and shallow networks, it is possible to capture the features of the defects more comprehensively, and further, it is helpful to distinguish defects of similar morphology but belonging to different types. In summary, the present invention can more accurately identify and classify defects on paper, such as defects that are small in size, complex in shape, or difficult to identify in complex backgrounds; and it integrates features and detail information of different scales, so that the model has better generalization ability when processing various types of paper defects; at the same time, the high speed characteristics of the introduced YOLOV8 model enable the present invention to quickly process a large number of paper images, achieving higher precision and higher efficiency paper defect detection.
[0122] Moreover, compared with the existing instrument scanning method for detecting paper defects, which usually requires expensive equipment and maintenance costs, the present invention can be implemented on standard computing devices by using image processing technology and machine learning algorithms, thereby greatly reducing hardware investment and operating costs, while quickly processing a large number of paper images, and can be applied in large-scale production. It also reduces the reliance on special instruments, reduces downtime caused by equipment failure or maintenance, and further improves production efficiency and economic benefits.
[0123] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc. In the present application, the unit described as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment of the present invention. In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0124] Although the present invention is disclosed as above, the protection scope of the present invention is not limited thereto. Those skilled in the art may make various changes and modifications without departing from the spirit and scope of the present invention, and these changes and modifications will fall within the protection scope of the present invention.
Claims
1. A paper quality detection method, characterized in that: The method is based on the YOLOV8 model, which includes a shallow network feature extraction module, an adaptive weight downsampling module, a reversible feature fusion module and a deep network feature extraction module. The method includes: Performing feature extraction operation on the paper image to be tested according to the shallow network feature extraction module to obtain an initial feature map; When the deep network feature extraction module performs a downsampling operation on the initial feature map, the initial feature map is divided into a plurality of feature regions, and a weight is assigned to each of the feature regions through the adaptive weight downsampling module, and then a weighted feature map is generated according to the weight of the feature region; Through the reversible feature fusion module, the weighted feature map is reversely transferred to the shallow network feature extraction module to obtain a fused weighted feature map; The defect information of the paper image to be tested is determined according to the fused weighted feature map through the deep network feature extraction module.
2. The paper quality detection method according to claim 1, characterized in that: The feature extraction operation is performed on the paper image to be tested according to the shallow network feature extraction module to obtain an initial feature map, including: Input the paper image to be tested into the YOLOV8 model, and perform feature extraction on the paper image to be tested in sequence through the multi-layer convolutional network of the shallow network feature extraction module; The output feature map of the convolutional network of the previous layer of the deep network feature extraction module is used as the initial feature map.
3. The paper quality detection method according to claim 1, characterized in that: When the deep network feature extraction module performs a downsampling operation on the initial feature map, the initial feature map is divided into a plurality of feature regions, including: When the deep network feature extraction module performs a downsampling operation on the initial feature map, determining a grid division specification according to the size data of the initial feature map; The initial feature map is divided according to the division grid to obtain a plurality of the feature regions.
4. The paper quality detection method according to claim 1, characterized in that: The adaptive weight downsampling module includes an average pooling layer and a splicing layer. The adaptive weight downsampling module is used to divide weights for each feature area, and then a weighted feature map is generated according to the weights of the feature areas, including: Through the average pooling layer, the index statistics of each of the feature regions are performed to obtain the average value corresponding to the pixel value of each of the feature regions; Through the concatenation layer, the feature regions are fused according to the average value of each feature region to obtain a fused feature map; The fused feature map is weightedly fused through the attention mechanism in the adaptive weight downsampling module to obtain the weighted feature map.
5. The paper quality detection method according to claim 4, characterized in that: The step of performing weighted fusion on the fused feature map through the attention mechanism in the adaptive weight downsampling module to obtain the weighted feature map includes: Dividing the fused feature map to obtain a plurality of non-overlapping sub-regions, wherein each of the sub-regions corresponds to at least one feature map channel; Determining an attention value of the sub-region through the feature map channel of the sub-region; Determining a weight of the sub-region according to the attention value; Weighted fusion is performed according to the weights of the sub-regions to obtain the weighted feature map.
6. The paper quality detection method according to claim 1, characterized in that: The weighted feature map is transmitted back to the shallow network feature extraction module through the reversible feature fusion module to obtain the fused weighted feature map, including: Determining target sizes of the shallow network feature extraction module and the deep network feature extraction module; By means of a reversible gradient method, the size of the weighted feature map of the deep network feature extraction module and the initial feature map output by the shallow network feature extraction module are adjusted to the target size; According to the weighted feature map and the shallow network feature map, the fused weighted feature map is obtained.
7. The paper quality detection method according to claim 6, characterized in that: The step of obtaining the fused weighted feature map according to the weighted feature map and the shallow network feature map comprises: The weighted feature map and the shallow network feature map are spatially aligned through padding and clipping operations; After the weighted feature map and the shallow network feature map are aligned, the weighted feature map and the shallow network feature map are stacked in the channel dimension to obtain an overlapping feature map; The weighted feature map and the shallow network feature map are concatenated and fused according to the overlapping feature map to obtain the fused weighted feature map.
8. The paper quality detection method according to claim 1, characterized in that: The step of determining the defect information of the paper image to be tested according to the fused weighted feature map includes: By using the deep network feature extraction module, feature extraction is performed on the fused weighted feature map to obtain detail features of the paper image to be tested; Performing target detection according to the detail features to determine whether the paper image to be tested has defect features; When the paper to be tested has defect features, category prediction is performed according to the defect features to determine the defect information of the image of the paper to be tested.
9. The paper quality detection method according to claim 8, characterized in that: The performing target detection according to the detail features to determine whether the image of the paper to be tested has defect features includes: Generate a bounding box according to the coordinates of the detail features in the fused weighted feature map; The features within the bounding box are predicted through the prediction network of the YOLOV8 model to determine whether the defect features exist.
10. A paper quality detection system, characterized in that: The system is applied to the YOLOV8 model, which includes a shallow network feature extraction module, an adaptive weight downsampling module, a reversible feature fusion module and a deep network feature extraction module. The system includes: Feature extraction unit: used for performing feature extraction operation on the paper image to be tested according to the shallow network feature extraction module to obtain an initial feature map; An image generation unit: used for dividing the initial feature map into a plurality of feature regions when the deep network feature extraction module performs a downsampling operation on the initial feature map, and assigning weights to each of the feature regions through the adaptive weight downsampling module, and then generating a weighted feature map according to the weights of the feature regions; Image fusion unit: used for reversely transferring the weighted feature map to the shallow network feature extraction module through the reversible feature fusion module to obtain a fused weighted feature map; Information processing unit: used to determine the defect information of the paper image to be tested according to the fused weighted feature map through the deep network feature extraction module.
Citation Information
Patent Citations
Paper defect classification method based on multi-scale morphology combined with convolutional neural network
CN108427969A
Power transmission line defect detection method based on hierarchical region feature fusion learning
CN110335270A
Paper defect detection method based on improved YOLOv5
CN115457026A
Leather defect detection method based on refined segmentation network
CN115861323A
Unsupervised notebook appearance defect detection method based on multi-scale standardized flow
CN116205876A
Cited By
High-voltage equipment oil paper insulation defect identification method, system, equipment and medium
CN120088489A