Liquid packaging bottle production equipment control method and system based on visual detection

CN122966622APending Publication Date: 2026-10-23GUANGDONG ZHONGKAI PLASTIC IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611235427.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-14
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0005]本发明提供了一种基于视觉检测的液体包装瓶生产设备控制方法及系统,以解决现有技术中存在的高速生产环境下缺陷检测与设备参数动态调整严重脱节的问题

Benefits of technology

(1)本发明通过利用预先训练的缺陷识别模型提取深层图像特征,并结合几何参量提取逻辑对缺陷进行像素级的定量描述,进而在多元加权回归模型中融合环境运行数据进行特征映射。由此,本发明改变了现有技术中仅依赖定性视觉报警或固定参数设置的局限,通过将隐蔽部位的微观几何特征,如裂纹偏移量,与宏观环境变量,如相对湿度进行深度数理融合,实现了从视觉信息到设备执行参数,吹塑压力、灌装时间的精准量化映射。最终解决了复杂生产环境下细微缺陷识别精度不足及参数调整缺乏依据的技术问题,提升了包装瓶的生产质量一致性;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122966622A_ABST
    Figure CN122966622A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of computer vision, and discloses a liquid packaging bottle production equipment control method and system based on visual inspection, the method comprising obtaining environmental operation data of a liquid packaging bottle production line, line transmission speed and bottle local image blocks; inputting the bottle local image blocks into a pre-trained defect recognition model to perform feature mapping and extract contours, obtaining defect space geometric parameters; performing feature mapping according to the defect space geometric parameters, the defect category label and the environmental operation data, obtaining an equipment parameter correction amount; comparing single bottle movement time and instruction response time to obtain a timing matching result, generating a rejection control instruction and generating a parameter update instruction using the equipment parameter correction amount. The method can realize high-speed line defect detection and dynamic closed-loop control of equipment parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision technology, and in particular to a control method and system for liquid packaging bottle production equipment based on visual inspection. Background Technology

[0002] With the widespread adoption of automated production lines, the inspection of the integrity and consistency of liquid packaging bottles under high-speed operation has become a crucial aspect of the manufacturing industry.

[0003] In existing technologies, quality control typically relies on manual, timed sampling or traditional visual inspection methods based on fixed thresholds. These solutions primarily depend on static image comparison to screen for defective products. However, when faced with diverse bottle shapes, material properties, and dynamic fluctuations in production speed, basic inspection alone is insufficient to accurately identify extremely subtle local defects such as minute cracks in the bottle neck thread or hidden stains on the bottle bottom. To improve defect identification capabilities, some solutions attempt to introduce basic visual intelligence algorithms for offline or non-real-time analysis. However, this directly leads to a severe disconnect between the inspection and production control processes. When defects occur during high-speed operation of production equipment, the lack of real-time defect spatial feature quantification capabilities and immediate equipment parameters, such as blow molding pressure and filling time, along with a linkage feedback mechanism, means that parameter issuance and adjustment often lag significantly behind the occurrence of physical defects. This prevents the equipment from adaptively correcting itself based on the actual quality status of the work-in-process, resulting in continuous quality degradation and low production line efficiency.

[0004] Existing technologies suffer from a serious disconnect between defect detection and dynamic adjustment of equipment parameters in high-speed production environments. Summary of the Invention

[0005] This invention provides a control method and system for liquid packaging bottle production equipment based on visual inspection, in order to solve the problem of serious disconnect between defect detection and dynamic adjustment of equipment parameters in high-speed production environments in the prior art.

[0006] In a first aspect, to address the aforementioned technical problems, this invention provides a vision-based detection-based control method for liquid packaging bottle production equipment, comprising: acquiring environmental operating data, production line transmission speed, and partial image blocks of the bottle body from the liquid packaging bottle production line; inputting the partial image blocks of the bottle body into a pre-trained defect recognition model for feature mapping to obtain the probability of defect occurrence; when the probability of defect occurrence is greater than a preset probability threshold, determining the existence of a corresponding defect and recording a defect category label; simultaneously extracting the contour of the partial image blocks of the bottle body to obtain spatial geometric parameters of the defect; performing feature mapping based on the spatial geometric parameters of the defect, the defect category label, and the environmental operating data to obtain a correction amount for equipment parameters; performing time-delay extrapolation based on the production line transmission speed to obtain the movement time of a single bottle, acquiring the command response time of the control equipment, and comparing the movement time of a single bottle with the command response time to obtain a timing matching result; generating a rejection control command for the current defective bottle based on the timing matching result, and generating a parameter update command for subsequent empty bottles using the correction amount of equipment parameters to control the production of liquid packaging bottles.

[0007] Secondly, the present invention provides a control system for a liquid packaging bottle production equipment based on vision detection, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method described above.

[0008] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.

[0009] Compared with the prior art, the present invention has the following beneficial effects: (1) This invention extracts deep image features using a pre-trained defect recognition model and combines it with geometric parameter extraction logic to quantitatively describe defects at the pixel level. Then, it integrates environmental operating data into a multivariate weighted regression model for feature mapping. Thus, this invention overcomes the limitations of existing technologies that rely solely on qualitative visual alarms or fixed parameter settings. By deeply fusing the microscopic geometric features of hidden parts, such as crack offset, with macroscopic environmental variables, such as relative humidity, it achieves precise quantitative mapping from visual information to equipment execution parameters, such as blow molding pressure and filling time. Ultimately, it solves the technical problems of insufficient accuracy in identifying subtle defects and lack of basis for parameter adjustment in complex production environments, improving the consistency of packaging bottle production quality. (2) This invention obtains the movement time of a single bottle by performing a delay calculation based on the production line transmission speed, and generates a timing matching result by comparing it with the equipment command response time. This, in turn, collaboratively generates spatial rejection commands and parameter update commands. Thus, this invention breaks away from the inefficient control mode of traditional technology where stopping or slowing down for adjustment is the immediate response upon discovering a defect. By using timing matching logic to precisely pinpoint the defect, it ensures that defective entities are accurately tracked and rejected, and that the corrected process parameters are precisely applied to subsequent empty bottles entering the workstation. Ultimately, it achieves dynamic closed-loop parameter repair without interrupting the high-speed production flow, effectively eliminating response lag in production control and improving the overall line operating efficiency. Attached Figure Description

