Beverage bottle cap defect checking system based on image recognition

The image recognition-based beverage bottle cap defect detection system utilizes multi-angle structured light and cascaded mapping inference models to solve the problem of online and accurate detection of hidden defects inside multi-layered nested bottle caps, achieving efficient and stable defect determination.

CN123175902APending Publication Date: 2026-11-27SHANGLUO GUOFENG HEALTH IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611236041.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-14
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing technologies struggle to reliably identify internal hidden defects in multi-layered nested beverage bottle caps, such as fluid leakage and localized damage to the sealing film, without removing the cap or damaging the packaging, resulting in low accuracy and reliability of online inspections.

Method used

A beverage bottle cap defect detection system based on image recognition is adopted. External multi-source optical characterization images are acquired through multi-angle structured light. Combined with an ambient light noise model and dynamic light and shadow adaptive convergence coefficient, local reflective topological distortion and transmittance gradient distribution features are extracted. The internal latent defect state is determined by using a cascaded mapping inference model.

Benefits of technology

This technology enables precise online detection of hidden defects within multi-layered nested bottle caps without damaging the packaging, improving the stability and accuracy of the judgment, reducing the impact of false environmental anomalies, and ensuring the reliability and adaptability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123175902A_ABST
    Figure CN123175902A_ABST
Patent Text Reader

Abstract

The present application relates to the field of machine vision detection and intelligent manufacturing, in particular to a beverage bottle cap defect investigation system based on image recognition, comprising an image acquisition terminal module, a feature processing gateway module and a cascaded inference cloud platform module; the image acquisition terminal module projects multi-angle structured light to a beverage bottle cap with a multi-layer nested structure and an internal membrane breaking structure, obtains an external multi-source optical representation image, and extracts local reflection topology distortion features and light transmission rate gradient distribution features; the feature processing gateway module calculates optical topology distortion confidence based on an ambient light noise model containing ambient light distribution parameters, and filters to generate target distortion features; the cascaded inference cloud platform module constructs a multi-source optical feature sequence based on the light transmission rate gradient distribution features and the target distortion features, determines the internal implicit defect state and generates the final investigation result containing early warning control instructions; the accuracy of fluid penetration and mechanical structure failure division is improved.
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 and intelligent manufacturing, specifically to a beverage bottle cap defect detection system based on image recognition. Background Technology

[0002] Defect detection of beverage bottle caps is a common technical means in the quality control of beverage packaging. It can usually identify obvious abnormalities in the appearance, packaging status and surface of the bottle cap, and can be combined with the production line cycle to achieve continuous online detection, with a high degree of automation and detection efficiency. With the development of functional beverage packaging structures, bottle caps have gradually evolved from ordinary single-layer structures to complex caps with multi-layer nested structures and internal membrane breaking structures. However, when troubleshooting defects in such caps, existing detection methods still mainly focus on externally visible defects. It is difficult to reliably identify latent defects such as fluid penetration, localized damage to the sealing film, and internal mechanism misalignment without opening the cap or damaging the packaging, resulting in low accuracy and reliability of online troubleshooting. Summary of the Invention

[0003] The purpose of this invention is to provide an image recognition-based defect detection system for beverage bottle caps, solving the following technical problems: This method avoids the need for spot checks that damage the packaging or rely on X-ray equipment when investigating hidden problems inside multi-layered nested bottle caps. It also makes it easier to transform internal solid-liquid coupling defects into external multi-source optical characterization for non-contact online accurate investigation, and effectively separates environmental false anomalies to improve the stability of defect inference.

[0004] The objective of this invention can be achieved through the following technical solutions: A beverage bottle cap defect detection system based on image recognition, comprising: The image acquisition terminal module includes a light source projection unit and an image acquisition unit. It is used to project multi-angle structured light onto the target object and acquire the external multi-source optical characterization image of the target object under the illumination of the multi-angle structured light. The target object is a beverage bottle cap with a multi-layer nested structure and an internal perforated structure. The image acquisition terminal module is also used to perform noise reduction and image correction preprocessing on the external multi-source optical characterization image, and input the preprocessed image into the feature extraction unit for edge detection and gradient calculation to extract local reflective topological distortion features and transmittance gradient distribution features. The feature processing gateway module is connected to the image acquisition terminal module. It is used to receive local reflective topological distortion features and transmittance gradient distribution features, calculate the optical topological distortion confidence level based on the preset ambient light noise model containing ambient light distribution parameters, and filter the local reflective topological distortion features according to the optical topological distortion confidence level to generate target distortion features. The cascaded inference cloud platform module is used to construct a multi-source optical feature sequence based on the transmittance gradient distribution characteristics and target distortion characteristics. The multi-source optical feature sequence is used as the input of a pre-defined cascaded mapping inference model containing a multi-layer feature mapping network. The cascaded mapping inference model is a multi-classifier model built based on a deep convolutional neural network. Based on the output classification probability distribution characteristics of the pre-defined cascaded mapping inference model, the internal latent defect state is determined by mapping the highest probability category. The classification probabilities of different dimensions output by the model correspond to the occurrence probabilities of fluid infiltration state and mechanical structure failure state, respectively. The final investigation result containing early warning and control instructions is generated based on the internal latent defect state.

[0005] Furthermore, the feature processing gateway module includes: The confidence calculation unit is used to combine the ambient light noise model with a preset internal fluid permeation model containing fluid distribution parameters to calculate the feature similarity between local reflective topological distortion features and standard features constructed based on ambient light distribution parameters and fluid distribution parameters. The standard features are constructed by fusing the background illumination matrix extracted from the ambient light noise model and the expected distortion morphology matrix generated by the internal fluid permeation model using the following formula: ;in, As a standard feature, This is the background illumination matrix corresponding to the ambient light distribution parameters. This represents the desired distortion shape matrix corresponding to the fluid distribution parameters. and The preset distribution weight coefficients are used; the feature similarity is obtained by calculating the cosine similarity between the spatial feature vector of the local reflective topological distortion feature and the spatial feature vector of the standard feature, and the feature similarity is used as the confidence level of optical topological distortion. The dynamic convergence unit is used to calculate the dynamic light and shadow adaptive convergence coefficient when the confidence level of optical topological distortion is lower than a preset confidence threshold. The formula for calculating the dynamic light and shadow adaptive convergence coefficient is as follows: in, For dynamic light and shadow adaptive convergence coefficients, To obtain the pixel change frequency corresponding to the local reflective topological distortion features in consecutive image frames. For optical topological distortion confidence level. , and All are preset convergence adjustment constants, and the non-defect optical changes in the local reflective topological distortion features are suppressed by using dynamic light and shadow adaptive convergence coefficients. The feature filtering unit is used to retain local reflective topological distortion features to generate target distortion features when the confidence level of optical topological distortion is higher than or equal to a preset confidence level threshold.

[0006] Furthermore, the cascaded inference cloud platform module includes: Sequence construction unit, used to align the transmittance gradient distribution features and target distortion features in terms of feature dimensions to construct a multi-source optical feature sequence; The weighting unit is used to assign cross-domain feature concatenation weights to different feature dimensions in a multi-source optical feature sequence. The defect inference unit is used to input the multi-source optical feature sequence after assigning cross-domain feature cascade weights into a preset cascade mapping inference model to output the internal latent defect state, which includes the fluid infiltration state and the mechanical structure failure state.

[0007] Furthermore, the cascaded inference cloud platform module also includes: The mapping rate evaluation unit is used to compare the inference results of the internal latent defect state in each key structural dimension with the corresponding real state in the preset real defect sample library containing real defect labels, and determine the latent defect representation mapping rate based on the proportion of structural dimensions that match the comparison. The model update unit is used to adjust the cross-domain feature cascade weights and update the preset cascade mapping inference model when the latent defect representation mapping rate is lower than the preset mapping rate threshold; and to keep the preset cascade mapping inference model unchanged when the latent defect representation mapping rate is higher than or equal to the preset mapping rate threshold.

[0008] Furthermore, the image acquisition terminal module also includes a feature extraction unit, which performs edge detection and gradient calculation on the external multi-source optical characterization image to extract local reflective topological distortion features and transmittance gradient distribution features.

