A method and system for online detection of sealing of food plastic packaging
By collecting and fusing acoustic, optical, and thermodynamic data of food plastic packaging, and combining them with a convolutional neural network model to dynamically calibrate acoustic parameters, the problem of insufficient multi-dimensional data correlation in existing detection technologies has been solved, enabling accurate detection and efficient sorting of sealing status.
Patent Information
- Application Number
- CN202511718481.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-21
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2045-11-21
AI Technical Summary
Existing food plastic packaging sealing inspection technologies are insufficient to fully cover complex defect types. Optical images are easily affected by reflections, shadows, or transparent materials. The sensitivity of pressure tests to micro-leakage is affected by packaging thickness and material properties. There is a lack of multi-dimensional data correlation analysis. Interference factors in the dynamic production environment cause the detection parameters to drift. The lack of a real-time calibration mechanism affects the stability and accuracy of measurement results.
Acoustic data, optical images, and thermodynamic spectra of food plastic packaging are collected to generate a multi-physical quantity dataset. The amplitude attenuation parameter is dynamically corrected through a sound wave energy absorption model. Combined with a pre-trained convolutional neural network model, multi-scale feature extraction and attention fusion are performed to generate a defect probability score, thereby achieving accurate judgment of the sealing status.
By integrating multiple physical quantities and performing dynamic calibration, the accuracy and reliability of sealing detection are improved, the ability to identify complex defects and the accuracy of classification are enhanced, and precise judgment and efficient sorting of sealing status are achieved.
Smart Images

