Ready-to-eat prefabricated dish package airtightness identification method based on image analysis

By fusing multimodal image features and adjusting parameters in real time, the problem of misjudgment in the airtightness detection of ready-to-eat pre-prepared food packaging was solved, achieving highly reliable and intelligent airtightness identification and improving detection accuracy and efficiency.

CN121482549APending Publication Date: 2026-02-06SHAOGUAN QUJIANG XINGCHANG NON WOVEN TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511674173.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-14
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

Existing methods for detecting the airtightness of ready-to-eat pre-prepared food packaging rely on single image features, which are prone to misjudgment in complex environments and lack dynamic evaluation and compensation mechanisms, resulting in low recognition reliability.

Method used

By employing an image analysis-based approach, which integrates visible light edge features, infrared temperature features, and texture features, a multimodal feature saliency matrix is ​​constructed. Through real-time adjustment of image acquisition parameters and feature compensation mechanisms, combined with defect confidence and physical re-inspection, highly reliable airtightness identification is achieved.

Benefits of technology

It improves the accuracy and robustness of airtightness testing, reduces the workload of physical re-inspection, realizes intelligent and standardized testing, and ensures testing efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121482549A_ABST
    Figure CN121482549A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of food package detection, in particular to a ready-to-eat prefabricated dish package airtightness identification method based on image analysis, which comprises the following steps: calculating a clear quality quantitative index through an infrared image collected in real time to obtain a high-quality package image; extracting multi-modal defect features such as visible light edge, infrared temperature and texture from the packaging image, constructing a feature saliency matrix, and performing multi-modal fusion compensation based on the reliability of each feature channel to obtain a standard feature saliency matrix; calculating a defect confidence coefficient according to the matrix so as to determine whether to trigger air tightness physical reinspection or not; and finally, combining the defect confidence coefficient with a physical recheck result, calculating an air tightness index, and completing the final judgment of the air tightness of the package. Through the multi-modal feature fusion and reliability compensation mechanism, the accuracy, the robustness and the automation level of package airtightness recognition are remarkably improved, and the defects that in the prior art, dependence on a single feature is high, and misjudgment is prone to occurring in a complex environment are effectively overcome.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of food packaging inspection technology, and in particular to a method for identifying the airtightness of ready-to-eat pre-prepared food packaging based on image analysis. Background Technology

[0002] The airtightness of ready-to-eat pre-prepared food packaging directly affects the food's hygiene, safety, and shelf life. Currently, commonly used airtightness testing methods mainly include visual inspection, water testing, or air pressure testing. These methods suffer from low efficiency, high subjectivity, and inability to provide comprehensive coverage.

[0003] Chinese invention patent CN105136396A discloses a packaging sealing airtightness testing device, comprising a frame, a support platform and a cylinder mounted on the frame, a pressure plate connected to the cylinder and located directly above the support platform, a pressure sensor mounted on the support platform, and an image acquisition sensor mounted on the frame and facing the support platform. While this invention applies pressure to the packaging bag using the pressure plate, detects the pressure value using the pressure sensor, and monitors the condition of the packaging bag using the image acquisition sensor to determine whether the sealing of the batch of packaging bags meets the requirements, it still suffers from technical problems such as relying heavily on single image features, being prone to misjudgment under complex lighting, reflection, or noise interference, and lacking a dynamic evaluation and compensation mechanism for the reliability of the features.

[0004] Therefore, there is an urgent need for a highly reliable packaging airtightness identification method that can integrate multimodal image features and has adaptive compensation capabilities. Summary of the Invention

[0005] To address these issues, this invention provides an image analysis-based method for identifying the airtightness of ready-to-eat pre-prepared food packaging. This method overcomes the problems of existing technologies that rely on single image features, leading to easy misjudgment in complex environments, low recognition reliability, and a lack of dynamic evaluation and compensation mechanisms for feature reliability.

[0006] To achieve the above objectives, this invention provides a method for identifying the airtightness of ready-to-eat pre-prepared food packaging based on image analysis, comprising the following steps: Step S1: Based on the real-time acquired infrared image, determine the clarity quality quantification index, and adjust the image acquisition parameters based on the clarity quality quantification index to obtain the packaging image. The image acquisition parameters include light source power, exposure time, and shutter mode; Step S2: Extract packaging defect features from the packaging image; construct a feature saliency matrix based on the packaging defect features; and determine multimodal fusion compensation for the defect features according to the feature saliency matrix to obtain a standard feature saliency matrix, wherein... The packaging defect features include visible light edge features, infrared temperature features, and texture features; The multimodal fusion compensation includes collaborative compensation of the visible light edge features and infrared temperature features, collaborative compensation of the infrared temperature features and texture features, and repair compensation of the texture features; Step S3: Determine the defect confidence level of the packaging image based on the standard feature saliency matrix, and determine the trigger for physical re-inspection of airtightness based on the defect confidence level; Step S4: Perform a physical re-inspection of the airtightness of the packaging, determine the airtightness index based on the results of the physical re-inspection and the defect confidence level, and finally determine whether the airtightness of the packaging is qualified.

