Non-woven fabric packaging bag quality inspection method based on machine vision

CN122928801APending Publication Date: 2026-10-16XUMEIDA (SICHUAN) NEW MATERIAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611125862.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-28
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0008]基于已训练的缺陷检测模型对所述检测图像进行处理,得到缺陷区域掩膜;基于所述缺陷区域掩膜提取各缺陷的属性,所述属性至少包括缺陷的位置、面积和对比度;根据缺陷的位置与所述多个功能区域的掩膜的空间对应关系,确定各缺陷所处的功能区域,并赋予与该功能区域对应的预设的分区关键系数,所述分区关键系数表征不同功能区域对缺陷的容忍程度;利用缺陷的对比度和面积,生成各缺陷的视觉显著性值,所述视觉显著性值衡量缺陷在视觉上的醒目程度;针对每个缺陷,依据其位置与其他缺陷的位置之间的距离关系,获得一聚集增强因子,所述聚集增强因子反映因缺陷空间聚集而导致的风险放大程度;将所述视觉显著性值、所述分区关键系数和所述聚集增强因子相乘,得到该缺陷的有效危险度,所述有效危险度是综合考虑了缺陷显著程度、区域重要度和聚集效应的单一缺陷风险度量;融合所有缺陷的有效危险度,生成表征包装袋整体质量风险的综合风险指数;将所述综合风险指数与预设的多级质量阈值进行比较,输出质检判定结果

Benefits of technology

[0022]1.通过引入“分区关键系数”,为提手连接区、缝合边缘区等受力或密封关键部位赋予更高的风险权重,实现了缺陷风险评估与产品实际功能区域的深度绑定。这使得一个位于关键区域的小缺陷能被准确识别出其高风险特性,避免了传统方法中“一刀切”式评估带来的误判。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122928801A_ABST
    Figure CN122928801A_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of machine vision detection, and relates to a non-woven fabric packaging bag quality inspection method based on machine vision. The method obtains a plurality of functional area masks of the packaging bag through a semantic segmentation model, simultaneously obtains a defect area mask through a defect detection model, and extracts the position, area and contrast of the defect; generates a visual saliency value based on the contrast and area of the defect, gives a partition key coefficient according to the functional area where the defect is located, and calculates an aggregation enhancement factor according to the spatial distance between defects; multiplies the three to obtain the effective risk degree of a single defect; fuses the effective risk degrees of all defects to generate a comprehensive risk index, and compares the comprehensive risk index with a multi-level quality threshold to output a graded quality inspection judgment result. The present application multi-dimensionally fuses the visual saliency, area importance and spatial aggregation effect of defects, realizes accurate evaluation and fine grading of the quality risk of the packaging bag, and significantly improves the reliability and accuracy of quality inspection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of machine vision inspection technology, and relates to a machine vision-based method for quality inspection of nonwoven packaging bags. Background Technology

[0002] Non-woven packaging bags are widely used in food, daily chemical, and industrial packaging due to their lightweight, low cost, and environmental friendliness. However, during production, factors such as raw materials, processes, and equipment can lead to various defects on the packaging bag surface, including holes, stains, and skipped stitches, severely affecting the product's sealing performance, aesthetics, and brand image. Therefore, efficient and accurate quality inspection of non-woven packaging bags is crucial.

[0003] Traditional manual visual inspection relies on operator experience and subjective judgment, which is not only inefficient and costly, but also prone to missed detections and misjudgments due to the difficulty in standardizing procedures. With the development of machine vision technology, automated defect detection solutions are gradually being adopted. However, most current solutions only focus on identifying defects and their dimensions, and their judgment logic is relatively simple.

[0004] Existing technologies have at least the following shortcomings: First, they do not fully consider the differences in the impact of defects on product quality depending on the functional area where the defect is located. For example, a tiny stain located in the main body of the bag and a tiny crack located in the handle connection area pose drastically different potential risks, but traditional methods may assign the same quality rating due to similar defect areas. Second, they do not effectively assess the synergistic amplification effect of dispersed tiny defects due to spatial aggregation. Several tiny holes distributed in a region may be acceptable individually, but when clustered together, they form a high-risk structural weakness. This simplistic and isolated assessment method leads to low accuracy and reliability of quality inspection results, failing to truly reflect the quality risks that may arise in actual use. Summary of the Invention

