A method and system for detecting wrinkles and false seals of a soft package heat-sealed opening

CN122820731APending Publication Date: 2026-09-25YIWU JIEDU MASCH EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611332116.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-31
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

[0008]针对现有软包装封口的可见光机器视觉检测中,皱褶因几何起伏形成的明暗条带与虚封因熔合态改变形成的亮度不均在单一固定光照的二维图像中呈现高度相似的表观,检测系统难以在同一封口区内将良性皱褶与危害性虚封这两种表观相似而物理成因不同的现象准确判别,从而在过度拒收与漏检虚封之间难以兼顾的技术问题,本发明提供一种用于软包装热封口的皱褶与虚封判别检测方法及系统,以可见光多方向光照下的反射物理先验,将封口区的良性皱褶与危害性虚封解耦判别,在低成本、非接触、在线的条件下降低两者的混淆误判率,提高软包装封口检测的准确性与可靠性

Benefits of technology

[0025]本发明的有益效果在于,通过在可见光多光照条件下采集同一封口区的多方向图像序列,利用皱褶为几何起伏、其明暗随光照方向翻转且法向可重建,与虚封为材料熔合态差异、其反射随光照方向变化弱且呈各向同性的物理差异,从多方向图像重建表面法向场及反射各向异性特征,再由神经网络融合并输出判别结果,实现了仅凭可见光即在同一封口区内将良性皱褶与危害性虚封解耦判别;由于将由法向可解释的亮度变化逐方向扣除后以残差表征材料熔合态差异,使几何成因与材料成因在特征层面得以分离,从而克服了两者在单一固定光照二维图像中表观相似而难以区分的困境;相较于依赖红外、多光谱等昂贵成像或接触、破坏式传感的方案,本发明在低成本、非接触、在线的条件下显著降低了良性皱褶与危害性虚封的混淆误判率,既减少了将良性皱褶误判为虚封的过度拒收,又避免了为容忍皱褶而放宽阈值导致的虚封漏检,提高了软包装封口在线检测的准确性与可靠性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122820731A_ABST
    Figure CN122820731A_ABST
Patent Text Reader

Abstract

The application discloses a kind of creases and virtual seal discrimination detection method and system for soft package heat seal, to not less than three different azimuth angles, different incident direction each other's switchable light source illumination same heat seal area, gather imaging perspective consistent but illumination direction different image sequence;Registration and extraction seal area region of interest, obtain multidirectional brightness observation;Surface normal is solved pixel by pixel to obtain surface normal field;The brightness change that can be explained by surface normal field is deducted direction by direction, and residual reflection change is used as the reflection anisotropy feature representing material fusion state difference;Surface normal field, reflection anisotropy feature and multidirectional brightness observation are used as the multi-channel input neural network, and the discrimination result that each position belongs to benign crease, harmful virtual seal or normal seal is output.The application only relies on visible light, and the two are decoupled and distinguished in the same seal area, to reduce the confusion misjudgment rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision inspection technology, specifically to a method and system for detecting and distinguishing wrinkles and false seals in the heat sealing of flexible packaging. Background Technology

[0002] Flexible packaging, with its advantages of being lightweight, flexible in shaping, low in cost, and easy to print, is widely used in the packaging of food, pharmaceuticals, cosmetics, and daily necessities. The sealing area of ​​this type of packaging typically consists of two or more layers of heat-sealable film fused together under heat, pressure, and a certain time, forming a continuous sealing strip that isolates the contents from the external environment. The quality of the seal directly determines the packaging's sealing performance and shelf life, making it a crucial aspect that must be strictly controlled in flexible packaging production.

[0003] In actual production, when the sealing temperature is insufficient, the pressure or holding time is inadequate, the sealing material is improperly matched, or powder, oil, liquid film, or air bubbles are trapped between the sealing surfaces, the heat seal often fails to truly fuse or fuses insufficiently, resulting in a defect known as a false seal (also called a weak seal or fake seal). A false seal sometimes looks very similar to a normal seal, even difficult to detect under visual inspection. However, its sealing performance is already compromised, making it highly susceptible to air and liquid leaks, moisture absorption and deterioration of the contents, and even bag bulging and rupture during distribution and shelf life. This is one of the main causes of bulk recalls of flexible packaging and shelf complaints. Therefore, the ability to reliably detect false seals on the production line and promptly remove defective products has always been a pressing issue for the flexible packaging industry.

[0004] Meanwhile, flexible packaging films are subjected to tension and compression during heat sealing, traction, and winding processes, which easily causes surface geometric undulations such as wrinkles and creases in the sealing area and its adjacent areas. Wrinkles are essentially just geometric deformations of the film and, in most cases, do not disrupt the continuous fusion of the sealing strip; they are benign appearance fluctuations and should generally be allowed. This leads to a special and specialized discrimination situation in online inspection of flexible packaging seals: the two objects that need to be distinguished are not defects and non-defects in the usual sense, but rather two phenomena that cause anomalies in brightness and darkness on the sealing area image but belong to different physical causes—one is the geometric undulation of the film surface, i.e., wrinkles, and the other is the difference in the fusion state of the sealing material, i.e., a false seal. How to accurately distinguish between the two has constituted a long-standing problem in this field.

[0005] Existing visible light machine vision inspection for flexible packaging sealing mostly acquires two-dimensional images of the sealing area under unidirectional or circular illumination. It judges for anomalies based on geometric features such as brightness distribution, width, stripes, and texture of the sealing strip, and alarms for wrinkles, channels, and unsealed areas as sealing defects. However, wrinkles, due to geometric undulations, form bright and dark stripes in the image, while false seals, due to local non-adhesion or changes in fusion state, also create areas of uneven brightness and discontinuous texture. These two types of defects often appear highly similar in a two-dimensional image under a single, fixed illumination. If the inspection system classifies all brightness and darkness anomalies within the sealing area as defects, it will misclassify many benign wrinkles as false seals, leading to excessive rejection and reduced yield. Conversely, if the judgment threshold is relaxed to tolerate wrinkles, genuine false seals will be missed, creating a hidden risk of seal failure. Therefore, relying solely on two-dimensional appearance features under single illumination makes it difficult to strike a balance between accurately eliminating false seals and avoiding the misidentification of wrinkles, thus limiting the accuracy and reliability of the inspection.

[0006] To reliably identify false seals, the industry has tried methods such as infrared or thermal imaging, ultrasound, laser displacement, and dye penetration. While these methods can reflect the fusion state of the seal to some extent, they either rely on expensive non-visible light imaging equipment and dedicated sensors, resulting in high inspection costs and complex system structures; or they are contact-based, destructive offline sampling methods, which cannot meet the needs of full, continuous, and non-contact online inspection on production lines. More importantly, none of these methods directly address the specific dilemma of "wrinkles and false seals appearing similar when using only visible light imaging," making it difficult to balance cost, efficiency, and accuracy on actual production lines.

[0007] Furthermore, existing surface inspection technologies combining multi-light illumination, photometric stereoscopic imaging, and neural networks primarily aim to reconstruct the geometric morphology of objects or identify geometric defects such as dents and scratches, mainly for the appearance inspection of highly reflective surfaces like metals. These technologies only use the changes in brightness with the direction of illumination to restore surface geometry, neglecting non-geometric defects such as differences in the fusion state of sealing materials, and failing to consider the differences in physical behavior between wrinkles and false seals under different lighting conditions. Therefore, they cannot be directly used to distinguish between two similar appearances in flexible packaging seals. Consequently, in online inspection of flexible packaging seals, accurately distinguishing between benign wrinkles and harmful false seals—two phenomena with similar appearances but different physical causes—within the same sealing area under low-cost, non-contact, and online operation conditions remains a long-standing and unresolved technical problem. Summary of the Invention

[0008] In existing visible light machine vision inspection of flexible packaging seals, wrinkles, due to geometric undulations, exhibit highly similar appearances in a two-dimensional image under a single fixed illumination. This makes it difficult for the inspection system to accurately distinguish between benign wrinkles and harmful false seals—two phenomena with similar appearances but different physical causes—within the same sealing area. This leads to a trade-off between excessive rejection and missed detection of false seals. This invention provides a method and system for distinguishing and detecting wrinkles and false seals in flexible packaging heat sealing. By utilizing the physical prior of reflection under multi-directional visible light illumination, benign wrinkles and harmful false seals in the sealing area are decoupled for identification. This reduces the confusion and misjudgment rate of the two types of seals under low-cost, non-contact, and online conditions, improving the accuracy and reliability of flexible packaging seal inspection.

[0009] The physical priors upon which this invention is based are as follows: wrinkles are essentially geometric undulations on the surface of a thin film, with each point on the sealed area having a definite surface normal that varies with position. When the illumination direction changes, the brightness of each point changes with the geometric relationship between the incident light and the normal. The raised, light-facing and shadow-facing slopes undergo brightness reversal and migration under different illumination directions. Therefore, the appearance of the wrinkled area shows a strong and regular change with the illumination direction, and this geometric undulation can be reconstructed from the brightness changes under multi-directional illumination to obtain the surface normal field. The virtual seal is essentially a difference in the fusion state of the sealing layer material. The surface of the unfused or insufficiently fused area does not have a significant normal difference from the surrounding sealing area in macroscopic geometry. Its apparent difference comes from the change in the microstructure and reflective properties of the material surface. This type of reflective behavior changes weakly and tends to be isotropic under different illumination directions. This invention utilizes the two separable physical differences—that the reflection of wrinkles changes strongly with the direction of illumination and its normal can be reconstructed, while the reflection of virtual seals changes weakly with the direction of illumination and is isotropic—as the core criterion for distinguishing between the two.

[0010] In one aspect, the present invention provides a method for detecting and distinguishing wrinkles and false seals in the heat sealing of flexible packaging, the method comprising the following steps.

[0011] Step S1 involves illuminating the same heat-sealed area with at least three switchable light sources located at different azimuth angles and with different incident directions, and acquiring an image sequence of the heat-sealed area with a consistent imaging angle but different illumination directions under at least three illumination directions. Specifically, at least three switchable light sources located at different azimuth angles are set up, each with a known and different incident direction relative to the sealed area being inspected. The image acquisition unit is aligned with the same heat-sealed area. The light sources are controlled to be illuminated synchronously or at different times under at least three illumination directions, and image sequences of the same sealed area under different illumination directions are acquired accordingly. This ensures that the imaging angle of each image in the image sequence is consistent while the illumination direction is different, thereby fully exposing the reflection response of the sealed area surface to different illumination directions with only the illumination direction as a variable, while keeping the imaging geometry unchanged.