[0010] Figure 1 This is a schematic diagram of the control method for liquid packaging bottle production equipment based on vision detection provided in the first embodiment of the present invention. Detailed Implementation

[0011] 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.

[0012] Reference Figure 1 The first embodiment of the present invention provides a control method for liquid packaging bottle production equipment based on vision detection, including the following steps: S1, acquire environmental operation data, production line transmission speed and local image blocks of the bottle body of the liquid packaging bottle production line; S2, input the local image block of the bottle into the pre-trained defect recognition model for feature mapping to obtain the probability of defect occurrence. When the probability of defect occurrence is greater than the preset probability threshold, determine that there is a corresponding defect and record the defect category label. At the same time, extract the contour of the local image block of the bottle to obtain the defect spatial geometric parameters. S3, perform feature mapping based on the defect space geometric parameters, the defect category labels, and the environmental operation data to obtain the equipment parameter correction amount; S4. Based on the production line transmission speed, the delay is calculated to obtain the single bottle movement time, the command response time of the control equipment is obtained, and the single bottle movement time is compared with the command response time to obtain the timing matching result. S5. Generate a rejection control instruction for the current defective bottle based on the timing matching result, and generate a parameter update instruction for subsequent empty bottles using the equipment parameter correction amount, so as to control the production of liquid packaging bottles.

[0013] In step S1, environmental operating data, production line transmission speed, and partial image blocks of the bottle are acquired from the liquid packaging bottle production line. In one implementation, both environmental operating data and production line transmission speed are acquired. It should be noted that the environmental operating data includes real-time temperature and humidity values ​​within the production workshop. In this embodiment, temperature and humidity sensors deployed at the workstations of the liquid packaging bottle production line continuously read analog temperature and humidity signals, converting the corresponding analog signals into digital quantities to obtain the environmental operating data. Simultaneously, this embodiment extracts the real-time pulse frequency of the rotary encoder connected to the main conveyor belt drive shaft by reading register data from the main control programmable logic controller of the liquid packaging bottle production line; the real-time pulse frequency is multiplied by a preset conveyor belt transmission ratio constant, and algebraic conversion is performed to obtain the production line transmission speed. It is worth noting that the preset conveyor belt transmission ratio constant is directly obtained by consulting the factory calibration parameters on the mechanical nameplate of the main conveyor belt reducer.

[0014] In one implementation, a local image patch of the bottle is acquired. This embodiment uses an industrial camera fixed above the production line conveyor belt to acquire raw color image data of the liquid packaging bottle. This embodiment performs grayscale conversion on the raw color image data. Specifically, using the perceptual brightness weighting of the NTSC standard, the red, green, and blue channel values ​​of each pixel in the raw color image data are extracted; the red channel value is multiplied by 0.299, the green channel value by 0.587, and the blue channel value by 0.114; the above three products are then summed algebraically, and the sum is determined as the grayscale value of the corresponding pixel, generating a two-dimensional grayscale image matrix.

[0015] This embodiment utilizes the Canny edge detection algorithm to extract edges from the two-dimensional grayscale image matrix, obtaining a binary edge image matrix. It should be noted that the Canny edge detection algorithm involves preset low and high thresholds. The preset low and high thresholds are determined as follows: A preset number of historical normal and abnormal bottle image samples are obtained; the global pixel gradient magnitude of all image samples is calculated, and a cumulative probability density function curve of the global gradient magnitude is plotted; the physical gradient magnitude corresponding to a cumulative probability density of 60% is extracted and determined as the preset low threshold; the physical gradient magnitude corresponding to a cumulative probability density of 90% is extracted and determined as the preset high threshold.

[0016] This embodiment performs dilation and erosion sequentially on the edge binary image matrix. Specifically, a 3×3 rectangular structuring element is used to perform morphological connectivity processing on the set of non-zero pixels in the edge binary image matrix. It should be noted that the 3×3 size is chosen based on the physical prior calibration that the theoretical minimum imaging width of common micro-cracks and bubbles on the bottle surface is approximately 2 to 3 pixels under the current working object distance and resolution of the high-speed camera. After performing the connectivity processing, a set of closed region contours is generated. Subsequently, this embodiment calls the flood filling algorithm to perform pixel filling operations on the internal holes of the closed region contour set, generating solid connected components. The total number of pixels contained in the interior of each independent contour in the solid connected component is extracted and determined as the contour area value. The contour area value is compared with a preset area threshold; when the contour area value is greater than the preset area threshold, the maximum bounding rectangle boundary of the corresponding contour is extracted; according to the coordinate system dimension of the maximum bounding rectangle boundary, matrix cropping is performed from the original color image data to output the local image block of the bottle.