[0009] Furthermore, the dynamic convergence unit is configured to: acquire the pixel change frequency in the external multi-source optical characterization image corresponding to the local reflective topological distortion features; And when the pixel change frequency is higher than the preset frequency threshold, the dynamic light and shadow adaptive convergence coefficient is set to the first preset value; And when the pixel change frequency is lower than or equal to the preset frequency threshold, the dynamic light and shadow adaptive convergence coefficient is set to the second preset value. The first preset value is greater than the second preset value.

[0010] Furthermore, the fluid permeation state characterizes the capillary permeation phenomenon generated by high-viscosity fluids in the local gaps of multi-layered nested structures; The failure state of a mechanical structure characterizes the physical positional displacement of the internal membrane structure within a multi-layered nested structure.

[0011] Furthermore, both the feature processing gateway module and the image acquisition terminal module include: The data compression unit is used to compress the local reflective topological distortion features and transmittance gradient distribution features based on a preset encoding algorithm, and to transmit the compressed feature data based on a block transmission strategy.

[0012] Furthermore, the cascaded inference cloud platform module and the feature processing gateway module include a real-time channel and an asynchronous channel. The real-time channel adopts a physically isolated independent network for transmitting internal latent defect status and early warning control instructions. The asynchronous channel uses wireless communication standards to transmit compressed feature data and model update parameters, which are used to update the preset cascaded mapping inference model.

[0013] The beneficial effects of this invention are: 1. This invention projects multi-angle structured light onto multi-layered nested bottle caps to acquire refracted and total internal reflection distortion images, extracting local reflective topological distortion and transmittance gradient distribution features. This mechanism transforms internal solid-liquid coupling defects, which cannot be directly observed, into external optical representations, enabling online detection of internal fluid infiltration and structural misalignment without damaging the encapsulation.

[0014] 2. This invention introduces a feature processing gateway, which calculates confidence levels using an ambient light noise model and utilizes a dynamic light and shadow adaptive convergence coefficient to suppress non-defect changes such as high-frequency fluctuations. This mechanism enables the effective separation of real defect signs from false environmental anomalies at the field edge, reducing noise contamination in subsequent inferences and improving the system's decision stability.

[0015] 3. This invention utilizes a cascaded inference cloud platform to align the dimensions of transmittance and distortion features and assign cross-domain feature cascade weights, which are then input into the model to determine the internal defect state. This mechanism organizes external multi-source optical information into an interpretable, structured chain of evidence, avoiding misjudgments caused by isolated decisions based on single features, and improving the accuracy of fluid permeation and mechanical structure failure classification.

[0016] 4. This invention compares the inferred state with a real defect sample library through a mapping rate evaluation unit. When the mapping rate of latent defect characterization is low, the weights are adaptively adjusted and the inference model is updated. This mechanism enables the system to continuously adapt to viscosity changes of fluids due to temperature or formulation, as well as batch differences in materials, preventing the model from deviating from actual physical laws and ensuring the reliability of long-term troubleshooting.

[0017] 5. This invention employs feature data compression and segmented transmission, and establishes independent real-time channels and wireless asynchronous channels between cloud gateways. This mechanism, by separating control commands from data links, reduces the transmission burden of large-scale detection while ensuring low latency and high reliability for critical actions such as production line rejection and early warning, and simultaneously meets the needs of feature accumulation and model optimization. Attached Figure Description

[0018] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 This is a schematic diagram of a beverage bottle cap defect detection system based on image recognition provided in an embodiment of this application. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] Please see Figure 1 A beverage bottle cap defect detection system based on image recognition is proposed. The system includes an image acquisition terminal module, comprising a light source projection unit and an image acquisition unit, used to project multi-angle structured light onto the target object and acquire the external multi-source optical characterization image of the target object under the illumination of the multi-angle structured light. The target object is a beverage bottle cap with a multi-layer nested structure and an internal broken film structure. The image acquisition terminal module is also used to preprocess the external multi-source optical characterization image by denoising and image correction, and input the preprocessed image into the feature extraction unit for edge detection and gradient calculation to extract local reflective topological distortion features and transmittance gradient distribution features. The feature processing gateway module is connected to the image acquisition terminal module. It is used to receive local reflective topological distortion features and transmittance gradient distribution features, calculate the optical topological distortion confidence level based on the preset ambient light noise model containing ambient light distribution parameters, and filter the local reflective topological distortion features according to the optical topological distortion confidence level to generate target distortion features. The cascaded inference cloud platform module is used to construct a multi-source optical feature sequence based on the transmittance gradient distribution characteristics and target distortion characteristics. The multi-source optical feature sequence is used as the input of a pre-defined cascaded mapping inference model containing a multi-layer feature mapping network. The cascaded mapping inference model is a multi-classifier model built based on a deep convolutional neural network. Based on the output classification probability distribution characteristics of the pre-defined cascaded mapping inference model, the internal latent defect state is determined by mapping the highest probability category. The classification probabilities of different dimensions output by the model correspond to the occurrence probabilities of fluid infiltration state and mechanical structure failure state, respectively. The final investigation result containing early warning and control instructions is generated based on the internal latent defect state.