[0012] Step S2 involves registering the image sequence and extracting the region of interest (ROI) of the sealing area to obtain multi-directional brightness observations corresponding to each pixel. Specifically, the image sequence is registered to align images under different illumination directions at the pixel level; the sealing band is located on the aligned image, and the ROI of the sealing area is extracted. Subsequent processing is performed only on the sealing area and its neighborhood to obtain multi-directional brightness observations corresponding to each pixel, thereby reducing computational load and suppressing interference from irrelevant backgrounds.

[0013] Step S3 involves taking the brightness observations of each pixel within the region of interest under different illumination directions and the corresponding known illumination directions as input, and solving the surface normal pixel by pixel to obtain the surface normal field covering the sealing area. Specifically, based on the law of surface reflection changing with illumination direction, the surface normal of that point is solved pixel by pixel to obtain the surface normal field covering the sealing area. From this surface normal field, features reflecting geometric undulations are further derived. These features are significantly enhanced in the wrinkled region and weaker in the virtual sealing region, providing a basis for the subsequent separation of geometric and material origins.

[0014] Step S4 involves subtracting the brightness changes explainable by the surface normal field from the multi-directional brightness observations one direction at a time. The remaining reflection changes that cannot be explained by the surface normal field are used as the reflection anisotropy features characterizing the differences in the fusion state of the material. Specifically, taking the brightness observations of each pixel in the region of interest under different illumination directions as samples, the brightness changes that can be explained by the surface normal reconstructed in step S3 are subtracted from the observations one direction at a time. The remaining reflection changes that cannot be explained by the geometric normal are used as the reflection anisotropy features characterizing the differences in the fusion state of the material: the brightness of the wrinkled region changes strongly with the illumination direction due to geometric undulations, and the residual after subtracting the explainable part is small, and the reflection anisotropy is high-directional selectivity dominated by geometry; the reflection behavior of the virtual sealed region changes weakly with the illumination direction and tends to be isotropic, and its reflection anisotropy features are low-directional selectivity, thereby separating the geometric cause from the material cause at the feature level.

[0015] Step S5 involves inputting the surface normal field, the anisotropic reflection features, and the multi-directional brightness observations as multiple channels into a neural network. The neural network then fuses these elements and outputs a judgment result indicating whether each location within the sealing area is a benign wrinkle, a harmful false seal, or a normal seal. Specifically, the surface normal field obtained in step S3 and its derived geometric undulation features, the anisotropic reflection features obtained in step S4, and the original multi-directional brightness observations of the sealing area are input into the neural network as multiple channels. The neural network fuses the aforementioned geometric and reflective features, providing a wrinkle and false seal discrimination map of the sealing area using pixel-by-pixel segmentation or region classification. This allows the network to learn to classify appearances that strongly change with the illumination direction and can be explained by the normal as wrinkles, and appearances that change weakly with the illumination direction and are isotropic as false seals. Thus, even when two types of appearances are similar, the network can still distinguish them based on their differences in response to the illumination direction.

[0016] Furthermore, the switchable light source mentioned in step S1 is either a visible light surface light source or a line light source and is arranged along the extension direction of the sealing strip, with the azimuth angle of each light source evenly distributed in the circumferential direction. This arrangement of line light sources along the extension direction of the sealing strip adapts to the continuous direction of the sealing strip, ensuring that each segment of the sealing area receives consistent illumination. The uniform distribution of azimuth angles in the circumferential direction guarantees balanced sampling of the surface normal by each illumination direction, preventing certain slope-shaped wrinkles from being effectively excited due to concentration of illumination directions.

[0017] Further, in step S3, the surface normal is solved pixel-by-pixel using a photometric stereo method, or the surface normal is estimated from brightness observations of each pixel within the region of interest under different illumination directions using another neural network. Features reflecting geometric undulations are derived from the surface normal field, including the spatial gradient of the surface normal, local curvature, and relative height distribution obtained by integrating the surface normal. Specifically, when using the photometric stereo method, the pixel-by-pixel normal is solved by simultaneously solving multi-directional brightness and known illumination directions. Considering that the thin film surface is not ideally diffuse, a solution method robust to non-Lambertian reflection can also be used, or the surface normal can be estimated from multi-directional brightness observations using a neural network to improve the accuracy of normal reconstruction under specular and specular reflection conditions. The resulting spatial gradient, local curvature, and relative height distribution jointly characterize the geometric undulations of the sealing area, significantly enhanced in the wrinkled region and tending to be gentler in the virtual sealing region.

[0018] Furthermore, in step S4, for each pixel within the region of interest, its brightness under each illumination direction is normalized, and then the change in brightness with the illumination direction is fitted. The fitted direction dependence intensity is used as a measure of the direction selectivity of the pixel's reflection behavior with the illumination direction, and this direction selectivity measure is incorporated into the reflection anisotropy feature. Specifically, for each pixel, its brightness under each illumination direction is first normalized to eliminate the overall albedo difference, and then a curve of brightness changing with the illumination direction is fitted. In wrinkled regions, this curve shows a strong direction dependence, while in vacant regions, the curve tends to be flat. Using the fitted direction dependence intensity as a measure of direction selectivity and incorporating it into the reflection anisotropy feature can further enhance the separability of the two types of phenomena in the feature space.

[0019] Furthermore, the neural network described in step S5 is a convolutional neural network with multi-branch inputs. Its first branch receives the surface normal field and the features reflecting geometric undulations, while the second branch receives the anisotropic reflection features. The two branches extract features separately and then fuse them in an intermediate layer, outputting the discrimination result using pixel-by-pixel segmentation or region classification. In this way, the first branch focuses on geometric cues, and the second branch focuses on reflection cues, extracting features separately and fusing them in an intermediate layer. This maintains the independent expression of the two types of physical causes in the front end of the network while achieving joint discrimination of geometric and material information through the fusion layer.

[0020] Furthermore, in step S5, the neural network outputs the confidence level of each category while outputting the discrimination result, and performs actions such as releasing, rejecting, or re-inspecting the sealed area based on the confidence level. The neural network is trained using sealed samples labeled with wrinkled and falsely sealed areas as supervision. Specifically, normal seals with high confidence levels are released, harmful false seals with high confidence levels are rejected, and areas with confidence levels in between are transferred to re-inspection, thereby ensuring the detection of false seals while suppressing the false rejection of benign wrinkles. During training, sealed samples labeled with wrinkled and falsely sealed areas are used as supervision to enable the network to stably learn the differences in the response of the two types of appearances to the direction of illumination.

[0021] Furthermore, before the output of step S5, a consistency check is performed on the geometric undulations obtained from the surface normal field and the material fusion state obtained from the reflection anisotropy features. The reflection anisotropy features include the reflection residual energy obtained from the reflection changes remaining after subtraction and the reflection direction selectivity measure: when the geometric undulations of a certain region are greater than a corresponding threshold and the reflection residual energy is lower than a corresponding threshold, it is judged as a benign wrinkle; when the geometric undulations of a certain region are less than a corresponding threshold, the reflection residual energy is higher than a corresponding threshold, and the reflection direction selectivity measure is lower than a corresponding threshold, it is judged as a suspected false seal and its re-examination weight is increased. In this way, a consistency check based on physical prior is added in addition to the neural network discrimination, which can correct and weight the discrimination results when wrinkles and false seals are adjacent or superimposed in local space, further improving the stability of the discrimination.

[0022] Furthermore, multiple regions of interest (ROIs) are arranged along the sealing strip within the same heat-sealing area, and the discrimination results of each ROI are summarized. The existence of continuous false-seal segments on the sealing strip is used as the basis for whether to reject the entire bag. By using the continuity of false-seal segments on the sealing strip, rather than the discrimination of individual isolated pixels, as the rejection criterion, false rejections caused by fluctuations in the discrimination of individual pixels can be avoided, making the decision to release or reject the entire bag more in line with the actual requirements of sealing performance.

[0023] Furthermore, in step S1, time-division acquisition is used, synchronizing stroboscopic illumination with camera exposure. As the inspected sealing area moves with the film, light sources in each direction are sequentially illuminated and captured continuously, resulting in a multi-directional image sequence with overlapping positions. In step S2, the region of interest (ROI) is located based on the position of the sealing strip relative to the bag or the edge features of the sealing strip. This approach, adapting to a moving production line, synchronizes stroboscopic illumination with camera exposure, sequentially illuminating light sources in each direction and capturing continuously within a very short time. This ensures that the sealing area moving with the film is substantially aligned in the images from each direction, and then registration eliminates minor displacements. Furthermore, locating the ROI based on the position of the sealing strip relative to the bag or the edge features of the sealing strip allows for stable locking of the sealing strip even when the bag's position drifts.

[0024] Another aspect of the present invention provides a wrinkle and false seal discrimination detection system for heat sealing of flexible packaging, comprising: an image acquisition unit for illuminating the same heat-sealing area with at least three switchable light sources located at different azimuth angles and with different incident directions, and acquiring an image sequence of the heat-sealing area with the same imaging angle but different illumination directions under at least three illumination directions; a preprocessing unit for registering the image sequence and extracting the region of interest of the sealing area to obtain multi-directional brightness observations corresponding to each pixel; and a normal reconstruction unit for using the brightness observations of each pixel in the region of interest under different illumination directions and the corresponding known illumination directions. The system takes the surface normal as input and solves it pixel by pixel to obtain the surface normal field covering the sealing area. The anisotropy extraction unit is used to subtract the brightness changes that can be explained by the surface normal field from the multi-directional brightness observations in each direction, and use the remaining reflection changes that cannot be explained by the surface normal field as the reflection anisotropy features characterizing the differences in the fusion state of the material. The discrimination unit is used to input the surface normal field, the reflection anisotropy features and the multi-directional brightness observations as multiple channels into the neural network, and output the discrimination results of each position in the sealing area as benign wrinkles, harmful false seals or normal seals after the neural network fuses them. The functions of each unit in the system correspond one-to-one with the steps of the aforementioned method: the image acquisition unit realizes multi-directional illumination image acquisition in step S1, the preprocessing unit realizes registration and region of interest extraction in step S2, the normal reconstruction unit realizes surface normal field reconstruction in step S3, the anisotropy extraction unit realizes reflection anisotropy feature extraction in step S4, and the discrimination unit realizes neural network fusion and discrimination in step S5. Thus, the above method is supported in hardware by the coordinated use of switchable light source, image acquisition device and computing processing device.