[0005] The purpose of this invention is to provide a machine vision-based quality inspection method for nonwoven packaging bags, thereby solving the aforementioned technical problems.

[0006] The technical solution adopted in this invention is as follows:

[0007] A machine vision-based quality inspection method for nonwoven packaging bags includes: acquiring at least one detection image of the nonwoven packaging bag; and processing the detection image based on a trained semantic segmentation model to obtain a mask for multiple functional regions.

[0008] The detected image is processed based on a trained defect detection model to obtain a defect region mask. Attributes of each defect are extracted based on the defect region mask, including at least the defect's location, area, and contrast. The functional region of each defect is determined according to the spatial correspondence between its location and the masks of the multiple functional regions, and a preset partitioning key coefficient is assigned to each functional region. This partitioning key coefficient represents the tolerance level of different functional regions to defects. Visual saliency values ​​are generated for each defect using its contrast and area, measuring the visual prominence of the defect. For each defect, an aggregation enhancement factor is obtained based on its location and the distance between its location and the locations of other defects. This aggregation enhancement factor reflects the degree of risk amplification caused by spatial aggregation of defects. The effective risk of the defect is obtained by multiplying the visual saliency value, the partitioning key coefficient, and the aggregation enhancement factor. This effective risk is a single defect risk measure that comprehensively considers defect saliency, regional importance, and aggregation effect. The effective risk values ​​of all defects are merged to generate a comprehensive risk index characterizing the overall quality risk of the packaging bag. The comprehensive risk index is compared with preset multi-level quality thresholds to output the quality inspection judgment result.

[0009] Optionally, the visual saliency value is obtained by multiplying the contrast of the defect by its area and then normalizing the result.

[0010] Optionally, obtaining an aggregation enhancement factor includes:

[0011] A spatial radius is preset, and for each defect, the number of other defects existing within the spatial radius centered on the defect location is counted, and the aggregation enhancement factor is calculated based on the number, wherein the aggregation enhancement factor is equal to 1 plus the product of the number and a preset amplification factor.

[0012] Optionally, the method of integrating the effective risk levels of all defects to generate a comprehensive risk index includes:

[0013] Calculate the sum of the effective hazard levels of all defects and add a penalty term that is proportional to the product of the total number of defects and the maximum value among all effective hazard levels.

[0014] Optionally, the plurality of functional areas include a bag body area, a handle connection area, a sewn edge area, and a printed graphic area; wherein, the partition critical coefficients corresponding to the handle connection area and the sewn edge area are greater than the partition critical coefficients corresponding to the bag body area and the printed graphic area.

[0015] Optionally, the defect detection model is a deep instance segmentation network, which is trained to segment at least one of holes, stains, and skipped stitches from the detection image.

[0016] Optionally, the multi-level quality threshold includes a first threshold and a second threshold, wherein the first threshold is less than the second threshold; the output quality inspection judgment result includes:

[0017] If the comprehensive risk index is less than the first threshold, it is determined to be a superior product;

[0018] If the comprehensive risk index is between the first threshold and the second threshold, it is determined to be a qualified product;

[0019] If the comprehensive risk index is greater than the second threshold, the product is determined to be unqualified.

[0020] Secondly, a control signal is generated based on the quality inspection judgment result to drive the rejection device to separate the non-woven packaging bags that are judged to be unqualified from the conveyor line.

[0021] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:

[0022] 1. By introducing a "zoning critical coefficient," higher risk weights are assigned to critical stress or sealing areas such as handle connection areas and seam edge areas, achieving a deep integration of defect risk assessment with the actual functional areas of the product. This allows a small defect located in a critical area to be accurately identified as having high-risk characteristics, avoiding misjudgments caused by the "one-size-fits-all" assessment in traditional methods.

[0023] 2. By calculating the "aggregation enhancement factor," this invention can quantify the structural weakness risk caused by the aggregation of multiple spatially adjacent micro-defects. This mechanism effectively prevents products from being missed due to the dense distribution of a large number of micro-defects, significantly improving the rigor of the inspection.