[0021] This embodiment provides a defect detection mechanism for beverage bottle caps based on image recognition. Specifically, this embodiment takes the filling and capping production line of a separate honey water beverage as the main scenario. The target bottle cap in the production line is a multi-layer nested bottle cap with a liquid storage cavity, a film breaking component, a sealing film, and an external thread layer. These bottle caps are usually intact on the outside before leaving the factory, but there may be hidden problems inside, such as honey micro-leakage, partial damage to the sealing film, misalignment of the puncture component, or jamming of the pressing mechanism. Therefore, it is necessary to conduct an online inspection of their internal condition without opening the cap or randomly inspecting to destroy the seal. Specifically, the image acquisition terminal module is arranged between the rotating conveyor star wheel and the packing section, and the light source projection unit projects structured light from the top of the bottle cap in three directions: oblique, lateral, and circumferential. The multi-angle illumination configuration is designed to address the different external optical responses that the same defect will exhibit under different incident directions: if honey undergoes capillary penetration along the inner layer gap, it will change the local refractive index, causing discontinuous bright bands to appear at the light transmission boundary at the root of the thread; if the internal film-breaking part is off-center, it will cause the reflective texture of the top cover area to show skewed or localized collapse characteristics. After the image acquisition unit acquires these external multi-source optical characterization images, the image acquisition terminal module, for example through the feature extraction unit in the subsequent embodiment, first performs background removal, cover area localization and posture correction, and then extracts local reflective topological distortion features and transmittance gradient distribution features from them. The former is used to characterize whether there are abnormal bends, stretches or breaks in the surface reflective texture, while the latter is used to characterize whether the transition of light transmission intensity caused by changes in internal fluid or membrane structure is abnormal. Furthermore, the feature processing gateway module is deployed at the edge of the production line to receive on-site data and complete the first round of authenticity screening; the ambient light noise model can pre-record typical parameters such as the distribution of workshop ceiling lights, metal reflection from the conveyor line, condensate scattering, and reflection from the bottle's own label; these typical parameters are mathematically represented based on a Gaussian mixture distribution model, and their joint probability density function is: in, These are the pixel coordinates of the image; These correspond to four types of environmental noise sources: workshop overhead light distribution, metal reflection from conveyor lines, condensate scattering, and reflection from bottle labels. The prior probability distribution weights of each typical noise source satisfy the following conditions: ; The mean coordinates of the spatial reflection centers of each typical noise source in the image field of view are recorded in advance; and The variance values ​​are the specific values ​​of the scattering degree of the reflected light spot in the horizontal and vertical directions; the covariance matrix formed by the above feature set is used as the ambient light distribution parameter. The gateway module compares the input local reflection topological distortion features with the noise model to calculate the confidence level of optical topological distortion. The specific confidence level calculation algorithm is as follows: the extracted current local reflection topological distortion features are flattened to form a multi-dimensional spatial feature vector. Simultaneously, standard features constructed based on ambient light distribution parameters are extracted to form a standard spatial feature vector. The gateway module calculates the optical topological distortion confidence level by measuring the spatial cosine similarity between the two components. Its mathematical formula is: in, The total dimension of the extracted optical feature vectors. and The actual extracted vector and the standard model vector are respectively at the th... The algorithm evaluates the geometric spatial distance of the feature distribution by mapping the angle changes of high-dimensional vectors, and directly quantizes it into interval values. The confidence score is a numerical value between the two values; the confidence score represents the probabilistic bias of the current abnormal reflective features relative to the distribution set of true defect features and the distribution set of environmental interference noise. If an abnormal region consistently appears near the root of the thread or the boundary of the top membrane at multiple acquisition angles, it is more likely to correspond to changes in the internal structure. If the anomaly only appears at a single moment and its location drifts with the external light spot, it is more likely to be external noise; after this filtering, the remaining part is used as the target distortion feature. Furthermore, the cascaded inference cloud platform module receives transmittance gradient distribution features and target distortion features, and constructs a multi-source optical feature sequence; The cascading process is characterized by inference from the outside to the inside: first, the presence of liquid entering the gap is determined by the abnormal light transmission of the threads and edges; then, the internal film-breaking parts are determined by the reflective morphology of the top cover; and finally, the defect distribution pattern of the target object is determined by combining the two to determine whether it is a single fluid penetration, a single mechanical structure failure, or a combination of both. To facilitate understanding, a feature data processing example can be used: for example, a sequence. It contains three sequential segments: the first segment corresponds to the change in light transmission through the threads, the second segment corresponds to the distortion of reflection on the top of the cap, and the third segment corresponds to the continuity of the circumferential boundary. If the first and third segments are both abnormal while the second segment is basically normal, the model determines the output fluid permeation state; if the second segment is the most abnormal, the model determines the output mechanical structure failure state. Based on this, the cloud platform generates the final investigation results and outputs early warning and control instructions, such as rejection, re-inspection, deceleration and re-shooting, or notifying the upstream sealing station to verify the position of the stamping head; As an anomaly handling mechanism, if the acquired image cannot be stably positioned due to severe rotation and tilt of the bottle cap, label obstruction, lens fogging, or the cap exceeding the imaging field of view, the image acquisition terminal module marks the sample as a low-confidence original sample, only uploads the basic status code, and does not directly participate in defect inference. If the gateway module determines that the ambient light interference is too strong, causing the target distortion features to be unreliably generated, the system enters a conservative process and sends the bottle cap to the secondary shooting channel. If the multi-source optical feature sequence received by the cloud platform has obvious missing segments, it will not output a specific defect category, but will output a control instruction to wait for manual review or transfer to the re-inspection station, so as to avoid mistakenly rejecting normal products when there is insufficient evidence. On a separate honey water production line, after the bottle caps are filled, they enter the capping section and then enter the inspection station in a continuous cycle. A batch of bottle caps have complete outlines, but a small number of bottle caps have abnormal light transmission bands with a width lower than the preset size threshold at the lower edge of the thread. At the same time, the reflective texture on the top of the cap is biased to one side. The image acquisition terminal module recorded that the anomaly was stable at multiple illumination angles. Based on this, the gateway module removed the instantaneous high spot from the flashing spot of condensation water and only retained the target distortion features related to the inherent structure of the cover. The cloud platform further determined that some of the samples were due to honey seeping into local gaps, while others were due to misalignment of the membrane breaking components. It then issued instructions to the sorting execution agency to remove the unqualified products and to sample and trace the corresponding caps. The purpose of this step / mechanism is to transform internal solid-liquid coupling defects that are originally impossible to observe directly into external optical characteristics that can be acquired online and interpreted layer by layer, thereby enabling non-contact inspection of hidden defects in complex functional bottle caps without relying on perspective equipment or damaging the packaging.

[0022] In a preferred embodiment of the present invention, the feature processing gateway module includes: a confidence calculation unit, used to combine an ambient light noise model with a preset internal fluid permeation model containing fluid distribution parameters to calculate the feature similarity between local reflective topological distortion features and standard features constructed based on ambient light distribution parameters and fluid distribution parameters, wherein the standard features are constructed by fusing the background illumination matrix extracted by the ambient light noise model and the expected distortion morphology matrix generated by the internal fluid permeation model using the following formula: ;in, As a standard feature, This is the background illumination matrix corresponding to the ambient light distribution parameters. This represents the desired distortion shape matrix corresponding to the fluid distribution parameters. and The preset distribution weight coefficients are used; the feature similarity is obtained by calculating the cosine similarity between the spatial feature vector of the local reflective topological distortion feature and the spatial feature vector of the standard feature, and the feature similarity is used as the confidence level of optical topological distortion. The dynamic convergence unit is used to calculate the dynamic light and shadow adaptive convergence coefficient when the confidence level of optical topological distortion is lower than a preset confidence threshold. The formula for calculating the dynamic light and shadow adaptive convergence coefficient is as follows: in, For dynamic light and shadow adaptive convergence coefficients, To obtain the pixel change frequency corresponding to the local reflective topological distortion features in consecutive image frames. For optical topological distortion confidence level. , and All are preset convergence adjustment constants, and the non-defect optical changes in the local reflective topological distortion features are suppressed by using dynamic light and shadow adaptive convergence coefficients. The feature filtering unit is used to retain local reflective topological distortion features to generate target distortion features when the confidence level of optical topological distortion is higher than or equal to a preset confidence level threshold.