[0017] It is worth noting that the method for determining the preset area threshold is as follows: The theoretical minimum imaging physical area pixel value of the target bottle neck thread and the target bottle bottom under the current industrial camera focal length and working object distance is obtained; this theoretical minimum imaging physical area pixel value is multiplied by a tolerance coefficient of 0.8, and a product operation is performed. Specifically, the tolerance coefficient of 0.8 is calculated by photographing a standard bottle when the production line is stationary, calculating the theoretical pixel area of ​​the target area, photographing the same bottle while the production line is running at its highest speed, repeating the measurement 20 times to obtain an actual area sequence, taking the minimum value of this sequence, dividing the minimum value by the theoretical pixel area to obtain a coefficient. If this coefficient is greater than 0.8, then 0.8 is used; otherwise, the coefficient is used. The result of the product operation is determined as the preset area threshold.

[0018] For example, this embodiment acquires environmental operating data of a current ambient temperature of 25 degrees Celsius and a relative humidity of 40%, as well as a production line transmission speed of 500 meters per minute, through a temperature and humidity sensor and a rotary encoder; these values ​​are only examples, and the actual speed is determined based on the production line configuration. An industrial camera captures raw color image data with a single frame resolution of 1920×1080 pixels. The system performs multiplication and addition operations based on perceived brightness weights to convert it into a two-dimensional grayscale image matrix. Subsequently, based on historical statistical distribution, the system calls a preset low threshold of 50 and a preset high threshold of 150 to execute the Canny algorithm, and uses a 3×3 structuring element to complete dilation and erosion, obtaining a closed region contour. The system eliminates hollow wireframe features using a flood filling algorithm, calculating the area of ​​a solid connected region to be 700 pixels. Knowing that the theoretical minimum imaging physical area pixel value for the target part is 625, multiplying it by a tolerance factor of 0.8 yields a preset area threshold of 500 pixels. The system determines that 700 is greater than 500, and therefore, based on the coordinates of the bounding rectangle of the contour, it crops and outputs the partial image block of the bottle from the original color image data.

[0019] In step S2, the local image patch of the bottle is input into a pre-trained defect recognition model for feature mapping to obtain the probability of defect occurrence. When the probability of defect occurrence is greater than a preset probability threshold, a corresponding defect is determined to exist and the defect category label is recorded. Simultaneously, the contour of the local image patch of the bottle is extracted to obtain the spatial geometric parameters of the defect. The process of inputting the local image patch of the bottle into the pre-trained defect recognition model for feature mapping to obtain the probability of defect occurrence includes: statistically analyzing the grayscale histogram of the local image patch of the bottle to generate a grayscale feature vector; inputting the local image patch of the bottle into the pre-trained defect recognition model to extract multi-layer features to obtain a deep image feature vector; concatenating the grayscale feature vector with the deep image feature vector to obtain a fused feature vector; and inputting the fused feature vector into the pre-trained defect recognition model to calculate a nonlinear mapping, outputting the probability of crack occurrence and the probability of stain occurrence.

[0020] In one implementation, a grayscale histogram is plotted on a local image patch of the bottle to generate a grayscale feature vector. Specifically, the number of pixels in the local image patch whose values ​​fall within any of the 256 grayscale ranges from 0 to 255 is counted; the number of pixels in each grayscale range is divided by the total number of pixels in the image patch to obtain the pixel percentage for each grayscale level; and the pixel percentages of all 256 grayscale ranges are combined to generate the one-dimensional grayscale feature vector.

[0021] It should be noted that the local image patch of the bottle is input into the pre-trained defect recognition model to extract multi-layer features, resulting in a deep image feature vector. The structure of the pre-trained defect recognition model includes a feature extraction network based on the EfficientNet-B0 architecture and a multi-layer perceptron fully connected network. In this embodiment, the local image patch of the bottle is uniformly scaled to a size of 256×256 pixels and then input into the feature extraction network. After multi-layer convolution and pooling operations, a two-dimensional feature map is extracted, and the two-dimensional feature map is flattened to output the deep image feature vector.

[0022] In this embodiment, the grayscale feature vector and the deep image feature vector are concatenated to obtain a fused feature vector. The fused feature vector is then input into the pre-trained defect recognition model to calculate a nonlinear mapping, outputting the probability of crack occurrence and the probability of stain occurrence. Specifically, the fused feature vector is input into the fully connected multilayer perceptron network, and a mapping relationship is calculated using a nonlinear activation function to output the independent probabilities of crack occurrence and stain occurrence.

[0023] It is worth noting that the probability of crack occurrence is compared with a preset crack probability threshold, and the probability of stain occurrence is compared with a preset stain probability threshold. If the probability of crack occurrence is greater than the preset crack probability threshold, a crack defect is determined to exist; if the probability of stain occurrence is greater than the preset stain probability threshold, a stain defect is determined to exist. All defect types that are determined to exist are recorded, and defect category labels are generated. When cracks and stains are detected at the same time, the defect category label set contains both crack and stain items. During subsequent process compensation, the equipment parameter correction amount can be generated according to the priority of defect severity, for example, setting the priority of cracks that cause structural damage to be higher than that of surface stains, either sequentially or by weight.

[0024] It should be noted that when the probability of the defect occurrence is less than or equal to the preset probability threshold, the system determines that there is no surface defect in the corresponding area of ​​the current local image block of the bottle. At this time, the system marks the quality status of the current bottle as qualified and releases it to the downstream production station. At the same time, it skips the subsequent contour extraction and equipment parameter deduction operations and uploads the probability detection data to the quality database to maintain the continuity of the monitoring feature sequence.