[0025] The beneficial effect of this invention lies in the fact that by acquiring multi-directional image sequences of the same sealing area under multiple visible light illumination conditions, and utilizing the physical differences between wrinkles (geometric undulations, whose brightness and darkness flip with the illumination direction and whose normal direction can be reconstructed) and false seals (differences in material fusion state, whose reflection changes weakly with the illumination direction and is isotropic), the surface normal field and anisotropic reflection characteristics are reconstructed from the multi-directional images. Then, a neural network fuses and outputs the discrimination result, achieving the decoupling and discrimination of benign wrinkles and harmful false seals within the same sealing area using only visible light. Because the brightness changes explained by the normal direction are subtracted directionally, the residual... The difference in characterization of the fusion state of materials allows for the separation of geometric origin and material origin at the feature level, thus overcoming the difficulty of distinguishing between the two due to their similar appearance in a single fixed-light two-dimensional image. Compared with expensive imaging methods such as infrared and multispectral imaging or contact and destructive sensing, this invention significantly reduces the confusion rate between benign wrinkles and harmful false seals under low-cost, non-contact, and online conditions. It reduces excessive rejection due to misjudging benign wrinkles as false seals and avoids missed detection of false seals caused by relaxing the threshold to tolerate wrinkles, thereby improving the accuracy and reliability of online detection of flexible packaging seals. Attached Figure Description

[0026] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0027] Figure 1 This is a flowchart of the method for detecting and distinguishing wrinkles and false seals in the heat sealing of flexible packaging according to the present invention; Figure 2 This is a schematic diagram illustrating the principle of multi-directional illumination image acquisition and region of interest extraction of the present invention; Figure 3 This is a data flow graph of the present invention, which reconstructs the surface normal field from multi-directional brightness observation and extracts the anisotropic characteristics of reflection. Figure 4 This is a structural block diagram of the wrinkle and false seal discrimination and detection system for heat sealing of flexible packaging according to the present invention; Figure 5 This is a schematic diagram illustrating the response of the three forms of the present invention—benign wrinkles, harmful false seals, and normal seals—to the direction of light illumination and the mechanism of normal explanatory component stripping. Figure 6 This is a side view of the deployment of the detection station of the detection system of the present invention on the flexible packaging filling and sealing production line; Figure 7 This is a cross-sectional comparison diagram of the sealing tape in the present invention, which exhibits three forms: benign wrinkles, harmful false seals, and normal seals. Figure 8 This is a line graph showing the stability of various evaluation indicators of the present invention under different batches of films and different production line speeds. Detailed Implementation

[0028] To make the objectives and technical solutions of this invention clearer, the embodiments of this invention will be further described in detail below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solutions of this invention and should not be construed as limiting the scope of protection of this invention.

[0029] Example 1 This embodiment provides a method for detecting and distinguishing wrinkles and incomplete seals in the heat-sealing of flexible packaging, such as... Figure 1 As shown, the method sequentially includes steps S1 to S5. For ease of understanding, the physical priors upon which this embodiment is based are explained first: wrinkles are essentially geometric undulations on the surface of the film. Each point on the surface of the sealing area has a definite surface normal that varies with position. When the illumination direction changes, the brightness of each point changes with the geometric relationship between the incident light and the normal. The raised, light-facing slope and the back-facing slope undergo brightness reversal and migration under different illumination directions. Therefore, the appearance of the wrinkled area shows a strong and regular change with the illumination direction, and this geometric undulation can be reconstructed from the brightness changes under multi-directional illumination to obtain the surface normal field. The virtual seal is essentially a difference in the fusion state of the sealing layer material. The surface of the unfused or insufficiently fused area does not have a significant normal difference from the surrounding sealing area in macroscopic geometry. Its apparent difference comes from the change in the microstructure and reflective properties of the material surface. This kind of reflective behavior changes weakly under different illumination directions and tends to be isotropic. This embodiment utilizes this pair of separable physical differences to decouple and distinguish between benign wrinkles and harmful false seals that appear similar but have different causes within the sealing area. The flexible packaging film described in this embodiment is a multi-layer composite film, with a heat-sealing layer on the sealing side and a substrate layer on the back side. During heat sealing, the heat-sealing layers of the two films fuse together to form a sealing strip. The morphological differences of benign wrinkles, harmful false seals, and normal seals on the cross-section of the sealing strip, as well as the differences in light and dark response of the three under two different lighting directions (denoted as direction 1 and direction 2 in the figure), are shown below. Figure 7 As shown; the differences in luminance response of the three under different illumination directions and the residuals after subtracting the explainable luminance of the normal direction in each direction are as follows: Figure 5 As shown, Figure 5 The arrows above each column indicate the illumination direction at azimuth angles of 0°, 90°, and 180°, respectively. The markings on each curve only indicate the sampled illumination direction. The three vertical axes use the same scale. The following description proceeds from steps S1 to S5, where step S5 involves the neural network. First, it describes how the trained network processes the input and generates the discrimination result during the detection (inference) phase, and then it describes separately how the network obtains data from the samples during the training phase.

[0030] Step S1, Multi-directional Illumination Image Acquisition. Illuminate the same heat-sealing area with at least three switchable light sources located at different azimuth angles and with different incident directions. Acquire an image sequence of the heat-sealing area under at least three illumination directions, with the imaging viewpoint being consistent but the illumination direction different. For example... Figure 2 As shown, an image acquisition unit is positioned above the sealed area to be inspected, with its optical axis approximately perpendicular to the plane of the sealing strip. Multiple independently illuminating visible light sources are arranged around the sealing strip. In a preferred configuration of this embodiment, four light sources are used, located at azimuth angles of 0°, 90°, 180°, and 270°, respectively, i.e., evenly distributed in a circular direction. Each light source has a known and distinct incident direction relative to the sealed area to be inspected. The incident zenith angle is preferably a moderate grazing angle between 30° and 55°, such as 42°, to achieve a balance between sufficient contrast and avoiding excessively strong projected shadows. Figure 2 The incident zenith angle is indicated by θ. Figure 2 This is a schematic diagram of the principle. The angles of each optical path and the size ratio of the sealing strip to the region of interest are not drawn to scale. The region of interest actually defines the sealing strip and its adjacent neighborhood. When the surface albedo of the object being inspected changes drastically or the wrinkles have a single orientation, the number of light sources can be increased to six or eight, with the azimuth angles evenly distributed at intervals of 60° or 45° to improve the sampling uniformity of wrinkles on each slope.

[0031] Each light source is preferably a visible light surface light source or a line light source, arranged along the extension direction of the sealing strip. Since the sealing strip of flexible packaging is usually a continuous narrow strip extending along the production line, using line light sources arranged along the extension direction of the sealing strip can match the continuous direction of the sealing strip, so that each section of the sealing area receives consistent illumination, avoiding uneven brightness caused by point light sources on long strip sealing strips due to distance differences. The wavelength of the light source is preferably white light or a single band of visible light, and the color temperature and spectrum of each light source are consistent to avoid misinterpreting the differences in the light source spectrum as anisotropy of reflection. During acquisition, the control unit controls each light source to be lit in time-division under no less than three illumination directions: first, the 0° light source is lit and the camera is triggered to expose and acquire one frame; after it is turned off, the 90° light source is lit and another frame is acquired; this process is repeated in each direction to obtain four images of the same sealing area under four different illumination directions, forming a set of image sequences. Because the camera and the object under inspection remain relatively stationary during the acquisition process, the images in this image sequence have the same imaging angle but different illumination directions. Thus, under the premise of unchanged imaging geometry, the surface reflection response of the sealed area to different illumination directions is fully exposed by only the illumination direction as a variable.

[0032] To adapt to the moving production line, step S1 further employs time-division acquisition that synchronizes strobe lighting with camera exposure. When the flexible packaging moves continuously with the film without stopping, the sealing area passes through the camera's field of view sequentially within a very short time. At this time, a strobe controller drives the light sources in each direction to strobe and light up sequentially within milliseconds or even sub-milliseconds, ensuring that each strobe flash is strictly synchronized with one exposure of the camera. During the movement of the sealed area with the film, the light sources in each direction are lit sequentially within a very short time, and continuous shooting is performed. Since the four exposures are completed within a total count of milliseconds, the displacement of the sealing area between adjacent frames is minimal, resulting in a multi-directional image sequence with essentially overlapping positions. The strobe pulse width is preferably between 50 and 300 microseconds, and the pulse peak current is much higher than the rated current during continuous lighting, to obtain sufficient light intake and freeze motion blur within the extremely short exposure time. If the production line speed is high enough that there is still perceptible displacement between adjacent frames, the residual displacement is eliminated by image registration in step S2. As an alternative, on stationary production lines or sampling inspection stations, the sealing area can be kept completely still during the acquisition process, and the light sources from each direction can be lit up sequentially with the normal exposure time. In this case, the positional overlap of the image sequence is higher and the registration burden is lighter.

[0033] Step S2: Image registration and region of interest extraction for the same sealing area. The image sequence is registered and the region of interest for the sealing area is extracted to obtain multi-directional brightness observations corresponding to each pixel. First, the image sequence is registered: using one image in the sequence (e.g., an image in the 0° illumination direction) as the reference frame, the remaining images are aligned with the reference frame, ensuring pixel-level alignment of images under different illumination directions. Registration preferably uses rigid or affine registration based on the sealing tape edge or bag body feature points: first, extract the straight edges of the sealing tape or stable corner points, printed marks, and other features on the bag body from each image; then estimate the translation and slight rotation of each image relative to the reference frame, and resample the remaining frames to the reference frame coordinate system. Since step S1 has already made the positions of each frame basically coincide, this registration only needs to eliminate small displacements at the sub-pixel to several-pixel level. The registration accuracy is preferably controlled within half a pixel to ensure that subsequent pixel-by-pixel normal reconstruction does not introduce artifacts due to misalignment. For image sequences acquired completely at rest, registration can be omitted or simplified.

[0034] After registration, the sealing tape is located on the aligned image, and the region of interest (ROI) of the sealing area is extracted. Localization is preferably based on the position of the sealing tape relative to the bag body or the edge features of the sealing tape: For flexible packaging, the sealing tape is usually located at the top or edges of the bag body, and in the image, it appears as a pair of approximately parallel straight line boundaries with a regular textured band between them. Based on this, edge detection combined with straight line fitting can be used to determine the two long sides of the sealing tape, thus defining the sealing tape and its neighborhood within a few millimeters as the ROI. Even if the bag body position drifts, the sealing tape can still be stably locked based on its own edge features, allowing the ROI to adaptively move with the sealing tape position. After extracting the ROI, only the sealing area and its neighborhood are processed. This significantly reduces the computational load and suppresses interference from irrelevant areas such as the bag's printed pattern and the background conveyor belt. After this step, each pixel within the ROI corresponds to a set of multi-directional brightness observations, i.e., the four brightness values ​​of the pixel under four known illumination directions, denoted as the multi-directional brightness observation vector of that pixel, serving as the common input for steps S3 and S4.