[0023] This embodiment provides a refined processing mechanism for a feature processing gateway; specifically, in the aforementioned basic scheme, although reflective distortion and light transmission gradient can be extracted from external images, on the actual production line, water droplets, packaging film reflections, metal guide rail flashes, and local fog may all form bright spots and dark lines similar to defects. If these changes are directly fed into the subsequent inference, short-term light shadows may be misjudged as honey leakage or structural failure; therefore, this embodiment further introduces three consecutive units on the gateway side: confidence calculation, dynamic convergence, and feature filtering. Specifically, the confidence calculation unit uses both the ambient light noise model and the internal fluid permeation model as references. The internal fluid permeation model describes the stable impact on the external optical path when high-viscosity honey permeates in narrow gaps. For example, abnormal reflections are often continuously distributed close to the root of the thread and remain consistent in position under adjacent viewing angles. Meanwhile, the high bright spots caused by ambient noise usually exhibit a free-state distribution on the surface, unstable edges, and a lack of fixed correspondence with the lines of the cap structure. As a simplified example of feature evaluation: Suppose that a local anomaly is extracted from a bottle cap in three observation regions R1, R2, and R3, where R1 is located at the root of the thread, R2 is located at the center of the top surface, and R3 is located at a random position on the side of the cap; The standard leakage feature template mainly focuses on R1 and circumferential continuity, while the environmental flashing spot template is more likely to appear at random locations in R3 class. If the current sample is closer to the former, the confidence level increases; if it is closer to the latter, the confidence level decreases. Specifically, when constructing the standard feature vector, the confidence calculation unit generates the background illumination matrix by extracting background distribution data from the ambient light noise model. The fluid diffusion probability in the internal fluid permeation model is extracted to generate the desired distortion morphology matrix. Therefore, the formula is adopted. Linear superposition generates a standard feature matrix and flattens it into a standard feature vector; The internal fluid permeation model is specifically constructed based on fluid capillary diffusion dynamics to characterize the spatial distribution probability of fluid in the local gaps of a multi-layered nested structure; the expected distortion morphology matrix. internal pixel coordinates The value at this location is calculated using the following formula: in, These are characteristic coefficients in the fluid distribution parameters that characterize the effect of fluid viscosity. Image pixel coordinates The shortest physical mapping distance from the baseline at the root of the gap. This represents the preset standard deviation of fluid diffusion. Simultaneously, the specific process of constructing the standard leakage feature template and representing its feature vectors is as follows: The standard feature matrix generated after fusion is processed using a preset structured spatial grid. Perform line-by-line scanning extraction, reduce the dimensionality, and flatten it into a standard spatial feature vector. This feature vector is specifically represented as a one-dimensional numerical sequence: in, The total number of dimensions of the extracted optical features. For the eigenvector corresponding to the first The expected optical topological distortion intensity values ​​at each spatial grid node position; through the construction of the above model and spatial grid mapping, the system transforms the continuous theoretical diffusion physical form into a discrete feature vector that can be used for high-dimensional space cosine similarity calculation; To clearly define the rules for similarity calculation, the confidence calculation unit extracts the morphological feature vector of local reflective topological distortion features when calculating feature similarity, and calculates the geometric spatial distance between it and the standard feature vector constructed based on ambient light distribution parameters and fluid distribution parameters. The reciprocal of this distance is normalized, and the resulting value is used as the feature similarity, i.e., the confidence score of optical topological distortion. Through this structured calculation process, it can be ensured that the output of the confidence score has strict quantitative significance and avoid the bias of the evaluation benchmark that lacks technical significance. Furthermore, when the confidence level is lower than the preset threshold, the dynamic convergence unit does not immediately determine that it is normal, but first suppresses non-defect optical changes; The convergence here can be understood as gradually compressing the influence range of optical changes that have high-frequency position time-varying characteristics, transient high-frequency brightness jump characteristics, and lack structural dependence, so that they no longer dominate subsequent inferences; Its engineering significance lies in the fact that anomalies truly caused by internal leakage or misalignment of the membrane component usually have positional anchoring and structural continuity; while external light and shadow interference often lacks this stability; the dynamic convergence unit thus prioritizes retaining the anomaly trajectory associated with the inherent geometry of the cover, weakening transient changes caused solely by the environment. Furthermore, when the confidence level is higher than or equal to the threshold, the feature filtering unit directly retains the local reflective topological distortion feature and sends it to the subsequent stage as the target distortion feature; The reason for the above feature filtering is that the significance of some early defect features is lower than the preset characterization threshold. If the smoothing process is too smooth, it will erase the weak anomalies that truly have key physical characterization significance. Therefore, once it is confirmed that it is more consistent with the physical characterization of the real defect, its original structural relationship should be maintained. As an anomaly handling mechanism, if the overall environment of a certain batch changes abruptly, such as replacing the top light after maintenance or adding a highly reflective metal guard plate next to the conveyor line, causing a short-term mismatch in the existing ambient light noise model, the gateway module can mark the current batch as an environment reconstruction batch, temporarily increase the re-inspection ratio, and recalibrate the environmental reference through normal samples from the recent period. If the fluid leakage model shows adaptation deviation due to changes in the viscosity of the honey formula, the system allows calling multiple model versions corresponding to the temperature range and viscosity grade to avoid a single template misjudging normal samples as defects. On the same honey production line, after the night shift started, the temperature difference in the workshop increased, and a thin mist appeared on the outer surface of some bottle caps; at this time, scattered bright spots with a density higher than the preset distribution threshold appeared in the acquired images; in contrast, when the density of scattered bright spots was lower than or equal to the preset distribution threshold, it was determined to be an effective local optical distortion that was not caused by fog interference. The confidence calculation unit detected that these bright spots were loosely distributed and did not appear stably along the threads or top film boundary, so they were classified as low confidence anomalies. The dynamic convergence unit suppresses this type of change, retaining the abnormal stripes that remain attached to the root of the thread and whose position remains basically unchanged in two consecutive frames; the feature filtering unit uploads this stripe as the target distortion feature, while excluding random fog speckle. The purpose of this step / mechanism is to enable the separation of real defect signs and false environmental anomalies at the field edge first, reduce noise pollution to the subsequent model, and thus improve the stability of the whole system in judging latent defects.

[0024] In a preferred embodiment of the present invention, the cascaded inference cloud platform module includes: a sequence construction unit, used to align the transmittance gradient distribution features and target distortion features in terms of feature dimensions to construct a multi-source optical feature sequence; The weighting unit is used to assign cross-domain feature concatenation weights to different feature dimensions in a multi-source optical feature sequence. The defect inference unit is used to input the multi-source optical feature sequence after assigning cross-domain feature cascade weights into a preset cascade mapping inference model to output the internal latent defect state, which includes the fluid infiltration state and the mechanical structure failure state.

[0025] This embodiment provides a deduction mechanism for a cascaded inference cloud platform; specifically, in the aforementioned basic scheme, the edge side can already screen out more reliable target distortion features, but if only a certain type of anomaly is judged independently, misclassification may still occur; For example, based solely on changes in light transmittance, differences in film thickness may be misjudged as fluid leakage; based solely on reflective distortion, injection molding shrinkage marks may be misjudged as mechanical misalignment. Therefore, in this embodiment, multiple features are organized into a unified sequence on the cloud platform side, and joint inference from the outside to the inside is completed through cross-domain weighting. Specifically, the sequence construction unit first performs dimensional alignment between the transmittance gradient distribution features and the target distortion features; that is, through structured mapping, the two types of features establish spatial positional topological relationships under the same cover structure reference system, for example, they are both mapped to unified structural partitions such as the threaded area, shoulder transition area, top membrane area, and central membrane breaking area. Feature data processing example: Divide a bottle cap into four structural segments S1, S2, S3, and S4, and form a sequence of light transmission features. Distortion feature formation sequence After alignment, they form a combined sequence. ; Through the above spatial dimension alignment operation, the model no longer treats a certain highlighted area in isolation, but can know where it occurs and whether it occurs together with anomalies in adjacent structural segments; Furthermore, the weight allocation unit assigns cross-domain feature cascade weights to different feature dimensions; its core principle is that different defects do not have the same projection path to the external world. Fluid infiltration has a higher probability of altering the light transmission boundaries of the threaded and gap regions, while mechanical structural failures are more likely to preferentially affect the reflective topology of the top membrane and central regions. Therefore, when judging a certain type of defect, the feature segments that are closer to its physical propagation chain should be given higher attention. To illustrate with a simplified example, if the light transmittance of a sample is significantly abnormal in S1 and S2, while the reflectivity of S4 is relatively weak, the cloud platform can increase the weight of the light transmittance characteristics of the threaded area, making the conclusion biased towards fluid permeation; conversely, if the reflectivity of S3 and S4 is most significantly skewed, the weight of the distortion characteristics of the top membrane area and the central area can be increased, making the conclusion biased towards mechanical structure failure. Furthermore, the defect inference unit inputs the weighted multi-source optical feature sequence into the cascaded mapping inference model; here, the cascaded mapping emphasizes a hierarchical interpretation relationship: the first layer identifies whether the external optical anomaly has structural anchoring; the second layer determines whether the anomaly is caused by a change in fluid path or a mechanical pose shift; and the third layer provides the state of the internal latent defect. The specific technical implementation of the cascaded mapping inference model is as follows: the model is based on a three-layer network architecture consisting of a one-dimensional convolutional neural network and fully connected layers stacked together, with an input dimension of... The multi-source optical feature matrix, where This represents the number of structural segments after alignment with the feature dimensions. Number of feature channels; The first layer is a one-dimensional convolutional layer, containing Each convolutional kernel and employs Activation functions are used to extract spatial local features between sequences to identify structural anchoring. The second layer is a fully connected layer, containing One neuron and using The activation function is used for non-linear dimensionality reduction and causal feature mapping of features; the third layer is a fully connected output layer, containing... One neuron and using Activation function, where The total number of categories of internal latent defect states is preset, used to output the predicted probability corresponding to each state; in terms of model training, a batch-based supervised learning mechanism and the Adam optimizer are used for gradient backpropagation, with the initial learning rate set to [value missing]. The prediction error is calculated using the cross-entropy loss function, and the formula for the loss function is as follows: in, As an indicator variable for the actual distribution of defect labels, The first output of the model The classification probability of each category; The output status includes at least the fluid permeation status and the mechanical structure failure status, and can be further subdivided into levels such as slight permeation, extended permeation, local displacement, and severe displacement, to match different treatment strategies. As an abnormal degradation processing mechanism, if the light transmission feature is complete but the distortion feature is missing, or the distortion feature is complete but the light transmission feature is missing, the cloud platform can adopt a single-domain degradation inference mode, only outputting suspected fluid anomalies or suspected structural anomalies, and requiring re-photographing for confirmation. If the sequence results of the same bottle cap obtained at different shooting times conflict with each other, the verification instruction will be output conservatively first, and a single defect type will not be forced; if the overall significance of the multi-source features is lower than the preset category judgment threshold to support the category judgment, only the sample number, production line number and timestamp will be retained and handed over to the sample library for subsequent model training. In the same production line, after a cap wears out, a batch of bottle caps appear one after another; after the cloud platform receives the structural segment sequence of this batch of samples, it detects that the changes in the light transmittance gradient of S1 and S2 are not prominent, but S3 and S4 have obvious reflection center skew and top film boundary asymmetry. The weight allocation unit thus increases the influence of the relevant features of the top membrane area. The defect inference unit ultimately classifies this batch of samples as mainly mechanical structure failure state and triggers maintenance warning for the corresponding cap head. Another batch of samples shows continuous bright band enhancement in the thread area, disordered circumferential light transmission gradient, and basically stable top membrane reflection. The system classifies it as fluid permeation state. The purpose of this step / mechanism is to organize external multi-source optical information into an interpretable, structured chain of evidence, avoid isolated decisions based on single features, and thus improve the accuracy and traceability of internal latent defect type classification.