[0024] 3. This invention does not simply determine the presence or size of defects, but rather organically integrates the visual salience of defects, the importance of their location, and the spatial clustering effect among defects to calculate a unified "effective hazard level," ultimately generating a "comprehensive risk index." This multi-dimensional and in-depth information fusion approach makes the output quality assessment results more comprehensive, objective, and reliable, truly reflecting the overall quality risk of the product.

[0025] 4. By comparing the comprehensive risk index with preset multi-level quality thresholds, the system can achieve refined and automatic sorting of superior, qualified, and unqualified products, providing technical support for adapting differentiated downstream processing procedures for products of different grades and meeting the requirements of modern production for refined quality management. Attached Figure Description

[0026] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort, wherein:

[0027] Figure 1 This is a schematic diagram of a machine vision-based quality inspection method for nonwoven packaging bags. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only for explaining the invention and are not intended to limit the invention; that is, the described embodiments are merely some embodiments of the invention, and not all embodiments. The components of the embodiments of the invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0029] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0030] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0031] The features and performance of the present invention will be further described in detail below with reference to embodiments.

[0032] Example 1:

[0033] The preferred embodiment of the present invention provides a machine vision-based quality inspection method for non-woven packaging bags, which aims to build a defect evaluation system that can comprehensively assess multi-dimensional risk information, thereby outputting more accurate and reliable quality judgment results.

[0034] First, acquire at least one inspection image of the nonwoven packaging bag. This inspection image is taken by a high-resolution industrial camera under standard lighting conditions, clearly revealing all details of the packaging bag's surface.

[0035] Next, the trained semantic segmentation model is used to process the detected images to obtain masks for multiple functional regions. This semantic segmentation model employs an encoder-decoder structure from deep learning. The encoder part extracts multi-scale features from the detected images through multi-layer convolution and pooling operations, while the decoder part restores the spatial resolution of the feature map through upsampling and skip connections, ultimately outputting pixel-level classification results of the same size as the input detected image. The training process of this semantic segmentation model is as follows: First, several sample images of non-woven fabric packaging bags are collected, and each sample image is manually labeled pixel-by-pixel with category labels for four functional regions: the main body area of ​​the bag, the handle connection area, the stitching edge area, and the printed graphic area, forming a semantic segmentation training dataset. Then, using the cross-entropy loss function as the target, the semantic segmentation model is trained under supervised learning using this training dataset until the model converges. After training, the detected images are input into the trained semantic segmentation model, which outputs a segmentation map of the same size as the detected image. Each pixel in the segmentation map is assigned a category label, and all pixels belonging to the same functional region constitute the mask for that functional region, thus obtaining the masks for each of the four functional regions. The functional regions refer to the parts of the packaging bag that have different functions and structural importance. Semantic segmentation models can achieve pixel-level region division, laying the foundation for subsequent differentiated weighting.

[0036] Meanwhile, the trained defect detection model is used to process the same detection image to obtain a defect region mask. This defect detection model employs a deep instance segmentation network, specifically the Mask R-CNN network structure, which adds a segmentation branch parallel to the detection branch on top of the Faster R-CNN object detection framework. The processing flow of this defect detection model is as follows: First, the backbone network performs convolutional feature extraction on the detection image to generate a feature map of the entire image; then, the region proposal network generates several candidate regions that may contain defects on this feature map; next, a region of interest alignment operation is performed on each candidate region to obtain a local feature map of fixed size; finally, the classification branch outputs the probability that the candidate region belongs to the category of hole, stain, or skipped stitch, the detection box regression branch outputs the precise location box coordinates of the defect, and the segmentation branch outputs a pixel-by-pixel binary mask within the candidate region. This binary mask is the defect region mask. The training process of this defect detection model is as follows: First, several sample images of non-woven packaging bags containing defects such as holes, stains, and skipped stitches are collected. Each defect is manually labeled with its bounding box coordinates, category label, and pixel-level contour mask, forming a defect detection training dataset. Then, a multi-task loss function is used for end-to-end supervised training of the defect detection model. This multi-task loss function is a weighted sum of classification loss, detection box regression loss, and segmentation mask loss. Training continues until the model converges. After training, the detected images are input into the trained defect detection model, and the model outputs the category label, bounding box coordinates, and defect region mask for each detected defect. This defect detection model is used to accurately locate and segment all defects.