[0035] Step S3, Surface Normal Reconstruction. Using the brightness observations of each pixel within the region of interest under different illumination directions and the corresponding known illumination directions as input, the surface normal is calculated pixel-by-pixel to obtain the surface normal field covering the sealed area. For example... Figure 3 As shown, this embodiment preferably employs a photometric stereo approach to solve for the surface normal pixel by pixel. For any pixel within the region of interest, its brightness observation under the k-th illumination direction is considered a function of the unit illumination vector in that direction multiplied by the pixel's surface normal and albedo. Under the Lambertian diffuse reflection approximation, pixel brightness is proportional to the dot product of albedo, illumination direction, and unit normal. By arranging the unit vectors of each illumination direction in rows to form an illumination direction matrix, and arranging the brightness observations in each direction into column vectors, a system of linear equations can be established with the product of the pixel's albedo and normal as unknowns. When there are at least three illumination directions that are not coplanar, the system of equations is overdetermined or exactly determined. The product vector of albedo and normal can be obtained by solving using the least squares method, and the albedo can be obtained by taking its modulus, and the unit normal can be obtained by normalization. Performing the above solution pixel by pixel within the region of interest yields the surface normal field covering the sealed area.

[0036] Considering that the surface of flexible packaging films often contains specular and specular reflection components, and is not ideal Lambertian diffuse reflection, step S3 further adopts a solution method robust to non-Lambertian reflection. One approach is to introduce robust estimation in the least squares solution: treating brightness observations under each illumination direction as samples, identifying specular observations that deviate from the dominant diffuse reflection model as outliers and reducing their weights, for example, using iterative reweighted least squares, successively adjusting the weights of each observation based on the residuals, thereby suppressing the contamination of normal estimation by specular reflections in individual directions. Another approach is to use a neural network to directly estimate the surface normal from the brightness observations of each pixel within the region of interest under different illumination directions, i.e., training a mapping network with multi-directional brightness observation vectors as input and unit normal as output, so that it can still provide stable normal estimations on real film surfaces containing specular and specular reflections. These two approaches can be chosen individually or in combination to improve the accuracy of normal reconstruction under specular and specular reflection conditions.

[0037] The surface normal field is further used to derive features reflecting geometric undulations, providing a basis for the subsequent separation of geometric and material origins. These features include the spatial gradient of the surface normal, local curvature, and the relative height distribution obtained by integrating the surface normal. Specifically, the spatial gradient of the surface normal is given by the rate of change of the direction of the normals of adjacent pixels, characterizing the speed of the normal's transition with position; local curvature is estimated by the second-order change of the normal field in the local neighborhood, characterizing the degree of surface curvature; and the relative height distribution is obtained by integrating the normal field within the region of interest, reconstructing the undulation height map of the sealing area relative to the reference plane. These features are significantly enhanced in wrinkled regions due to the obvious geometric undulations, and tend to be flatter in dummy sealing regions because the macroscopic geometry of the surface is not significantly different from the surrounding sealing areas. Therefore, geometric undulation features alone can initially highlight wrinkles and suppress dummy sealing, forming geometric clues for subsequent discrimination.

[0038] Step S4: Extraction of Reflection Anisotropy Features. The brightness changes explainable by the surface normal field are subtracted from the multi-directional brightness observations direction by direction. The remaining reflection changes that cannot be explained by the surface normal field are used as the reflection anisotropy features characterizing the differences in the fusion state of the material. Specifically, using the brightness observations of each pixel within the region of interest under different illumination directions as samples, the normal and albedo of the pixel reconstructed in step S3 are combined with the known illumination directions to predict the brightness that the pixel should exhibit under each illumination direction according to the Lambert model, i.e., the brightness changes explainable by the geometric normal. Then, this predicted brightness is subtracted from the measured brightness in the corresponding direction direction direction by direction to obtain the residuals in each direction. These residuals are the reflection changes that cannot be explained by the geometric normal. For wrinkled regions, the strong variation in brightness with illumination direction is mainly caused by geometric undulations, with the majority of the variation explained by the normal. After subtraction in each direction, the residual is small, and the anisotropy of reflection exhibits high directional selectivity dominated by geometry. For unsealed regions, the surface normal is similar to the surrounding sealed areas, and the geometrically explainable portion is insufficient to explain the brightness distribution. After subtraction, residuals remain due to changes in the microstructure and reflective properties of the material surface. These residuals are relatively uniformly distributed across illumination directions, exhibiting low directional selectivity and tending towards isotropy. Thus, at the characteristic level, the geometric and material origins are separated.

[0039] Step S4 further involves normalizing the brightness of each pixel within the region of interest under various illumination directions and then fitting the brightness variation with the illumination direction. The fitted direction dependence intensity is used as a measure of the directional selectivity of the pixel's reflectivity variation with the illumination direction, and this directional selectivity measure is incorporated into the reflectivity anisotropy feature. Specifically, for each pixel, its brightness under various illumination directions is first normalized by dividing it by the mean or maximum brightness of that pixel in each direction to eliminate the interference of overall albedo differences among pixels on the directional selectivity judgment. Then, a curve of brightness variation with the illumination direction is fitted with the illumination azimuth angle as the independent variable and the normalized brightness as the dependent variable. For example, it is fitted as a cosine curve containing a first harmonic term, and the modulation amplitude, i.e., the ratio of the peak-to-valley difference to the mean, is taken as the directional dependence intensity. In wrinkled regions, this curve exhibits strong sinusoidal fluctuations with the illumination direction, indicating a large directional dependence intensity; in partially enclosed regions, the curve tends to be flat, indicating a small directional dependence intensity. The orientation selectivity measure, together with the aforementioned directional residuals, is organized into a reflection anisotropy feature map. Its value in the virtual sealed region is significantly different from that in the wrinkled region, thereby further enhancing the separability of the two types of phenomena in the feature space. To enhance robustness to noise, the orientation selectivity measure can be moderately smoothed within the pixel neighborhood, or combined with the directional distribution statistics of the residuals (such as the concentration of residual energy in each direction) to jointly construct a multi-channel reflection anisotropy feature.

[0040] Step S5, Neural Network Fusion and Discrimination. The surface normal field, the reflection anisotropy features, and the multi-directional brightness observations are input into the neural network as multiple channels. After fusion, the neural network outputs the discrimination results for each location within the sealing area, indicating whether it is a benign fold, a harmful false seal, or a normal seal. The following describes the inference process of the trained neural network in the detection phase. In the inference phase, for each sealing area to be inspected, the surface normal field obtained in step S3 and its derived geometric undulation features (normal three-component map, spatial gradient map, local curvature map, relative height map) are stacked into a geometric feature channel. The reflection anisotropy features obtained in step S4 (directional residual map, direction selectivity metric map) are stacked into a reflection feature channel. Together with the original multi-directional brightness observation channel of the sealing area obtained in step S2, these are input into the neural network as a multi-channel tensor. The extraction links of the above geometric feature channels and reflection feature channels are... Figure 3 The branches are denoted as geometric branches and reflection branches, respectively.

[0041] The neural network in this embodiment is preferably a convolutional neural network with multi-branch inputs. Its first branch receives the surface normal field and the features reflecting geometric undulations, while the second branch receives the anisotropic reflection features. Each branch is composed of several convolutional layers and downsampling layers, extracting geometric and reflection features respectively. The features extracted by the two branches are concatenated by channel in an intermediate layer and then fused. After fusion, the features are restored to the region of interest resolution through several convolutional layers and upsampling layers. Finally, the output layer provides the probability that each pixel belongs to one of three categories—benign wrinkles, harmful false seals, or normal seals—either through pixel-by-pixel segmentation or through region classification. By having the first branch focus on geometric cues and the second branch focus on reflection cues, the independent expression of the two types of physical causes in the network's front end is maintained, while the fusion layer achieves joint discrimination of geometric and material information. The original multi-directional brightness observation channels can be incorporated into the second branch or set up as a separate auxiliary branch to provide the network with the original appearance without physical decomposition as a reference. The network learned that appearances that change strongly with the direction of illumination and can be explained by the normal direction are classified as wrinkles, while appearances that change weakly with the direction of illumination and are isotropic are classified as virtual seals. Thus, when the two types of appearances are similar, they can still be distinguished based on their differences in response to the direction of illumination.

[0042] While outputting the discrimination results, the neural network also outputs the confidence level for each category, and performs release, rejection, or re-inspection on the sealed area based on the confidence level. Specifically, normal seals with a confidence level higher than the release threshold are released, areas with a confidence level of harmful false seals higher than the rejection threshold are rejected, and areas with a confidence level between the two thresholds are transferred to re-inspection, thereby ensuring the detection of false seals while suppressing the false rejection of benign wrinkles. As a further optimization, before outputting the discrimination results in step S5, the consistency between the geometric undulations obtained from the surface normal field and the material fusion state obtained from the reflection anisotropy features is verified. The reflection anisotropy features include the reflection residual energy obtained from the reflection changes remaining after subtraction and the reflection direction selectivity measure: when the geometric undulations of a certain area are greater than the corresponding threshold and the reflection residual energy is lower than the corresponding threshold, it is judged as a benign wrinkle; when the geometric undulations of a certain area are less than the corresponding threshold, the reflection residual energy is higher than the corresponding threshold, and the reflection direction selectivity measure is lower than the corresponding threshold, it is judged as a suspected false seal and its re-inspection weight is increased. This physical prior-based consistency verification is independent of the neural network and can correct and weight the network's judgment results when wrinkles and false seals are adjacent or superimposed in local space. Furthermore, multiple regions of interest (ROIs) are arranged along the sealing strip in the same heat-sealing area, and the judgment results of each ROI are summarized. The existence of continuous false seal segments on the sealing strip is used as the basis for whether to reject the entire bag. This uses the continuity of false seal segments, rather than the judgment of individual isolated pixels, as the rejection criterion, avoiding false rejections caused by fluctuations in the judgment of individual pixels. This makes the decision to release or reject the entire bag more in line with the actual requirements of sealing performance.

