Intelligent detection method and system for food packaging

By introducing geometric perturbation and spectral differential adaptive filtering into the surface inspection of food packaging, the problems of low efficiency and insufficient accuracy in traditional methods are solved, achieving high-precision, real-time defect detection and improving the sensitivity and stability of the detection.

CN121353087AActive Publication Date: 2026-01-16GUANGZHOU BEILE FOOD CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511664462.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-13
Publication Date
2026-01-16
Estimated Expiration
2045-11-13

AI Technical Summary

Technical Problem

Existing technologies struggle to efficiently detect micron-level defects on food packaging surfaces in complex and dynamic industrial environments, especially tiny defects on aluminum foil seals, beverage can bottoms, and brushed metal casings. Traditional methods are inefficient, lack precision, and are sensitive to changes in lighting.

Method used

A method combining geometric perturbation, spectral difference, and adaptive filtering is adopted. By acquiring the original image and applying a preset geometric perturbation, the spectral difference signal is calculated, a benchmark model is established, an adaptive filter is constructed, and the image is dynamically filtered in the frequency domain and reconstructed in the spatial domain to achieve defect identification.

Benefits of technology

It achieves high-precision, real-time defect detection on the surface of food packaging, effectively suppresses noise interference, improves detection sensitivity and stability, and significantly enhances the reliability and automation level of product quality inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121353087A_ABST
    Figure CN121353087A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of intelligent detection, in particular to an intelligent detection method and system for food packaging. The method comprises the following steps: acquiring an original image of a measured film; applying preset geometric perturbation to the original image to obtain an auxiliary image; performing two-dimensional fast Fourier transform on the original image and the auxiliary image, and calculating a frequency spectrum differential signal; establishing a reference model of the standard sample, and comparing the frequency spectrum differential signal of the tested film with the reference model to obtain frequency domain anomaly; constructing a self-adaptive filter according to the frequency domain anomaly, and applying the self-adaptive filter to the original image for filtering; and performing two-dimensional inverse fast Fourier transform on the filtered spectrum data to identify defects. According to the method, the accuracy and precision of defect detection under the periodic texture background are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent detection technology. More specifically, this invention relates to an intelligent detection method and system for food packaging. Background Technology

[0002] In modern industrial manufacturing, particularly in consumer electronics, food packaging, and precision optics, the surface quality of a product is one of the key factors determining its final value. Many such products, such as aluminum foil seals on food packaging, the bottoms of beverage cans, and brushed metal casings, possess highly repetitive, periodic background textures. Against this strong, regular background, the detection of randomly occurring, low-contrast micro-defects (such as micrometer-sized pinholes, shallow scratches, foreign object imprints, or stains) remains a long-standing and extremely challenging industry problem.

[0003] Traditional inspection methods suffer from significant technical limitations. Manual visual inspection is inefficient and highly subjective, failing to meet the high-speed and high-consistency requirements of modern production lines. Two-dimensional vision inspection systems based on digital image processing often suffer from extremely low signal-to-noise ratios due to strong background texture noise overwhelming defect signals, resulting in high false alarm and false negative rates, and are sensitive to changes in ambient lighting. Three-dimensional scanning inspection technology is primarily used for macroscopic dimensional measurements; for micrometer-level surface defect detection, its equipment is expensive, scanning time is long, and data processing volume is enormous, failing to meet the millisecond-level real-time response requirements of industrial production lines. While classic Fourier optical inspection technology can theoretically filter out periodic backgrounds, it relies on a fixed physical mask and cannot handle the minute positional, orientation, and dimensional changes of the measured object caused by mechanical vibration, batch variations, or material stretching in real industrial production. This makes it virtually impossible to operate stably in the complex and dynamic industrial environment. Summary of the Invention

[0004] The purpose of this invention is to propose an intelligent detection method and system for food packaging, in order to solve the problem of insufficient defect detection accuracy in the prior art.

[0005] In a first aspect, the present invention provides an intelligent detection method for food packaging, the detection method comprising: acquiring an original image of a film to be tested; applying a preset geometric perturbation to the original image to obtain an auxiliary image; performing two-dimensional fast Fourier transform on the original image and the auxiliary image respectively, and calculating a spectral difference signal; establishing a benchmark model of standard samples, comparing the spectral difference signal calculated from the original image and the auxiliary image with the benchmark model to obtain the frequency domain anomaly degree of each pixel in the spectral data of the original image; constructing an adaptive filter based on the frequency domain anomaly degree, and using the adaptive filter to perform dynamic frequency domain filtering on the spectral data of the original image; performing a two-dimensional inverse fast Fourier transform on the frequency domain filtered spectral data to obtain a reconstructed spatial domain image, and performing threshold segmentation on the reconstructed spatial domain image to obtain a defect identification result.