[0025] It is worth noting that the training method of the pre-trained defect recognition model is as follows: A training set is constructed by acquiring 3000 historical local image samples of bottles labeled with crack and stain bounding boxes; the optimization objective is to minimize the multi-label binary cross-entropy loss function, i.e., to independently calculate and sum the binary cross-entropy loss for each defect category; an adaptive moment estimation algorithm is used to iteratively update the weights of the network structure; the training learning rate is set to 0.0005, the batch size to 32, and the total number of training iterations to 40; iteration stops and the network node weights are fixed when the classification accuracy on the validation set no longer increases, thus completing the model training. Furthermore, the method for determining the preset crack probability threshold and the preset stain probability threshold is as follows: the classification performance of the trained model on crack and stain categories is evaluated using receiver operating characteristic (ROC) analysis; the Youden index corresponding to each probability decision point is calculated; and the probability value corresponding to the highest Youden index is determined as the corresponding preset probability threshold.

[0026] The process of extracting contours from local image blocks of the bottle to obtain defect spatial geometric parameters includes: extracting edges from the local image blocks of the bottle using the Canny edge detection algorithm to obtain a set of defect contour boundary points; fitting a geometric polygon to the set of defect contour boundary points to calculate the two-dimensional coordinates of the geometric center and the pixel size of the circumscribed bounding box; calculating the Euclidean distance between each boundary point in the set of defect contour boundary points and the two-dimensional coordinates of the geometric center, and selecting the midpoint between the boundary point with the smallest Euclidean distance and the two-dimensional coordinates of the geometric center as the starting seed point; using a region growing algorithm, accumulating connected component pixels based on the starting seed point to obtain the absolute pixel area of ​​the defect; and serializing and packaging the two-dimensional coordinates of the geometric center, the pixel size of the circumscribed bounding box, and the absolute pixel area of ​​the defect to generate defect spatial geometric parameters.

[0027] In one implementation, the Canny edge detection algorithm is used to extract edges from the local image patch of the bottle to obtain a set of defect contour boundary points. This embodiment employs the classic Canny edge detection algorithm. The detection threshold is determined by using the Otsu algorithm to calculate the maximum inter-class variance of the local image patch of the bottle. The grayscale value of this maximum inter-class variance is adaptively calibrated as the high detection threshold, and half of this high detection threshold is calibrated as the low detection threshold. Pixels in the local image patch exceeding the high detection threshold, as well as pixels connected to pixels exceeding the high detection threshold and higher than the low detection threshold, are edge-marked, and a binarized set of defect contour boundary points is output.

[0028] A geometric polygon is fitted to the set of boundary points of the defect contour, and the two-dimensional coordinates of the geometric center and the pixel size of the bounding box are calculated. Specifically, the abscissa and ordinate sequences of all marked pixels in the set of boundary points of the defect contour are extracted, and the arithmetic mean of the abscissa sequence and the arithmetic mean of the ordinate sequence are calculated respectively. These are then combined to generate the two-dimensional coordinates of the geometric center. The maximum and minimum values ​​in the abscissa sequence and the maximum and minimum values ​​in the ordinate sequence are extracted, and their differences are calculated to obtain the absolute width and absolute height values ​​of the two-dimensional bounding box, which are then determined as the pixel size of the bounding box.

[0029] Calculate the Euclidean distance between each boundary point in the defect contour boundary point set and the two-dimensional coordinates of the geometric center, and extract the boundary point with the smallest Euclidean distance. Calculate the midpoint pixel of the line connecting the two-dimensional coordinates of the geometric center and the boundary point with the smallest Euclidean distance, and determine the midpoint pixel as the starting seed point. Using a region growing algorithm, accumulate connected component pixels based on the starting seed point to obtain the absolute pixel area of ​​the defect.

[0030] It should be noted that the specific operations performed using the region growing algorithm are as follows: The spatial coordinates of the starting seed point are pushed into the search queue, and the pixel grayscale value at those coordinates is extracted as a reference mean; the adjacent unlabeled pixels in the eight-neighbor space of that point are traversed, and the absolute value of the difference between the grayscale value of the adjacent unlabeled pixels and the reference mean is calculated; the absolute value of the difference is compared with a preset growth threshold; when the absolute value of the difference is less than or equal to the preset growth threshold, the corresponding adjacent unlabeled pixels are included in the effective connected component set, and their coordinates are pushed into the search queue; the above diffusion steps are iterated until the search queue is empty. The total number of pixels contained in the final effective connected component set is counted and accumulated to obtain the absolute pixel area of ​​the defect.

[0031] It is worth noting that the method for determining the preset growth threshold is as follows: retrieve the aforementioned historical local image samples of the bottle, calculate the mean of the intra-class standard deviation of the global grayscale distribution for the pixels inside the marked defects; multiply the mean of the intra-class standard deviation by a scattering coefficient of 1.5. Considering that the grayscale distribution of the defects approximates a Gaussian normal distribution, in order to cover approximately 86.6% of the core pixels of the defects, the scattering coefficient is determined to be 1.5 based on the confidence interval characteristics of the normal distribution. The calculated envelope width value is directly labeled as the preset growth threshold.

[0032] In this embodiment, the two-dimensional coordinates of the geometric center, the pixel dimensions of the bounding box, and the absolute pixel area of ​​the defect are serialized and packaged to generate defect spatial geometric parameters. Using a JSON data exchange format, the extracted two-dimensional coordinate values, width and height dimensions, and area integer values ​​are added to corresponding key-value pairs for encapsulation, generating a structured string, which is then identified as the defect spatial geometric parameters.