[0043] The following describes the training phase of the neural network in step S5, i.e., how to obtain the network used for inference from the samples. The neural network is trained using sealed samples labeled with wrinkled and false-sealed areas as supervision. The collection and preparation of training data are as follows: On a multi-directional illumination acquisition device consistent with actual detection, a large number of multi-directional image sequences covering normal seals, seals with benign wrinkles, seals with harmful false seals, and seals with both wrinkles and false seals are collected. The samples should cover different film materials, different sealing temperatures and pressures, different wrinkle directions, and different causes of false seals (insufficient temperature, powder or oil contamination, air bubbles, etc.) to ensure diversity. For each sample, the labeler refers to the actual sealing state confirmed by offline verification methods such as peel tests and dye penetration, and labels its category pixel by pixel on the region of interest, i.e., one of three categories: benign wrinkles, harmful false seals, or normal seals, forming a pixel-by-pixel category label map as supervision label.

[0044] The data preprocessing before training is consistent with the aforementioned inference stage. Specifically, for each training sample, steps S2 (registration and region of interest extraction), S3 (normal reconstruction and geometric feature extraction), and S4 (reflection anisotropy feature extraction) are performed, thus converting each sample into a multi-channel input tensor with the same structure as in the inference stage. Each channel is standardized with zero mean and unit variance to make geometric and reflection features comparable in magnitude. To improve generalization ability and alleviate class imbalance caused by the relative scarcity of dummy samples, data augmentation is employed: this includes random translation and cropping along the sealing band direction, random perturbation of brightness and contrast, and consistent circular permutation of the illumination direction label and corresponding channel to simulate the overall rotation of the light source orientation. Simultaneously, minority class samples such as dummy samples are oversampled, or a higher weight is assigned to the minority class in the loss function.

[0045] The loss function used during training employs a pixel-wise classification loss, preferably a weighted cross-entropy loss that is robust to class imbalance, and is superimposed with a region overlap loss (such as Dice loss) to suppress boundary fragmentation. The two are weighted and summed to form the total loss, with the preferred weight ratio being approximately 1:0.6 between the cross-entropy and Dice terms. The optimizer preferably uses an adaptive moment estimation optimizer with weight decay (AdamW), with the weight decay coefficient set to... The initial learning rate is set to... It employs a cosine annealing decay strategy to smoothly reduce the learning rate to approximately [value missing] during the later stages of training. The first few rounds of training employ linear warm-up to stabilize initial optimization. A batch size of 24 is preferred, but can be reduced to 12 if memory is limited, and gradient accumulation can be used to maintain an equivalent batch size. The optimal number of training rounds is approximately 120, with convergence criteria based on whether the mean intersection-union ratio (IU) and recall of false seals on the validation set no longer improve for several consecutive rounds. Early stopping is employed to avoid overfitting. During training, evaluation metrics are monitored on an independent validation set. These metrics include precision, recall, F1 score, and IU for each category, with particular attention paid to the recall of harmful false seals (to control missed detections) and the false detection rate of benign wrinkles misclassified as false seals (to control excessive rejections). After training, the model weights that achieve the optimal trade-off between false seal recall and wrinkle false detection rate on the validation set are fixed and used in the aforementioned inference phase.

[0046] Through steps S1 to S5, this embodiment acquires multi-directional image sequences of the same sealing area under multi-directional visible light illumination, reconstructs the surface normal field, extracts reflectance anisotropy features, and then uses a neural network with multi-branch inputs to fuse geometric and reflectance cues and output the discrimination result. This achieves the decoupling and discrimination of benign wrinkles and harmful false seals within the same sealing area using only visible light. By subtracting the brightness changes that can be explained by the normal direction in each direction and using the residual to characterize the differences in the material fusion state, the geometric cause and the material cause are separated at the feature level. This overcomes the difficulty of distinguishing between the two in a single fixed-light two-dimensional image due to their similar appearance. Under low-cost, non-contact, and online conditions, the misjudgment rate of benign wrinkles and harmful false seals is significantly reduced.

[0047] Example 2 In a preferred embodiment of the present invention, the extraction of anisotropic reflection features in step S4 is further refined to explicitly and analytically remove the geometric cause from multi-directional brightness observations, retaining only the direction-dependent reflection residual unique to the fusion state of the material and unexplainable by the geometric normal. This residual is then fed into the neural network in step S5 as an independent channel in tensor form. The technical idea behind this embodiment is that the brightness of the wrinkled region changing with the direction of illumination can almost entirely be predicted by the reconstructed normal according to the reflection law, and the residual after subtraction tends to zero; the surface normal of the virtual sealed region is similar to that of the surrounding normal sealed region, and geometric prediction is insufficient to explain its measured brightness, and residuals caused by changes in the microstructure and reflection characteristics of the material surface are still retained after subtraction. Therefore, the residual after removing the interpretable normal component is precisely the discriminant that carries the information of the fusion state of the material and is independent of the geometric cause of the wrinkles.

[0048] Specifically, the reflection residual modeling in this embodiment is performed pixel by pixel according to the following algorithm steps.

[0049] The first step is to construct a pixel-level observation model. For any pixel within the region of interest, denote its position at the [i]th [i]th [i]. The measured brightness under known illumination directions is: The corresponding unit illumination direction vector is The sequence number of the illumination direction Take 1 to 1 in sequence , The number of illumination directions is preferably selected. The values ​​are four to eight. The unit surface normal of the pixel has been reconstructed from step S3. With albedo Under the Lambert or near-Lambert assumptions, the pixel in the th... The theoretical luminance that can be explained by the geometric normal under each illumination direction is: It is the product of albedo and the dot product of the surface normal and the unit vector of illumination in that direction (negative values ​​are truncated to zero to eliminate non-physical values ​​when the normal is backlit).