[0037] The processing of these two models can be executed in parallel or serially, and their outputs provide two types of basic spatial information, namely "region" and "defect", for all subsequent calculations.

[0038] Based on this, multidimensional risk information is extracted and fused, a process consisting of the following steps:

[0039] The first step is to extract the visual saliency features of defects. Based on the defect region mask, the attributes of each defect are extracted. These attributes include at least the defect's location, area, and contrast. Location is the center coordinate of the defect, area is the total number of pixels occupied by the defect, and contrast is the grayscale difference between the defect area and the surrounding normal area. Using the contrast and area of ​​the defects, a visual saliency value is generated for each defect. The visual saliency value measures the visual prominence of a defect. The principle is that high-contrast, large-area defects are more easily detected by the naked eye and therefore have a higher initial risk. A specific calculation method is to multiply the defect's contrast by its area and then normalize the value to map it to a standardized range. For example, multiplying the contrast value of each defect by its area value and then dividing all the products by the largest product value yields a visual saliency value ranging from 0 to 1.

[0040] The second step is to assess the regional risk of the defect's location. Based on the spatial correspondence between the defect's location and the masks of multiple functional areas, the functional area where each defect is located is determined, and a preset zone criticality coefficient is assigned to that functional area. The zone criticality coefficient characterizes the tolerance of different functional areas to defects. The principle for setting it is: critical areas that bear structural stress or perform sealing functions (such as the handle connection area and seam edge area) have extremely low tolerance for defects, and therefore are assigned a higher zone criticality coefficient (e.g., 1.5 or 2.0); while non-critical areas that mainly affect aesthetics (such as the main body of the bag and printed graphics areas) have relatively lower zone criticality coefficients (e.g., 0.5 or 1.0). Through this mechanism, a small defect located in the handle connection area will have its risk magnified many times over.

[0041] The third step is to quantify the clustering risk of defects in their spatial distribution. For each defect, a clustering enhancement factor is obtained based on its location and the distance between it and the locations of other defects. The clustering enhancement factor reflects the degree of risk amplification caused by the spatial clustering of defects. Its calculation principle is as follows: a spatial radius is preset (e.g., 50 pixels); for each defect, the number of other defects existing within this spatial radius centered on the defect's location is counted, and the clustering enhancement factor is calculated based on this number. If the number is 0, the clustering enhancement factor is 1, indicating no clustering effect; if the number is greater than 0, the clustering enhancement factor is equal to 1 plus the product of the number and a preset amplification factor. The amplification factor is used to adjust the risk amplification factor of the clustering effect. This demonstrates that when multiple small defects cluster together, they form a structurally weak area that is more severe than the simple sum of their individual components.

[0042] The fourth step is to generate the effective risk of a single defect. The effective risk is obtained by multiplying the visual saliency value, zoning criticality coefficient, and clustering enhancement factor obtained in the previous steps. The effective risk is a single defect risk measure that integrates three pieces of information: "visual prominence," "location criticality," and "distribution density." This multiplication is not a simple weighted sum; it represents the coupling and multiplicative relationship between the three risk factors. A change in any one factor will cause a significant non-linear change in the final risk value.

[0043] The fifth step is to integrate individual risks into overall risk. This involves aggregating the effective hazard levels of all defects to generate a comprehensive risk index characterizing the overall quality risk of the packaging bag. An effective aggregator not only considers the sum of all individual risks but also introduces a penalty term to reflect the overall risk of densely packed defects. Specifically, the comprehensive risk index equals the sum of the effective hazard levels of all defects, plus a penalty term proportional to the product of the total number of defects and the maximum value among all effective hazard levels. The significance of introducing the penalty term is that when a product has a large number of high-risk defects, even if these high-risk defects are not clustered together, its overall unreliability should be non-linearly amplified. This aligns more closely with the actual assessment logic of engineering risks.