[0026] In a preferred embodiment of the present invention, the cascaded inference cloud platform module further includes: a mapping rate evaluation unit, which is used to compare the inference results of the internal latent defect state in each key structural dimension with the corresponding real state in a preset real defect sample library containing real defect labels, and determine the latent defect representation mapping rate based on the proportion of structural dimensions that match the comparison. The model update unit is used to adjust the cross-domain feature cascade weights and update the preset cascade mapping inference model when the latent defect representation mapping rate is lower than the preset mapping rate threshold; and to keep the preset cascade mapping inference model unchanged when the latent defect representation mapping rate is higher than or equal to the preset mapping rate threshold.

[0027] This embodiment provides a model self-correction mechanism; specifically, in the aforementioned basic scheme, the cloud platform is already able to extrapolate fluid permeation and mechanical structure failure, but there is a long-term variation problem with separated honey water products: the viscosity of honey is affected by the season, formula and storage temperature, and the batch of sealing film material will also change its optical response; If the model remains unchanged for a long time, the originally effective mapping relationship may gradually shift, so it is necessary to introduce an update process that compares the closed loop with the real sample. Specifically, the mapping rate evaluation unit calls up a real defect sample library; the labels in this sample library can come from unpacking verification, offline dissection inspection, vacuum pressure testing, customer return traceability, and manual judgment results after production line sampling inspection. During the evaluation, we not only compare whether the final categories are consistent, but also whether the correspondences on the key structural dimensions are consistent; To facilitate understanding, a feature data processing example can be used: Suppose that the inference results of a certain sample are abnormal thread penetration, normal shoulder, skewed top membrane, and center offset in four structural dimensions, while the actual re-examination results show abnormal thread penetration, normal shoulder, skewed top membrane, and normal center. Then, three of the four dimensions are consistent, which can be regarded as the sample having high mapping consistency. The mapping rate evaluation unit then summarizes the dimensional consistency of multiple samples to form the latent defect characterization mapping rate. Furthermore, when the mapping rate is lower than a preset threshold, the model update unit adjusts the cross-domain feature concatenation weights and updates the inference model; The engineering logic is that if the actual re-inspection continues to show that the probability of a certain type of defect being judged by the system is lower than the actual label distribution, it means that the correlation mapping coefficient of the external evidence corresponding to the defect in the existing model has not reached the set standard. If the system's misclassification rate for normal textures exceeds the allowable tolerance range, the weight assignment of the feature cascade representing a specific dimension deviates from the reasonable range; the update process can prioritize directional calibration within the corresponding structural segment, the corresponding optical domain, and the corresponding environmental condition group, rather than global indiscriminate adjustment, in order to avoid damaging other stable discrimination capabilities; Furthermore, when the mapping rate is higher than or equal to the threshold, the model remains unchanged; the technical purpose is to ensure the version continuity of the production line model during the stable production phase and suppress high-frequency fluctuations in model weights caused by a small number of occasional abnormal samples. For industrial sites, a stable and traceable model version is equally important because it is directly related to the consistency of the non-conforming product rejection rules. As an exception handling mechanism, if the number of real defect samples is insufficient in a short period of time, or only a very small number of special defects are collected in a certain period of time, the system will not perform a formal model update, but will first store them as candidate supplementary samples in the buffer. If there are conflicts between the sources of the same label, for example, if manual inspection determines that the membrane is misaligned but pressure holding retesting does not show any abnormalities, the sample will be marked as a disputed sample and will not be directly involved in the update, but will only be used as a risk observation object; If the updated candidate model causes a significant increase in misjudgments of existing stable samples during replay testing, then the update will be revoked and the previous stable version will be retained and continued to run. During the high temperatures of summer, honey becomes more fluid, and abnormal external light transmission caused by slight membrane damage appears earlier than in winter. The cloud platform compares the results of capping and verification within a week with the online inference results to determine that the system is not accurate enough in detecting early light penetration, resulting in a decrease in the mapping rate. The model update unit accordingly increased the influence weight of weak light transmission anomaly in the threaded area under high-temperature conditions, while maintaining low attention to the reflective disturbance in the top film area that did not increase accordingly; after the update, the identification of slight penetration in subsequent batches is closer to the actual re-inspection results. The purpose of this step / mechanism is to enable the model to continuously adapt to changes in material state, fluid state, and operating conditions, while using real samples to constrain the update direction and prevent the inference model from deviating from the actual physical defect evolution law.

[0028] In a preferred embodiment of the present invention, the image acquisition terminal module further includes: a feature extraction unit, used to perform edge detection and gradient calculation on the external multi-source optical characterization image to extract local reflective topological distortion features and transmittance gradient distribution features.

[0029] This embodiment provides a refined implementation mechanism for an image acquisition terminal; specifically, in the aforementioned basic scheme, if only a single-angle planar illumination is used, only ordinary appearance images can be obtained, making it difficult to magnify the minute structural changes hidden inside the multi-layered cover. Therefore, this embodiment uses multi-angle structured light, refractive images and total internal reflection distortion images to acquire images in combination, so that the internal solid-liquid coupling anomaly forms more easily identifiable optical evidence on the outside. Specifically, the light source projection unit may include an annular oblique light source, a top axial light source, and a low-angle side-scan light source; the annular oblique light source mainly emphasizes the reflection continuity of the thread and shoulder gap, the top axial light source is used to observe the central symmetry of the top film area, and the low-angle side-scan light source is more conducive to magnifying the reflective trail caused by the undulations of the local surface. Because honey seeps into the gaps in plastic, it changes the path of light at the material boundary. Therefore, in refracted images, it often appears as a stretching or interruption of the originally smooth transition between light and dark. Misalignment of internal membrane components or membrane rupture components is more likely to manifest as off-center, bent, or locally collapsed reflective stripes in total internal reflection distortion images. Furthermore, the image acquisition unit can continuously acquire at least two types of images within one sampling period: one type is an optical refraction image used to characterize changes in the transmission or semi-transmission path, and the other type is a total internal reflection distortion image used to characterize the reflection anomalies of the surface and interlayer interface. To facilitate understanding, a very simple example can be used: take one frame of the same bottle cap from the top view and one frame from the side view. The former highlights the symmetry of the top film area, and the latter highlights the light transmission boundary at the root of the thread. The two frames together constitute a set of external multi-source optical characterization images of the bottle cap. Furthermore, the feature extraction unit performs edge detection and gradient calculation on the acquisition results not only to obtain the image contour, but also to extract the physical changes related to defects, such as where the brightness suddenly increases, where the transition becomes gentle, and where the boundary is distorted. The characteristics of local reflective topological distortion mainly come from the bending, breakage, eccentricity or abnormal aggregation of reflective stripes; the characteristics of transmittance gradient distribution mainly come from whether the transition mode of the transmittance boundary from the inside to the outside and from bright to dark changes; the former can better reflect the positional relationship of the internal structure, while the latter can better reflect the change of the light path after the liquid enters the gap. As an anomaly handling mechanism, if there are printed characters, inkjet codes, or shipping scratches on the surface of a bottle cap, which may interfere with edge detection, the feature extraction unit can first call the structural prior template to limit the feature extraction to the threaded area, the top membrane boundary area, and the central membrane breakage area, so as to avoid including irrelevant textures in the analysis. If an image at a certain angle becomes invalid due to occlusion, it is allowed to use the remaining valid angle to complete the downgrade extraction, but an integrity mark will be attached for the subsequent stage to determine whether a re-shoot is needed; At the same production line inspection station, when a bottle cap is illuminated by a top axial light source, the image acquisition unit captures that the reflective rings in the top film area are not evenly distributed around the geometric center. The side-scan light source illuminates the threaded area of ​​the bottle cap, and a local bright band extending along the root of the thread appears in the refracted image; the feature extraction unit extracts the reflective topological distortion from the former and the transmittance gradient change from the latter, forming two types of core features required for subsequent gateway processing. The purpose of this step / mechanism is to transform internal anomalies that are difficult to identify with the naked eye into separable, calculable, and traceable external feature evidence through optical acquisition methods specifically designed for the solid-liquid coupling characteristics of multi-layered covers.