[0033] For example, the Canny algorithm detects a crack, and the system extracts its contour boundary point set. The system calculates the mean of the x and y coordinates of the point set to obtain the two-dimensional coordinates of the geometric center as x-coordinate 128 and y-coordinate 134. At the same time, it calculates the extreme span to obtain the bounding box pixel size of 30 pixels wide and 10 pixels high. Since the crack is crescent-shaped, the geometric center (128, 134) falls in the normal bottle background area. The system traverses the boundary point set to calculate the distance and finds that the boundary point located at (129, 136) has the smallest Euclidean distance to the geometric center. To avoid errors caused by using the boundary transition pixels as the growth reference, the system calculates the midpoint of the line connecting the geometric center (128, 134) and the boundary point (129, 136), and after rounding the coordinates, obtains (128, 135). Therefore, (128, 135) is established as the starting seed point. The region growing algorithm uses this point as its starting point and expands outwards and accumulates the region under the condition that the preset growth threshold of 10, defined by the intra-class variance and statistical confidence interval, ultimately obtaining an absolute pixel area of ​​280 pixels for the crack defect. The system encapsulates these position, size, and area variables into a predetermined format system to generate defect space geometric parameters containing descriptions of all geometric features. If the system determines during the nonlinear mapping inference stage that the probability of crack occurrence is 0.25, which is less than the preset crack probability threshold of 0.7, and the probability of stain occurrence is 0.2, which is less than the preset stain probability threshold of 0.65, then the corresponding region of the image block is marked as qualified and uploaded to the quality monitoring database. The system then skips all the contour extraction and geometric calculation processes mentioned above.

[0034] In step S3, feature mapping is performed based on the defect space geometric parameters, the defect category labels, and the environmental operation data to obtain the equipment parameter correction amount. This includes: extracting the two-dimensional coordinates of the geometric center from the defect space geometric parameters, determining the defect space distribution location, and combining the defect space distribution location with the defect category labels to generate a defect condition index; acquiring the current production line's process operation data, which includes at least the mold cavity pressure, blowing pressure curve, and heating zone temperature distribution; inputting the defect condition index into a pre-constructed defect process causal mapping table for rule matching to extract the corresponding parameter adjustment direction and associated process parameter set; extracting the corresponding target feature data from the process operation data and the environmental operation data based on the associated process parameter set; inputting the defect space geometric parameters and the target feature data into a pre-constructed parameter dynamic compensation model for numerical mapping, and calculating and outputting the equipment parameter correction amount corresponding to the parameter adjustment direction.

[0035] In one implementation, the two-dimensional coordinates of the geometric center in the defect space geometric parameters are extracted to determine the spatial distribution of defects. These spatial distributions are then combined with the defect category labels to generate a defect condition index. Specifically, the mechanical dimensions of a standard liquid packaging bottle are obtained. Using the intrinsic and extrinsic parameter matrix of an industrial camera, the three-dimensional physical height boundaries of the bottle mouth, body, and bottom are projected onto a two-dimensional image pixel coordinate system to establish a vertical axis pixel boundary threshold. The vertical coordinate values ​​of the two-dimensional geometric center are compared with the vertical axis pixel boundary threshold to classify the spatial distribution of defects into areas such as the bottle mouth, body, or bottom. Defect category labels such as cracks, bubbles, or stains output in the previous steps are extracted and combined, for example, bottom-whitening or body-uneven wall thickness, to generate the defect condition index in string format.

[0036] The process operation data of the current production line is obtained. In this embodiment, the process operation data, including mold cavity pressure, blowing pressure curve, temperature distribution of each heating zone, and preform temperature, is obtained by reading the real-time register of the main programmable logic controller.

[0037] The defect condition index is input into a pre-constructed defect process causal mapping table for rule matching, extracting the corresponding parameter adjustment direction and associated process parameter set. It should be noted that the defect process causal mapping table is constructed based on the physical control mechanism of PET blow molding, and in the underlying system implementation, it is represented by a key-value hash table database pre-written into the system memory space. For example, for the defect condition index of "whitening at the bottom of the bottle," the physical mechanism indicates that it is caused by insufficient bottom cooling or improper stretching ratio leading to crystallization. In this case, the parameter adjustment direction output by the mapping table is to reduce the cooling water temperature at the bottom of the mold, and its associated process parameter set is the cooling water circulation temperature and ambient humidity. For the defect condition index of "bubbles on the bottle body," the physical mechanism indicates that it is caused by insufficient raw material dryness or excessive melt temperature. In this case, the parameter adjustment direction output by the mapping table is to reduce the power of the heating furnace zones, and its associated process parameter set is the temperature distribution of the heating zone and the ambient temperature.

[0038] Based on the associated process parameter set, corresponding target feature data is extracted from the process operation data and the environmental operation data. The defect spatial geometric parameters, such as the absolute pixel area of ​​the defect, are numerically mapped to the target feature data in a pre-constructed parameter dynamic compensation model, and the resulting output is the equipment parameter correction amount corresponding to the parameter adjustment direction.