[0044] Finally, a graded quality assessment is performed. The comprehensive risk index is compared with preset multi-level quality thresholds, and the quality inspection result is output. The multi-level quality thresholds include at least a first threshold and a second threshold, with the first threshold being less than the second threshold. If the comprehensive risk index is less than the first threshold, it is judged as a superior product; if the comprehensive risk index is between the first and second thresholds, it is judged as a qualified product; if the comprehensive risk index is greater than the second threshold, it is judged as a non-qualified product. Furthermore, this method can also generate a control signal based on the assessment result to drive a rejection device to separate the non-woven packaging bags judged as non-qualified from the conveyor line.

[0045] Example 2:

[0046] This embodiment is based on Embodiment 1 and uses a specific production testing example to illustrate the technical solution of the present invention.

[0047] At the end of a non-woven bag production line, a machine vision quality inspection system is deployed. The system includes a 5-megapixel industrial camera, a ring-shaped LED light source, and an industrial computer with a built-in GPU. The conveyor belt transports the finished non-woven packaging bags at a speed of 0.5 meters per second.

[0048] The system acquires a front image of the non-woven packaging bag to be inspected. The bag is rectangular, measuring 400 mm × 250 mm.

[0049] First, the industrial control computer loads the trained semantic segmentation model and defect detection model. After processing the image, the semantic segmentation model outputs masks for four functional regions: the main body of the bag, the handle connection area (top and bottom), the seam edge area (left and right sides and bottom), and the printed graphic area (the central trademark pattern). The key coefficients for each region are preset as follows: 0.6 for the main body of the bag, 0.8 for the printed graphic area, 3.0 for the handle connection area, and 2.5 for the seam edge area.

[0050] Meanwhile, the defect detection model (a trained Mask R-CNN network) processed the same image and detected three defects:

[0051] Defect A: An ink stain located in the printed graphic area, with an area of ​​15 square millimeters and a contrast (average grayscale difference) of 30.

[0052] Defect B: A tiny hole located near the bottom of the main body of the bag, with an area of ​​0.5 square millimeters and a contrast of 80.

[0053] Defect C: A tiny hole located at the bottom of the main body area of ​​the bag, adjacent to defect B. The distance between the center of the hole and the center of defect B is only 2 mm. The area is 0.4 square millimeters and the contrast is 85.

[0054] Next, the system performs calculations:

[0055] Calculate the visual saliency value:

[0056] First, multiply the contrast by the area to obtain the original saliency value.

[0057] Defect A: 30 × 15 = 450; Defect B: 80 × 0.5 = 40; Defect C: 85 × 0.4 = 34; After normalization, all values ​​are divided by the maximum value of 450. The visual salience value of defect A = 450 / 450 = 1.0; the visual salience value of defect B = 40 / 450 ≈ 0.089; the visual salience value of defect C = 34 / 450 ≈ 0.076.

[0058] Assign a key factor to the partition:

[0059] Based on the location of the defects, defect A is determined to belong to the printed graphic area, and a criticality coefficient of 0.8 is assigned to it; defects B and C both belong to the main body area of ​​the bag, and a criticality coefficient of 0.6 is assigned to them.

[0060] Calculate the aggregation enhancement factor:

[0061] The preset spatial radius is 10 mm. The distance between defects B and C is 2 mm, which is less than 10 mm, and they are considered to be adjacent defects.

[0062] For defect A, there are no other defects within its 10 mm radius, and the number of neighboring defects is 0. Its aggregation enhancement factor = 1 + 0 × magnification factor = 1.

[0063] For defect B, there is one other defect (defect C) within its 10 mm radius, and the number of neighboring defects is 1. The preset magnification factor is 0.5. Its aggregation enhancement factor = 1 + 1 × 0.5 = 1.5.

[0064] Similarly, for defect C, there is one other defect (defect B) within its 10 mm radius. Its aggregation enhancement factor = 1 + 1 × 0.5 = 1.5.

[0065] Calculate the effective hazard level:

[0066] The effective risk of defect A = 1.0 × 0.8 × 1 = 0.80; the effective risk of defect B = 0.089 × 0.6 × 1.5 ≈ 0.080; the effective risk of defect C = 0.076 × 0.6 × 1.5 ≈ 0.068.