[0006] This invention achieves high-precision identification and real-time detection of defects in food packaging films through an analysis method based on spectral difference and adaptive filtering. It can effectively suppress noise interference, improve detection sensitivity and stability, and thus significantly improve the reliability and automation level of product quality inspection.

[0007] Optionally, the preset geometric perturbation includes translational perturbation, rotational perturbation, and scale perturbation.

[0008] The preset magnitude of the geometric perturbation ensures that the perturbation is sufficient to produce a measurable response in the spectral differential signal without causing a significant degradation in image quality.

[0009] Optionally, the calculation steps of the spectral differential signal include: performing pixel-by-pixel complex subtraction on the spectral data after Fourier transform of the original image and the auxiliary image; the complex subtraction operation is applied to both the real and imaginary parts of the spectral data to obtain a spectral differential signal containing amplitude and phase difference.

[0010] By using complex subtraction, we can not only easily and effectively compare the energy differences between two spectral data, but also accurately capture the phase changes caused by defects, thus improving the sensitivity and accuracy of detection.

[0011] Optionally, the steps for establishing the benchmark model include: acquiring multiple sample images of the standard sample film; calculating the spectral differential signal of each frame of the sample image; dividing the frequency domain into multiple sub-regions and calculating the differential signal energy of each sub-region; performing statistical analysis on the differential signal energy of multiple frames of standard samples, calculating the average energy of each sub-region, and obtaining the benchmark model.

[0012] Optionally, the calculation steps of the frequency domain anomaly include: the frequency domain anomaly is defined as the deviation of the original image spectral energy from the reference model, that is, the difference signal energy of the thin film under test is subtracted from the average energy of the reference model, the absolute value is taken and then divided by the average energy of the reference model; bicubic interpolation is performed on the frequency domain anomaly of each sub-region to generate a continuous frequency domain anomaly map.

[0013] Frequency domain anomaly can effectively normalize the energy fluctuations of background noise, highlight the real anomalous signals caused by defects, and generate smooth and detailed anomaly maps through high-quality interpolation algorithms, providing more accurate spatial guidance for subsequent adaptive filtering.

[0014] Optionally, the construction steps of the adaptive filter include: for any pixel in the spectral data of the original image, establishing a nonlinear mapping function between frequency domain anomaly and filter weights, converting the frequency domain anomaly into filter weights according to the nonlinear mapping function, and the filter weights of each pixel constitute the adaptive filter, wherein the filter weights in the nonlinear mapping function are negatively correlated with the frequency domain anomaly.

[0015] Optionally, the adaptive filtering step includes: performing pixel-by-pixel complex multiplication of the filtering weights with the spectral data of the original image to achieve adaptive filtering.

[0016] Adaptive filtering can ensure that while significantly attenuating the energy of background components, the energy and phase information of defect components are fully preserved.

[0017] Optionally, obtaining the defect identification result includes: performing threshold segmentation on the reconstructed spatial domain image to obtain a binarized image; performing connected component analysis on the binarized image to identify the foreground region, which is the potential defect region; determining whether the potential defect region is a defect according to a preset rule to obtain the defect identification result.

[0018] Optionally, the defect determination step includes: extracting the area and major-minor axis ratio of each connected region in the potential defect area, determining the connected regions with an area greater than a preset value as defects, and otherwise determining them as non-defects.

[0019] In a second aspect, an intelligent detection system for food packaging includes: processor; The memory stores computer instructions for an intelligent detection system for food packaging, which, when executed by the processor, cause the system to perform the aforementioned intelligent detection method for food packaging.

[0020] The beneficial effects of this invention are as follows: The solution of this invention deeply integrates geometric perturbation and spectral differential analysis, amplifies the defect signal through the nonlinear response introduced by the known perturbation, suppresses periodic backgrounds through differential calculation, and dynamically protects defects through adaptive filtering, thereby achieving a significant performance leap in defect detection against periodic texture backgrounds. Compared with traditional methods, this invention significantly improves detection accuracy and precision. Attached Figure Description

[0021] Figure 1 This is a flowchart of an intelligent detection method for food packaging according to an embodiment of the present invention.

[0022] Figure 2 This is a structural block diagram of an intelligent detection system for food packaging according to an embodiment of the present invention. Detailed Implementation