[0039] It is worth noting that the dynamic parameter compensation model is not a single global model, but rather includes multiple independent sub-models for adjusting various parameters, such as temperature compensation sub-models and pressure compensation sub-models. Taking the temperature compensation sub-model for adjusting the power of the heating furnace zone as an example, its construction and training method is as follows: obtain batch data of bottle bubble defects that occurred in historical production, extract the historical defect area, historical ambient temperature, and historical initial temperature of the heating zone as input features, and use the percentage decrease in heating furnace zone power when the bubbles disappear after manual adjustment as the target label; use the gradient boosting decision tree (GBDT) algorithm to construct a regression model. To ensure model convergence and optimal fitting, this embodiment uses a grid search method to determine the core hyperparameters, sets a weak regressor, i.e., the search space for the number of regression decision trees is [50, 200] with a search step size of 10, the search space for the learning rate is [0.01, 0.1] with a search step size of 0.01, and the search space for the maximum depth of the tree is [3, 7] with a search step size of 1. During the grid search process, multiple rounds of iterative training are performed with the goal of minimizing the mean squared error (MSE) until the mean absolute error on the validation set is lower than the preset control precision, such as below 1%. Then, the hyperparameter combination that minimizes the MSE is extracted, and the model is solidified. In this embodiment, the current defect area, ambient temperature, and real-time heating zone temperature are input into the sub-model, which outputs a specific power reduction ratio. The node attributes are then encapsulated using Extensible Markup Language (EXPLAIN) to generate the final device parameter correction amount.

[0040] It is worth noting that for other parameter adjustment directions under this model system, such as cavity pressure compensation, the network structure, loss function and training optimization logic of the corresponding independent sub-model are exactly the same as the temperature compensation sub-model. It can be achieved by simply replacing the corresponding process input features and target labels according to the defect process causal mapping table and training independently. This will not be elaborated here.

[0041] In step S4, the single-bottle movement time is obtained by delay extrapolation based on the production line transmission speed, the command response time of the control equipment is obtained, and the single-bottle movement time and the command response time are compared to obtain a timing matching result. This includes: dividing the preset physical path length between workstations by the production line transmission speed to calculate the single-bottle movement time; calculating the algebraic sum of the preset network communication delay parameter and the preset mechanical execution delay parameter to obtain the command response time; comparing the single-bottle movement time and the command response time to obtain the numerical relationship, and determining the numerical relationship as the timing matching result.

[0042] In one implementation, the preset physical path length between workstations is divided by the production line transmission speed to calculate the single-bottle movement time. It should be noted that the preset physical path length between workstations is determined by obtaining the center coordinates of the current visual image acquisition workstation and the center coordinates of the downstream physical rejection workstation's actuator on the liquid packaging bottle production line; measuring the actual physical space curve distance between the center coordinates of the visual image acquisition workstation and the center coordinates of the downstream physical rejection workstation's actuator along the main conveyor belt's transmission direction; and directly defining the actual physical space curve distance as the preset physical path length between workstations. The production line transmission speed obtained in the aforementioned steps is extracted, and an algebraic division operation is performed. The preset physical path length between workstations is divided by the production line transmission speed to calculate a floating-point value representing the physical time required for the bottle to move across workstations, which is then determined as the single-bottle movement time.

[0043] It is worth noting that the command response time is obtained by algebraically summing the preset network communication delay parameter and the preset mechanical execution delay parameter. The preset network communication delay parameter is determined by continuously sending 1000 Internet Control Message Protocol (ICP-T) probe data packets to the production line's underlying programmable logic controller via a central control server; recording the round-trip time of each probe data packet; calculating the arithmetic mean of the remaining values ​​after removing the maximum and minimum values ​​from the round-trip time sequence; and determining half of this arithmetic mean as the preset network communication delay parameter for one-way transmission.

[0044] The method for determining the preset mechanical execution delay parameter is as follows: obtain the mechanical response calibration data of the underlying actuator, such as a pneumatic rejection cylinder or a pressure regulating servo valve; specifically, in an offline no-load state, use a high-speed camera to record the working scene from the moment the actuator control coil receives the level trigger signal to the moment the mechanical contact reaches the calibrated action displacement; analyze the working scene frame by frame to extract the time difference sequence between the trigger start point and the action end point; calculate the arithmetic mean of the time difference sequence obtained from multiple repeated tests, and directly calibrate it as the preset mechanical execution delay parameter.

[0045] This embodiment performs algebraic addition on the preset network communication delay parameter and the preset mechanical execution delay parameter to calculate and output the overall time consumption value including the bus communication link and the mechanical action link, thus obtaining the instruction response time. Based on this, the numerical relationship between the single-bottle movement time and the instruction response time is obtained, and this numerical relationship is determined as the timing matching result. Specifically, the numerical comparison logic between the single-bottle movement time and the instruction response time is extracted; it is determined whether the single-bottle movement time is greater than, equal to, or less than the instruction response time; a Boolean state or difference symbol reflecting the comparison judgment of the two time parameters is extracted to generate the numerical relationship; and the data set containing the numerical relationship is output as a whole and determined as the timing matching result.

[0046] For example, the system obtains a preset physical path length of 12.5 meters between the visual image acquisition station and the downstream physical rejection station, and extracts the production line transmission speed from the aforementioned steps as 8.33 meters per second, equivalent to 500 meters per minute. The system divides 12.5 by 8.33 to calculate a single bottle movement time of 1.5 seconds. Simultaneously, the system retrieves a preset network communication latency parameter of 0.1 seconds, obtained from 1000 network detections, and a preset mechanical execution latency parameter of 0.4 seconds, obtained from high-speed camera calibration tests. The system adds 0.1 and 0.4 to obtain a command response time of 0.5 seconds. The system compares the 1.5-second single bottle movement time with the 0.5-second command response time to determine the numerical relationship between the single bottle movement time and the command response time, and writes this relationship into a register as a timing matching result.

[0047] In step S5, a rejection control instruction for the current defective bottle is generated based on the timing matching result, and a parameter update instruction for subsequent empty bottles is generated using the equipment parameter correction amount to control the production of liquid packaging bottles. This includes: when the timing matching result indicates that the single bottle movement time is greater than or equal to the instruction response time, obtaining the production line encoder position sequence associated with the current defective bottle; encapsulating the production line encoder position sequence using a control protocol format to generate a rejection control instruction for the current defective bottle; obtaining the estimated arrival timestamp of the next batch of target empty bottles entering the current production station; and timing-binding and encapsulating the equipment parameter correction amount with the estimated arrival timestamp to generate a parameter update instruction.