[0007] Further, in step S1, the process of determining the clarity quality quantification index based on the real-time acquired infrared image includes: Step S111: Obtain the horizontal gradient set and the vertical gradient set of the infrared image; Step S112: Determine the mean edge gradient based on the set of horizontal gradients and the set of vertical gradients; Step S113: Calculate the noise variance of the infrared image using the Gaussian filtered residual; Step S114: The ratio of the mean edge gradient to the variance of the noise is determined as the clarity quality quantification index.

[0008] Further, in step S1, the process of determining the adjustment of image acquisition parameters based on the clarity quality quantification index includes: Step S121: Compare and analyze the clear quality quantification index with the preset quantification index; Step S122: Based on the result that the sharpness quality quantification index is less than the first preset quantification index, determine to adjust and reduce the exposure time, and at the same time enable the global shutter mode. Step S123: Based on the result that the clarity quality quantification index is greater than or equal to the first preset quantification index and the clarity quality quantification index is less than the second preset quantification index, determine to gradually increase the light source power. Step S124: Based on the result that the clarity quality quantification index is greater than or equal to the second preset quantification index, determine that the clarity meets the standard.

[0009] Furthermore, in step S2, the process of constructing a feature saliency matrix based on the packaging defect features includes: Step S211: Perform edge detection on the packaging image, extract the contour of the packaging sealing area, calculate the contour continuity index of each pixel based on the topological structure of the contour, generate a contour continuity feature map, and then characterize the visible light edge features. Step S212: Based on the grayscale value distribution of the packaging image, calculate the temperature gradient of each pixel, normalize the temperature gradient to the [1,5] value range, generate a temperature gradient feature map, and then characterize the infrared temperature feature. Step S213: Based on the gray-level co-occurrence matrix of the packaging image, calculate the local texture features in the neighborhood of each pixel through a sliding window of fixed size to generate a texture feature map, thereby representing the texture features; Step S214: The visible light edge features, the infrared temperature features, and the texture features are summed pixel-by-pixel with weights to construct the feature saliency matrix, wherein... The weights of each feature map are pre-set based on the contribution of each feature map to defect identification.

[0010] Further, in step S2, the process of determining the multimodal fusion compensation for the defect features based on the standard feature saliency matrix includes: Step S221: Calculate the statistical distribution characteristics of each feature channel in the standard feature saliency matrix; Step S222: Determine the regional reliability of each feature channel based on the statistical distribution characteristics; Step S223: Based on the regional reliability, generate a reliability weight map with the same scale as the standard feature saliency matrix, wherein... The reliability weight map includes the reliability weights corresponding to the visible light edge features, the infrared temperature features, and the texture features, respectively. Step S224: Perform multimodal fusion compensation on the defect features based on the reliability weight map.

[0011] Further, in step S224, the logic for performing multimodal fusion compensation on the defect features based on the reliability weight map includes: Based on the result that the reliability weight of the visible light edge feature is less than the corresponding preset weight, it is determined that the visible light edge feature and the infrared temperature feature should be compensated in a coordinated manner. Based on the result that the reliability weight of the infrared temperature feature is less than the corresponding preset weight, it is determined that the infrared temperature feature and the texture feature should be compensated collaboratively. Based on the result that the reliability weight of the texture feature is less than the corresponding preset weight, the repair compensation for the texture feature is determined.

[0012] Further, in step S3, the process of determining the defect confidence level based on the standard feature saliency matrix includes: Step S311: Perform saliency region segmentation on the standard feature saliency matrix and calculate the geometric feature value of each segmented region, wherein... The salient region segmentation is based on a preset salient threshold, which divides the pixels in the matrix into highly salient regions, moderately salient regions, and lowly salient regions. The geometric feature values ​​include area, perimeter, compactness, and minimum bounding rectangle; Step S312: Calculate the statistical characteristics of the saliency values ​​of each segmented region, and calculate the global spatial characteristics based on the spatial distribution of the segmented regions, wherein... The statistical characteristics of each segmented region include the region's maximum significance, the region's average significance, the region's significance variance, the region's significance skewness, and the region's significance kurtosis. The global spatial features include regional density features and spatial clustering indices; Step S313: Combine the geometric and statistical features of each segmented region into a feature vector, and input the region feature vector into a pre-trained region defect classification model to determine the region-level confidence of each segmented region; Step S314: Determine the defect confidence level based on the confidence level of each segmented region and the region area.