[0023] The technical solutions of the embodiments of the present invention will now be clearly and completely described with reference to the accompanying drawings. Figure 1 The diagram shown is a flowchart of an intelligent detection method for food packaging according to an embodiment of the present invention.

[0024] Step S1: Acquire the original image of the thin film under test; apply a preset geometric perturbation to the original image to obtain an auxiliary image.

[0025] An industrial CMOS camera is used to acquire a high-resolution grayscale image of the thin film under test, which serves as the original image. A copy of the original image is then made in memory, and a set of precisely controlled geometric perturbations are applied to generate a new image, which serves as the auxiliary image.

[0026] The preset geometric perturbation is set as a set of standard parameters, including: horizontally shifting to the right by 0.15 pixels, vertically shifting downward by 0.10 pixels, rotating clockwise around the center of the original image by 0.08 degrees, and simultaneously magnifying the original image by 1.0008 times along both the x and y axes.

[0027] Step S2: Perform two-dimensional fast Fourier transform on the original image and the auxiliary image respectively, and then calculate the spectral difference signal.

[0028] Two-dimensional Fast Fourier Transform (FFT) is performed on both the original and auxiliary images to transform them from the spatial domain to the frequency domain. To facilitate subsequent processing and visualization, the transformed spectral data is centered, moving the zero-frequency component to the center of the spectral image.

[0029] Subsequently, the spectral difference signal ΔF between the original image and the auxiliary image is calculated. Since the auxiliary image is derived from the original image and only has known geometric perturbations applied, the two spectral data are highly similar. The calculation of the spectral difference signal involves performing pixel-by-pixel complex subtraction on the two spectral data. This operation applies to both the real and imaginary parts of the spectral data, resulting in a spectral difference signal containing amplitude and phase differences. For periodic background textures, they appear as discrete high-energy frequency peaks in the frequency domain. These peaks are highly consistent in position and amplitude in both spectra and cancel each other out after the difference operation. However, for random defects, because they disrupt the symmetry and periodicity of the image, a nonlinear spectral response is generated after applying geometric perturbations, leading to abnormal spectral abrupt changes in the spectral difference signal, and the amplitude is significantly amplified.

[0030] After the spectral differential signal is calculated, preprocessing is performed. First, the statistical distribution of the amplitude spectrum of the spectral differential signal is calculated to identify outliers with amplitude values ​​much larger than the mean. These outliers typically correspond to strong noise or transient interference in the image. Median filtering is used to smooth these outliers, with the filter window size set to 5×5 pixels. The preprocessed differential signal is then used for subsequent frequency domain anomaly calculations and adaptive filter construction.

[0031] Step S3: Establish a benchmark model for standard samples, and compare the spectral difference signals calculated from the original image and auxiliary image with the benchmark model to obtain the frequency domain anomaly degree.

[0032] Before running the program, an offline calibration is required to establish a reference model for the thin film under test. The operation procedure is as follows: continuously acquire 30 or more sample images of the standard thin film sample. For each sample image, perform the aforementioned steps S1 and S2 to calculate its spectral differential signal ΔF.

[0033] The frequency domain was divided into 64×64 sub-region grids, and the energy of the spectral differential signal was calculated for each sub-region. Subsequently, statistical analysis was performed on the spectral differential signal energies of all 30 standard frames to calculate the average energy of each sub-region. These average energy values ​​are stored in the database as a benchmark model and associated with the product model. The benchmark model fully describes the energy distribution characteristics of the spectral differential signal of the standard sample after a known perturbation is applied.

[0034] During online testing, the energy of the spectral differential signal of the thin film under test is calculated in real time. Frequency domain anomaly Defined as the deviation of the current thin-film spectral differential signal energy from the reference model, it is calculated by subtracting the average energy of the reference model from the differential signal energy of the tested thin film, taking the absolute value, and then dividing by the average energy of the reference model. The specific calculation formula is as follows: ; in, A small constant (set to 0.01 in this practical example) is used to prevent division by zero errors. The frequency domain anomaly index has normalization properties, eliminating the influence of energy level differences in different frequency regions. This represents the frequency domain anomaly degree of each sub-region.