[0067] The results show that, due to its high significance, defect A, although located in a non-critical area, still has a much higher effective risk (0.80) than a single small hole. Defects B and C, due to their aggregation effect, both showed a 50% increase in effective risk compared to when they were not aggregated (0.053 and 0.046, respectively).

[0068] Generate a comprehensive risk index:

[0069] First, calculate the sum of the effective hazard values ​​of all defects: 0.80 + 0.080 + 0.068 = 0.948.

[0070] Next, calculate the penalty. The total number of defects is 3, and the maximum value among all valid risks is 0.80. The preset penalty factor is 0.2. Penalty = 0.2 × 3 × 0.80 = 0.48.

[0071] Overall risk index = 0.948 + 0.48 = 1.428.

[0072] Output quality inspection results:

[0073] The system has preset multiple quality thresholds: the first threshold is 0.8, and the second threshold is 1.2.

[0074] Because the comprehensive risk index of 1.428 is greater than the second threshold of 1.2, the non-woven packaging bag is judged to be a "non-conforming product".

[0075] The industrial control computer then sends a control signal to drive the downstream air-blowing rejection device to blow the packaging bag into the non-conforming product collection box.

[0076] As can be seen from this embodiment, although the areas of individual micro-defects B and C are negligible and easily overlooked in traditional inspection, the method of this invention successfully captures the local risk they collectively form through an aggregation enhancement factor. Ultimately, this risk is superimposed on the risk of the highly significant stain defect A, and further amplified by the penalty term for the total number of defects and the maximum risk, causing the product's overall risk index to exceed the threshold and thus correctly determine it as unqualified. This demonstrates the sensitivity and accuracy of the method of this invention in risk assessment.

[0077] This embodiment addresses the shortcomings of existing nonwoven packaging bag quality inspection technologies, such as a single defect assessment dimension, failure to consider the differences in functional areas where defects are located, and neglect of the spatial clustering effect of defects. It proposes a multi-dimensional risk fusion quality inspection method based on machine vision.

[0078] Its core principle can be summarized as "extraction of two types of spatial information, multiplication of three risk factors, and fusion judgment of two-stage risks".

[0079] First, two types of basic spatial information are obtained from the same detection image using two parallel deep learning models. The semantic segmentation model is responsible for dividing the packaging bag into multiple functional areas such as the main body area, handle connection area, seam edge area, and printed graphic area, providing a basis for differentiated weighting; the defect detection model is responsible for accurately identifying and segmenting defects such as holes, stains, and skipped stitches, and extracting the location, area, and contrast attributes of each defect.

[0080] Then, based on the two types of spatial information mentioned above, the risk of each defect is quantified from three dimensions and multiplied to form a single effective hazard level. The three risk dimensions are: visual salience value, determined by the defect's contrast and area, measuring its visual prominence; zoning criticality coefficient, determined by the functional area where the defect is located, with higher risk weights assigned to structural load-bearing areas, reflecting the differences in defect tolerance across different areas; and clustering enhancement factor, determined by the spatial distance between the defect and other surrounding defects, quantifying the structural risk amplification effect caused by defect clustering. Multiplying these three factors means that an increase in any one factor will lead to a non-linear jump in the risk value, truly reflecting the coupling relationship between quality defects and risk.

[0081] Finally, a two-stage risk fusion is performed to obtain an overall quality assessment. In the first stage, the effective hazard levels of all individual defects are summed, and a penalty term with the total number of defects and the maximum hazard level as variables is added to generate a comprehensive risk index. This penalty term amplifies the overall unreliability of a product when there are many defects, including high-hazard defects. In the second stage, this comprehensive risk index is compared with preset multi-level quality thresholds to classify products as superior, qualified, or unqualified, and this information can directly drive the rejection device for automatic sorting.

[0082] In summary, this solution constructs a three-dimensional risk multiplication model of "salience-location-clustering" and introduces an overall penalty mechanism based on defect density and severity, thereby achieving a refined and multi-dimensional comprehensive assessment of the quality risks of non-woven packaging bags and significantly improving the accuracy and reliability of quality inspection results.