[0030] In a preferred embodiment of the present invention, the dynamic convergence unit is configured to: acquire the pixel change frequency in an external multi-source optical characterization image corresponding to the local reflective topological distortion features; And when the pixel change frequency is higher than the preset frequency threshold, the dynamic light and shadow adaptive convergence coefficient is set to the first preset value; And when the pixel change frequency is lower than or equal to the preset frequency threshold, the dynamic light and shadow adaptive convergence coefficient is set to the second preset value. The first preset value is greater than the second preset value.

[0031] This embodiment provides a dynamic light and shadow adaptive convergence mechanism. Specifically, in the aforementioned gateway scheme, low-confidence anomalies will enter the suppression process. However, if the suppression strength remains fixed, two problems still exist: First, when the dynamic light and shadow adaptive convergence coefficient is higher than the first preset value, weak defect features will be lost; second, when it is lower than the second preset value, high-frequency transient noise on the high-speed conveyor line cannot be filtered out. Therefore, this embodiment further utilizes the pixel change frequency to determine whether the current anomaly is more like dynamic interference or a stable defect. Specifically, the pixel change frequency here reflects the degree of anomalous pattern jumping in consecutive sampling frames; the real defect is attached to the cap structure, and as long as the change in the cap posture is within the preset tolerance range, the corresponding anomaly will usually appear stably in the preset spatial neighborhood. Ambient light and shadow noise, such as reflections from flowing water, condensation dripping, and flashing of metal edges, often change, drift, or disappear rapidly within a short period of time. To facilitate understanding, a feature data processing example can be used: if a bright spot appears sequentially in region A, region C, and region B in three consecutive frames, and the brightness is in a high-frequency alternating state, it can be regarded as a high-frequency change; if it is stably attached to the same position near the thread in three consecutive frames, it can be regarded as a low-frequency change. Furthermore, when the pixel change frequency is higher than the frequency threshold, the dynamic convergence unit determines that there is dynamic ambient light and shadow noise, and increases the dynamic light and shadow adaptive convergence coefficient to the first preset value. Its effect is to more effectively compress the influence of such rapidly changing signals in subsequent features, prioritizing the protection of structurally stable anomalies; Conversely, when the pixel change frequency is lower than or equal to the frequency threshold, it indicates that the current lighting environment is relatively stable. At this time, the convergence coefficient is reduced to avoid over-smoothing of minor but real defects. The two preset values ​​here can be understood as two levels of suppression intensity: high for noise-dominated environments and low for evidence-preserving environments. Specifically, to ensure the suppression process has clear quantitative derivation, the execution logic for suppressing non-defect optical changes in local reflective topological distortion features using dynamic light and shadow adaptive convergence coefficients is as follows: The system uses formulas Real-time calculation of dynamic light and shadow adaptive convergence coefficients When it is determined that there is dynamic ambient light and shadow noise and the pixel change frequency At higher levels, the exponentially decaying term Approaching the minimum value, the convergence coefficient decreases, and further low confidence is used to adaptively down-adjust the intensity of noise features. On this basis, the original abnormal brightness values ​​of each optical change connected domain in the local reflective topological distortion features are extracted, and the original abnormal brightness values ​​are weighted and attenuated using the currently adopted dynamic light and shadow adaptive convergence coefficient to suppress the optical feature weights of high-frequency jumping regions. When dynamic ambient light and shadow noise is detected, the dynamic light and shadow adaptive convergence coefficient is increased to the first preset value, thereby significantly reducing the original abnormal brightness value; when the ambient light and shadow are stable, it is reduced to the second preset value, thereby retaining most of the original abnormal brightness for subsequent analysis. Furthermore, the frequency threshold can be determined by combining the conveyor line cycle time, camera frame rate, and the dwell time of the bottle cap through the detection window; its essence is not an arbitrary empirical value, but rather reflects the time stability that a real structural anomaly should have under this working condition. For example, if the bottle cap stably passes through two sampling cycles within the detection window, the structural anomaly will usually remain in a similar position for at least those two cycles; if it only flashes in a single frame, it is often closer to external reflective disturbances. As an anomaly handling mechanism, if the camera causes uneven inter-frame intervals due to network latency or buffer jitter, the dynamic convergence unit can first perform normalization judgment based on the timestamp to avoid mistaking the timing instability of the acquisition system itself as ambient light and shadow noise. If the bottle cap itself has an abnormally high rotational angular velocity, causing structural abnormalities to move rapidly in the image, the system can combine the attitude compensation results to correct the frequency judgment and prevent the real defects from being suppressed. If the number of sampling frames is insufficient, frequency-driven adaptive convergence will not be enabled, and the process will fall back to the basic confidence filtering procedure. On the same honey production line, at a certain time, due to condensation dripping onto the inside of the protective cover, a bright spot appeared in the captured image that moved rapidly. The gateway module detects that the positions of these bright spots change significantly in consecutive frames and the pixel change frequency exceeds the threshold. Therefore, it increases the dynamic light and shadow adaptive convergence coefficient to quickly reduce the influence of this type of signal. The abnormal bright band at the root of the thread of the other bottle cap was basically fixed in position in the continuous frames. The system maintained a low suppression intensity for it, so that the abnormality was retained and entered into the subsequent defect inference. The purpose of this step / mechanism is to dynamically adjust the suppression intensity based on the temporal stability of the abnormal signal, so that the system can suppress rapid noise in the field without sacrificing its ability to preserve weak real defects.

[0032] In a preferred embodiment of the present invention, the fluid permeation state characterizes the capillary permeation phenomenon generated by the high viscosity fluid in the local gaps of the multi-layer nested structure; the mechanical structure failure state characterizes the physical positional displacement of the internal membrane structure inside the multi-layer nested structure.