[0050] The second step is to subtract and normalize in each direction. The theoretical brightness is subtracted from the measured brightness in each direction to obtain the reflection residual of the pixel in each illumination direction, i.e., the difference between the measured brightness and the theoretical brightness in that direction. To eliminate the interference of the overall albedo difference of each pixel on the residual amplitude, the reflection residual of the pixel in each direction is further normalized. Arithmetic mean of brightness observations under each illumination direction Normalize the residuals to obtain normalized residuals. ,in To prevent small positive numbers with a denominator of zero, it is preferable to take... 1% of the typical order of magnitude. This yields a set of normalized residuals arranged according to the direction of illumination. ( Take 1 to 1 in sequence This refers to the direction-dependent reflection response, which, after stripping away the geometric origin, is dominated solely by the material's fusion state and surface microstructure.

[0051] The third step involves constructing multiple statistics from the residual sequence to characterize its directional distribution. One of these is the residual energy (denoted as...). Take the normalized squared residual values ​​in each direction. The mean value in each direction represents the overall intensity of geometrically inexplicable components; the virtual sealed region is affected by material reflection anomalies. The normal sealing area, which is larger than expected and fully fused, matches the measured brightness with the geometric prediction. Approaching zero. The second is the measure of the direction selectivity of the residuals (denoted as...). First, the normalized residuals are fitted with the first harmonic (cosine type) according to the azimuth angle of each light source. The DC component and the amplitude of the first harmonic of the fitted curve are obtained. Then, the ratio of the amplitude of the first harmonic to the amplitude of the DC component is taken as the first harmonic. If a small amount of residual remains in the wrinkled area due to normal reconstruction error, this residual is still strongly correlated with the direction of illumination. The values ​​are relatively large; the residuals in the virtual sealed region are relatively evenly distributed in all directions. The third is the isotropic index of the residuals (denoted as ). The concentration of residual energy in each illumination direction is measured by: first, normalizing the squared value of the normalized residual in each direction to its proportion within the pixel; then, summing the proportions in each direction according to the usual definition of information entropy to obtain the result. A higher entropy value indicates that the residuals are more uniformly distributed in all directions, tending towards isotropy, and the virtual sealed region is more likely to be affected. Too high.

[0052] The fourth step involves organizing the pixel-by-pixel normalized residual sequence, residual energy, orientation selectivity metric, and isotropic index into a multi-channel reflection residual tensor at pixel positions within the region of interest. The normalized residual sequence itself constitutes... Each channel preserves the complete directional distribution of the residuals along the illumination direction, rather than just their scalar statistics, enabling the subsequent neural network to adaptively learn discrimination cues from the directional structure of the residuals. The residual energy, directional selectivity metric, and isotropic index each constitute a channel, providing the network with explicit physical quantities as prior guidance. This reflection residual tensor, along with the surface normal field and geometric fluctuation features from step S3, and the original multi-directional brightness observations from step S2, are fed into the neural network in step S5.

[0053] Preferably, to avoid contaminating residual statistics with specular observations from individual directions when specular and specular reflections exist on the thin film surface, robust preprocessing is performed on the measured brightness sequence before calculating the residuals in the second step: observations that significantly deviate from the median brightness of the pixel in multiple directions are identified as specular outliers and weighted less, or a specular reflection term is introduced into the theoretical brightness model in the first step, so that the geometrically interpretable part includes not only diffuse reflection components but also specular specular components determined by the normal and illumination directions, thereby making the residuals after subtraction more purely reflect the material origin. Furthermore, considering that the photometric stereo normal reconstruction may have biases when the number of illumination directions is small, the residual tensor can be appropriately spatially smoothed along the pixel neighborhood, or the median of the residual statistics in the neighborhood can be used to replace the single pixel value to suppress the propagation of normal reconstruction noise in the residuals after subtraction.

[0054] In step S5, the second branch receiving the aforementioned reflection residual tensor preferably employs the following network configuration: its number of input channels is... ,Right now This branch consists of three statistical channels: a normalized residual channel and three statistical channels: residual energy, direction selectivity measure, and isotropic index. The branch is composed of three to four convolutional cascades, with the kernel size preferably selected from the specified values. The number of channels in the feature maps at each level increases sequentially from shallow to deep, at an order of magnitude of 32, 64, 128, and 128. Each convolutional level is followed by batch normalization and nonlinear activation, and the spatial scale is gradually reduced between levels by downsampling or pooling with a stride of 2 to expand the receptive field. To make the network sensitive to the directional structure of the residuals, attention along the channel dimension (i.e., the illumination direction dimension) is preferably introduced in the shallow layer of the second branch. The channel attention module adaptively assigns weights to the residual channels in each direction, and the number of attention heads is preferably 2 to 4. In this way, the network can enhance the response to isotropic residual patterns and suppress residuals that still have directional selectivity, which is consistent with the physical characteristics of virtual seals. The first branch that receives the surface normal field and geometric undulation features adopts a convolutional cascade of similar depth to the second branch. The features extracted by the two branches are concatenated by channel in the intermediate layer and then jointly modeled by fusion convolution. After upsampling, they are restored to the resolution of the region of interest. The output layer provides the probability of three categories: benign wrinkles, harmful virtual seals, and normal seals on a pixel-by-pixel basis.

[0055] Preferably, to enable the network to explicitly utilize the prior knowledge that geometric factors have been stripped during training, a consistency constraint loss is added to the training loss in step S5 in addition to the pixel-by-pixel classification loss. Let the classification loss be the sum of the weighted cross-entropy loss (robust to class imbalance) and the region overlap loss, denoted as... Consistency constraint loss The constraint is used to ensure that the network's classification of false seals aligns with the high residual energy and low directional selectivity indicated by the reflection residual tensor. Specifically, the deviation between the network's output false seal probability and the physical indicator constructed from the residual energy and isotropic index is used as a penalty, ensuring that the network's classification is consistent with the physical prior and does not overly rely on accidental correlations in the data. The total loss is the classification loss. With consistency constraint loss The weighted sum of the classification loss and the consistency constraint loss are preferably set to 1, and the weight of the consistency constraint loss is preferably set to between 0.2 and 0.5, so that the consistency constraint can guide the judgment direction without overshadowing the classification loss.

[0056] The beneficial effects of this implementation are as follows: by subtracting and normalizing the reconstructed brightness changes in each direction, the geometric causes that strongly vary with the direction of illumination are explicitly and analytically separated from multi-directional brightness observations. This allows the input left to the discrimination network to be the direction-dependent reflection residual unique to the fusion state of the material. Compared to directly using the original multi-directional brightness or only using scalar direction selectivity as the reflection feature, using the complete residual sequence along with the multi-channel residual tensor composed of residual energy, direction selectivity measure, and isotropic index as an independent input channel, on the one hand, it more thoroughly isolates the interference of wrinkle geometry on false seal discrimination at the feature level, reducing the possibility of residual brightness and darkness in wrinkle areas being mistaken for material anomalies, thereby suppressing excessive rejection; on the other hand, by directly characterizing the intensity of geometrically unexplainable components with residual energy, it improves the sensitivity to weak false seals such as incomplete fusion, which helps to reduce missed detections. By feeding the residuals into the network as tensors rather than single scalars, the complete distribution of residuals along the illumination direction is preserved. This allows the network to learn more detailed discrimination boundaries from the directional structure, demonstrating better robustness in sealing areas with uneven film reflectivity and diverse wrinkle orientations. After adding a consistency constraint loss, the network's discrimination and physical priors corroborate each other, achieving relatively stable discrimination performance even when the proportion of false seals in the training samples is low. It should be noted that when the surface specular highlights of the sealing area are extremely strong and spread in all directions, causing the residuals to be dominated by specular reflection, the ability of the above residual statistics to characterize the material origin may be affected. In this case, it is advisable to combine it with the aforementioned specular term modeling or specular highlight weighting preprocessing, or appropriately increase the number of illumination directions to improve the reliability of normal reconstruction and residual estimation.

[0057] The aforementioned beneficial effects stem from the fact that the reflection behavior of wrinkles and false seals under multi-directional illumination follows different physical mechanisms, and the difference in these mechanisms can be amplified in the residual space by stripping away the interpretable components of the normal. Wrinkles are geometric undulations on the surface of a thin film, and their brightness varies with the direction of illumination, determined by the geometric relationship between the incident light direction and the surface normal, following the cosine law of reflection. Therefore, this variation can be accurately predicted by the normal reconstructed from the brightness of multiple directions according to the theoretical brightness model, and the residual tends to zero after subtraction. Even if there are errors in the normal reconstruction and residuals remain, these residuals are still strongly correlated with the direction of illumination, exhibiting high values ​​in the directional selectivity measure and low values ​​in the isotropic index, thus still distinguishing them from false seals. A false seal arises from the difference in the fusion state of the sealing layer material. Its surface, macroscopically, shows no significant normal difference from the surrounding sealing area. Therefore, there is a systematic deviation between the theoretical brightness predicted by the geometric normal and the measured brightness. This deviation originates from changes in the surface microstructure and reflective properties of the unfused or insufficiently fused areas. Their reflective behavior changes only slightly with the direction of illumination and tends to be isotropic. Consequently, the residuals are uniformly distributed in all directions, with higher energy and lower directional selectivity. Thus, the residuals after stripping away the interpretable components of the normal precisely compress the geometric cause to near zero while retaining and highlighting the material cause, allowing the two types of physical causes to separate along different dimensions in the residual characteristic space. The neural network makes discrimination based on the separated features, without having to painstakingly decouple geometry and materials in the original appearance, thus making it easier to learn stable discrimination boundaries. The reinforcement of isotropic residual patterns by channel attention and the guidance of physical priors by consistency constraint loss further ensure that the discrimination direction is consistent with the real physical mechanism. This is the principle behind the implementation of this method that can accurately decouple benign wrinkles and harmful false seals with similar appearances within the same sealing area.

[0058] Example 3 In another embodiment of the present invention, an alternative solution is provided that does not rely on explicit pixel-by-pixel normal reconstruction and residual subtraction. Directional response modeling is performed on the brightness sequence of each pixel under multiple illumination directions, and the sequence model determines whether the pixel belongs to a benign wrinkle, a harmful false seal, or a normal seal. This embodiment solves the same technical problem as the aforementioned embodiments, namely, decoupling and distinguishing wrinkles and false seals with similar appearances but different causes within the same sealing area. However, the core technical path used is different: it does not solve the surface normal through photometric stereo, nor does it perform directional subtraction of the Lambert theory brightness. Instead, it transforms the physical difference between the strong directional selectivity of wrinkles and the weak directional selectivity of false seals into a morphological discrimination of the brightness-illumination direction curve, which is directly learned by a data-driven sequence model.

[0059] As an alternative, the processing flow of this embodiment is as follows. Steps S1 and S2, involving multi-directional illumination acquisition, registration, and region of interest extraction, are consistent with the aforementioned embodiment, obtaining the region of interest for each pixel within the region of interest. Multi-directional brightness observations under known illumination directions. The difference lies in the subsequent processing: for each pixel, its multi-directional brightness is arranged in order of the azimuth angle of the corresponding light source to form a brightness sequence with the illumination azimuth angle as the independent variable, and then normalized by the mean of the multi-directional brightness of that pixel to obtain a normalized brightness sequence, thus eliminating albedo differences. Since the azimuth angles of each light source are uniformly distributed in the circumferential direction, this sequence can be regarded as periodic sampling of brightness variation with azimuth angle.

[0060] For the normalized brightness sequence, this implementation method extracts its directional response features using frequency domain decomposition. The sequence is subjected to a Discrete Fourier Transform along the azimuth angle, and the amplitudes and phases of its DC component, first harmonic, and second harmonic are obtained. In the folded region, due to the existence of clearly defined upslopes and downslopes, the brightness exhibits strong single-peak or double-peak fluctuations with the azimuth angle, and the ratio of the first or second harmonic amplitude to the DC component is relatively large, indicating deep directional modulation. In the vacuous region, the brightness changes weakly with the azimuth angle, and the ratio of each harmonic amplitude to the DC component is relatively small, making the sequence tend to be flat. Therefore, the ratio of harmonic amplitude to the DC component, and the brightness reversal azimuth indicated by each harmonic phase, together constitute the frequency domain features characterizing the directional response pattern. To enhance robustness, time-domain statistics, such as the peak-to-valley difference, variance, and extreme values ​​of the brightness change rate between adjacent azimuths, can be supplemented and organized together with the frequency domain features to form the directional response feature vector of that pixel.

[0061] In the discrimination stage, this implementation does not employ a dual-branch fusion convolutional network, but instead uses a network that models the sequence to classify the directional responses. A preferred approach is to use a one-dimensional convolutional network to convolve the normalized brightness sequence along the illumination direction dimension, extracting local directional response patterns before connecting to a fully connected layer to output three types of probabilities. Since the illumination directions are contiguous on a circle, the one-dimensional convolution preferably uses circular padding to maintain the periodicity of the azimuth angle. Another preferred approach is to model the brightness sequence using a sequence encoder with self-attention: the brightness in each direction of the sequence, along with its azimuth position encoding, is input as a marker to the encoder. Self-attention establishes associations between directions, and the sequence representation output by the encoder is aggregated and fed into the classification head. The self-attention mechanism enables the network to adaptively focus on directions where brightness flips or jumps, exhibiting strong selectivity for the directions of folds, while outputting isotropic representations for virtual sealed sequences with nearly constant directions. After the sequence model independently distinguishes each pixel, it organizes the categories of each pixel into a discrimination map on the region of interest. In order to utilize the spatial context and suppress the discrimination fluctuations of isolated pixels, a lightweight spatial smoothing network or conditional random field post-processing can be added on top of the pixel-by-pixel category probability map output by the sequence model to make the discrimination of adjacent pixels tend to be consistent.

[0062] The neural network in this embodiment is also trained under supervision using sealed samples labeled with wrinkled and false-sealed regions. The acquisition, labeling, and data augmentation of training samples are similar to those in the previous embodiments. The difference lies in that its input is a pixel-by-pixel normalized brightness sequence and its frequency and temporal directional response features, instead of the non-directional field and reflection residual tensor. The training loss uses a weighted cross-entropy that is robust to class imbalance, and can be superimposed with constraints to encourage the network to classify sequences with deep directional modulation as wrinkles and sequences with nearly flat directions but abnormal overall reflection as false seals. Since this embodiment does not perform normal reconstruction, its sensitivity to surface highlights and specular reflections on the thin film differs from that in the previous embodiments: specular highlights can form spikes in individual directions in the brightness sequence, which may be mistakenly identified as wrinkles if not processed. Therefore, it is preferable to perform robust filtering on the sequence before frequency domain decomposition to identify spikes that significantly deviate from the median of the sequence as highlights and suppress or interpolate them. When the direction of the folds in the sealing area is uniform, causing the directional modulation of the brightness sequence to be concentrated in a few directions, or when the number of illumination directions is too small, resulting in sparse directional sampling, the resolution of the frequency domain decomposition will decrease. This can be improved by increasing the number of light sources and densifying the directional sampling.

[0063] As a further supplement to this embodiment, to balance pixel-level directional response discrimination and region-level spatial coherence, the aforementioned pixel-level sequence discrimination can be combined with region-level overall decision. Specifically, after obtaining the pixel-by-pixel category probability map, the region of interest is divided into several continuous sub-segments along the sealing strip direction. For each sub-segment, the proportion of false-sealed pixels and their spatial connectivity are statistically analyzed. Only when the false-sealed pixels in a sub-segment form a continuous, clustered distribution rather than a scattered distribution are the sub-segments classified as false-sealed segments. The presence or absence of continuous false-sealed segments on the sealing strip is then used as the basis for whether the entire bag is rejected. By using the directional response discrimination provided by the sequence model as the basis and the segment-level continuity decision as the merging method, the path simplicity advantage of this embodiment can be retained while avoiding the amplification of discrimination fluctuations caused by sequence noise in individual pixels into false rejections. Furthermore, the directional response feature vector of this embodiment can complement the reflection residual tensor of the aforementioned embodiment at the feature level: in cases where the robustness of the discrimination is required to be high, the features extracted by the two paths can be fed into a fusion discriminator in parallel, and the discrimination result can be given by combining the directional response morphology and the reflection residual distribution, thereby flexibly making trade-offs between computational overhead and discrimination reliability.

[0064] Compared to the aforementioned embodiments, this implementation replaces normal reconstruction and residual subtraction with the morphology discrimination of the brightness-light direction variation curve, and replaces the geometric-reflection dual-branch fusion convolutional network with a sequence modeling network. While both utilize the same physical priors, their implementation methods differ substantially. This alternative eliminates pixel-by-pixel normal calculation, resulting in a simpler computational process. It is suitable for applications where high accuracy in normal reconstruction is not required or where surface albedo is relatively uniform, such as soft packaging sealing inspection. It can serve as an independent and feasible implementation method outside of the aforementioned embodiments.

[0065] Example 4 This embodiment provides a system for detecting and distinguishing wrinkles and incomplete seals in the heat-sealing of flexible packaging, such as... Figure 4 As shown, this system corresponds one-to-one with the method described in Embodiment 1, including an image acquisition unit, a preprocessing unit, a normal reconstruction unit, an anisotropy extraction unit, and a discrimination unit. Each unit can be deployed on the same computing device, or it can be placed separately on an edge acquisition device and a back-end computing server next to the production line to work collaboratively: the image acquisition unit, along with its light source and camera, is arranged at the production line inspection station; the preprocessing unit, normal reconstruction unit, anisotropy extraction unit, and discrimination unit are carried by computing devices with parallel computing capabilities. These computing devices can be edge computing devices equipped with graphics processors or back-end servers. Data is transmitted sequentially between the units via wired or wireless data links, forming a complete information flow from image acquisition to discrimination output. The following describes each unit in the order of the data flow.

[0066] An image acquisition unit is used to illuminate the same heat-sealed area with at least three switchable light sources located at different azimuth angles and with different incident directions, and to acquire a sequence of images of the heat-sealed area with the same imaging angle but different illumination directions under at least three illumination directions. The unit includes a camera aligned with the same heat-sealed area and whose optical axis is approximately perpendicular to the plane of the sealing strip, and multiple independently illuminating visible light sources arranged around the sealing strip. Each light source has a known and different incident direction relative to the sealed area being inspected, with its azimuth angle evenly distributed in the circumferential direction and an incident zenith angle of moderate grazing. Each light source is preferably a visible light surface source or a line source and is arranged along the extension direction of the sealing strip, with the color temperature and spectrum of each light source being consistent. The image acquisition unit also includes a controller that controls the time-division lighting of each light source and synchronizes it with camera exposure. This controller controls the light sources to be lit synchronously or time-divisionally under at least three illumination directions, corresponding to the acquisition of image sequences of the same sealing area under different illumination directions. To adapt to moving production lines, the controller is configured to use a time-division acquisition method with stroboscopic lighting synchronized with camera exposure. As the inspected sealing area moves with the film, the light sources in each direction are lit sequentially and captured continuously, resulting in a multi-directional image sequence with overlapping positions. The image acquisition unit outputs the acquired image sequence to the preprocessing unit.

[0067] The preprocessing unit is used to register the image sequence and extract the region of interest (ROI) of the sealing area to obtain pixel-by-pixel multi-directional brightness observations. This unit is configured to register the image sequence, aligning images under different illumination directions at the pixel level; and then locate the sealing strip on the aligned image based on its position relative to the bag or its edge features, thereby defining the sealing strip and its adjacent area as the ROI. Subsequent processing is performed only on the sealing area and its neighborhood to obtain pixel-by-pixel multi-directional brightness observations, reducing computational load and suppressing interference from irrelevant backgrounds. The preprocessing unit simultaneously outputs the pixel-by-pixel multi-directional brightness observations to both the normal reconstruction unit and the anisotropy extraction unit.

[0068] The normal reconstruction unit is used to solve for the surface normal pixel-by-pixel, taking the brightness observations of each pixel within the region of interest under different illumination directions and the corresponding known illumination directions as input, to obtain the surface normal field covering the sealed area. This unit is configured to solve for the surface normal pixel-by-pixel using a photometric stereo approach, or to estimate the surface normal from the brightness observations of each pixel within the region of interest under different illumination directions using another neural network, and to employ robust estimation for non-Lambertian reflections to improve the normal reconstruction accuracy under specular and specular reflection conditions. This unit is also configured to derive features reflecting geometric undulations from the surface normal field. These features include the spatial gradient of the surface normal, local curvature, and the relative height distribution obtained by integrating the surface normal. These features are significantly enhanced in wrinkled regions and tend to be flatter in the vacant sealed region. The normal reconstruction unit outputs the surface normal field and its derived geometric undulation features to the anisotropy extraction unit and the discrimination unit.

[0069] An anisotropy extraction unit is used to subtract the brightness changes explainable by the surface normal field from the multi-directional brightness observations one direction at a time. The remaining reflection changes that cannot be explained by the surface normal field are used as the reflection anisotropy features characterizing the differences in the fusion state of the material. This unit is configured to use the brightness observations of each pixel in the region of interest under different illumination directions as samples. The normal of the pixel reconstructed by the normal reconstruction unit is combined with the albedo of each known illumination direction to predict the brightness that the pixel should present under each illumination direction. Then, the predicted brightness is subtracted from the measured brightness in the corresponding direction one direction at a time to obtain the residual. The unit is also configured to normalize the brightness of each pixel under each illumination direction and fit the brightness change with the illumination direction. The fitted direction dependence intensity is used as the direction selectivity measure of the pixel's reflection behavior as a function of the illumination direction, and the direction selectivity measure is incorporated into the reflection anisotropy features. The residual in the wrinkled region is smaller and the direction dependence intensity is larger, while the residual in the vacant region is uniformly distributed in all directions and the direction dependence intensity is smaller, thereby separating the geometric origin from the material origin at the feature level. The anisotropy extraction unit outputs the reflection anisotropy features to the discrimination unit.

[0070] The discrimination unit is used to input the surface normal field, the anisotropic reflection features, and the multi-directional brightness observations as multiple channels into a neural network. The neural network then fuses these inputs and outputs a discrimination result indicating whether each location within the sealing area is a benign fold, a harmful false seal, or a normal seal. The neural network used in this unit is a convolutional neural network with multiple input branches. The first branch receives the surface normal field and the features reflecting geometric undulations, while the second branch receives the anisotropic reflection features. The features extracted by the two branches are fused in an intermediate layer, and the discrimination result is output using either pixel-by-pixel segmentation or region classification. The unit is also configured to output confidence scores for each category while outputting the discrimination result, and to handle the sealing area by releasing, rejecting, or re-inspecting based on the confidence scores; before outputting, it verifies the consistency between the geometric undulations obtained from the surface normal field and the material fusion state obtained from the reflection anisotropy features, arranges multiple regions of interest along the sealing strip in the same heat-sealed area, and summarizes the discrimination results of each region of interest, using the existence of continuous false-seal segments on the sealing strip as the basis for whether to reject the entire bag. The neural network is obtained through supervised pre-training using sealed samples labeled with wrinkled and false-seal areas.

[0071] The functions of each unit described above correspond one-to-one with the steps of the method described in Example 1: the image acquisition unit performs multi-directional illumination image acquisition in step S1; the preprocessing unit performs registration and region of interest extraction in step S2; the normal reconstruction unit performs surface normal field reconstruction in step S3; the anisotropy extraction unit performs reflection anisotropy feature extraction in step S4; and the discrimination unit performs neural network fusion and discrimination in step S5. The data stream starts from the multi-directional image sequence acquired by the image acquisition unit, is converted into pixel-by-pixel multi-directional brightness observation by the preprocessing unit, passes through the normal reconstruction unit to obtain the surface normal field and geometric undulation features, and passes through the anisotropy extraction unit to obtain the reflection anisotropy features. The two, together with the original multi-directional brightness observation, are fed into the discrimination unit to complete fusion and discrimination. Thus, the method described in Example 1 is carried out in hardware through the coordinated operation of switchable light sources, image acquisition devices, and computing processing devices.

[0072] Example 5 This embodiment uses an online detection application case of a flexible packaging bag filling and sealing production line to illustrate the implementation process and technical effect of the method described in Embodiment 1. The film packaged on this production line is a multi-layer composite film, with the sealing strip extending continuously along the production line direction. The production line speed is high, and two types of difficult-to-distinguish phenomena commonly coexist in the sealing area at the same workstation: one is benign wrinkles formed by uneven tension during heat sealing, which appear as alternating bright and dark stripes in a two-dimensional image under fixed illumination; the other is harmful false seals formed by insufficient sealing temperature in certain areas or the inclusion of trace amounts of powder or oil, which also appear as uneven brightness in the same two-dimensional image. Since the two types of phenomena appear highly similar under a single fixed illumination, and given the high production line speed, strict real-time requirements, and strong highlights on the surface of the composite film, conventional detection methods based on grayscale or texture thresholds of a single two-dimensional image are difficult to reliably separate the two in the same sealing area. It is often difficult to balance excessive rejection of benign wrinkles with missed detection of harmful false seals, so it is necessary to adopt the method of this invention.

[0073] The overall deployment of the testing station in this embodiment is as follows: Figure 6 As shown. In step S1, a camera with its optical axis perpendicular to the sealing strip is positioned above the inspection station. Four visible light sources are evenly arranged around the sealing strip at azimuth angles of 0°, 90°, 180°, and 270°, extending along the sealing strip's direction. The incident zenith angle is 42°, and all light sources have the same color temperature. A strobe controller drives the four directional light sources to sequentially strobe and illuminate within milliseconds, strictly synchronized with the camera exposure. The width of a single pulse is approximately 120 microseconds, thus capturing four multi-directional images with essentially overlapping positions as the sealing area moves with the film, forming an image sequence. In step S2, using the 0° direction image as the reference frame, affine registration is performed on the remaining frames based on the sealing strip edge line and the printed markings on the bag. The registration accuracy is controlled within half a pixel. Then, the sealing strip and its neighboring areas are defined as regions of interest based on the sealing strip edge features, obtaining the multi-directional brightness observation vectors of each pixel within the region of interest under four known illumination directions. In step S3, the specular highlights on the composite film surface are solved pixel-by-pixel using iterative reweighted least squares photometric stereochemical methods to obtain the surface normal field covering the sealing area, and geometric undulation features such as spatial gradient, local curvature, and relative height distribution are derived. In step S4, the brightness that should be presented in each direction is predicted from the reconstructed normal and albedo, and residuals are obtained by subtracting them in each direction. Then, the direction-dependent intensity is fitted by the normalized brightness to form a reflection anisotropy feature map. In step S5, the geometric and reflection channels, along with the original multi-directional brightness observations, are input into a convolutional neural network with multi-branch inputs. The probability of three types of sealing is output pixel-by-pixel: benign wrinkles, harmful false seals, and normal seals. The probability is then summarized by multiple regions of interest along the sealing strip to give the bag release, rejection, or re-inspection. Bags judged to be rejected are blown off the conveyor belt by an air nozzle at the rejection station downstream of the conveyor belt and fall into the collection hopper.

[0074] To evaluate the effectiveness, a number of sealing samples were collected, including normal seals, seals containing benign folds, seals containing hazardous malformations, and seals containing both folds and malformations. These samples covered different sealing temperatures and pressures, different fold orientations, and different causes of malformations. The true sealing state was confirmed using offline methods such as peel tests and dye penetration tests, and each sample was labeled pixel-by-pixel. The samples were divided into a training set and independent test sets. On the test set, the recall, precision, and F1 score for hazardous malformations, the false detection rate of benign folds being misclassified as malformations, and the average crossover ratio (CLORD) of the three classes were used as evaluation metrics.

[0075] When using the complete method of this invention, the recall rate for harmful false seals is approximately 96.8%, the precision is approximately 93.5%, the F1 score is approximately 0.951, the false detection rate of benign wrinkles as false seals is approximately 3.2%, and the average intersection-over-union ratio (IoU) for the three classes is approximately 0.882. In contrast, when using conventional methods based solely on the grayscale and texture features of a single fixed-light 2D image, due to the similar appearance of the two types of phenomena, the recall rate for false seals is approximately 82.4%, the false detection rate for wrinkles is as high as 21.6%, and the average IoU is approximately 0.706, showing a significant imbalance between excessive rejection and missed detection. To further examine the contributions of each innovative step, an ablation comparison was conducted: When removing the reflection anisotropy features from step S4 and inputting only the surface normal field and geometric undulation features into the network, the false positive recall rate dropped to approximately 88.1%, the false positive rate for wrinkles increased to approximately 9.7%, and the mean cross-union ratio (CUNR) dropped to approximately 0.803 due to the lack of key clues characterizing the differences in the material's fusion state. When removing the surface normal reconstruction from step S3 and inputting only the original multi-directional brightness observations into the network, the false positive recall rate was approximately 90.3%, the false positive rate for wrinkles was approximately 8.4%, and the mean CUNR was approximately 0.822 because the geometric causes were not explicitly separated. Further removing the direction selectivity measure from step S4 and retaining only the per-directional residuals resulted in a false positive recall rate of approximately 94.6% and a false positive rate for wrinkles of approximately 5.1%, slightly lower than the complete method. These data indicate that both surface normal reconstruction and reflection anisotropy feature extraction steps substantially contribute to the discrimination performance, and the combination of the two yields the best performance.

[0076] The above tests were repeated under different batches of films and different production line speeds, and the various indicators showed some fluctuations, such as... Figure 8 As shown: the false positive recall rate varied between approximately 95.4% and 97.3%, the false positive rate varied between approximately 2.8% and 4.6%, and the average crossover ratio varied between approximately 0.861 and 0.894. Figure 8The horizontal axis, from batch 1 to batch 6, corresponds to a combination of a film batch and a production line speed from low to high. As the production line speed increases, the false seal recall rate and average cross-validation ratio (CVR) slightly decrease, while the false detection rate of wrinkles slightly increases, with all indicators remaining within the aforementioned range. The vertical axis represents the indicator values, where the false seal recall rate and false detection rate of wrinkles are expressed as percentages, and the average CVR is multiplied by 100 and shown coaxially with the former two. The point values ​​for each batch are the average of multiple repeated measurements, and error bars indicate their dispersion range. The fluctuation range of the false seal recall rate is shown by a shaded band. When the film surface has strong highlights or the wrinkle direction is uniform, the indicators slightly decrease, and increase accordingly after increasing the number of light sources to six. Overall, this embodiment, under low-cost, non-contact, and online conditions, decouples the discrimination of benign wrinkles and hazardous false seals within the same sealing area, significantly improving the detection of hazardous false seals while effectively suppressing the false rejection of benign wrinkles, verifying the feasibility and technical effectiveness of the method described in Example 1.

[0077] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, 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 detecting and distinguishing wrinkles and false seals in heat-sealing flexible packaging, characterized in that, include: Step S1: Illuminate the same heat-sealing area with no less than three switchable light sources located at different azimuth angles and with different incident directions, and acquire an image sequence of the heat-sealing area with the same imaging angle but different illumination directions under no less than three illumination directions. Step S2: Register the image sequence and extract the region of interest of the sealing area to obtain multi-directional brightness observations corresponding to each pixel; Step S3: Using the brightness observation of each pixel in the region of interest under different lighting directions and the corresponding known lighting directions as input, solve the surface normal pixel by pixel to obtain the surface normal field covering the sealing area. Step S4: The brightness changes that can be explained by the surface normal field are subtracted from the multi-directional brightness observations one direction at a time, and the remaining reflection changes that cannot be explained by the surface normal field are used as the reflection anisotropy characteristics characterizing the differences in the fusion state of the material. Step S5: The surface normal field, the anisotropic reflection characteristics, and the multi-directional brightness observation are input into the neural network as multiple channels. After being fused by the neural network, the results are output to determine whether each position in the sealing area is a benign wrinkle, a harmful false seal, or a normal seal.

2. The method according to claim 1, characterized in that, The switchable light source mentioned in step S1 is a visible light surface light source or a line light source and is arranged along the extension direction of the sealing strip, with the azimuth angle of each light source being evenly distributed in the circumferential direction.

3. The method according to claim 1, characterized in that, In step S3, the surface normal is solved pixel by pixel using a photometric stereo method, or the surface normal is estimated from the brightness observation of each pixel in the region of interest under different illumination directions using another neural network; and features reflecting geometric undulations are derived from the surface normal field. The features reflecting geometric undulations include the spatial gradient of the surface normal, the local curvature, and the relative height distribution obtained by integrating the surface normal.

4. The method according to claim 1, characterized in that, In step S4, for each pixel in the region of interest, the brightness under each illumination direction is normalized and the change of brightness with the illumination direction is fitted. The fitted direction-dependent intensity is used as the direction selectivity measure of the pixel's reflection behavior with the illumination direction, and the direction selectivity measure is incorporated into the reflection anisotropy feature.

5. The method according to claim 3, characterized in that, The neural network described in step S5 is a convolutional neural network with multiple branches. Its first branch receives the surface normal field and the features reflecting geometric undulations, and its second branch receives the reflective anisotropic features. The two branches extract features respectively and then fuse them in the intermediate layer, and output the discrimination result in a pixel-by-pixel segmentation or region classification manner.

6. The method according to claim 5, characterized in that, In step S5, the neural network outputs the confidence level of each category while outputting the discrimination result, and performs release, rejection or re-inspection on the sealed area based on the confidence level; the neural network is trained with sealed samples labeled with wrinkled areas and false sealed areas as supervision.

7. The method according to claim 1, characterized in that, Before the output of step S5, the consistency between the geometric undulations obtained from the surface normal field and the material fusion state obtained from the reflection anisotropy features is verified. The reflection anisotropy features include the reflection residual energy obtained from the reflection changes after subtraction and the reflection direction selectivity measure: when the geometric undulations of a certain region are greater than the corresponding threshold and the reflection residual energy is lower than the corresponding threshold, it is judged as a benign wrinkle; when the geometric undulations of a certain region are less than the corresponding threshold, the reflection residual energy is higher than the corresponding threshold and the reflection direction selectivity measure is lower than the corresponding threshold, it is judged as a suspected false seal and its re-inspection weight is increased.

8. The method according to claim 1, characterized in that, Multiple regions of interest (ROIs) are arranged along the sealing strip in the same heat-sealing area, and the judgment results of each ROI are summarized. The existence of continuous false-sealed sections on the sealing strip is used as the basis for whether the whole bag is rejected.

9. The method according to claim 1, characterized in that, In step S1, time-division acquisition is adopted to synchronize strobe lighting with camera exposure. During the movement of the sealed area under inspection with the film, the light sources in each direction are lit sequentially and continuous shots are taken to obtain a multi-directional image sequence with overlapping positions. In step S2, the region of interest is located based on the position of the sealing tape relative to the bag or the edge features of the sealing tape.

10. A system for detecting and distinguishing wrinkles and false seals in the heat sealing of flexible packaging, characterized in that, include: The image acquisition unit is used to illuminate the same heat-sealing area with no less than three switchable light sources located at different azimuth angles and with different incident directions, and to acquire an image sequence of the heat-sealing area with the same imaging angle but different illumination directions under no less than three illumination directions. The preprocessing unit is used to register the image sequence and extract the region of interest of the sealing area to obtain multi-directional brightness observations corresponding to each pixel; The normal reconstruction unit is used to solve the surface normal pixel by pixel, taking the brightness observation of each pixel in the region of interest under different lighting directions and the corresponding known lighting directions as input, to obtain the surface normal field covering the sealing area. An anisotropy extraction unit is used to subtract the brightness changes that can be explained by the surface normal field from the multi-directional brightness observations one direction at a time, and use the remaining reflection changes that cannot be explained by the surface normal field after subtraction as the reflection anisotropy features characterizing the differences in the fusion state of the material. The discrimination unit is used to input the surface normal field, the anisotropic reflection characteristics, and the multi-directional brightness observation as multiple channels into the neural network, and output the discrimination result of each position in the sealing area as a benign wrinkle, a harmful false seal, or a normal seal after the neural network fuses them.