[0013] Furthermore, in step S3, based on the result that the defect confidence level is greater than or equal to the first preset defect confidence level and the defect confidence level is less than the second preset defect confidence level, it is initially determined that the airtightness of the packaging is unqualified, and a physical re-inspection of the airtightness is triggered.

[0014] Further, in step S4, the defect confidence level and the airtightness physical re-inspection result are weighted and summed to determine the airtightness index.

[0015] Furthermore, in step S4, the process of finally determining whether the packaging airtightness is qualified includes: Step S41: Compare and analyze the airtightness index with the preset airtightness index; Step S42: Based on the result that the air tightness index is greater than or equal to the preset air tightness index, determine that the air tightness of the packaging is qualified; Step S43: Based on the result that the air tightness index is less than the preset air tightness index, it is determined that the air tightness of the packaging is unqualified.

[0016] Compared with the prior art, the beneficial effects of the present invention are as follows: By integrating features of three different physical properties—visible light edge, infrared temperature, and texture—a multi-dimensional feature saliency matrix is ​​constructed, thereby overcoming the limitation that a single feature is prone to failure when there are reflections, shadows, or changes in material.

[0017] Furthermore, during the image acquisition stage, the system can automatically adjust parameters such as light source and exposure based on real-time calculated clarity quality indicators, ensuring high-quality images are obtained from the source and reducing the impact of environmental interference.

[0018] Furthermore, in the feature processing stage, an innovative feature reliability scoring and multimodal fusion compensation mechanism is proposed to automatically diagnose which feature is unreliable in which region and trigger corresponding collaborative compensation or repair logic, thereby realizing a dynamic and adaptive processing method and improving the stability and reliability of airtightness testing in complex and ever-changing industrial environments.

[0019] Furthermore, by setting a defect confidence threshold, the system can clearly distinguish between qualified products, unqualified products, and suspected defective products. Only suspected defective products with a confidence level in the intermediate ambiguity zone can trigger a more costly and slower physical re-inspection of airtightness. This greatly reduces the workload of physical re-inspection, avoids the waste of resources in physical testing of all packaging, and maximizes detection efficiency while ensuring no missed inspections.

[0020] Furthermore, this invention generates a comprehensive airtightness index by weightedly fusing image analysis results with physical detection results. This index provides a quantifiable and unified evaluation standard for packaging quality, reducing the differences in subjective human judgment and facilitating the standardization of quality control. On this basis, the deep integration of image analysis, machine learning, and automated control technology provides a solid technical foundation for realizing full-process intelligent quality monitoring and quality traceability of ready-to-eat pre-prepared food packaging production lines.

[0021] Furthermore, this invention addresses the pain points of existing technologies by optimizing the process from multimodal feature fusion to dynamic reliability compensation and then to progressive detection decision-making, ultimately achieving a comprehensive improvement in the accuracy, robustness, efficiency, and intelligence of packaging airtightness identification. Attached Figure Description

[0022] Figure 1 This is a flowchart illustrating the steps of the image analysis-based method for identifying the airtightness of ready-to-eat pre-prepared food packaging according to an embodiment of the present invention. Figure 2 This is a flowchart illustrating the steps of determining clarity quality quantification indicators based on real-time acquired infrared images, as described in an embodiment of the present invention. Figure 3This is a flowchart illustrating the steps of adjusting image acquisition parameters based on a clarity quality quantification index, as described in an embodiment of the present invention. Figure 4 This is a flowchart illustrating the steps of constructing a feature saliency matrix based on packaging defect features in an embodiment of the present invention. Detailed Implementation

[0023] To make the objectives and advantages of the present invention clearer, the present invention will be further described below with reference to embodiments; it should be understood that the specific embodiments described herein are merely for explaining the present invention and are not intended to limit the present invention.

[0024] Preferred embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.

[0025] Please see Figure 1 As shown, Figure 1 This is a flowchart illustrating the steps of an image analysis-based method for identifying the airtightness of ready-to-eat pre-prepared food packaging, as described in an embodiment of the present invention.