[0033] This embodiment provides a physical definition mechanism for internal latent defect states. Specifically, in the aforementioned cloud platform solution, the system outputs fluid permeation state and mechanical structure failure state. However, in order to make the judgment results have clear engineering meaning, this embodiment further defines the actual failure mechanisms corresponding to these two types of states, thereby ensuring that the output conclusions can be used for subsequent process traceability and equipment maintenance. Specifically, the fluid permeation state corresponds to the capillary permeation phenomenon of high-viscosity fluid in the local gaps of a multi-layered nested structure; for a split honey water bottle cap, honey is usually sealed in the storage cavity and should not enter the thread gap, sealing boundary or the outer edge of the top film before leaving the factory under normal conditions. When the sealing film has micropores, poor sealing, poor interlayer bonding, or micro-cracks at the edge of the liquid storage cavity, the honey will slowly migrate along the tiny gaps under capillary action. Because honey has a high refractive index and viscosity, once it enters a gap where fluid should not be present, it will change the light transmission transition and reflective continuity of that area; therefore, the system defines this kind of internal permeation phenomenon reflected by abnormal optical paths as a fluid permeation state. Furthermore, the mechanical structure failure state corresponds to the physical positional shift of the internal membrane rupture structure; such bottle caps are usually equipped with a press-type or puncture-type liquid release mechanism, which is required to maintain a predetermined position near the axis of the cap body so that the membrane can be accurately punctured and honey released when the consumer opens it; If the mechanism is misaligned due to assembly eccentricity, injection molding deformation, heat sealing tension, or transportation vibration, even if the appearance outline is not obviously abnormal, the reflective topology of the top film area and the central area will lose its original symmetry; accordingly, the system defines the state related to the deviation of the central axis, the tilting of the punctured component, or the jamming of the local structure as the mechanical structure failure state. For ease of understanding, a very simple example can be used: if the light transmission in the threaded area of ​​the combined sequence is abnormally significant while the reflection in the central area is basically symmetrical, then it is judged to be dominated by fluid penetration; If the reflective ring in the central area is eccentric while the light transmission in the threaded area changes little, it is judged that mechanical structure failure is the main cause; if both types of anomalies occur together, a composite anomaly state can be output, indicating that the sample has both sealing risk and opening function failure risk. As an anomaly handling mechanism, if an anomaly has both fluid and structural characteristics, but the evidence is insufficient to clarify the primary and secondary relationship, the system can first output a composite suspicious state, along with a priority re-examination suggestion. If only weak light transmission anomaly is observed without a clear physical path to support it, it should not be directly defined as fluid infiltration, but should first be classified as an observation sample to prevent material texture differences from being misjudged as leakage. If there is a reflective deviation in the central area but it is consistent with the known mold texture direction, it is necessary to verify it in conjunction with the mold batch information to avoid misinterpreting the manufacturing texture stability deviation as structural failure. In this honey production line, after the system analyzed a batch of online samples, it was determined that some bottle caps had continuous abnormal bright bands extending in the circumferential direction in the threaded area. Upon disassembly and verification, it was confirmed that there were honey residues adhering to the inner layer gaps. Therefore, these samples were classified as fluid permeation state. Although no obvious leakage was found in another part of the samples, the reflective ring in the top membrane area was off-center from the center of the cover. After verification, it was confirmed that the puncture part was misaligned, so it was classified as a mechanical structure failure. The purpose of this step / mechanism is to establish a direct physical failure meaning for the defect categories output by the system, so that the detection results can be used not only for sorting, but also for locating problems in the sealing process and assembly process.

[0034] In a preferred embodiment of the present invention, both the feature processing gateway module and the image acquisition terminal module include: a data compression unit, used to compress local reflective topological distortion features and transmittance gradient distribution features based on a preset encoding algorithm, and to transmit the compressed feature data based on a block transmission strategy.

[0035] This embodiment provides a feature data compression and block transmission mechanism; specifically, in the aforementioned basic scheme, the image acquisition terminal and gateway module need to continuously process a large number of bottle cap samples; if each sample uploads a complete original image, it will not only occupy communication bandwidth exceeding the preset load, but also increase the cloud platform waiting time and affect the timeliness of online early warning; Therefore, this embodiment only compresses the extracted local reflective topological distortion features and transmittance gradient distribution features, and adopts a block transmission strategy to achieve efficient collaboration between the field side and the cloud side. Specifically, the data compression unit prioritizes retaining structured features directly related to defect judgment, such as abnormal locations in the threaded area, the direction of reflection eccentricity in the top film area, and the sequence of changes in the circumferential light transmission gradient, while compressing and weakening background details that are less related to defects. The core reason for doing this is that what cloud platforms really need is the form and positional relationship of defective evidence, rather than every texture detail of the entire image; To facilitate understanding, a feature data processing example can be used: After the original extraction of a sample, it contains four feature segments P1, P2, P3, and P4, where P1 and P3 are the core anomaly segments, and P2 and P4 are context auxiliary segments. In the compression process, P1 and P3 can be preserved more precisely, while P2 and P4 can be encoded more compactly. Furthermore, the block transmission strategy can divide data blocks according to structural regions, time order, or feature types; for example, the light transmission characteristics of the threaded area can be used as the first block, the distortion characteristics of the top film area as the second block, and the comprehensive index of the entire cover as the third block. In this way, even if there are momentary fluctuations in the network, the cloud platform can receive the most critical anomaly blocks first and start preliminary inference, without having to wait for all the data to be complete before starting processing; for production lines with transmission rates higher than the preset cycle threshold, this method of prioritizing critical data and then supplementing data meets the control command latency indicators set by the system. Furthermore, both the image acquisition terminal and the gateway module can be configured with a data compression unit. The former is responsible for compressing the initial features extracted on site and sending them to the gateway, while the latter combines the environmental screening results to perform secondary compression and recombination before sending them to the cloud. The division of labor between the two-level compression helps reduce the burden on edge links while preserving sufficient structural semantics and avoiding premature loss of abnormal details that may affect the final decision. As an anomaly handling mechanism, if a sample is determined to be a high-risk sample, for example, if the cloud platform initially infers that it is a composite anomaly or a continuous batch anomaly, the system can skip the strong compression mode and instead upload a higher-fidelity feature block, and if necessary, attach a cropped fragment of the original image for review and analysis. If a non-critical block is lost during the segmented transmission, the cloud platform can first make a preliminary judgment based on the received critical blocks and mark the incompleteness in the result; if the critical block is lost, the automatic judgment is paused and the process of retransmission or re-photographing is initiated. During peak hours on this honey and aquatic product line, a large number of bottle caps pass through the inspection station every minute. The image acquisition terminal first compresses the light transmission characteristics of the threaded area and the distortion characteristics of the top film area of ​​each bottle cap into two main data blocks and sends them to the gateway. After the gateway completes noise filtering, it prioritizes uploading the structural blocks with the most obvious anomalies to the cloud platform. After receiving the main block, the cloud platform can determine whether there is an increased risk of leakage in a certain batch and promptly issue an early warning to the sorting organization or the upstream capping station. Subsequent auxiliary blocks are then used to improve records and traceability. The purpose of this step / mechanism is to reduce the transmission burden in large-scale online detection and improve the cloud platform's response speed to production line anomalies without sacrificing evidence of critical defects.

[0036] In a preferred embodiment of the present invention, the cascaded inference cloud platform module and the feature processing gateway module include a real-time channel and an asynchronous channel, wherein the real-time channel adopts a physically isolated independent network for transmitting internal latent defect status and early warning control instructions; The asynchronous channel uses wireless communication standards to transmit compressed feature data and model update parameters, which are used to update the preset cascaded mapping inference model.

[0037] This embodiment provides a dual-channel communication mechanism; specifically, in the aforementioned compression and block transmission scheme, although the amount of data has been reduced, there is still a deeper problem in the industrial field: the defect judgment results and control commands require low latency and strong determinism, while the feature data backhaul and model update emphasize throughput and flexibility. If the two types of services are used together on the same link, in the event of bandwidth contention, there may be an unreasonable situation where control commands arrive late while data packets arrive first; therefore, this embodiment divides the cloud platform and the gateway into a real-time channel and an asynchronous channel. Specifically, the real-time channel adopts a physically isolated independent network to carry internal latent defect status and early warning control instructions; the significance of the independent network is to ensure that key instructions such as whether to remove the bottle cap, whether to reduce the current capping head cycle time, and whether to switch the re-inspection mode are not affected by the large-volume transmission of feature data. The amount of information transmitted on this channel is usually lower than the first data volume threshold, but the timeliness and reliability requirements meet the preset real-time indicators. Therefore, it is suitable to use fixed priority, fixed routing and acknowledgment feedback mechanism. As a simplified example of channel allocation: when the cloud platform outputs sample number N as a mechanical structure failure state, the real-time channel immediately sends the result to the production line execution end, and the execution end then returns a status code indicating that the sample has been rejected or that the execution failed, thus forming a closed loop; Furthermore, the asynchronous channel adopts a wireless communication standard to transmit compressed feature data and model update parameters. Since this data is often larger than the second data volume threshold and has a higher latency tolerance than the real-time channel, it is suitable for processing in batch, buffer, and retransmission mode. Feature data can be used for post-event playback, statistical analysis, and model training on the cloud platform. Model update parameters are sent from the cloud platform to the gateway or terminal to ensure that the detection strategy for subsequent batches is consistent with the latest model. The two types of data use asynchronous channels to avoid occupying critical control links. Furthermore, the dual-channel design facilitates business tiering; the real-time channel emphasizes addressing current risks first, while the asynchronous channel emphasizes optimizing future judgments. In this way, when the network pressure on the production line increases for a short period of time, the system can still ensure that the rejection of defective products and the early warning action are completed first, while the incremental synchronization of the model and the backhaul of historical features can be completed later. As an emergency response mechanism for abnormal situations, if the asynchronous channel is interrupted, the system can still rely on the real-time channel to maintain online judgment and elimination control under the current model version, but the uploading of historical features and the distribution of new models will be suspended. If an anomaly occurs in the real-time channel, the system enters a safe mode, which can temporarily increase the on-site re-inspection ratio or trigger a local conservative rejection strategy, while prohibiting the execution of unconfirmed remote model switching. If both channels are congested at the same time, the real-time channel will be restored first, and all asynchronous services will be transferred to the buffer queue and retransmitted in timestamp order after the link is restored. During the continuous operation of the same honey production line, the cloud platform detected that the risk of mechanical structure failure of a sample corresponding to a certain capping head was rapidly increasing. Therefore, it immediately issued a control command through the real-time channel to locate the capping head and trigger a shutdown inspection. Meanwhile, the compressed feature data of this batch and the model update parameters used to improve structural deviation identification are continuously transmitted in the background via an asynchronous channel. Even if the asynchronous channel experiences a short delay due to wireless interference in the workshop, on-site rejection and shutdown warnings can still be completed in a timely manner through the independent networked real-time channel; The purpose of this step / mechanism is to ensure the real-time reliability of critical processing actions on the production line by separating control information from business feature data, while also taking into account the transmission capacity required for feature accumulation and continuous model optimization.