[0035] Frequency domain anomaly reflects the degree of deviation of the spectral differential signal of the tested thin film from the frequency domain of a standard sample. For periodic background regions, since their spectral characteristics are highly consistent with the standard sample, the energy of the spectral differential signal is close to the benchmark model, resulting in a small frequency domain anomaly value. For regions with defects, the defect components generate abnormal energy accumulation in the spectral differential signal, causing the current spectral differential signal energy to deviate significantly from the benchmark model, and the frequency domain anomaly value increases substantially. Due to the differential amplification effect, even weak defect signals can produce significant response peaks in the frequency domain anomaly plot.

[0036] Finally, bicubic interpolation is performed on the frequency domain anomalies of each sub-region to generate a continuous frequency domain anomaly map. Through this frequency domain anomaly calculation process, it is possible to accurately identify which regions in the frequency domain correspond to defect components, providing precise guidance for subsequent adaptive filter construction.

[0037] Step S4: Construct an adaptive filter based on the frequency domain anomaly, and use the adaptive filter to perform dynamic frequency domain filtering on the original image spectrum data.

[0038] Using the calculated frequency domain anomalies, a filter capable of automatically adapting to the state of the thin film under test is constructed; the adaptive filter employs a nonlinear mapping function to convert the frequency domain anomalies into filter weights. In nonlinear mapping functions, the filter weights are negatively correlated with the frequency domain anomaly. (Filter weights) for: ; In this embodiment, the strong suppression coefficient is set to be =0.85, The frequency domain anomaly threshold is set to [value] in this embodiment. =0.5. This function has the following characteristics: When the frequency domain anomaly is close to 0 (corresponding to the periodic background frequency), the filter weight takes a small value, indicating strong suppression of the frequency component and retaining only a small proportion of energy. When the frequency domain anomaly is much greater than the threshold (corresponding to the defect frequency), the filter weight is close to 1, indicating complete preservation of the frequency component without suppression. In the intermediate transition region (frequency domain anomaly ≈ threshold), the filter weight changes smoothly, avoiding the frequency domain ringing artifacts that may be introduced by the drastic jump at the cutoff frequency in traditional hard threshold filters.

[0039] Adaptive filter parameters and The selection of the threshold directly affects the filtering effect. The strong suppression coefficient controls the background suppression intensity; too large a value may lead to over-suppression of some weak defect signals, while too small a value will result in insufficient background suppression. The transition region threshold controls the selectivity of the adaptive filter; too large a value will make the adaptive filter insensitive to changes in frequency domain anomalies, while too small a value may introduce excessive high-frequency noise.

[0040] After construction, an adaptive filter is applied to the spectrum of the original image. The adaptive filtering steps include: performing pixel-by-pixel complex multiplication of the filter weights with the spectrum data of the original image to achieve dynamic filtering. This operation ensures that while significantly attenuating the energy of background components, the energy and phase information of defective components are fully preserved.

[0041] Step S5: Perform a two-dimensional inverse fast Fourier transform on the frequency domain filtered spectrum data to obtain the reconstructed spatial domain image, and perform threshold segmentation on the reconstructed spatial domain image to obtain the defect identification result.

[0042] A two-dimensional inverse fast Fourier transform is performed on the adaptively filtered spectral data to reconstruct a spatial domain image. In the reconstructed image, the energy of the periodic texture in the background is extremely suppressed, appearing as a near-uniform dark field, while any potential defects are clearly presented as high-contrast bright areas.

[0043] Subsequently, the reconstructed spatial domain image is processed to obtain the final defect identification result. This process includes: thresholding the reconstructed image. Since the background has been sufficiently suppressed, a fixed low threshold (30 pixels in this embodiment) can be directly applied for global binarization to obtain a binarized image. Next, connected component analysis is performed on the binarized image to mark and identify all independent foreground regions, which are the potential defect areas. Finally, within the potential defect areas, the area and aspect ratio of each connected component are extracted, and defects are determined according to preset rules. The rules set in this embodiment are as follows: areas greater than 50 pixels are determined as valid defects; areas less than 50 pixels are determined as noise points and filtered out; aspect ratios greater than 5 pixels are determined as scratch defects; and aspect ratios less than 3 pixels are determined as blemish defects.

[0044] According to a second aspect of the invention, the invention also provides an intelligent detection system for food packaging. Figure 2 This is a structural block diagram of an intelligent detection system for food packaging according to an embodiment of the present invention. Figure 2As shown, the system includes a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement the intelligent detection method for food packaging according to the first aspect of the present invention. The system also includes other components well-known to those skilled in the art, such as a communication bus and a communication interface; their configuration and functions are known in the art and will not be described further here.

[0045] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be within the scope of protection of the present invention.

Claims