[0026] This invention provides a method for identifying the airtightness of ready-to-eat pre-prepared food packaging based on image analysis, comprising the following steps: Step S1: Based on the real-time acquired infrared image, determine the clarity quality quantification index, and adjust the image acquisition parameters based on the clarity quality quantification index to obtain the packaging image. Image acquisition parameters include light source power, exposure time, and shutter mode; Step S2 involves extracting packaging defect features from the packaging images, constructing a feature saliency matrix based on these features, and determining multimodal fusion compensation for the defect features according to the feature saliency matrix to obtain a standard feature saliency matrix. Packaging defect characteristics include visible light edge characteristics, infrared temperature characteristics, and texture characteristics; Multimodal fusion compensation includes collaborative compensation for visible light edge features and infrared temperature features, collaborative compensation for infrared temperature features and texture features, and repair compensation for texture features. Step S3: Determine the defect confidence level of the packaging image based on the standard feature saliency matrix, and determine the trigger for physical re-inspection of airtightness based on the defect confidence level; Step S4: Perform a physical re-inspection of the airtightness of the packaging. Based on the results of the physical re-inspection and the confidence level of the defects, determine the airtightness index to ultimately determine whether the airtightness of the packaging is qualified.

[0027] In this embodiment of the invention, the infrared image is captured by a 5-megapixel industrial camera (resolution 2592×1944), equipped with a 470nm visible light source and an 850nm near-infrared light source, and the frame rate is set to 60fps to match the production line speed.

[0028] Please see Figure 2 As shown, Figure 2 This is a flowchart illustrating the steps of determining clarity quality quantification indicators based on real-time acquired infrared images, as described in an embodiment of the present invention.

[0029] Specifically, in step S1, the process of determining the clarity quality quantification index based on the real-time acquired infrared image includes: Step S111: Obtain the set of horizontal gradients and the set of vertical gradients of the infrared image; Step S112: Determine the mean edge gradient based on the set of horizontal and vertical gradients; Step S113: Calculate the noise variance of the infrared image using the Gaussian filter residual; Step S114: The ratio of the mean edge gradient to the noise variance is determined as the clarity quality quantification index.

[0030] In step S113 of this embodiment of the invention, the noise difference is evaluated through the following calculation steps: The infrared image is smoothed by Gaussian filtering to obtain a smoothed image. Then calculate the residual between the original image and the smoothed image; Finally, the noise variance is calculated based on the sum of squared pixel values ​​of the residual image.

[0031] Please see Figure 3 As shown, Figure 3 This is a flowchart illustrating the steps of adjusting image acquisition parameters based on a clarity quality quantification index, as described in an embodiment of the present invention.

[0032] Specifically, in step S1, the process of determining the adjustment of image acquisition parameters based on the clarity quality quantification index includes: Step S121: Compare and analyze the clear quality quantification indicators with the preset quantification indicators; Step S122: Based on the result that the sharpness quality quantization index is less than the first preset quantization index, determine to adjust and reduce the exposure time, and at the same time enable the global shutter mode. Step S123: Based on the result that the clarity quality quantization index is greater than or equal to the first preset quantization index and the clarity quality quantization index is less than the second preset quantization index, determine to gradually increase the light source power. Step S124: Based on the result that the clarity quality quantification index is greater than or equal to the second preset quantification index, determine that the clarity meets the standard.

[0033] In this embodiment of the invention, the first preset quantitative index is set to 10, and the second preset quantitative index is set to 15; When determining to gradually increase the power of the light source, each adjustment increment is 5%, with the adjustment range between 30% and 70%. When adjusting the exposure time, reduce the exposure time from 10ms to 5ms.

[0034] Please see Figure 4 As shown, Figure 4 This is a flowchart illustrating the steps of constructing a feature saliency matrix based on packaging defect features in an embodiment of the present invention.

[0035] Specifically, in step S2, the process of constructing a feature saliency matrix based on packaging defect features includes: Step S211: Perform edge detection on the packaging image, extract the contour of the packaging sealing area, calculate the contour continuity index of each pixel based on the topological structure of the contour, generate a contour continuity feature map, and then characterize the visible light edge features. Step S212: Based on the gray value distribution of the packaging image, calculate the temperature gradient of each pixel, normalize the temperature gradient to the [1,5] value range, generate a temperature gradient feature map, and then characterize the infrared temperature features. Step S213: Based on the gray-level co-occurrence matrix of the packaged image, calculate the local texture features in the neighborhood of each pixel through a sliding window of fixed size to generate a texture feature map, and then characterize the texture features. Step S214 involves performing a pixel-by-pixel weighted sum of visible light edge features, infrared temperature features, and texture features to construct a feature saliency matrix. The weights of each feature map are pre-set based on the contribution of each feature map to defect identification.

[0036] In step S211 of this embodiment of the invention, the Canny operator is used for edge detection because its high threshold is set to 100 and its low threshold is set to 50, which can effectively balance the sensitivity of edge detection and noise suppression. Based on connected component analysis, the closed contour of the packaging sealing area is extracted, and noise contours with an area smaller than a preset threshold (such as 100 pixels) are removed. For each pixel, the continuity of the contour direction is calculated within its neighborhood, and the contour continuity index is... Defined as:

[0037] in, In neighboring pixels Set the value to 1 if it belongs to the contour, otherwise set it to 0. The total number of pixels in the 8-neighborhood.

[0038] In step S212 of this embodiment of the invention, the temperature gradients in the x-direction Gx and y-direction Gy are calculated using the following Sobel operator:

[0039]

[0040] The temperature gradient is:

[0041] The temperature gradient is mapped to the [1,5] interval using a linear normalization method:

[0042] in, and These are the temperature gradient magnitudes in the image. The maximum and minimum values.

[0043] In step S213 of this embodiment of the invention, a 5×5 pixel sliding window with a step size of 1 pixel is used to ensure the continuity of texture features. The calculation distance of the gray-level co-occurrence matrix is ​​d=1, and the direction θ can be taken as 0°, 45°, 90°, and 135°. For each sliding window position, features are extracted from the GLCM in the four directions, and then the average value is taken: Based on the gray-level co-occurrence matrix, four texture indices—contrast, energy, homogeneity, and correlation—are calculated, and a texture feature map is obtained through weighted fusion. Contrast reflects image sharpness, energy reflects texture uniformity, homogeneity reflects local consistency, and correlation reflects the linear dependence between pixels. The weighting coefficients are pre-set based on the contribution of each feature to defect identification. In this embodiment, the weight of contrast is set to 0.3, the weight of energy to 0.25, the weight of homogeneity to 0.25, and the weight of correlation to 0.2.

[0044] Feature map construction: Assign the fused texture feature value to the center position of each window to construct a complete texture feature map.

[0045] In step S214 of this embodiment of the invention, the contour continuity feature, temperature gradient feature and texture feature are summed pixel by pixel according to preset weights to construct a feature saliency matrix, with the contour weight set to 0.5, the temperature weight to 0.3 and the texture weight to 0.2.

[0046] Specifically, in step S2, the process of determining the multimodal fusion compensation for defect features based on the standard feature saliency matrix includes: Step S221: Calculate the statistical distribution characteristics of each feature channel in the standard feature saliency matrix; Step S222: Determine the regional reliability of each feature channel based on statistical distribution characteristics; Step S223: Based on regional reliability, generate a reliability weight map with the same scale as the standard feature saliency matrix, where... The reliability weight map includes reliability weights corresponding to visible light edge features, infrared temperature features, and texture features, respectively. Step S224: Perform multimodal fusion compensation on defect features based on reliability weight map.

[0047] In step S221 of this embodiment of the invention, the specific content and calculation method of the statistical distribution characteristics are as follows: The mean μ is obtained by calculating the average value of all pixel values ​​in the entire feature map, reflecting the overall intensity level of the feature. The specific formula is as follows:

[0048] Where N is the total number of pixels, and X(i,j) is the pixel value; The variance σ² is obtained by calculating the variance of all pixel values ​​in the entire feature map. It reflects the dynamic range and non-uniformity of the feature. The specific formula is as follows:

[0049] Skewness is used to measure the asymmetry of a probability distribution. Negative skewness indicates that the distribution is skewed to the left, with its peak value deviating from the center to the right; positive skewness indicates that the distribution is skewed to the right, with its peak value deviating from the center to the left; skewness close to 0 indicates that the distribution is approximately symmetrical.

[0050] Kurtosis is obtained by calculating the sharpness of the distribution. Kurtosis indicates that the data distribution is steeper than the normal distribution, and the variance is mainly contributed by extreme values, which may mean the presence of noise or outliers. By calculating the above statistics, the quality and distribution characteristics of each feature map can be quantified, providing a data foundation for reliability assessment.

[0051] In step S222 of this embodiment of the invention, skewness and kurtosis are used to measure the asymmetry and sharpness of the distribution, respectively, and can be calculated by the following formula: Skewness: , Used to measure distribution asymmetry; Kuroshi: , Used to measure the sharpness of a distribution; in, The average pixel value of the feature map. is the standard deviation, and is the total number of pixels.

[0052] The reliability score calculation rule is as follows: a reliability score Rk∈[0,1] is calculated for each feature channel k, and the specific rules are as follows: Edge feature reliability (Re) is determined based on the statistical distribution characteristics of edge feature channels. If the variance of the edge features is less than 0.05, it indicates that the edge response is too weak, so Re = 0.2 is determined. If the absolute value of the edge feature skewness is >2.0, it indicates that the edge distribution is severely asymmetrical, and Re is determined to be 0.3; If the edge feature kurtosis is >5.0, it indicates that there is sharp noise at the edge, and Re is set to 0.4; Otherwise, set Re=0.9.