[0048] In one implementation, when the timing matching result indicates that the single-bottle movement time is greater than or equal to the instruction response time, the production line encoder position sequence associated with the current defective bottle is obtained. This embodiment parses the timing matching result output from the preceding steps and extracts the numerical relationships. When it is determined that the single-bottle movement time is greater than or equal to the instruction response time, a position read request is sent to the main programmable logic controller. The system reads the continuous pulse count value of the rotary encoder on the main conveyor belt that is synchronously bound to the physical position of the current defective bottle, and uses the obtained continuous pulse count values ​​to construct the production line encoder position sequence.

[0049] The production line encoder position sequence is encapsulated using a control protocol format to generate a rejection control command for the current defective bottle. Specifically, a pre-configured lower-level communication protocol template, such as a Modbus TCP protocol template, is extracted. The production line encoder position sequence is converted into a hexadecimal data payload in the corresponding protocol format, and a pre-defined device identification code of the downstream physical rejection station actuator is appended to the header to generate a complete binary command message, which is then identified as the rejection control command for the current defective bottle. It is worth noting that the pre-defined device identification code of the downstream physical rejection station actuator is directly obtained by reading the production line equipment topology configuration table.

[0050] It should be noted that when the timing matching result indicates that the movement time of the single bottle is less than the instruction response time, a global deceleration instruction is generated and sent to the controller of the main conveyor belt drive shaft. At the same time, the production line encoder position sequence associated with the current defective bottle is recorded, and a downstream manual intervention warning signal containing the position sequence is generated and sent to the human-machine interface. After deceleration, if no defects are found in 20 consecutive bottles, the original speed is gradually restored, with a 5% increase each time and a stabilization period of 10 seconds before continuing the detection.

[0051] In one implementation, the estimated arrival timestamp of the next batch of empty bottles entering the current production station is obtained. This embodiment obtains the physical distance between the center axes of two adjacent fixed fixtures on the main conveyor belt and directly labels it as a preset physical distance parameter. The preset physical distance parameter is divided by the production line transmission speed, and an algebraic division operation is performed to calculate the single-bottle circulation time interval. The absolute clock timestamp of the current system motherboard is extracted, and the single-bottle circulation time interval is added to the absolute clock timestamp to obtain the estimated arrival timestamp.

[0052] The device parameter correction amount and the expected arrival timestamp are time-bound and encapsulated to generate a parameter update instruction. This embodiment extracts the device parameter correction amount generated in the preceding steps. The blow molding pressure correction amount and filling time compensation amount, among other parameter fields, are mapped and bound to the expected arrival timestamp to form a control data packet with a timestamp trigger attribute. Using Extensible Markup Language (XML) format, the control data packet is written into the register address structure of the device control module, and multi-field concatenation and message verification calculations are performed to generate the parameter update instruction.

[0053] For example, the system analyzes the timing matching results. If it confirms that the single-bottle movement time of 1.5 seconds is greater than the instruction response time of 0.5 seconds, the system requests the pulse count value of the current defective bottle from the main programmable logic controller to obtain the production line encoder position sequence in the range of 10500 to 10520. The system converts the production line encoder position sequence into hexadecimal load and concatenates it with the equipment identification code of the rejection mechanism, such as 0x0A, to generate a rejection control instruction. Conversely, if the single-bottle movement time is only 0.3 seconds and the instruction response time is 0.5 seconds, the system issues a global deceleration instruction to the main conveyor belt drive shaft and sends the encoder position of the current bottle to the human-machine interface to trigger a manual warning. At the same time, the system measures that the preset physical distance parameter between adjacent fixtures is 0.5 meters. Dividing this by the production line transmission speed of 8.33 meters per second, the system calculates that the single-bottle circulation time interval is approximately 0.06 seconds. The system extracts the current timestamp, for example, 10:00:00.00, and adds 0.06 seconds to obtain the estimated arrival timestamp of 10:00:00.06. The system binds the previously generated 8.5% pressure reduction ratio and 0.8-second time extension step with the 10:00:00.06 timestamp, encapsulates it using Extensible Markup Language (XML) format and adds message verification, and generates a parameter update command which is then sent to the device control unit for execution.

[0054] In summary, this invention acquires environmental operating data and local image patches from a liquid packaging bottle production line, utilizes a pre-trained defect recognition model and edge extraction algorithm to accurately quantify microscopic defects, and innovatively integrates defect geometric parameters with environmental temperature and humidity data. It then uses a multivariate weighted regression model to derive precise equipment parameter corrections. Simultaneously, through rigorous time-series delay deduction logic, it precisely matches the movement time of a single bottle with the command response time, collaboratively issuing rejection commands for the current bottle and parameter update commands for subsequent bottles. This solution breaks down the technical barriers of traditional production lines where single-visual qualitative alarms and fixed-parameter control are separate. It successfully constructs a full-process adaptive control system, from precise visual quantification and multi-dimensional variable mapping compensation to precise time-series checkpoints and global trend closed-loop optimization. Ultimately, it effectively eliminates control response lag without interrupting high-speed production line operation, improving the quality consistency and overall operational efficiency of liquid packaging bottle production in complex dynamic environments.

[0055] The second embodiment of the present invention provides a control system for liquid packaging bottle production equipment based on vision inspection, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps of the method described above.