[0038] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the patent coverage of this invention.

Claims

1. A beverage bottle cap defect detection system based on image recognition, characterized in that, The system includes: The image acquisition terminal module includes a light source projection unit and an image acquisition unit, used to project multi-angle structured light onto a target object and acquire an external multi-source optical characterization image of the target object under the illumination of the multi-angle structured light, wherein the target object is a beverage bottle cap with a multi-layer nested structure and an internal perforated structure; the image acquisition terminal module is also used to perform noise reduction and image correction preprocessing on the external multi-source optical characterization image, and input the preprocessed image to the feature extraction unit for edge detection and gradient calculation to extract local reflective topological distortion features and transmittance gradient distribution features; The feature processing gateway module is connected to the image acquisition terminal module. It is used to receive the local reflective topological distortion features and the transmittance gradient distribution features, calculate the optical topological distortion confidence level based on a preset ambient light noise model containing ambient light distribution parameters, and filter the local reflective topological distortion features according to the optical topological distortion confidence level to generate target distortion features. The cascaded inference cloud platform module is used to construct a multi-source optical feature sequence based on the transmittance gradient distribution characteristics and the target distortion characteristics, and to use the multi-source optical feature sequence as input to a preset cascaded mapping inference model containing a multi-layer feature mapping network. The cascaded mapping inference model is a multi-classifier model built based on a deep convolutional neural network. Based on the output classification probability distribution characteristics of the preset cascaded mapping inference model, the internal latent defect state is determined by mapping the highest probability category. The classification probabilities of different dimensions output by the model correspond to the occurrence probabilities of the fluid infiltration state and the mechanical structure failure state, respectively. The module generates a final investigation result containing early warning control instructions based on the internal latent defect state.

2. The image recognition-based beverage bottle cap defect detection system according to claim 1, characterized in that, The feature processing gateway module includes: The confidence calculation unit is used to combine the ambient light noise model with a preset internal fluid permeation model containing fluid distribution parameters to calculate the feature similarity between the local reflective topological distortion features and the standard features constructed based on the ambient light distribution parameters and the fluid distribution parameters. The standard features are constructed by fusing the background illumination matrix extracted from the ambient light noise model and the desired distortion morphology matrix generated by the internal fluid permeation model using the following formula: ;in, For the aforementioned standard features, The background illumination matrix corresponding to the ambient light distribution parameters. The desired distortion shape matrix corresponding to the fluid distribution parameters. and The preset distribution weight coefficients are used; the feature similarity is obtained by calculating the cosine similarity between the spatial feature vector of the local reflective topological distortion feature and the spatial feature vector of the standard feature, and the feature similarity is used as the confidence level of the optical topological distortion. A dynamic convergence unit is used to calculate a dynamic light and shadow adaptive convergence coefficient when the confidence level of the optical topological distortion is lower than a preset confidence threshold. The formula for calculating the dynamic light and shadow adaptive convergence coefficient is as follows: in, The adaptive convergence coefficient for the dynamic light and shadow is... To obtain the pixel change frequency corresponding to the local reflective topological distortion feature in consecutive image frames. The confidence level for the optical topological distortion is given. , and All are preset convergence adjustment constants, and the dynamic light and shadow adaptive convergence coefficient is used to suppress non-defect optical changes in the local reflective topological distortion features; The feature filtering unit is used to retain the local reflective topological distortion features to generate the target distortion features when the confidence level of the optical topological distortion is higher than or equal to the preset confidence level threshold.

3. The image recognition-based beverage bottle cap defect detection system according to claim 1, characterized in that, The cascaded inference cloud platform module includes: A sequence construction unit is used to align the transmittance gradient distribution features and the target distortion features in terms of feature dimensions to construct the multi-source optical feature sequence. A weight allocation unit is used to assign cross-domain feature concatenation weights to different feature dimensions in the multi-source optical feature sequence; The defect inference unit is used to input the multi-source optical feature sequence after assigning the cross-domain feature cascade weights into the preset cascade mapping inference model to output the internal latent defect state, wherein the internal latent defect state includes fluid permeation state and mechanical structure failure state.

4. The image recognition-based beverage bottle cap defect detection system according to claim 3, characterized in that, The cascaded inference cloud platform module also includes: The mapping rate evaluation unit is used to compare the inference results of the internal latent defect state in each key structural dimension with the corresponding real state in a preset real defect sample library containing real defect labels, and determine the latent defect representation mapping rate based on the proportion of structural dimensions that match the comparison. The model update unit is used to adjust the cross-domain feature cascade weights and update the preset cascade mapping inference model when the latent defect representation mapping rate is lower than a preset mapping rate threshold; and to keep the preset cascade mapping inference model unchanged when the latent defect representation mapping rate is higher than or equal to the preset mapping rate threshold.

5. The image recognition-based beverage bottle cap defect detection system according to claim 1, characterized in that, The image acquisition terminal module further includes a feature extraction unit, used to perform edge detection and gradient calculation on the external multi-source optical characterization image to extract the local reflective topological distortion features and the transmittance gradient distribution features.

6. The image recognition-based beverage bottle cap defect detection system according to claim 2, characterized in that, The dynamic convergence unit is configured to: acquire the pixel change frequency in the external multi-source optical characterization image corresponding to the local reflective topological distortion feature; And when the pixel change frequency is higher than a preset frequency threshold, the dynamic light and shadow adaptive convergence coefficient is set to a first preset value; And when the pixel change frequency is lower than or equal to the preset frequency threshold, the dynamic light and shadow adaptive convergence coefficient is set to a second preset value; Wherein, the first preset value is greater than the second preset value.

7. The image recognition-based beverage bottle cap defect detection system according to claim 3, characterized in that, The fluid permeation state characterizes the capillary permeation phenomenon of high-viscosity fluid in the local gaps of the multi-layered nested structure. The mechanical structure failure state characterizes the physical positional offset of the internal membrane structure within the multi-layered nested structure.

8. The image recognition-based beverage bottle cap defect detection system according to claim 1, characterized in that, Both the feature processing gateway module and the image acquisition terminal module include: The data compression unit is used to compress the local reflective topological distortion features and the transmittance gradient distribution features based on a preset encoding algorithm, and to transmit the compressed feature data based on a block transmission strategy.

9. The image recognition-based beverage bottle cap defect detection system according to claim 8, characterized in that, The cascaded inference cloud platform module and the feature processing gateway module include a real-time channel and an asynchronous channel. The real-time channel adopts a physically isolated independent network and is used to transmit the internal latent defect status and the early warning control command. The asynchronous channel adopts a wireless communication standard to transmit the compressed feature data and model update parameters, which are used to update the preset cascaded mapping inference model.