[0053] The reliability Rt of the temperature feature is determined based on the statistical distribution characteristics of the temperature feature channels: If the mean temperature characteristic is <1.5 or μt>4.5, it indicates an abnormal temperature gradient, and Rt=0.3 is determined. If the temperature characteristic variance > 1.2, it indicates that the temperature distribution is too discrete, so Rt = 0.4 is determined. If the temperature characteristic kurtosis is >4.0, it indicates that there is an abnormal temperature peak, and Rt = 0.5 is determined. Otherwise, set Rt=0.9.

[0054] Texture feature reliability Rx is determined based on the statistical distribution characteristics of texture feature channels: If the texture feature variance is less than 0.03, it indicates that the texture response is too weak, so Rx = 0.2 is set. If the absolute value of the texture feature skewness is >1.5, it indicates that the texture distribution is severely skewed, and Rx is determined to be 0.4; If the kurtosis of the texture feature is >6.0, it indicates that the texture is abnormally concentrated, and Rx is set to 0.3; Otherwise, set Rx = 0.9.

[0055] In step S223 of this embodiment of the invention, for each feature channel Calculate the local confidence plot :

[0056] Among them, window size (Can be adjusted according to image resolution) In pixels Centered Local mean within the window For row index variables, For column index variables; The local confidence normalization is calculated using the following formula. :

[0057] The reliability weight map is generated using the following formula. :

[0058] The weight normalization is calculated using the following formula:

[0059] Specifically, in step S224, the logic for multimodal fusion compensation of defect features based on the reliability weight map includes: Based on the result that the reliability weight of visible light edge features is less than the corresponding preset weight, it is determined that visible light edge features and infrared temperature features should be compensated in a coordinated manner. Based on the result that the reliability weight of infrared temperature features is less than the corresponding preset weight, it is determined that infrared temperature features and texture features should be compensated in a coordinated manner. Based on the result that the reliability weight of the texture feature is less than the corresponding preset weight, the repair compensation for the texture feature is determined.

[0060] In this embodiment of the invention, the preset weight value of the reliability weight of visible light edge features is set to 0.2, the preset weight value of the reliability weight of infrared temperature features is set to 0.2, and the preset weight value of the reliability weight of texture features is set to 0.2. Guided filtering can employ existing guided filtering algorithms, the core of which lies in using a guide image (texture features) to smooth the edges of the input image (infrared temperature features). Specifically, this filtering process is achieved by establishing a linear relationship between the guide image and the input image within a local window, with the regularization parameter ε used to control the degree of smoothing. The collaborative compensation of visible light edge features and infrared temperature features is achieved by weighted fusion of the edge response extracted from the infrared temperature feature map and the visible light edge feature map. The fusion weight is dynamically adjusted according to the reliability score of the edge features. The collaborative compensation of infrared temperature features and texture features employs a guided filtering algorithm. The texture feature map is used as a guide image to filter the infrared temperature feature map, thereby smoothing noise while preserving texture-related temperature boundary information. The specific implementation of guided filtering can refer to existing technologies, and its regularization parameter ε is set to 0.01 to 0.1 according to the image noise level; Texture feature restoration and compensation targets areas with low reliability in the texture feature map and uses linear interpolation or median filtering based on neighboring pixels to restore reasonable texture information.

[0061] Specifically, in step S3, the process of determining the defect confidence level based on the standard feature saliency matrix includes: Step S311: Segment the standard feature saliency matrix into salient regions and calculate the geometric eigenvalues ​​of each segmented region, where... Saliency region segmentation is based on a preset saliency threshold, which divides the pixels in the matrix into highly saliency regions, moderately saliency regions, and low saliency regions. Geometric eigenvalues ​​include area, perimeter, compactness, and minimum bounding rectangle; Step S312: Calculate the statistical characteristics of the saliency values ​​of each segmented region, and calculate the global spatial characteristics based on the spatial distribution of the segmented regions, where... The statistical characteristics of each segmented region include the region's maximum significance, the region's average significance, the region's significance variance, the region's significance skewness, and the region's significance kurtosis. Global spatial characteristics include regional density characteristics and spatial clustering indices; Step S313: Combine the geometric and statistical features of each segmented region into a feature vector, and input the region feature vector into the pre-trained region defect classification model to determine the region-level confidence of each segmented region; Step S314: Determine the defect confidence level based on the confidence level of each segmented region and the region area.

[0062] In this embodiment of the invention, compactness is the ratio of the area of ​​the region to the square of the perimeter; Spatial clustering can be described as the distribution density of salient regions in an image.