[0056] It should be noted that the vision-based liquid packaging bottle production equipment control system provided in this embodiment of the invention is used to execute all the process steps of the vision-based liquid packaging bottle production equipment control method in the above embodiment. The working principles and beneficial effects of the two are one-to-one, so they will not be described again.

[0057] It should be noted that the system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0058] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.

Claims

1. A control method for liquid packaging bottle production equipment based on vision inspection, characterized in that, include: The system acquires environmental operation data, production line transmission speed, and partial image patches of the bottle body from the liquid packaging bottle production line. It inputs these partial image patches into a pre-trained defect recognition model for feature mapping to obtain the probability of defect occurrence. When the probability of defect occurrence exceeds a preset probability threshold, a corresponding defect is identified and its category label is recorded. Simultaneously, the system extracts the contour of the partial image patches to obtain the spatial geometric parameters of the defect. Based on the spatial geometric parameters, the defect category label, and the environmental operation data, it performs feature mapping to obtain equipment parameter correction amounts. It then uses the production line transmission speed to perform delay extrapolation to obtain the movement time of a single bottle, acquires the command response time of the control equipment, and compares the single bottle movement time with the command response time to obtain a timing matching result. Based on the timing matching result, it generates a rejection control command for the current defective bottle and uses the equipment parameter correction amounts to generate parameter update commands for subsequent empty bottles to control the production of liquid packaging bottles.

2. The control method for liquid packaging bottle production equipment based on vision detection according to claim 1, characterized in that, The step of inputting the local image patch of the bottle into a pre-trained defect recognition model for feature mapping to obtain the probability of defect occurrence includes: statistically analyzing the grayscale histogram of the local image patch of the bottle to generate a grayscale feature vector; inputting the local image patch of the bottle into the pre-trained defect recognition model to extract multi-layer features to obtain a deep image feature vector; concatenating the grayscale feature vector with the deep image feature vector to obtain a fused feature vector; and inputting the fused feature vector into the pre-trained defect recognition model to calculate a nonlinear mapping and output the probability of crack occurrence and the probability of stain occurrence.

3. The control method for liquid packaging bottle production equipment based on vision detection according to claim 1, characterized in that, The step of extracting the contour of the local image patch of the bottle to obtain the defect spatial geometric parameters includes: extracting the edges of the local image patch of the bottle using the Canny edge detection algorithm to obtain a set of defect contour boundary points; fitting a geometric polygon to the set of defect contour boundary points to calculate the two-dimensional coordinates of the geometric center and the pixel size of the circumscribed bounding box; calculating the Euclidean distance between each boundary point in the set of defect contour boundary points and the two-dimensional coordinates of the geometric center, and selecting the midpoint between the boundary point with the smallest Euclidean distance and the two-dimensional coordinates of the geometric center as the starting seed point; using a region growing algorithm, accumulating connected component pixels based on the starting seed point to obtain the absolute pixel area of ​​the defect; and serializing and packaging the two-dimensional coordinates of the geometric center, the pixel size of the circumscribed bounding box, and the absolute pixel area of ​​the defect to generate the defect spatial geometric parameters.

4. The control method for liquid packaging bottle production equipment based on vision detection according to claim 1, characterized in that, The step of performing feature mapping based on the defect spatial geometric parameters, the defect category labels, and the environmental operation data to obtain the equipment parameter correction amount includes: extracting the two-dimensional coordinates of the geometric center from the defect spatial geometric parameters, determining the defect spatial distribution location, and combining the defect spatial distribution location with the defect category labels to generate a defect condition index; acquiring the current production line's process operation data, which includes at least the mold cavity pressure, blowing pressure curve, and heating zone temperature distribution; inputting the defect condition index into a pre-constructed defect process causal mapping table for rule matching to extract the corresponding parameter adjustment direction and associated process parameter set; extracting corresponding target feature data from the process operation data and the environmental operation data based on the associated process parameter set; inputting the defect spatial geometric parameters and the target feature data into a pre-constructed parameter dynamic compensation model for numerical mapping, and calculating and outputting the equipment parameter correction amount corresponding to the parameter adjustment direction.

5. The control method for liquid packaging bottle production equipment based on vision detection according to claim 1, characterized in that, The process of obtaining the single-bottle movement time based on the production line transmission speed, acquiring the command response time of the control equipment, and comparing the single-bottle movement time with the command response time to obtain a timing matching result includes: dividing the preset physical path length between workstations by the production line transmission speed to calculate the single-bottle movement time; calculating the algebraic sum of preset network communication delay parameters and preset mechanical execution delay parameters to obtain the command response time; comparing the single-bottle movement time with the command response time to obtain a numerical relationship, and determining the numerical relationship as the timing matching result.

6. The control method for liquid packaging bottle production equipment based on vision detection according to claim 1, characterized in that, The step of generating a rejection control instruction for the current defective bottle based on the timing matching result, and generating a parameter update instruction for subsequent empty bottles using the equipment parameter correction amount, to control the production of liquid packaging bottles, includes: when the timing matching result indicates that the movement time of the single bottle is greater than or equal to the instruction response time, obtaining the production line encoder position sequence associated with the current defective bottle; encapsulating the production line encoder position sequence using a control protocol format to generate a rejection control instruction for the current defective bottle; obtaining the estimated arrival timestamp of the next batch of target empty bottles entering the current production station; and performing timing binding and encapsulation of the equipment parameter correction amount and the estimated arrival timestamp to generate a parameter update instruction.

7. A control system for a liquid packaging bottle production equipment based on vision inspection, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method according to any one of claims 1 to 6.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method described in any one of claims 1 to 6.