[0083] Example 3:

[0084] This embodiment, based on Embodiment 1, provides a more refined implementation of the "quantification of the clustering risk of spatial distribution of defects" process in Embodiment 1. In the scheme of Embodiment 1, the calculation of the clustering enhancement factor uses a preset fixed spatial radius and counts the number of other defects within that radius. While this method is simple and efficient, it does not consider the different spatial influence ranges of different defects due to their size variations. For example, a large hole has a much larger structural influence range than a tiny pinhole. Using a uniform fixed radius may lead to insufficient assessment of the clustering risk of large defects or over-assessment of the clustering risk of small defects.

[0085] This embodiment introduces an adaptive neighborhood risk weighting model based on the defect's own size to refine the calculation of the aggregation enhancement factor, making the risk assessment more in line with physical reality.

[0086] The specific plan is as follows:

[0087] When extracting the attributes of each defect, in addition to location, area, and contrast, the equivalent influence radius of each defect is also extracted. The equivalent influence radius refers to the radius of a circle centered on the defect that covers its entire area. For irregularly shaped defects, the equivalent influence radius can be obtained by converting the defect area into the area of ​​a circle and then calculating the radius. For example, if the area of ​​a defect is S pixels, its equivalent influence radius is... .

[0088] When calculating the aggregation enhancement factor, a uniform preset spatial radius is no longer used. Instead, an adaptive influence range is defined for each defect. For any target defect i, its adaptive influence range is a circle centered on the location of target defect i and extending to the equivalent influence radius of target defect i. Multiply by a preset expansion ratio k to form a circular region with radius k. The expansion ratio k is a constant greater than 1, for example, 2.0 or 3.0, and its physical meaning is that the structural influence range of the defect is several times its own visible size.

[0089] Then, for the target defect i, iterate through all other defects j except for the target defect i, and calculate the Euclidean distance between the positions of the other defects j and the position of the target defect i. If the positions of other defects j fall within the adaptive influence range of the target defect i, then the condition is satisfied. If so, then the other defect j is considered a neighboring defect of the target defect i.

[0090] For each neighboring defect j, instead of simply counting them, a proximity risk contribution value is calculated between it and the target defect i. This proximity risk contribution value comprehensively considers both the area of ​​the neighboring defect j and its distance from the target defect i. Specifically, the proximity risk contribution value is equal to the area of ​​the neighboring defect j. Divide by The square of . That is, contribution value = The physical meaning of this formula is that the larger the area of ​​the neighboring defect, the stronger its structural weakening effect on the target defect; while the farther the neighboring defect is from the target defect, the more its influence decreases with the square of the distance, which is consistent with the general law of stress influence decreasing with distance in structural mechanics.

[0091] The sum of the risk contributions of all neighboring defects j of target defect i is obtained by summing the clustering risk sum of target defect i. Then, the clustering enhancement factor of target defect i is calculated based on this clustering risk sum. A specific calculation method is: Clustering enhancement factor = 1 + α × log(1 + Clustering risk sum), where α is a preset adjustment coefficient. A logarithmic function is used here for compression because when the clustering risk sum is extremely large, its amplification effect on the overall risk should tend to level off rather than grow infinitely linearly, avoiding a single indicator dominating the final judgment result. Of course, other monotonically increasing and bounded function forms, such as the arctangent function, can also be used; the core is to map the clustering risk sum to a moderate enhancement ratio.

[0092] Finally, following the same procedure as in Example 1, the aggregation enhancement factor is multiplied by the visual saliency value and the partition criticality coefficient to obtain the effective risk level of the defect, and the subsequent comprehensive risk index calculation and judgment process continues.

[0093] The adaptive neighborhood weighted model in this embodiment achieves the following technical effects:

[0094] First, the scope of influence is adaptive to the defect size. Large defects automatically acquire a larger radius of influence, and their potential clustering effect is captured more fully; the scope of influence of small defects is reasonably limited, avoiding the risk of over-amplifying tiny defects.