[0063] In this embodiment of the invention, the regional defect classification model is a classifier based on support vector machine or convolutional neural network. It is obtained through supervised training using a large number of labeled historical defect sample images and their regional feature vectors, and is used to output the defect confidence of the region based on the combined feature vector of the currently segmented region.

[0064] Specifically, in step S3, based on the result that the defect confidence level is greater than or equal to the first preset defect confidence level and the defect confidence level is less than the second preset defect confidence level, it is initially determined that the airtightness of the packaging is unqualified, and a physical re-inspection of the airtightness is triggered.

[0065] In this embodiment of the invention, the first preset defect confidence level is set to 0.8, and the second preset defect confidence level is set to 0.95; It also includes determining a definite defect based on a defect confidence level greater than a second preset defect confidence level, and directly marking it as unqualified; Based on the result that the defect confidence level is less than the first preset defect confidence level, the packaging airtightness is directly determined to be qualified.

[0066] Specifically, in step S4, the defect confidence level and the results of the physical re-inspection of airtightness are weighted and summed to determine the airtightness index.

[0067] Specifically, in step S4, the process of finally determining whether the packaging airtightness is qualified includes: Step S41: Compare and analyze the airtightness index with the preset airtightness index. Step S42: Based on the result that the air tightness index is greater than or equal to the preset air tightness index, determine that the air tightness of the packaging is qualified. Step S43: Based on the result that the air tightness index is less than the preset air tightness index, it is determined that the air tightness of the packaging is unqualified.

[0068] In this embodiment of the invention, the preset airtightness index is set to 0.9. The physical re-inspection of airtightness can be carried out by the air pressure attenuation method or the vacuum attenuation method, and the airtightness is judged by detecting the air pressure difference inside and outside the packaging.

[0069] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.

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

Claims

1. A method for identifying the airtightness of ready-to-eat pre-prepared food packaging based on image analysis, characterized in that, Includes the following steps: Step S1: Based on the real-time acquired infrared image, determine the clarity quality quantification index, and adjust the image acquisition parameters based on the clarity quality quantification index to obtain the packaging image. The image acquisition parameters include light source power, exposure time, and shutter mode; Step S2: Extract packaging defect features from the packaging image; construct a feature saliency matrix based on the packaging defect features; and determine multimodal fusion compensation for the defect features according to the feature saliency matrix to obtain a standard feature saliency matrix, wherein... The packaging defect features include visible light edge features, infrared temperature features, and texture features; The multimodal fusion compensation includes co-compensation of the visible light edge features and infrared temperature features, co-compensation of the infrared temperature features and texture features, and repair compensation of the texture features. Step S3: Determine the defect confidence level of the packaging image based on the standard feature saliency matrix, and determine the trigger for physical re-inspection of airtightness based on the defect confidence level; Step S4: Perform a physical re-inspection of the airtightness of the packaging, determine the airtightness index based on the results of the physical re-inspection and the defect confidence level, and finally determine whether the airtightness of the packaging is qualified.

2. The method for identifying the airtightness of ready-to-eat pre-prepared food packaging based on image analysis according to claim 1, characterized in that, In step S1, the process of determining the clarity quality quantification index based on the real-time acquired infrared image includes: Step S111: Obtain the horizontal gradient set and the vertical gradient set of the infrared image; Step S112: Determine the mean edge gradient based on the set of horizontal gradients and the set of vertical gradients; Step S113: Calculate the noise variance of the infrared image using the Gaussian filtered residual; Step S114: The ratio of the mean edge gradient to the variance of the noise is determined as the clarity quality quantification index.

3. The method for identifying the airtightness of ready-to-eat pre-prepared food packaging based on image analysis according to claim 2, characterized in that, In step S1, the process of determining the adjustment of image acquisition parameters based on the clarity quality quantification index includes: Step S121: Compare and analyze the clear quality quantification index with the preset quantification index; Step S122: Based on the result that the sharpness quality quantification index is less than the first preset quantification index, determine to adjust and reduce the exposure time, and at the same time enable the global shutter mode. Step S123: Based on the result that the clarity quality quantification index is greater than or equal to the first preset quantification index and the clarity quality quantification index is less than the second preset quantification index, determine to gradually increase the light source power. Step S124: Based on the result that the clarity quality quantification index is greater than or equal to the second preset quantification index, determine that the clarity meets the standard.