1. A smart detection method for food packaging, characterized in that, The detection method comprises the following steps: acquiring an original image of a measured film; applying a preset geometric disturbance to the original image to obtain an auxiliary image; After performing two-dimensional fast Fourier transform on the original image and the auxiliary image respectively, a frequency spectrum difference signal is calculated; A reference model of a standard sample is established, and the frequency spectrum difference signal calculated from the original image and the auxiliary image is compared with the reference model to obtain a frequency domain abnormality degree of each pixel point in the frequency spectrum data of the original image; An adaptive filter is constructed according to the frequency domain abnormality degree, and dynamic frequency domain filtering is performed on the frequency spectrum data of the original image by using the adaptive filter; After performing two-dimensional inverse fast Fourier transform on the frequency spectrum data filtered in the frequency domain, a reconstructed spatial domain image is obtained, and threshold segmentation is performed on the reconstructed spatial domain image to obtain a defect recognition result.

2. A smart detection method for food packaging according to claim 1, characterized in that, The preset geometric disturbance comprises a translation disturbance, a rotation disturbance and a scale disturbance.

3. The intelligent detection method for food packaging according to claim 1, wherein, The calculation step of the frequency spectrum difference signal comprises: performing a complex subtraction operation on the frequency spectrum data of the original image and the auxiliary image pixel by pixel; and the complex subtraction operation simultaneously acts on the real part and the imaginary part of the frequency spectrum data, so that the frequency spectrum difference signal containing the amplitude and the phase difference is obtained.

4. The intelligent detection method for food packaging according to claim 1, wherein, The establishment step of the reference model comprises: a plurality of sample images of the standard sample film are collected; the frequency spectrum difference signal of each frame of sample image is calculated; a plurality of sub-regions are divided in the frequency domain, and the difference signal energy of each sub-region is calculated; statistical analysis is performed on the difference signal energy of the plurality of frames of standard sample, the average energy of each sub-region is calculated, and the reference model is obtained.

5. A smart detection method for food packaging according to claim 4, characterized in that, The calculation step of the frequency domain abnormality degree comprises: the frequency domain abnormality degree is defined as the deviation degree of the original image spectrum energy relative to the reference model, that is, the difference signal energy of the measured film is subtracted from the average energy of the reference model, and the absolute value is divided by the average energy of the reference model to calculate the frequency domain abnormality degree; the frequency domain abnormality degrees of the sub-regions are subjected to bicubic interpolation to generate a continuous frequency domain abnormality degree map.

6. The intelligent detection method for food packaging according to claim 1, wherein, The construction step of the adaptive filter comprises: for any one pixel point in the frequency spectrum data of the original image, a nonlinear mapping function between the frequency domain abnormality degree and the filtering weight is established, the frequency domain abnormality degree is converted into the filtering weight according to the nonlinear mapping function, and the filtering weights of the pixel points constitute the adaptive filter, wherein the filtering weight and the frequency domain abnormality degree are negatively correlated in the nonlinear mapping function.

7. A smart detection method for food packaging according to claim 6, characterized in that, The adaptive filtering step comprises: the filtering weight and the frequency spectrum data of the original image are multiplied pixel by pixel to realize dynamic filtering.

8. The intelligent detection method for food packaging according to claim 1, wherein, The defect recognition result comprises: threshold segmentation is performed on the reconstructed spatial domain image to obtain a binary image; connected domain analysis is performed on the binary image to identify a foreground region, the foreground region is a potential defect region, whether the potential defect region is a defect is determined according to a preset rule, and a defect recognition result is obtained.

9. A smart detection method for food packaging according to claim 8, characterized in that, The defect determination step comprises: in the potential defect region, the area and the length-to-short-axis ratio of each connected domain are extracted, the connected domain with an area greater than a preset value is determined as a defect, and otherwise, it is determined as a non-defect.

10. A smart detection system for food packaging, characterized in that, comprises: a processor; a memory, wherein a computer program is stored in the memory; The processor is configured to implement the intelligent detection method for food packaging according to any one of claims 1-9 when executing the computer program.

Citation Information

Patent Citations

  • A spiral wound material defect detection method based on image enhancement in frequency domain

    CN109345501A

  • Automatic control method and system for battery film production based on visual inspection

    CN119229372A

  • Pipeline repairing method and system based on defect detection

    CN119295042A

  • High-precision five-axis turntable cooperative control method and system based on multi-closed-loop feedback

    CN120540200A

  • Smart park safety protection system and method based on intelligent video analysis and multi-mode integration

    CN120580810A