[0095] Secondly, distance-weighted assessment allows for more precise risk evaluation. Within the scope of influence, defects closer in distance contribute more, rather than treating all defects equally, which better aligns with the physical intuition of actual risk transmission.

[0096] Third, the introduction of a compression function allows the clustering enhancement factor to grow moderately. Even if the defects are in an extremely dense distribution, the clustering enhancement factor will not increase indefinitely, leading to decision imbalance, thus ensuring the robustness of the algorithm.

[0097] The refined scheme in this embodiment can be used alone or as an upgraded alternative to the fixed radius counting method in Embodiment 1.

[0098] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A machine vision-based quality inspection method for nonwoven packaging bags, characterized in that, include: Obtain at least one inspection image of the nonwoven packaging bag; The detected image is processed based on the trained semantic segmentation model to obtain masks for multiple functional regions; The detected image is processed based on the trained defect detection model to obtain a defect region mask; The attributes of each defect are extracted based on the defect region mask, and the attributes include at least the location, area and contrast of the defect; Based on the spatial correspondence between the location of the defect and the mask of the multiple functional areas, the functional area where each defect is located is determined, and a preset partitioning key coefficient is assigned to the functional area. The partitioning key coefficient represents the tolerance of different functional areas to defects. By utilizing the contrast and area of ​​the defects, a visual salience value is generated for each defect, which measures the visual prominence of the defect. For each defect, an aggregation enhancement factor is obtained based on the distance relationship between its location and the locations of other defects. The aggregation enhancement factor reflects the degree of risk amplification caused by the spatial aggregation of defects. The effective risk of the defect is obtained by multiplying the visual saliency value, the zoning criticality coefficient, and the clustering enhancement factor. The effective risk is a single defect risk measure that comprehensively considers the defect saliency, regional importance, and clustering effect. By integrating the effective risk levels of all defects, a comprehensive risk index is generated that characterizes the overall quality risk of the packaging bag. The comprehensive risk index is compared with the preset multi-level quality thresholds, and the quality inspection judgment result is output.

2. The machine vision-based quality inspection method for nonwoven packaging bags according to claim 1, characterized in that, The visual saliency value is obtained by multiplying the contrast of the defect by its area and then normalizing the result.

3. The machine vision-based quality inspection method for nonwoven packaging bags according to claim 2, characterized in that, Obtaining an aggregation enhancement factor includes: A spatial radius is preset, and for each defect, the number of other defects existing within the spatial radius centered on the defect location is counted, and the aggregation enhancement factor is calculated based on the number, wherein the aggregation enhancement factor is equal to 1 plus the product of the number and a preset amplification factor.

4. The machine vision-based quality inspection method for nonwoven packaging bags according to claim 2, characterized in that, The effective risk level of all defects is integrated to generate a comprehensive risk index, including: Calculate the sum of the effective hazard levels of all defects and add a penalty term that is proportional to the product of the total number of defects and the maximum value among all effective hazard levels.

5. The machine vision-based quality inspection method for nonwoven packaging bags according to claim 2, characterized in that, The multiple functional areas include the main body area of ​​the bag, the handle connection area, the stitched edge area, and the printed graphic area; wherein, the partition critical coefficients corresponding to the handle connection area and the stitched edge area are greater than the partition critical coefficients corresponding to the main body area of ​​the bag and the printed graphic area.

6. The machine vision-based quality inspection method for nonwoven packaging bags according to claim 1, characterized in that, The defect detection model is a deep instance segmentation network, which is trained to segment at least one of the following defects from the detection image: holes, stains, and skipped stitches.

7. The machine vision-based quality inspection method for nonwoven packaging bags according to claim 1, characterized in that, The multi-level quality thresholds include a first threshold and a second threshold, wherein the first threshold is less than the second threshold; the output quality inspection judgment result includes: If the comprehensive risk index is less than the first threshold, it is determined to be a superior product; If the comprehensive risk index is between the first threshold and the second threshold, it is determined to be a qualified product; If the comprehensive risk index is greater than the second threshold, the product is determined to be unqualified. Secondly, a control signal is generated based on the quality inspection judgment result to drive the rejection device to separate the non-woven packaging bags that are judged to be unqualified from the conveyor line.