4. The method for identifying the airtightness of ready-to-eat pre-prepared food packaging based on image analysis according to claim 3, characterized in that, In step S2, the process of constructing a feature saliency matrix based on the packaging defect features includes: Step S211: Perform edge detection on the packaging image, extract the contour of the packaging sealing area, calculate the contour continuity index of each pixel based on the topological structure of the contour, and generate a contour continuity feature map to characterize the visible light edge features. Step S212: Based on the grayscale value distribution of the packaging image, calculate the temperature gradient of each pixel, normalize the temperature gradient to the [1,5] value range, generate a temperature gradient feature map, and then characterize the infrared temperature feature. Step S213: Based on the gray-level co-occurrence matrix of the packaging image, calculate the local texture features in the neighborhood of each pixel through a sliding window of fixed size to generate a texture feature map, thereby representing the texture features; Step S214: The visible light edge features, the infrared temperature features, and the texture features are summed pixel-by-pixel with weights to construct the feature saliency matrix, wherein... The weights of each feature map are pre-set based on the contribution of each feature map to defect identification.

5. The method for identifying the airtightness of ready-to-eat pre-prepared food packaging based on image analysis according to claim 4, characterized in that, In step S2, the process of determining the multimodal fusion compensation for the defect features based on the standard feature saliency matrix includes: Step S221: Calculate the statistical distribution characteristics of each feature channel in the standard feature saliency matrix; Step S222: Determine the regional reliability of each feature channel based on the statistical distribution characteristics; Step S223: Based on the regional reliability, generate a reliability weight map with the same scale as the standard feature saliency matrix, wherein... The reliability weight map includes the reliability weights corresponding to the visible light edge features, the infrared temperature features, and the texture features, respectively. Step S224: Perform multimodal fusion compensation on the defect features based on the reliability weight map.

6. The method for identifying the airtightness of ready-to-eat pre-prepared food packaging based on image analysis according to claim 5, characterized in that, In step S224, the logic for performing multimodal fusion compensation on the defect features based on the reliability weight map includes: Based on the result that the reliability weight of the visible light edge feature is less than the corresponding preset weight, it is determined that the visible light edge feature and the infrared temperature feature should be compensated in a coordinated manner. Based on the result that the reliability weight of the infrared temperature feature is less than the corresponding preset weight, it is determined that the infrared temperature feature and the texture feature should be compensated collaboratively. Based on the result that the reliability weight of the texture feature is less than the corresponding preset weight, the repair compensation for the texture feature is determined.

7. The method for identifying the airtightness of ready-to-eat pre-prepared food packaging based on image analysis according to claim 6, characterized in that, In step S3, the process of determining the defect confidence level based on the standard feature saliency matrix includes: Step S311: Perform saliency region segmentation on the standard feature saliency matrix and calculate the geometric feature value of each segmented region, wherein... The salient region segmentation is based on a preset salient threshold, which divides the pixels in the matrix into highly salient regions, moderately salient regions, and lowly salient regions. The geometric feature values ​​include area, perimeter, compactness, and minimum bounding rectangle; Step S312: Calculate the statistical characteristics of the saliency values ​​of each segmented region, and calculate the global spatial characteristics based on the spatial distribution of the segmented regions, wherein... The statistical characteristics of each segmented region include the region's maximum significance, the region's average significance, the region's significance variance, the region's significance skewness, and the region's significance kurtosis. The global spatial features include regional density features and spatial clustering indices; Step S313: Combine the geometric and statistical features of each segmented region into a feature vector, and input the region feature vector into a pre-trained region defect classification model to determine the region-level confidence of each segmented region; Step S314: Determine the defect confidence level based on the confidence level of each segmented region and the region area.

8. The method for identifying the airtightness of ready-to-eat pre-prepared food packaging based on image analysis according to claim 7, characterized in that, In step S3, based on the result that the defect confidence level is greater than or equal to the first preset defect confidence level and the defect confidence level is less than the second preset defect confidence level, it is initially determined that the airtightness of the packaging is unqualified, and a physical re-inspection of the airtightness is triggered.

9. The method for identifying the airtightness of ready-to-eat pre-prepared food packaging based on image analysis according to claim 8, characterized in that, In step S4, the defect confidence level and the airtightness physical re-inspection result are weighted and summed to determine the airtightness index.

10. The method for identifying the airtightness of ready-to-eat pre-prepared food packaging based on image analysis according to claim 9, characterized in that, In step S4, the process of finally determining whether the packaging airtightness is qualified includes: Step S41: Compare and analyze the airtightness index with the preset airtightness index; Step S42: Based on the result that the air tightness index is greater than or equal to the preset air tightness index, determine that the air tightness of the packaging is qualified; Step S43: Based on the result that the air tightness index is less than the preset air tightness index, it is determined that the air tightness of the packaging is unqualified.

Citation Information

Patent Citations

  • Package sealing airtightness detection device

    CN105136396A