Figure CN121186086B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of non-destructive testing technology for food packaging quality, and in particular to an online method and system for testing the sealing of food plastic packaging. Background Technology
[0002] In the field of food plastic packaging quality control, online detection of sealing performance is a crucial step in ensuring product safety and shelf life. Current mainstream detection technologies mainly include machine vision-based optical inspection methods, pressure testing methods based on physical principles (such as positive and negative pressure methods), and non-destructive testing methods based on acoustics or thermodynamics. These methods use high-resolution cameras to capture images of the packaging surface and combine them with traditional algorithms or deep learning models to identify appearance defects in the sealing area (such as incomplete sealing, contamination, or structural damage). These technologies have been widely applied in the food and pharmaceutical industries, forming standardized testing systems and improving the automation and reliability of quality inspection.
[0003] Existing conventional methods, relying on single physical quantities for detection, struggle to comprehensively cover complex defect types. Optical images are susceptible to interference from reflections, shadows, or transparent materials, while pressure testing's sensitivity to micro-leakage is affected by packaging thickness and material properties, lacking multi-dimensional data correlation analysis. Furthermore, interference factors in dynamic production environments (such as packaging thickness fluctuations, noise, or temperature changes) can cause detection parameters to drift, and conventional methods lack real-time calibration mechanisms, potentially impacting the stability and accuracy of measurement results. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, this invention provides an online detection method for sealing food plastic packaging to solve the problem of multi-physical quantity fusion and dynamic calibration in online detection of food plastic packaging sealing.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:
[0007] In a first aspect, the present invention provides an online detection method for the sealing of food plastic packaging, comprising,
[0008] Acoustic data, optical images, and thermodynamic spectra of food plastic packaging are collected to generate a multi-physical quantity dataset;
[0009] Based on a multi-physical quantity dataset, the amplitude attenuation parameter is extracted from the acoustic data and the thickness distribution of food plastic packaging is scanned. The amplitude attenuation parameter is dynamically corrected through a sound wave energy absorption model to obtain calibrated acoustic data.
[0010] The calibrated acoustic data, optical images and thermodynamic spectra are standardized and spatially aligned to generate a spatially aligned multi-physical quantity dataset, and a physical quantity matrix is generated by weighted fusion.
[0011] The physical quantity matrix is input into a pre-trained convolutional neural network model, which outputs a multi-scale feature map. The multi-modal feature correlation of the physical quantity matrix is analyzed through an attention fusion mechanism, and the defect probability score is output.
[0012] Based on the defect probability score, the sealing status is checked, defective food plastic packaging is removed, multi-source data is integrated to generate a structured inspection log, and a convolutional neural network model is optimized through backpropagation to generate an inspection report.
[0013] As a preferred embodiment of the online sealing detection method for food plastic packaging according to the present invention, the steps for collecting acoustic data, optical images, and thermodynamic spectra of the food plastic packaging to generate a multi-physical quantity dataset are as follows.
[0014] Acoustic data, optical images, and thermodynamic spectra of food plastic packaging were collected.
[0015] Align the timestamps of acoustic data, optical images, and thermodynamic spectra, and integrate them into a multi-physical quantity dataset.
[0016] As a preferred embodiment of the online sealing detection method for food plastic packaging according to the present invention, the steps of extracting the amplitude attenuation parameter from the acoustic data and scanning the thickness distribution of the food plastic packaging based on a multi-physical quantity dataset are as follows:
[0017] Analyze the degree of signal energy attenuation after sound waves propagate in food plastic packaging, and extract the amplitude attenuation parameter;
[0018] The surface morphology of the sealed area of food plastic packaging is scanned, and noise is eliminated by Gaussian filtering algorithm to generate the thickness distribution of food plastic packaging.
[0019] In a preferred embodiment of the online sealing detection method for food plastic packaging according to the present invention, the step of dynamically correcting the amplitude attenuation parameter through a sound wave energy absorption model to obtain calibrated acoustic data is as follows:
[0020] Based on the thickness distribution of food plastic packaging and combined with the characteristics of sound waves, a mathematical function relationship between the amplitude attenuation parameter and the thickness distribution of food plastic packaging is established, and a sound wave energy absorption model is constructed.
[0021] Based on the thickness distribution of food plastic packaging, correction coefficients and amplitude attenuation parameters are calculated using a sound wave energy absorption model.
[0022] The corrected amplitude attenuation parameters are reintegrated into the acoustic data to generate calibrated acoustic data.
[0023] As a preferred embodiment of the online sealing detection method for food plastic packaging according to the present invention, the steps of standardizing and spatially aligning the calibrated acoustic data, optical images, and thermodynamic spectra to generate a spatially aligned multi-physical quantity dataset, and then generating a physical quantity matrix through weighted fusion, are as follows.
[0024] The calibrated acoustic data, optical images, and thermodynamic spectra are standardized to generate a standardized multi-physical quantity dataset.
[0025] The standardized multi-physical quantity dataset is spatially aligned using an affine transformation method to generate a spatially aligned multi-physical quantity dataset.
[0026] Weighted fusion of spatially aligned multi-physical quantity datasets is performed to generate fused feature data;
[0027] The fused feature data is matrix-integrated and a three-dimensional data structure is constructed to generate a physical quantity matrix.
[0028] In a preferred embodiment of the online sealing detection method for food plastic packaging according to the present invention, the steps of inputting the physical quantity matrix into a pre-trained convolutional neural network model and outputting a multi-scale feature map are as follows:
[0029] The physical quantity matrix is adjusted in dimension and normalized to generate a standardized tensor;
[0030] Based on historical multi-physical quantity datasets, a convolutional neural network model is trained through supervised learning.
[0031] The standardized tensor is input into the trained convolutional neural network model, and multi-scale features in the standardized tensor are extracted through a multi-branch convolutional structure and fused into a multi-scale feature map.
[0032] As a preferred embodiment of the online sealing inspection method for food plastic packaging according to the present invention, the step of analyzing the multimodal feature correlation of the physical quantity matrix through an attention fusion mechanism and outputting a defect probability score is as follows:
[0033] The channel weights of the multi-scale feature map are calculated through an attention mechanism, and feature interaction is performed to generate an associated feature matrix.
[0034] Global average pooling and fully connected layer processing are applied to the associated feature matrix to generate defect probability scores.
[0035] As a preferred embodiment of the online sealing inspection method for food plastic packaging described in this invention, the steps of detecting the sealing status based on defect probability scores, rejecting defective food plastic packaging, and integrating multi-source data to generate a structured inspection log are as follows:
[0036] Based on the defect probability score, the sealing status is determined by a threshold comparison algorithm, and a sealing status identifier is generated.
[0037] Identify the sealing status indicator, generate sorting instructions through a coordinate mapping algorithm, execute the sorting instructions, remove defective food plastic packaging, and record the sorting execution results;
[0038] Collect differences in spectral reflectance characteristics in the near-infrared band and identify the type of food plastic packaging;
[0039] Integrate food plastic packaging type, food plastic packaging thickness distribution, defect probability score, sealing status indication, and sorting execution results to generate a structured inspection log.
[0040] In a preferred embodiment of the online sealing inspection method for food plastic packaging according to the present invention, the step of optimizing the convolutional neural network model through backpropagation to generate an inspection report is as follows:
[0041] Based on structured detection logs, the backpropagation algorithm is used to optimize the convolutional neural network model, and the gradient descent method is used to adjust the weights of the fully connected layers to generate the optimized convolutional neural network model weights.
[0042] By integrating structured detection logs and optimized convolutional neural network model weights, a detection report is generated through data population.
[0043] Secondly, the present invention provides an online sealing inspection system for food plastic packaging, comprising,
[0044] The acquisition module is used to acquire acoustic data, optical images, and thermodynamic spectra of food plastic packaging, and generate a multi-physical quantity dataset.
[0045] The acoustic calibration module is used to extract the amplitude attenuation parameter from the acoustic data based on a multi-physical quantity dataset and scan the thickness distribution of food plastic packaging. The amplitude attenuation parameter is dynamically corrected through a sound wave energy absorption model to obtain calibrated acoustic data.
[0046] The data fusion module is used to standardize and spatially align the calibrated acoustic data, optical images and thermodynamic spectra to generate a spatially aligned multi-physical quantity dataset, and then generate a physical quantity matrix through weighted fusion.
[0047] The intelligent analysis module is used to input the physical quantity matrix into a pre-trained convolutional neural network model, output a multi-scale feature map, and analyze the multi-modal feature correlation of the physical quantity matrix through an attention fusion mechanism to output a defect probability score.
[0048] The decision optimization module is used to detect the sealing status based on the defect probability score, remove defective food plastic packaging, integrate multi-source data to generate structured inspection logs, optimize the convolutional neural network model through backpropagation, and generate inspection reports.
[0049] The beneficial effects of this invention are as follows: By establishing a mathematical model based on the packaging thickness distribution and dynamically calibrating acoustic parameters, the interference of uneven material thickness on the detection signal is effectively eliminated, improving the accuracy and reliability of acoustic data characterization of the sealing state. Multi-scale features are extracted through a pre-trained convolutional neural network, and information from multiple physical quantities (sound, light, and heat) is weighted and fused using an attention mechanism, enhancing the identification ability and classification accuracy of complex defects, and achieving accurate judgment and efficient sorting of the sealing state. Attached Figure Description
[0050] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 This is a flowchart of an online inspection method for the sealing of food plastic packaging.
[0052] Figure 2 This is a schematic diagram of an online sealing inspection system for food plastic packaging.
[0053] Figure 3 This is a flowchart of data acquisition and calibration.
[0054] Figure 4 A flowchart for decision-making and optimization. Detailed Implementation
[0055] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0056] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0057] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0058] Reference Figures 1-4 As one embodiment of the present invention, this embodiment provides an online detection method for the sealing of food plastic packaging, comprising the following steps:
[0059] S1. Collect acoustic data, optical images, and thermodynamic spectra of food plastic packaging to generate a multi-physical quantity dataset;
[0060] Acoustic data, optical images, and thermodynamic spectra of food plastic packaging were collected.
[0061] Furthermore, an air-coupled ultrasonic sensor emits a linear frequency modulated pulse signal to the surface of the food plastic packaging, receives the sound wave signal that penetrates the food plastic packaging, and converts the sound wave signal into acoustic data through a data acquisition card; at the same time, a high-resolution industrial camera continuously captures images of the food plastic packaging surface, and the contour features are extracted using the Canny edge detection algorithm to generate optical images; an infrared thermal imager scans the temperature distribution on the surface of the food plastic packaging, records the temperature value of each pixel, and calculates the temperature gradient vector to generate a thermodynamic spectrum.
[0062] Align the timestamps of acoustic data, optical images, and thermodynamic maps, and integrate them into a multi-physical quantity dataset;
[0063] Furthermore, a timestamp alignment algorithm is used to process the time series of acoustic data, optical images, and thermodynamic spectra. The aligned time series are then unified to the same time reference through interpolation calculation. A sliding window matching algorithm is used to associate acoustic data, optical images, and thermodynamic spectra at the same time and integrate them into a structured multi-physical quantity dataset according to the time dimension.
[0064] S2. Based on the multi-physical quantity dataset, the amplitude attenuation parameter is extracted from the acoustic data and the thickness distribution of food plastic packaging is scanned. The amplitude attenuation parameter is dynamically corrected through the sound wave energy absorption model to obtain the calibrated acoustic data.
[0065] Analyze the degree of signal energy attenuation after sound waves propagate in food plastic packaging, and extract the amplitude attenuation parameter;
[0066] Furthermore, the envelope features of the acoustic signal are extracted by Hilbert transform. Based on the envelope features, the high-frequency oscillation components in the acoustic signal are eliminated, the energy distribution profile of the acoustic signal is exposed, and the peak detection algorithm is used to locate the peak amplitude of the transmitted signal and the peak amplitude of the received signal. The ratio of the peak amplitude of the transmitted signal to the peak amplitude of the received signal is calculated and converted into an amplitude attenuation parameter by a logarithmic transformation formula.
[0067] The surface morphology of the sealing area of food plastic packaging is scanned, and noise is eliminated by Gaussian filtering algorithm to generate the thickness distribution of food plastic packaging.
[0068] Furthermore, a linear laser thickness gauge is used to perform a dot matrix scan on the sealing area of the food plastic packaging, collecting thickness sampling points at a fixed interval (e.g., 0.5 mm) to obtain a set of thickness sampling points. The set of thickness sampling points is then convolved using a Gaussian filtering algorithm to eliminate measurement noise and generate denoised thickness data. Based on the denoised thickness data, the mean thickness and standard deviation of the thickness are calculated, and abnormal areas where the thickness data exceeds the abnormal threshold are identified, generating a thickness distribution of the food plastic packaging that includes the mean thickness, standard deviation of the thickness, and abnormal area identification.
[0069] It should be noted that the outlier threshold is set based on the statistical distribution characteristics of the denoised thickness data, and is usually set to the range of the mean thickness plus or minus twice the standard deviation of the thickness.
[0070] Based on the thickness distribution of food plastic packaging and combined with the characteristics of sound waves, a mathematical function relationship between the amplitude attenuation parameter and the thickness distribution of food plastic packaging is established, and a sound wave energy absorption model is constructed.
[0071] Furthermore, based on the mean thickness and abnormal area markers in the thickness distribution of food plastic packaging, and combined with acoustic characteristics, the correlation between the amplitude attenuation parameter and the mean thickness is analyzed. A linear function is established with the mean thickness as the independent variable and the amplitude attenuation parameter as the dependent variable. The linear function is fitted to the data points of the amplitude attenuation parameter and the mean thickness using the least squares method to obtain the material-dependent calibration coefficient and the basic attenuation constant. The functional relationship between the mean thickness, the amplitude attenuation parameter, the material-dependent calibration coefficient, and the basic attenuation constant is defined as the acoustic energy absorption model. The sample data of the thickness distribution of food plastic packaging and the amplitude attenuation parameter extracted from the acoustic data are aligned by timestamps to generate a training dataset. The training dataset is input into the acoustic energy absorption model, and the calibration coefficient and the basic attenuation constant are iteratively adjusted using the least squares method. The goodness of fit of the linear function is evaluated by the coefficient of determination. When the coefficient of determination is lower than the preset convergence threshold, the prediction error is corrected. The training of the acoustic energy absorption model is completed through multiple rounds of iterative updates until convergence.
[0072] It should be noted that acoustic characteristics include frequency dependence, energy attenuation law, material acoustic impedance and scattering characteristics, which are obtained through acoustic parameter databases of common plastic materials and acoustic theory analysis; the convergence threshold is based on the statistical distribution characteristics of historical sample data, and is set by analyzing the distribution pattern of the set of determination coefficients, with a value range of 0.80–0.95.
[0073] The linear function expression is:
[0074] ;
[0075] in, This is the amplitude attenuation parameter; This is a material-dependent calibration factor, typically ranging from -25 to -5 (dB / mm), with the specific value determined based on the type and acoustic properties of the food plastic packaging material. This represents the average thickness. It is the basic attenuation constant.
[0076] Furthermore, based on the thickness distribution of food plastic packaging, the theoretical amplitude attenuation parameter is calculated using a sound wave energy absorption model; the ratio of the theoretical amplitude attenuation parameter to the extracted amplitude attenuation parameter is used as a correction coefficient; the amplitude attenuation parameter is adjusted using the correction coefficient to generate the corrected amplitude attenuation parameter.
[0077] The corrected amplitude attenuation parameters are reintegrated into the acoustic data to generate calibrated acoustic data;
[0078] Furthermore, the corrected amplitude attenuation parameter is embedded into the corresponding position in the acoustic data using a data replacement algorithm (such as a state estimation replacement algorithm based on Kalman filtering), and the amplitude attenuation parameter in the acoustic data is replaced. Integrity verification is performed on the replaced acoustic data to verify the continuity of timestamps and the compliance of parameter ranges, and calibrated acoustic data is generated.
[0079] S3. Standardize and spatially align the calibrated acoustic data, optical images and thermodynamic spectra to generate a spatially aligned multi-physical quantity dataset, and generate a physical quantity matrix through weighted fusion.
[0080] The calibrated acoustic data, optical images, and thermodynamic spectra are standardized to generate a standardized multi-physical quantity dataset.
[0081] Furthermore, through amplitude normalization, the mean and standard deviation of the amplitude values of the calibrated acoustic data are calculated, and the amplitude values of the acoustic data are standardized by zero-mean unit variance transformation; the optical image is subjected to pixel value scaling, and the pixel values of the optical image are linearly transformed to a preset standard range by a minimum-maximum scaling algorithm; the thermodynamic spectrum is subjected to temperature value normalization, and the mean and standard deviation are calculated according to the temperature value distribution, and the temperature values are standardized by Z-score standardization; the standardized acoustic data, standardized optical image, and standardized thermodynamic spectrum are integrated according to the timestamp dimension to generate a standardized multi-physical quantity dataset.
[0082] It should be noted that the standard range is typically set by a minimum-maximum scaling algorithm, based on a linear transformation of the minimum and maximum pixel values of the optical image (e.g., [0, 1] or [0, 255]).
[0083] The standardized multi-physical quantity dataset is spatially aligned using an affine transformation method to generate a spatially aligned multi-physical quantity dataset.
[0084] Furthermore, based on the multi-physical quantity dataset, using the spatial coordinate system of the optical image as a reference, the affine transformation parameters (including translation vector, rotation matrix, and scaling factor) of the acoustic data and thermodynamic spectrum relative to the optical image are calculated. Each data point in the acoustic data and thermodynamic spectrum is mapped to the coordinate system of the optical image through the affine transformation parameters, realizing the spatial coordinate alignment of the acoustic data, optical image, and thermodynamic spectrum. The spatially aligned acoustic data, optical image, and thermodynamic spectrum are then re-integrated according to the timestamp dimension to generate a spatially aligned multi-physical quantity dataset.
[0085] Weighted fusion of spatially aligned multi-physical quantity datasets is performed to generate fused feature data;
[0086] Furthermore, based on the spatially aligned multi-physical quantity dataset, a confidence index (such as signal-to-noise ratio or the negative value of classifier output entropy) is calculated using a normalized weight allocation method. Then, softmax normalization is performed on the confidence index to obtain the fusion weights of acoustic data, optical images, and thermodynamic spectra. For example, high weights are assigned based on the dominant role of acoustic data in sealing defect detection, medium weights are assigned based on the auxiliary role of optical images, and low weights are assigned based on the supplementary role of thermodynamic spectra. A weighted summation algorithm is then used to perform point-by-point fusion calculations on the weighted acoustic data, optical images, and thermodynamic spectra to generate fused feature data.
[0087] The fused feature data is matrix-integrated and a three-dimensional data structure is constructed to generate a physical quantity matrix;
[0088] Furthermore, the fused feature data is matrix-integrated and reorganized into a two-dimensional matrix, with rows corresponding to the time dimension and columns corresponding to the feature dimension. Channel dimensions (hierarchical dimensions that distinguish and store different physical quantity features) are added through dimension expansion methods, constructing a physical quantity matrix containing time, feature, and channel dimensions.
[0089] S4. Input the physical quantity matrix into the pre-trained convolutional neural network model, output multi-scale feature maps, and analyze the multi-modal feature correlation of the physical quantity matrix through the attention fusion mechanism to output defect probability scores.
[0090] The physical quantity matrix is adjusted in dimension and normalized to generate a standardized tensor;
[0091] Furthermore, the dimensional structure (height, width, and number of channels) of the physical quantity matrix is changed by reshaping method to match the input requirements of the convolutional neural network; the mean and standard deviation of the physical quantity matrix data are calculated, and the physical quantity matrix data is standardized by zero-mean unit variance transformation to generate a standardized tensor.
[0092] It should be noted that the reshaping method refers to mapping the time dimension and feature dimension to the height and width dimensions of the convolutional neural network input in row priority order, and adapting the input size through zero padding and truncation (e.g., the height is the length of the time window and the width is the feature dimension).
[0093] Based on historical multi-physical quantity datasets, a convolutional neural network model is trained through supervised learning.
[0094] Furthermore, a historical multi-physical quantity dataset (containing multimodal features of acoustic data, optical images, and thermodynamic spectra, as well as defect category labels) is used as training samples and input into a convolutional neural network model to predict and generate defect categories. The training error between the predicted defect category and the defect category label is calculated using the backpropagation algorithm, and the weight parameters of the convolutional neural network model are iteratively updated using the gradient descent method. The training error is quantified using the cross-entropy loss function, and the model performance is monitored using a validation set to prevent overfitting. The training of the convolutional neural network model is then complete.
[0095] It should be noted that the defect category label is derived from historical multi-physical quantity datasets and refers to the sealing status (such as "seal intact" or "bubble leakage") determined by standard testing methods during the data acquisition phase.
[0096] The standardized tensor is input into the trained convolutional neural network model, and multi-scale features in the standardized tensor are extracted through a multi-branch convolutional structure and fused into a multi-scale feature map.
[0097] Furthermore, the standardized tensor is input into the trained convolutional neural network model. Through parallel processing branches in the multi-branch convolutional structure, convolutional operations are performed on the standardized tensor using convolutional kernels of different scales (e.g., 1x1 convolutional kernels to extract point features, 3x3 convolutional kernels to extract local features, and 5x5 convolutional kernels to extract global features). Each branch independently outputs a feature map and captures feature information at different scales, including acoustic features, optical features, thermodynamic features, and process features (statistical distribution of thickness in food plastic packaging and packaging type labels), which are integrated into multi-scale features. Channel splicing is then used to concatenate the feature maps of all branches and the multi-scale features in channel order to generate a multi-scale feature map.
[0098] The channel weights of the multi-scale feature map are calculated through an attention mechanism, and feature interaction is performed to generate an associated feature matrix.
[0099] Furthermore, based on the multi-scale feature map, global statistical information of each channel of the multi-scale feature map is extracted through global average pooling. The global statistical information is then input into a fully connected layer and a sigmoid activation function to generate channel attention weight vectors. The channel attention weight vectors are used to perform channel-by-channel multiplication scaling on the multi-scale feature map to complete feature interaction and highlight key features in the multi-scale feature map, generating a scaled multi-scale feature map. The scaled multi-scale feature map is then processed through convolution to reduce feature dimensionality and enhance multimodal feature interaction, outputting an associated feature matrix.
[0100] It should be noted that key features are typically those that indicate sealing defects in acoustic, optical, and thermodynamic data (such as anomalous acoustic attenuation, areas of optical contamination, or anomalous thermal conduction). The channel attention weight vector quantifies the importance of each channel, with channels having higher weight values corresponding to key features in the multi-scale feature map.
[0101] Global average pooling and fully connected layer processing are applied to the correlation feature matrix to generate defect probability scores;
[0102] Furthermore, through global average pooling, the global average value of each feature channel of the associated feature matrix is calculated. Based on the global average value, the global average values of each channel are combined to form a dimension-reduced feature vector. The dimension-reduced feature vector is input into a fully connected layer, linearly transformed, and mapped to a fixed interval (e.g., the interval from 0 to 1) through a Sigmoid activation function, and the defect probability score is output.
[0103] S5. Based on the defect probability score, detect the sealing status, remove defective food plastic packaging, integrate multi-source data to generate structured inspection logs, optimize the convolutional neural network model through backpropagation, and generate an inspection report.
[0104] Based on the defect probability score, the sealing status is determined by a threshold comparison algorithm, and a sealing status identifier is generated.
[0105] Furthermore, the defect probability score is compared with a preset defect threshold. When the defect probability score is greater than or equal to the preset defect threshold, it is determined to be a sealing failure and a sealing failure flag is generated. When the defect probability score is less than the preset defect threshold, it is determined to be a sealing qualified flag and a sealing qualified flag is generated. The sealing status flag, which includes both the sealing failure flag and the sealing qualified flag, is then integrated to generate a sealing status flag.
[0106] It should be noted that the defect threshold is based on the defect probability score distribution corresponding to the defect category label in the historical multi-physical quantity dataset, and is set through ROC curve analysis and precision-recall balance point; the value range is usually 0.5 to 0.9.
[0107] Identify the sealing status indicator, generate sorting instructions through a coordinate mapping algorithm, execute the sorting instructions, remove defective food plastic packaging, and record the sorting execution results;
[0108] Furthermore, real-time position data of the food plastic packaging production line is collected by infrared position sensors; based on the sealing status indicator and the real-time position data of the production line, the spatial coordinates of the food plastic packaging with the failure indicator on the conveyor belt are calculated by a coordinate mapping algorithm, and the corresponding action command in the command generation rule is generated according to the spatial coordinates to generate a sorting instruction containing coordinate information and action command; the sorting action is received and executed by a pneumatic actuator to remove the failure food plastic packaging; the sorting execution process is monitored, and the sorting time, position coordinates and execution status (such as success or failure) are recorded to generate the sorting execution result.
[0109] It should be noted that the command generation rules are set based on the spatial coordinates on the conveyor belt, the production line speed, and the food plastic packaging sorting requirements (for example, the action type is set to "blowing" and the action duration is set to 0.1s). The sorting execution results include the execution timestamp, target spatial coordinates, response status (e.g., whether the action was successfully triggered), action duration, and the detection results of the presence of food plastic packaging before and after the action.
[0110] Collect differences in spectral reflectance characteristics in the near-infrared band and identify the type of food plastic packaging;
[0111] Furthermore, the surface of food plastic packaging is scanned with a near-infrared spectrometer to collect spectral reflectance data in the near-infrared band; based on the spectral reflectance data, the difference between the spectral reflectance value and the standard reference value is calculated to generate spectral reflectance feature differences; the spectral reflectance feature differences are then matched with a spectral database of food plastic packaging types to identify the type of food plastic packaging through similarity calculation.
[0112] It should be noted that the spectral database refers to a standardized set established based on historically collected near-infrared spectral reflectance data of food plastic packaging. The parameters of the spectral database are set by collecting standard spectral reference values for different packaging types and based on statistical distribution and experimental calibration.
[0113] Integrate food plastic packaging type, food plastic packaging thickness distribution, defect probability score, sealing status indication, and sorting execution results to generate a structured inspection log;
[0114] Furthermore, data aggregation operations are used to combine food plastic packaging types, food plastic packaging thickness distribution, defect probability scores, sealing status indicators, and sorting execution results into a multi-source dataset. The multi-source dataset is then formatted and converted into a unified structure (such as key-value pairs and tables). The integrity of the formatted multi-source dataset is verified by checking the synchronization of timestamps and the consistency of parameter logic. Finally, a log building algorithm is used to integrate the formatted multi-source dataset and generate a structured inspection log.
[0115] It should be noted that the log construction algorithm refers to the data aggregation and pattern verification algorithm, which integrates food plastic packaging type, food plastic packaging thickness distribution, defect probability score, sealing status indicator, sorting instructions, and sorting execution results into structured records (e.g., JSON format) according to predefined field mapping rules; the field mapping rules are established based on the key detection elements (food plastic packaging type, food plastic packaging thickness distribution, defect probability score, and sealing status indicator), sorting instructions, and sorting execution results in the online detection method for food plastic packaging sealing.
[0116] Based on structured detection logs, the backpropagation algorithm is used to optimize the convolutional neural network model, and the gradient descent method is used to adjust the weights of the fully connected layers to generate the optimized convolutional neural network model weights.
[0117] Furthermore, structured detection logs are used as training samples and input into the convolutional neural network model. The predicted output is calculated through forward propagation. The error gradient between the predicted output and the defect category label is calculated using the backpropagation algorithm. The weight parameters of the fully connected layer are iteratively updated based on the error gradient using the gradient descent method. The weight parameters are optimized through multiple iterations. The optimization process is monitored through the validation set to prevent overfitting and ensure the generalization ability of the convolutional neural network model. The optimized weights of the convolutional neural network model are then generated.
[0118] By integrating structured detection logs and optimized convolutional neural network model weights, a detection report is generated through data filling.
[0119] Furthermore, based on the structured detection logs and the optimized convolutional neural network model weights, the structured detection logs and the optimized convolutional neural network model weights are merged using a data integration method to generate a complete detection dataset. The complete detection dataset is then processed by data filling, with the following steps: based on a preset report template (such as an HTML or PDF format template), the complete detection dataset is mapped to the corresponding fields of the template; the complete detection dataset is inserted into the preset report template position using a data filling algorithm; and a format rendering operation is performed to generate a visual detection report.
[0120] It should be noted that the report template is based on a report structure example stored centrally in historical multi-physical quantity datasets, and uses markup languages (such as HTML or XML) to define the data insertion locations and visual display styles.
[0121] This embodiment also provides an online sealing inspection system for food plastic packaging, including:
[0122] The acquisition module is used to acquire acoustic data, optical images, and thermodynamic spectra of food plastic packaging, and generate a multi-physical quantity dataset.
[0123] The acoustic calibration module is used to extract the amplitude attenuation parameter from the acoustic data based on a multi-physical quantity dataset and scan the thickness distribution of food plastic packaging. The amplitude attenuation parameter is dynamically corrected through a sound wave energy absorption model to obtain calibrated acoustic data.
[0124] The data fusion module is used to standardize and spatially align the calibrated acoustic data, optical images and thermodynamic spectra to generate a spatially aligned multi-physical quantity dataset, and then generate a physical quantity matrix through weighted fusion.
[0125] The intelligent analysis module is used to input the physical quantity matrix into a pre-trained convolutional neural network model, output a multi-scale feature map, and analyze the multi-modal feature correlation of the physical quantity matrix through an attention fusion mechanism to output a defect probability score.
[0126] The decision optimization module is used to detect the sealing status based on the defect probability score, remove defective food plastic packaging, integrate multi-source data to generate structured inspection logs, optimize the convolutional neural network model through backpropagation, and generate inspection reports.
[0127] This embodiment also provides a computer device applicable to the online sealing detection method for food plastic packaging, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to realize the online sealing detection method for food plastic packaging as proposed in the above embodiment.
[0128] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0129] This embodiment also provides a storage medium storing a computer program, which, when executed by a processor, implements the online detection method for sealing food plastic packaging as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0130] In summary, this invention effectively eliminates the interference of uneven material thickness on the detection signal by establishing a mathematical model based on the packaging thickness distribution and dynamically calibrating acoustic parameters, thereby improving the accuracy and reliability of acoustic data characterization of sealing status. Furthermore, by extracting multi-scale features through a pre-trained convolutional neural network and weighting and fusing acoustic, optical, and thermal information through an attention mechanism, the invention enhances the identification ability and classification accuracy of complex defects, achieving precise judgment and efficient sorting of sealing status.
[0131] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for on-line detection of the seal of a food plastic package, characterized in that: The application relates to a method for detecting defects of food plastic packaging. The method comprises the following steps: Collecting acoustic data, optical images and thermodynamic maps of food plastic packaging to generate a multi-physical quantity data set; Based on the multi-physical quantity data set, the amplitude attenuation parameter in the acoustic data is extracted, and the thickness distribution of the food plastic packaging is scanned, and the amplitude attenuation parameter is dynamically corrected through a sound wave energy absorption model to obtain calibrated acoustic data; The calibrated acoustic data, optical images and thermodynamic maps are standardized and spatially aligned to generate a spatially aligned multi-physical quantity data set, and a physical quantity matrix is generated through weighted fusion; The physical quantity matrix is input into a pre-trained convolutional neural network model to output a multi-scale feature map, and the multi-modal feature correlation of the physical quantity matrix is analyzed through an attention fusion mechanism to output a defect probability score; 2. The method of on-line detection of seals of plastic packages of food products according to claim 1, characterized in that: According to the defect probability score, the sealing state of the seal is detected, the invalid food plastic packaging is removed, the multi-source data is integrated to generate a structured detection log, the convolutional neural network model is optimized through back propagation, and a detection report is generated. The method comprises the following steps: Collecting acoustic data, optical images and thermodynamic maps of food plastic packaging to generate a multi-physical quantity data set; 3. The method of on-line detection of seals of plastic packages of food products according to claim 2, characterized in that: Aligning the time stamps of the acoustic data, optical images and thermodynamic maps, and integrating them into a multi-physical quantity data set. The method comprises the following steps: Analyzing the signal energy attenuation degree of the sound wave after propagation in the food plastic packaging, and extracting the amplitude attenuation parameter; 4. The method of claim 3, wherein the step of detecting the seal of the food plastic package is performed by using a light source and a light detector. Scanning the surface topography of the sealing area of the food plastic packaging, and eliminating noise through a Gaussian filtering algorithm to generate a thickness distribution of the food plastic packaging. The method comprises the following steps: Based on the thickness distribution of the food plastic packaging, the mathematical function relationship between the amplitude attenuation parameter and the thickness distribution of the food plastic packaging is established in combination with the characteristics of the sound wave to construct a sound wave energy absorption model; Based on the thickness distribution of the food plastic packaging, the correction coefficient is calculated through the sound wave energy absorption model to correct the amplitude attenuation parameter; 5. The method of on-line detection of closures of plastic packages of food products according to claim 4, characterized in that: The corrected amplitude attenuation parameter is re-integrated into the acoustic data to generate calibrated acoustic data. The method comprises the following steps: Standardizing the calibrated acoustic data, optical images and thermodynamic maps to generate a standardized multi-physical quantity data set; The standardized multi-physical quantity data set is spatially aligned through an affine transformation method to generate a spatially aligned multi-physical quantity data set; The spatially aligned multi-physical quantity data set is weighted and fused to generate fusion feature data; 6. The method of on-line detection of seals of plastic packages of food products according to claim 5, characterized in that: The fusion feature data is matrix integrated and a three-dimensional data structure is constructed to generate a physical quantity matrix. The method comprises the following steps: The physical quantity matrix is dimensionally adjusted and normalized to generate a standardized tensor; Based on historical multi-physical quantity data sets, the convolutional neural network model is trained through supervised learning; The standardized tensor is input into the trained convolutional neural network model, multi-scale features in the standardized tensor are extracted through a multi-branch convolutional structure, and are fused into a multi-scale feature atlas.
7. The method of on-line detection of seals of plastic packages of food products according to claim 6, characterized in that: The steps of analyzing the multi-modal feature correlation of the physical quantity matrix through the attention fusion mechanism and outputting the defect probability score are as follows, The channel weight of the multi-scale feature atlas is calculated through the attention mechanism, feature interaction is performed, and a correlation feature matrix is generated; The correlation feature matrix is subjected to global average pooling and full connection layer processing to generate a defect probability score.
8. The method of on-line detection of seals of plastic packages of food products according to claim 7, characterized in that: The steps of detecting the sealing state of the seal according to the defect probability score, removing the failed food plastic packaging, integrating multi-source data to generate a structured detection log, are as follows, Based on the defect probability score, the sealing state of the seal is judged by a threshold comparison algorithm to generate a sealing state identifier; The sealing state identifier is recognized, a sorting instruction is generated through a coordinate mapping algorithm, and the sorting instruction is executed to remove the failed food plastic packaging and record the sorting execution result; The spectral reflectance feature difference of the near-infrared band is collected, and the type of the food plastic packaging is identified; The structured detection log is generated by integrating the food plastic packaging type, the food plastic packaging thickness distribution, the defect probability score, the sealing state identifier, and the sorting execution result.
9. The online detection method for sealing of food plastic packaging as described in claim 8, characterized in that: The steps of optimizing the convolutional neural network model through back propagation and generating a detection report are as follows, Based on the structured detection log, the convolutional neural network model is optimized using a back propagation algorithm, and the gradient descent method is used to adjust the full connection layer weight to generate an optimized convolutional neural network model weight; The structured detection log and the optimized convolutional neural network model weight are integrated to generate a detection report through data padding.
10. An online detection system for the seal of a food plastic package, based on the online detection method for the seal of a food plastic package according to any one of claims 1 to 9, characterized by the fact that it comprises: It includes, The acquisition module is used for collecting acoustic data, optical images and thermodynamic atlas of food plastic packaging to generate a multi-physical quantity data set; The acoustic calibration module is used for extracting the amplitude attenuation parameter in the acoustic data based on the multi-physical quantity data set and scanning the food plastic packaging thickness distribution, dynamically correcting the amplitude attenuation parameter through the acoustic wave energy absorption model to obtain calibrated acoustic data; The data fusion module is used for standardizing and spatially aligning the calibrated acoustic data, optical images and thermodynamic atlas to generate a spatially aligned multi-physical quantity data set, and generating a physical quantity matrix through weighted fusion; The intelligent analysis module is used for inputting the physical quantity matrix into a pre-trained convolutional neural network model to output a multi-scale feature atlas, and analyzing the multi-modal feature correlation of the physical quantity matrix through an attention fusion mechanism to output a defect probability score; The decision optimization module is used for detecting the sealing state of the seal according to the defect probability score, removing the failed food plastic packaging, integrating multi-source data to generate a structured detection log, and optimizing the convolutional neural network model through back propagation to generate a detection report.
Citation Information
Patent Citations
Fruit firmness measurement system and method fusing acoustic vibration with near-infrared spectrum
CN109932333A
Vacuum machine package sealing performance detection system based on convolutional neural network
CN118761014A