Method for identifying plastic particles of parallel-row ampoule bottles

By using deep learning models and multi-dimensional feature analysis, the problem of low accuracy in identifying plastic particles in row ampoules has been solved, achieving efficient and accurate identification of plastic particles and adapting to high-speed production environments.

CN120876501AActive Publication Date: 2025-10-31CHENGDU PUSH PHARM CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511408274.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-29
Publication Date
2025-10-31
Estimated Expiration
2045-09-29

AI Technical Summary

Technical Problem

In existing technologies, the accuracy of identifying plastic particles in ampoules is low, making it difficult to distinguish between plastic particles and air bubbles. Furthermore, it is severely affected by environmental interference, leading to misjudgments and missed detections.

Method used

Image recognition is performed using a deep learning-based convolutional neural network model. Combined with multi-dimensional feature analysis and liquid film interference correction, the system comprehensively judges whether plastic particles or bubbles are present by image acquisition, abnormal feature recognition, edge detection, transparency analysis, and multi-image comparison.

Benefits of technology

It improves the accuracy and robustness of plastic particle identification, adapts to interference in different production scenarios, reduces production costs, and increases production efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120876501A_ABST
    Figure CN120876501A_ABST
Patent Text Reader

Abstract

The invention discloses a method for identifying plastic particles of a row-connected ampoule bottle, relates to the technical field of ampoule bottle plastic particle identification, and aims to solve the technical problem of low plastic particle identification accuracy in the existing ampoule bottle filling process, and the method comprises the following steps: S1, image acquisition: in the filling process after blow molding of the row-connected plastic ampoule bottle, carrying out image acquisition; performing multiple times of image acquisition on the interior of the ampoule bottle through image acquisition equipment integrated on the filling head; s2, abnormal feature recognition: processing the acquired image by adopting an image recognition algorithm, and recognizing abnormal features on the inner wall of the ampoule bottle; s2a, boundary distinguishing: for the identified abnormal features, distinguishing the edges of the abnormal features and the edges of liquid films by analyzing gray-level co-occurrence matrixes and texture features of the abnormal features and surrounding areas, and retaining independent contour data of the abnormal features; and S3, based on judgment of edge features, carrying out edge detection and analysis on abnormal features. The method has the advantage of improving the plastic particle recognition accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of ampoule plastic particle identification technology, and more specifically, to a method for identifying plastic particles in a row of ampoules. Background Technology

[0002] The blow molding, filling, and sealing of multi-ampoule bottles are all completed rapidly in three separate steps at a single workstation on the production line. In the industrial production of multi-ampoule bottles (e.g., single-use cosmetics, eye drops, oral liquids), product quality is closely related to process control during production. In the blow molding process, due to the melting of raw materials and contact with the mold, plastic particles with a diameter of approximately 1-3 mm are easily generated and remain on the inner wall of the ampoule. After subsequent filling with medication, the medication may form bubbles or water droplets that adhere to the inner wall.

[0003] In quality control, ampoules must have a smooth, flat interior free of foreign matter. Ampoules containing plastic particles that remain on the inner wall are considered defective and must be effectively identified and removed. Current technologies rely heavily on manual visual inspection or traditional image recognition methods to detect abnormal features on the inner wall of ampoules. Manual inspection is not only inefficient but also highly susceptible to subjective factors, making it difficult to consistently distinguish between plastic particles and air bubbles. While traditional image recognition methods have achieved automation, they have significant limitations: firstly, plastic particles (blow molding residue) and air bubbles (generated during filling) share some similarities in grayscale and morphology, especially in areas covered by a liquid film, where the visual differences are further reduced; secondly, the liquid film on the inner wall of the ampoule causes abnormal light refraction, distorting key features such as the edge contours and transparency of abnormal features. This leads traditional algorithms to frequently misclassify air bubbles as plastic particles or miss actual plastic particles, severely impacting detection accuracy. Therefore, we propose a method for identifying plastic particles in rows of ampoules. Summary of the Invention

[0004] The purpose of this invention is to provide a method for identifying plastic particles in a row of ampoules, so as to solve the technical problem of low accuracy in identifying plastic particles in existing ampoules.

[0005] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a method for identifying plastic particles in a row of ampoules, comprising the following steps: S1. Image acquisition: During the filling process after the plastic ampoules are blow-molded, the image acquisition device integrated on the filling head performs multiple image acquisitions of the inside of the ampoules. S2. Abnormal Feature Recognition: Image recognition algorithms are used to process the acquired images and identify abnormal features on the inner wall of the ampoule. S2a, Boundary Distinction: For the identified abnormal features, by analyzing the gray-level co-occurrence matrix and texture features of the features with the surrounding area, the edge of the abnormal feature itself is distinguished from the edge of the liquid film, and the independent contour data of the abnormal feature is preserved. S3. Based on the judgment of edge features, perform edge detection and analysis on abnormal features, and make a preliminary judgment on whether the abnormal feature is a plastic particle or a bubble based on the smoothness of the edge. S4. Based on the judgment of transparency characteristics, perform transparency analysis on abnormal features, and make a preliminary judgment on whether the abnormal features are plastic particles or bubbles based on the degree of transparency. S5. Based on the judgment of multiple images, compare the size and position changes of abnormal features in multiple images, and make a preliminary judgment on whether the abnormal feature is plastic particles or bubbles based on the changes. S6, Liquid film interference correction: Detects and analyzes the state of the liquid film in the region where the abnormal feature is located, and corrects the preliminary judgment results of S3, S4, and S5 according to the degree of influence of the liquid film. S7. Comprehensive judgment: Based on the combined preliminary judgment results after S6 correction, finally determine whether the abnormal feature is plastic particles or air bubbles.

[0006] Preferably, in S1: The lens of the image acquisition device is directed towards the inside of the ampoule and the shooting range covers the key areas of the inner wall of the ampoule. The key areas include the corner of the inner wall of the ampoule, the peripheral area that contacts the filling head, and the middle area of ​​the bottle. The corner covers the arc-shaped part where the bottle body and the bottom of the bottle are connected, and the peripheral area that contacts the filling head is a ring-shaped area centered on the insertion point of the filling head. Multiple image acquisitions are performed at set time intervals; Multiple images of the ampoule's interior taken at different times clearly show the texture of the ampoule's inner wall and any possible abnormalities, without any obvious blurring or distortion.

[0007] Preferably, in S2: The image recognition algorithm is a deep learning-based algorithm, specifically including a convolutional neural network model, which includes an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer. The preprocessing process includes denoising the image to eliminate random noise generated during the shooting process. The denoising method adopts filtering based on pixel neighborhood information. Enhancement is used to improve the contrast between abnormal features and the background in the image. The enhancement method includes adjusting the brightness and contrast of the image. Edge extraction is used to highlight the contours of objects in the image. The extraction method adopts an edge detection method based on gradient changes. Anomalies are identified by a trained anomaly recognition model, which is trained on an image dataset containing a large number of plastic particles and bubble samples. During the training process, data augmentation processing is performed on the samples, including image rotation, flipping, and cropping operations. The abnormal features are areas that appear to be plastic particles or bubbles, which are visually distinct from the surrounding normal areas in terms of color, grayscale, or texture in the image.

[0008] Preferably, in S2a: When analyzing the gray-level co-occurrence matrix, the characteristic parameters of gray-level correlation, contrast, energy, and uniformity of the abnormal features and surrounding areas at different directions and distances are calculated. By combining roughness and directionality indicators in texture features, the edges of abnormal features themselves can be distinguished from the edges of liquid films.

[0009] Preferably, in S3: Edge detection of anomalous features includes obtaining edge contour data of anomalous features through an edge detection operator. The edge detection operator is an operator that can identify regions with abrupt changes in grayscale in an image. The edge contour data contains the coordinate information of each pixel on the contour, forming a complete closed contour. The analysis process involves calculating the smoothness parameter of the edge contour. The smoothness parameter is obtained by measuring the degree of continuous change of the line connecting adjacent pixels on the edge contour, specifically by calculating the change range of the angle between the line connecting adjacent pixels. When the smoothness parameter reaches the set standard, that is, the edge contour is continuous and there are no obvious abrupt turns, and the angle between adjacent lines changes little and is uniform, it is initially judged to be a bubble. Otherwise, if the edge contour has obvious jaggedness or abrupt turns, and the included angle between adjacent lines varies greatly and is irregular, it is preliminarily judged to be plastic granules.

[0010] Preferably, in S4: Transparency analysis yields a transparency parameter by calculating the ratio of light transmittance in abnormal feature areas to light transmittance in normal areas of the liquid inside the ampoule. The light transmittance is determined by analyzing the degree of light penetration in the corresponding area of ​​the image, specifically by using the gray value of the area in the image to reflect the intensity of light after penetration. When the transparency parameter reaches the set standard, that is, the light transmittance of the abnormal feature area is close to or reaches the light transmittance of the normal liquid area, the difference in gray value between the two is very small, and the light passes through almost without obstruction, it is initially judged to be a bubble. Otherwise, if the light transmittance of the abnormal feature area is significantly lower than that of the normal liquid area, the gray value of the two is significantly different, and there is obvious obstruction when the light passes through, it is initially judged to be plastic particles.

[0011] Preferably, in S5: Comparing the size and positional changes of abnormal features in multiple images includes tracking the same abnormal feature through a feature matching algorithm. The feature matching algorithm adopts a matching method based on local invariant features, combined with the prediction of motion vectors of liquid film flow, eliminating false matching points caused by liquid film interference, and achieving corresponding matching across images by identifying the unique visual features of abnormal features. Record its size data and position coordinates in each image. The size data is reflected by the number of pixels contained in the abnormal feature region. The more pixels, the larger the abnormal feature. The position coordinates are reflected by the coordinates of the geometric center of the abnormal feature region in the image. The geometric center is the center position surrounded by the region boundary. Calculate the rate of change of the size and the positional offset of abnormal features in adjacent images; When the rate of change in size and the positional offset reach the set standards, that is, when the size of the abnormal feature shows obvious expansion or contraction over time, the number of pixels increases or decreases significantly, the position moves significantly over time, and the geometric center coordinates change significantly, it is initially judged to be a bubble. Otherwise, if the size and location of the abnormal features remain relatively stable, and the number of pixels and the coordinates of the geometric center change little or not at all, it is preliminarily judged to be plastic particles.

[0012] Preferably, in S6: The detection and analysis of the liquid film state in the region of abnormal features includes identifying the distribution range by analyzing the gray-level gradient changes of the liquid film region in the image, determining the thickness by the difference in light reflection intensity of the liquid film region, and analyzing the flow state by analyzing the pixel displacement trajectory of the liquid film region in continuous images. An interference model is established based on the optical properties of liquid films, which reflects the influence of liquid films on light refraction and transparency. Based on the location of the abnormal features in the liquid film and the state of the liquid film, the correction values ​​of the edge smoothness parameter in S3, the correction value of the light transmittance ratio in S4, and the correction values ​​of the size change rate and position offset in S5 are calculated according to the interference model, and then the preliminary judgment results of S3, S4, and S5 are adjusted.

[0013] Preferably, in S7: The comprehensive judgment includes setting weight values ​​for the preliminary judgment results of S3, S4 and S5 after S6 correction. The weight values ​​are dynamically adjusted according to the state of the liquid film. When the liquid film is thicker, the weight of S5 is increased, and when the liquid film is thinner, the weights of S3 and S4 are increased. A comprehensive judgment value is obtained through weighted calculation. The weighted calculation is to multiply the score corresponding to each preliminary judgment result by its weight and then sum them up. A positive value is assigned when the preliminary judgment is a bubble and a negative value is assigned when the preliminary judgment is a plastic particle. When the comprehensive judgment value reaches the set standard, it is determined to be an air bubble; otherwise, it is determined to be a plastic particle. Furthermore, in the process of comprehensive judgment, if there are contradictions in the preliminary judgment results, a second verification is carried out. The second verification includes re-examining the processing procedures and feature extraction results of each step to ensure the accuracy of the judgment.

[0014] Compared with the prior art, the beneficial effects of the present invention are: 1. This invention accurately captures the essential differences between plastic particles and bubbles through the synergistic effect of multi-dimensional feature analysis and liquid film interference correction: plastic particles have rough edges, low transparency, and stable position and size, while bubbles have smooth edges, transparency close to that of liquid, are easy to flow, and have significant size variations. This effectively solves the problem of low accuracy in plastic particle identification in existing technologies, ensuring reliable identification of plastic particles generated during blow molding and providing core assurance for product quality control.

[0015] 2. This invention also employs a deep learning-based convolutional neural network model for anomaly feature recognition. Through training with a large number of samples containing interference from plastic particles, bubbles, and liquid films, the model can automatically learn feature patterns in complex scenarios. Even when the liquid film is unevenly distributed or the lighting conditions change, it can still stably extract abnormal features, significantly improving the robustness of recognition and reducing missed or false detections caused by environmental interference.

[0016] 3. This invention also uses a dynamic weight adjustment mechanism to flexibly allocate the judgment weights of each feature according to the thickness of the liquid film, so that the recognition method can adapt to the interference intensity of different production scenarios, ensuring detection accuracy and adapting to the high-speed production rhythm of ampoules. At the same time, the real-time recognition results can be fed back to the blow molding process to provide data support for process parameter optimization, reduce the generation of plastic particles from the source, reduce production costs and improve overall production efficiency. Attached Figure Description

[0017] Figure 1 This is a schematic diagram of the method flow of the present invention. Detailed Implementation

[0018] To facilitate understanding of the technical solution of the present invention by those skilled in the art, the technical solution of the present invention will now be further described in conjunction with the accompanying drawings.

[0019] Example 1, such as Figure 1 As shown, the present invention provides a method for identifying plastic particles in a row of ampoules, comprising the following steps: S1. Image acquisition: During the filling process after the plastic ampoules are blow-molded, the image acquisition device integrated on the filling head performs multiple image acquisitions of the inside of the ampoules. S2. Abnormal Feature Recognition: Image recognition algorithms are used to process the acquired images and identify abnormal features on the inner wall of the ampoule. S2a, Boundary Distinction: For the identified abnormal features, by analyzing the gray-level co-occurrence matrix and texture features of the features with the surrounding area, the edge of the abnormal feature itself is distinguished from the edge of the liquid film, and the independent contour data of the abnormal feature is preserved. S3. Based on the judgment of edge features, perform edge detection and analysis on abnormal features, and make a preliminary judgment on whether the abnormal feature is a plastic particle or a bubble based on the smoothness of the edge. S4. Based on the judgment of transparency characteristics, perform transparency analysis on abnormal features, and make a preliminary judgment on whether the abnormal features are plastic particles or bubbles based on the degree of transparency. S5. Based on the judgment of multiple images, compare the size and position changes of abnormal features in multiple images, and make a preliminary judgment on whether the abnormal feature is plastic particles or bubbles based on the changes. S6, Liquid film interference correction: Detects and analyzes the state of the liquid film in the region where the abnormal feature is located, and corrects the preliminary judgment results of S3, S4, and S5 according to the degree of influence of the liquid film. S7. Comprehensive judgment: Based on the combined preliminary judgment results after S6 correction, finally determine whether the abnormal feature is plastic particles or air bubbles.

[0020] In an embodiment of the present invention, in S1: The lens of the image acquisition device is directed towards the inside of the ampoule and the shooting range covers the key areas of the inner wall of the ampoule. The key areas include the corner of the inner wall of the ampoule, the peripheral area that contacts the filling head, and the middle area of ​​the bottle. The corner covers the arc-shaped part where the bottle body and the bottom of the bottle are connected, and the peripheral area that contacts the filling head is a ring-shaped area centered on the insertion point of the filling head. Multiple image acquisitions are performed at set time intervals. During the acquisition process, a mechanical fixing structure keeps the relative position of the image acquisition device and the ampoule stable to avoid image shift due to vibration or other factors. Multiple images of the ampoule's interior taken at different times clearly show the texture of the ampoule's inner wall and any possible abnormal features, without any obvious blurring or distortion. To evaluate image sharpness, a sharpness evaluation index is used. Quantification: ; in, Image sharpness is a dimensionless numerical value; the larger the value, the sharper the image. The width of the image is expressed in pixels, which is the number of pixels contained in the image in the horizontal direction. This represents the height of the image, expressed in pixels, which is the number of pixels contained in the image in the vertical direction. Represents coordinates in the image The absolute value of the gray-level gradient at point , where, The gray-level gradient of this pixel is calculated using the Sobel operator. It reflects the rate of change of the gray-level value at this pixel. The larger its absolute value, the clearer the image details at that location. This formula is used to quantitatively evaluate the sharpness of images captured inside ampoules. First, the Sobel operator is used to calculate the sharpness of each pixel in the image. grayscale gradient at The grayscale gradient reflects the rate of change of grayscale values ​​at a pixel; a larger rate of change indicates clearer image details at that location. Then, the absolute values ​​of the grayscale gradients of all pixels are summed to obtain the overall grayscale gradient sum of the image. The larger this sum, the more clear details are present in the image. Finally, this sum is divided by the total number of pixels in the image (i.e., the image width). With height The product of these factors is normalized to obtain the sharpness evaluation index. , The magnitude of the value is positively correlated with image sharpness. The higher the value, the clearer the image; From the perspective of targeted image acquisition, the image acquisition equipment accurately covers key areas of the ampoule's inner wall, ensuring focused monitoring of corners prone to plastic particles or air bubbles, areas surrounding the filling head, and the central part of the bottle, avoiding the omission of critical anomalies. The use of a mechanical fixing structure effectively maintains the relative positional stability of the image acquisition equipment and the ampoule, reducing image shift caused by vibration and other factors, providing a stable image foundation for subsequent anomaly identification and analysis. As for the sharpness evaluation index... The introduction of this technology enables a quantitative assessment of image sharpness, allowing for a scientific determination of whether the acquired image meets the requirements for subsequent processing. When the value reaches the set standard, it indicates that the image clearly presents the texture of the ampoule's inner wall and any possible abnormal features, ensuring the accuracy of subsequent steps such as abnormal feature recognition and edge detection; if If the value does not meet the standard, the image can be re-acquired in a timely manner to avoid misjudgment caused by blurry images, thereby improving the reliability and accuracy of the entire method for identifying plastic particles in a row of ampoules.

[0021] In an embodiment of the present invention, in S2: The image recognition algorithm is a deep learning-based algorithm, specifically including a convolutional neural network model, which includes an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer. The preprocessing process includes denoising the image to eliminate random noise generated during the shooting process. The denoising method adopts filtering based on pixel neighborhood information. Enhancement is used to improve the contrast between abnormal features and the background in the image. The enhancement method includes adjusting the brightness and contrast of the image. Edge extraction is used to highlight the contours of objects in the image. The extraction method adopts an edge detection method based on gradient changes. Anomalies are identified by a trained anomaly recognition model, which is trained on an image dataset containing a large number of plastic particles and bubble samples. During the training process, data augmentation processing is performed on the samples, including image rotation, flipping, and cropping operations. The abnormal features are areas that appear to be plastic particles or bubbles, which are visually distinct from the surrounding normal areas in terms of color, grayscale, or texture in the image. Contrast between anomalous features and background The calculation formula is: ; in, Represents the contrast between the anomalous feature and the background; it is dimensionless and its value ranges from 1 to 2. A larger value indicates a more obvious difference between the abnormal features and the background. The average gray value representing the abnormal feature region is obtained by calculating the arithmetic mean of the gray values ​​of all pixels in the abnormal feature region. It is dimensionless and its value range is consistent with the gray level of the image. This represents the average grayscale value of the background area. It is calculated as the arithmetic mean of the grayscale values ​​of all pixels within the background area. It is dimensionless and its value range is the same as... ; Indicates taking and The maximum value in the formula is used to prevent the denominator from being zero. For a very small positive number (such as This ensures the validity of the calculations; Absolute value sign, to ensure contrast It is a non-negative value; This formula is used to quantify the contrast between anomalous feature regions and background regions. First, the average gray value of the anomalous feature regions is calculated. and the average gray value of the background area The difference between the two This reflects the degree of difference in grayscale between two regions; a larger difference indicates a more significant difference. Then, to avoid a denominator of zero, a... As the denominator, ensure that the denominator is always positive. Finally, take the absolute value of the ratio of the difference to the denominator to obtain the contrast. , The larger the value, the more significant the difference between the abnormal feature region and the background region, and the easier it is to identify the abnormal feature from the background; Deep learning-based convolutional neural network models possess powerful feature extraction and pattern recognition capabilities. An anomaly recognition model trained on a large number of samples can accurately identify abnormal features on the inner wall of ampoules that may be plastic particles or air bubbles, laying a solid foundation for subsequent judgment steps. Denoising operations during preprocessing effectively eliminate random noise in the image, reducing its interference with anomaly recognition; contrast enhancement and edge extraction further highlight the anomaly features, making them easier to identify. (Formula for anomaly feature vs. background contrast) The introduction of this feature enables quantitative evaluation of contrast, facilitating the determination of the degree of distinction between abnormal features and the background. When When the value reaches a certain standard, it indicates that the abnormal features are obvious enough, which is beneficial for the accurate execution of subsequent steps such as edge detection and transparency analysis; if If the value is low, the contrast can be improved by adjusting the brightness and contrast of the image, thereby improving the accuracy and reliability of the entire recognition method and ensuring that plastic particles and bubbles can be more accurately identified and distinguished.

[0022] In an embodiment of the present invention, in S2a: When analyzing the gray-level co-occurrence matrix, the characteristic parameters of gray-level correlation, contrast, energy, and uniformity of the abnormal features and surrounding areas at different directions and distances are calculated. By combining roughness and directionality in texture features, the edges of abnormal features themselves can be distinguished from the edges of liquid films. Among them, the grayscale changes at the edges of the abnormal features are more dramatic and stable, while the grayscale changes at the edges of the liquid film are relatively gentle and change dynamically with the flow state. To quantify grayscale correlation, the following formula is used for calculation: ; in, Represents grayscale correlation, dimensionless, with a value range of [value range missing]. A larger value indicates a stronger correlation between pixel gray levels within a region; Represents the maximum gray value, dimensionless, and depends on the gray level of the image; Represents pixel pairs in the gray-level co-occurrence matrix The probability of occurrence is dimensionless and its range is [value missing]. ,all The sum is 1; , These are the grayscale values ​​of the two pixels in a pixel pair, dimensionless, and ranging from [value range missing]. ; This formula is used to quantify the correlation between anomalous features in an image and the grayscale values ​​of different pixels in the surrounding area. First, pixel pairs in the gray-level co-occurrence matrix are obtained. probability of occurrence This reflects the frequency of occurrence of specific grayscale value combinations in the image. Then, the grayscale value of each pixel pair is... and Multiply and with the corresponding probability Multiply the results, then sum all the results to obtain the total sum of the associated grayscale values. Finally, divide this sum by the maximum grayscale value. The gray-level correlation is obtained by normalizing the square of the value. , The larger the value, the higher the correlation between pixel grayscale values ​​within the region, and the more uniform the texture. Grayscale contrast The calculation formula is: ; in, Represents grayscale contrast, dimensionless, with a value range of [value range missing]. A larger value indicates a more pronounced difference in gray levels within the region; It represents the square of the difference between a pixel and its grayscale value, is dimensionless, and is used to amplify grayscale differences. This formula measures the degree of difference in grayscale values ​​within a region. It works by calculating the difference in grayscale values ​​for each pixel pair. The square of the grayscale difference, and the probability of that pixel pair appearing. Multiply them, then sum all the results to get the grayscale contrast. , The larger the value, the more significant the grayscale difference between different pixels in the area, and the coarser the texture; By calculating feature parameters such as grayscale correlation and contrast, the differences in texture between anomalous features and the liquid film can be effectively captured. Anomalous features themselves exhibit drastic grayscale changes at their edges (high...). Furthermore, the correlation is stable, and the grayscale change at the edge of the liquid film is gradual (low). Furthermore, the correlation varies with the flow, and these differences can be used to accurately distinguish the edges of the two. This distinction ensures that subsequent steps only analyze the abnormal features themselves, avoiding interference from the liquid film edges, improving the accuracy of subsequent steps such as edge detection and transparency analysis, and thus enhancing the reliability and accuracy of the entire plastic particle identification method, providing stronger technical support for ampoule quality inspection.

[0023] In an embodiment of the present invention, in step S3: Edge detection of anomalous features includes obtaining edge contour data of anomalous features through an edge detection operator. The edge detection operator is an operator that can identify regions with abrupt changes in grayscale in an image. The edge contour data contains the coordinate information of each pixel on the contour, forming a complete closed contour. The analysis process involves calculating the smoothness parameter of the edge contour. The smoothness parameter is obtained by measuring the degree of continuous change of the line connecting adjacent pixels on the edge contour, specifically by calculating the change range of the angle between the line connecting adjacent pixels. When the smoothness parameter reaches the set standard, that is, the edge contour is continuous and there are no obvious abrupt turns, and the angle between adjacent lines changes little and is uniform, it is initially judged to be a bubble. Otherwise, if the edge contour has obvious jaggedness or abrupt turns, and the included angle between adjacent lines varies greatly and is irregular, it is preliminarily judged to be plastic granules.

[0024] Smoothness parameters The calculation formula is as follows: ; in, The smoothness parameter representing the edge contour is dimensionless and has a value range of [value missing]. The closer the value is to 1, the smoother the edge; This represents the number of lines connecting adjacent pixels on the edge contour. It is dimensionless, a positive integer, and depends on the complexity of the edge contour. Pi, approximately 3.1416, is used to normalize the range of angular variation. Within the range; Indicates the first The angle between the line connecting adjacent pixels and the horizontal direction, in radians, with a value range of [value missing]. ; Indicates the first The angle between the line connecting adjacent pixels and the horizontal direction, in radians, with a value range of [value missing]. ; Indicates the first Article and No. The absolute value of the difference in the angles between the lines connecting the two points, expressed in radians, reflects the magnitude of change in the direction of the contour. Since the edge contour is closed, the 0th line and the 1st line... All connecting lines must be of the same type to ensure the integrity of the calculation; This formula is used to quantify the smoothness of the edge contours of anomalous features. First, the number of lines connecting adjacent pixels on the edge contour is determined. And obtain the angle between each connecting line and the horizontal direction. Then, calculate the absolute value of the difference between the angles between two adjacent lines. These differences reflect the magnitude of change in the direction of the edge contour; the larger the difference, the more abrupt the contour transition. After summing the differences of all adjacent angles, divide by... The average angle change rate is obtained. Finally, subtracting this average angle change rate from 1 yields the smoothness parameter. , The closer the value is to 1, the smoother the edge contour. The smaller the value, the rougher the edge contour and the more obvious the transition; On the one hand, this scheme accurately obtains the edge contour data of abnormal features using edge detection operators, providing a reliable foundation for subsequent analysis; on the other hand, the calculation logic of the smoothness parameter is scientifically sound and reasonable. Through quantitative analysis of the variation amplitude of the angle between adjacent lines, it can effectively distinguish the smooth edges of bubbles from the rough edges of plastic particles. When the value reaches the set standard, it is judged as an air bubble; otherwise, it is judged as plastic particles. This judgment method conforms to the difference in physical properties between air bubbles and plastic particles. This scheme not only improves the accuracy of the initial judgment but also provides an important basis for subsequent comprehensive judgment, reduces the overall identification deviation caused by misjudgment of edge features, and thus improves the reliability and practicality of the entire method for identifying plastic particles in a row of ampoules, which helps to conduct ampoule quality inspection more efficiently.

[0025] In an embodiment of the present invention, in step S4: Transparency analysis yields a transparency parameter by calculating the ratio of light transmittance in abnormal feature areas to light transmittance in normal areas of the liquid inside the ampoule. The light transmittance is determined by analyzing the degree of light penetration in the corresponding area of ​​the image, specifically by using the gray value of the area in the image to reflect the intensity of light after penetration. When the transparency parameter reaches the set standard, that is, the light transmittance of the abnormal feature area is close to or reaches the light transmittance of the normal liquid area, the difference in gray value between the two is very small, and the light passes through almost without obstruction, it is initially judged to be a bubble. Otherwise, if the light transmittance of the abnormal feature area is significantly lower than that of the normal liquid area, the gray value of the two is significantly different, and there is obvious obstruction when the light passes through, it is initially judged to be plastic particles.

[0026] Transparency parameter The calculation formula is: ; In the formula, and It can be determined by the average gray value of the corresponding area. and according to Calculations show that The maximum grayscale value of the image; in, This represents the transparency parameter, which is dimensionless and has a value range of [value range missing]. This value is used to measure the difference in transparency between abnormal feature areas and normal liquid areas. The closer the value is to 1, the more transparent the abnormal feature is. This represents the light transmittance of the anomalous feature region, dimensionless, and its value range is... This reflects the ability of light to penetrate areas with abnormal features; the higher the value, the stronger the penetration ability. This represents the light transmittance of the normal region of a liquid, dimensionless, and its value ranges from [value missing]. This reflects the ability of light to penetrate the normal area of ​​a liquid and serves as a reference standard. This represents the average grayscale value of the anomalous feature region. It is dimensionless and is the average of the grayscale values ​​of all pixels within the anomalous feature region. Its value range is consistent with the image grayscale levels, and it is used for calculation. ; Transparency parameter The calculation logic reflects the transparency of abnormal features by comparing the light transmittance of the abnormal feature region and the normal liquid region. First, based on the average gray value of the abnormal feature region... Average gray value of the normal liquid area Combined with the maximum gray value of the image According to respectively Calculate the light transmittance of the anomalous feature region Light transmittance in the normal liquid region Here, a higher grayscale value indicates a stronger intensity of light after penetration, and thus a higher light transmittance. Then, the light transmittance of the abnormal feature region is used... Divide by the light transmittance of the normal liquid region Obtain the transparency parameter , The closer the value is to 1, the closer the transparency of the abnormal feature area is to that of a normal liquid area, and the more likely it is to be an air bubble. The smaller the value, the lower the transparency of the abnormal feature area, and the more likely it is to be a plastic particle; This method effectively utilizes the inherent differences in transparency between bubbles and plastic particles for preliminary judgment, yielding significant results. On one hand, it correlates light transmittance with image grayscale values, quantifying light transmittance through this directly obtainable image feature. This makes transparency analysis operable and objective, avoiding errors from subjective judgment. On the other hand, transparency parameters... The calculation method is simple and intuitive, clearly reflecting the transparency difference between abnormal features and normal liquid areas, providing a reliable quantitative basis for distinguishing between bubbles and plastic particles. When If the set standard is met, it is identified as an air bubble; otherwise, it is identified as plastic particles. This method aligns with the physical properties of both, significantly improving the accuracy of the initial assessment. Furthermore, the results of this approach, as a crucial component of the comprehensive assessment, complement and validate other findings, further enhancing the precision of the entire method for identifying plastic particles in ampoule packs. This contributes to improving the efficiency and reliability of ampoule quality inspection.

[0027] In an embodiment of the present invention, in step S5: Comparing the size and positional changes of abnormal features in multiple images includes tracking the same abnormal feature through a feature matching algorithm. The feature matching algorithm adopts a matching method based on local invariant features (such as SIFT features), combined with the prediction of motion vectors of liquid film flow, eliminating false matching points caused by liquid film interference, and achieving corresponding matching across images by identifying the unique visual features of abnormal features. Record its size data and position coordinates in each image. The size data is reflected by the number of pixels contained in the abnormal feature region. The more pixels, the larger the abnormal feature. The position coordinates are reflected by the coordinates of the geometric center of the abnormal feature region in the image. The geometric center is the center position surrounded by the region boundary. Calculate the rate of change of the size and the positional offset of abnormal features in adjacent images; When the rate of change in size and the positional offset reach the set standards, that is, when the size of the abnormal feature shows obvious expansion or contraction over time, the number of pixels increases or decreases significantly, the position moves significantly over time, and the geometric center coordinates change significantly, it is initially judged to be a bubble. Otherwise, if the size and location of the abnormal features remain relatively stable, and the number of pixels and the coordinates of the geometric center change little or nothing, it is preliminarily judged to be plastic particles. Rate of change in size The calculation formula is: ; in, Represents the rate of change of magnitude, dimensionless, and its range is [value range missing]. This reflects the relative degree of change in the size of abnormal features; Indicates the first The number of pixels in the abnormal feature region of the image, dimensionless, and a positive integer; Indicates the first The number of pixels in the abnormal feature region of the image, dimensionless, and a positive integer; Represents the absolute value symbol, guaranteeing It is a non-negative value; This formula is used to calculate the relative change in the size of anomalous features between two adjacent images. First, calculate the... Zhang Image and the First The difference in the number of pixels in the abnormal feature region of the image Then divide the difference by the first... Number of pixels in abnormal feature regions in the image The relative change ratio is obtained, and finally the absolute value is taken to obtain the rate of change in magnitude. , The larger the value, the more significant the change in the size of the abnormal feature; Position offset The calculation formula is: ; in, This represents the position offset, in pixels, with a value range of [value range missing]. , indicating the distance moved from the location of the abnormal feature; Indicates the first The coordinates of the geometric center of the abnormal feature region in the image, in pixels. The horizontal coordinate is... Vertical coordinates; Indicates the first The coordinates of the geometric center of the abnormal feature region in the image, in pixels, have the same meaning as... ; The square root symbol is used to calculate the straight-line distance between two points in a plane. This formula is used to calculate the distance traveled by anomaly locations in two adjacent images. By calculating the... Zhang Image and the First The geometric center coordinates of the abnormal feature region in the image are in the horizontal direction. and vertical direction The difference between the two values ​​is calculated by squarening each value separately, summing the results, and then taking the square root of the sum to obtain the position offset. , The larger the value, the more significant the movement of the abnormal feature's location; Feature matching similarity The calculation formula is: ; in, Represents feature matching similarity, dimensionless, with a value range of 1. The closer the value is to 1, the more accurate the feature point matching. This represents the number of matched feature points; it is dimensionless and a positive integer. Indicates the first Euclidean distance between feature points, in pixels, reflects the spatial distance between two feature points; This represents the distance adjustment parameter, in pixels, used to adjust the degree of influence of Euclidean distance on matching similarity; This represents an exponential function used to convert distance information into similarity weights; This formula is used to measure the degree of matching of feature points in different images. For each pair of matching feature points, their Euclidean distance is calculated. With distance adjustment parameters The square of the ratio is taken, its negative is exponentially calculated, and then the results are summed over all matching feature points. Finally, the result is divided by the number of matching feature points. To obtain feature matching similarity , The closer the value is to 1, the more accurate the feature point matching. By analyzing the size and location changes of abnormal features through multi-image comparison and combining them with feature matching algorithms, bubbles and plastic particles can be effectively distinguished, with significant results. (Size change rate) and position offset The calculation can quantify the dynamic changes of anomalous characteristics. Bubbles, due to their fluidity and variability, [are subject to these changes]. and The values ​​are usually larger, while plastic granules are relatively stable. and The value is relatively small, which allows for a preliminary judgment. Feature matching similarity. The introduction of this method improves the accuracy of tracking abnormal features across images, reduces false matches caused by liquid film interference, and provides a reliable basis for calculating size and position changes. This scheme utilizes the differences in dynamic characteristics between bubbles and plastic particles, providing a key basis for comprehensive judgment. Combined with other judgment steps, it further enhances the accuracy of the entire recognition method, enabling more efficient quality inspection of ampoules.

[0028] In an embodiment of the present invention, in step S6: The detection and analysis of the liquid film state in the region of abnormal features includes identifying the distribution range by analyzing the gray-level gradient changes of the liquid film region in the image (such as the gray-level abrupt change at the interface between the liquid film and the air), determining the thickness by the difference in light reflection intensity of the liquid film region (such as stronger reflection in the thick film region), and analyzing the flow state by analyzing the pixel displacement trajectory of the liquid film region in continuous images. An interference model is established based on the optical properties of liquid films, which reflects the influence of liquid films on light refraction and transparency. Based on the location of the abnormal features in the liquid film and the state of the liquid film, the correction values ​​of the edge smoothness parameter in S3, the correction value of the light transmittance ratio in S4, and the correction values ​​of the size change rate and position offset in S5 are calculated according to the interference model, and then the preliminary judgment results of S3, S4, and S5 are adjusted.

[0029] Edge smoothness parameter correction value The calculation formula is: ; in, This represents the corrected edge smoothness parameter, which is dimensionless and has a value range of [value range missing]. This more accurately reflects the edge smoothness of abnormal features; This represents the edge smoothness parameter before correction; it is dimensionless and its value ranges from [value missing]. ; This represents the influence coefficient of liquid film thickness. It is dimensionless and determined based on experiments or experience, reflecting the degree of influence of liquid film thickness on edge smoothness parameters. It indicates the thickness of the liquid film, reflecting the degree of thickness of the liquid film; This formula is used to correct for the influence of liquid film thickness on edge smoothness parameters. First, determine the influence coefficient of liquid film thickness. and liquid film thickness Calculate the product of the two, subtract this product from 1 to get the correction coefficient, and then change the edge smoothness parameter before correction. Multiply by the correction factor to obtain the corrected edge smoothness parameter. The greater the thickness of the liquid film, the better the correction. value ratio The greater the value reduction, the better to counteract the interference of the liquid film on edge detection; Correction value for light transmittance ratio The calculation formula is: ; in, It represents the corrected light transmittance ratio, which is dimensionless and can more accurately reflect the transparency of anomalous features; This represents the transparency parameter before correction; it is dimensionless. The liquid film distribution influence coefficient is dimensionless and determined by experiments or experience, reflecting the influence of the liquid film distribution on the ratio of light transmittance. This indicates the distance from the anomalous feature to the edge of the liquid film, reflecting the positional relationship between the anomalous feature and the edge of the liquid film; This formula is used to correct for the effect of the distance from the anomalous feature to the edge of the liquid film on the light transmittance ratio. Calculate the liquid film distribution influence coefficient. Distance from the anomalous feature to the edge of the liquid film The product of these factors is subtracted from 1 to obtain the correction factor, which is then used to adjust the original transparency parameter. Multiply by the correction factor to obtain the corrected light transmittance ratio. The closer the abnormal feature is to the edge of the liquid film, the better. value ratio The greater the decrease in value, the better to correct for the interference of liquid film distribution on transparency analysis; Correction value for rate of change of size and position offset correction value They are respectively: ; ; in, It represents the corrected rate of change, is dimensionless, and more accurately reflects the magnitude change of the abnormal feature itself; This represents the rate of change of magnitude before correction, and is dimensionless. This represents the corrected positional offset, expressed in pixels, which more accurately reflects the positional movement of the anomaly feature itself. This represents the positional offset before correction, in pixels. The coefficient representing the influence of liquid film flow velocity is dimensionless and determined based on experiments or experience, reflecting the influence of liquid film flow velocity on the rate of change of magnitude and positional offset. This indicates the flow velocity of the liquid film, expressed in millimeters per unit time, such as millimeters per second. This indicates the time interval between adjacent image acquisitions, expressed in time units such as seconds. Correction value for rate of change of size Using the rate of change of size before correction Subtract the influence coefficient of liquid film flow velocity With liquid film flow velocity The product of these values ​​is used to eliminate the influence of liquid film flow on the judgment of abnormal feature magnitude changes. Position offset correction value. Use the position offset before correction minus , and adjacent image acquisition time interval The product of these factors is used to correct misjudgments of abnormal feature position shifts caused by liquid film flow. Liquid film flow rate The calculation formula is: ; in, It represents the physical size of a pixel, in millimeters per pixel, which is the actual physical length represented by each pixel; This represents the number of feature points tracked within the liquid film region; it is dimensionless and a positive integer. Indicates the first The feature point at the th ... The coordinates in the image are in pixels. Indicates the first The feature point at the th ... The coordinates in the image are in pixels. This formula is used to calculate the flow velocity of a liquid film. First, the displacement distance of each tracked feature point within the liquid film region between two adjacent images is calculated; that is, the distance through which the feature point passes in the [number of] images. Zhang Hedi The coordinate difference between the images is used to calculate the pixel distance of the displacement using the Pythagorean theorem, and then divided by the time interval between adjacent image acquisitions. Obtain the moving speed (pixels per unit time) of the feature point. Take the average moving speed of all feature points and multiply it by the pixel physical size. Convert the units to millimeters per unit time to obtain the liquid film flow velocity. ; By detecting and analyzing the state of the liquid film, an interference model was established, and the preliminary judgment results of S3, S4, and S5 were corrected, effectively eliminating the interference of the liquid film on the identification of abnormal features, with significant results. The calculation of correction values ​​for edge smoothness parameters, light transmittance ratio, size change rate, and position offset specifically addressed the impact of liquid film thickness, distribution, and flow velocity on edge detection, transparency analysis, and judgment of size and position changes, making the corrected parameters more accurately reflect the inherent properties of abnormal features. Accurate calculation of the liquid film flow velocity provided a reliable basis for the above corrections, ensuring their rationality and precision. This scheme, through a scientific correction mechanism, greatly improves the accuracy of subsequent comprehensive judgments, further perfecting the entire method for identifying plastic particles in connected ampoules. It maintains high recognition accuracy even in actual production scenarios with liquid film interference, providing stronger technical support for ampoule quality inspection.

[0030] In an embodiment of the present invention, in step S7: The comprehensive judgment includes setting weight values ​​for the preliminary judgment results of S3, S4 and S5 after S6 correction. The weight values ​​are dynamically adjusted according to the state of the liquid film. When the liquid film is thicker, the weight of S5 is increased, and when the liquid film is thinner, the weights of S3 and S4 are increased. A comprehensive judgment value is obtained through weighted calculation. The weighted calculation is to multiply the score corresponding to each preliminary judgment result by its weight and then sum them up. A positive value is assigned when the preliminary judgment is a bubble and a negative value is assigned when the preliminary judgment is a plastic particle. When the comprehensive judgment value reaches the set standard, it is determined to be an air bubble; otherwise, it is determined to be a plastic particle. Furthermore, in the process of comprehensive judgment, if there are contradictions in the preliminary judgment results, a second verification is carried out. The second verification includes re-examining the processing procedures and feature extraction results of each step to ensure the accuracy of the judgment.

[0031] Comprehensive judgment value The calculation formula is: ; in, This represents a comprehensive judgment value, which is dimensionless and used to ultimately determine whether the abnormal feature is an air bubble or plastic particles. The larger the value, the more likely it is an air bubble. , , These are the weights of the preliminary judgment results of S3, S4, and S5 after correction by S6, respectively. They are dimensionless and their range is [value missing]. And the sum of the three is 1; This represents the maximum possible position offset, expressed in pixels. The value is set according to the actual scenario and is used for... Perform normalization processing; This formula is used to synthesize the corrected parameters to obtain the final judgment index. First, the corrected values ​​of the edge smoothness parameter are calculated separately. Correction value for light transmittance ratio and their respective weights and Multiply them to get the weighted value of these two items. For the correction value of the rate of change of magnitude... and position offset correction value First through and Convert this into an index reflecting stability (the larger the value, the more stable the anomalous characteristics, and the more likely it is to be plastic particles), then multiply the two and add the weights. Multiply these three values ​​to obtain the weighted value for that term. Finally, sum these three weighted values ​​to obtain the overall judgment value. , The larger the value, the more the abnormal features match the characteristics of bubbles; The smaller the value, the more likely it is to be plastic pellets; The dynamic weight adjustment formula is: ; ; ; in, This represents the weighting coefficient, which is dimensionless and has a range of values ​​of 1. Used for control and The proportion; Indicates the thickness of the liquid film; This indicates the maximum possible thickness of the liquid film, which is determined based on the actual situation. This formula is used to dynamically adjust the weights of various judgment results based on the liquid film thickness. When the liquid film thickness... When smaller, The value is relatively large. and (The weights corresponding to S3 and S4) are relatively large. Smaller, highlighting the role of edges and transparency features; when the liquid film thickness When it is large, The value is small. and Smaller A relatively large value emphasizes the role of multi-image comparison results. Weighting coefficients. Used for control and The overall proportion is used to ensure that the sum of the weights is 1; Through comprehensive judgment and dynamic weight adjustment, accurate identification of abnormal features was achieved with significant results. (Comprehensive judgment value) The calculation integrates multiple factors, including corrected edge smoothness, transparency, size change rate, and positional offset, avoiding the limitations of single-feature judgment and providing a more comprehensive reflection of anomalous features. The dynamic weight adjustment mechanism flexibly allocates weights to each feature based on the liquid film thickness, highlighting more reliable judgment criteria under different liquid film conditions, thus improving the adaptability and accuracy of the judgment. The secondary verification step further reduces misjudgments caused by random errors, ensuring the reliability of the final result. As the final step in the entire identification method, this scheme integrates all effective information from the previous steps, significantly improving the accuracy of identifying plastic particles in rows of ampoules. It provides strong technical support for quality control in the ampoule production process, contributing to improved product quality and production efficiency.

[0032] The embodiments disclosed in this invention are preferred embodiments, but are not limited thereto. Those skilled in the art can easily understand the spirit of this invention based on the above embodiments and make different extensions and variations, but as long as they do not depart from the spirit of this invention, they are all within the protection scope of this invention.

Claims

1. A method for identifying plastic particles in a row of ampoules, characterized in that, Includes the following steps: S1. Image acquisition: During the filling process after the plastic ampoules are blow-molded, the image acquisition device integrated on the filling head performs multiple image acquisitions of the inside of the ampoules. S2. Abnormal Feature Recognition: Image recognition algorithms are used to process the acquired images and identify abnormal features on the inner wall of the ampoule. S2a, Boundary Distinction: For the identified abnormal features, by analyzing the gray-level co-occurrence matrix and texture features of the features with the surrounding area, the edge of the abnormal feature itself is distinguished from the edge of the liquid film, and the independent contour data of the abnormal feature is preserved. S3. Based on the judgment of edge features, perform edge detection and analysis on abnormal features, and make a preliminary judgment on whether the abnormal feature is a plastic particle or a bubble based on the smoothness of the edge. S4. Based on the judgment of transparency characteristics, perform transparency analysis on abnormal features, and make a preliminary judgment on whether the abnormal features are plastic particles or bubbles based on the degree of transparency. S5. Based on the judgment of multiple images, compare the size and position changes of abnormal features in multiple images, and make a preliminary judgment on whether the abnormal feature is plastic particles or bubbles based on the changes. S6, Liquid film interference correction: Detects and analyzes the state of the liquid film in the region where the abnormal feature is located, and corrects the preliminary judgment results of S3, S4, and S5 according to the degree of influence of the liquid film. S7. Comprehensive judgment: Based on the combined preliminary judgment results after S6 correction, finally determine whether the abnormal feature is plastic particles or air bubbles.

2. The method for identifying plastic particles in a row of ampoules according to claim 1, characterized in that, In S1: The lens of the image acquisition device is directed towards the inside of the ampoule and the shooting range covers the key areas of the inner wall of the ampoule. The key areas include the corner of the inner wall of the ampoule, the peripheral area that contacts the filling head, and the middle area of ​​the bottle. The corner covers the arc-shaped part where the bottle body and the bottom of the bottle are connected, and the peripheral area that contacts the filling head is a ring-shaped area centered on the insertion point of the filling head. Multiple image acquisitions are performed at set time intervals; Multiple images of the ampoule's interior taken at different times clearly show the texture of the ampoule's inner wall and any possible abnormal features, without obvious blurring or distortion.

3. The method for identifying plastic particles in a row of ampoules according to claim 1, characterized in that, In S2: The image recognition algorithm is a deep learning-based algorithm, specifically including a convolutional neural network model, which includes an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer. The preprocessing process includes denoising the image to eliminate random noise generated during the shooting process. The denoising method adopts filtering based on pixel neighborhood information. Enhancement is used to improve the contrast between abnormal features and the background in the image. The enhancement method includes adjusting the brightness and contrast of the image. Edge extraction is used to highlight the contours of objects in the image. The extraction method adopts an edge detection method based on gradient changes. Anomalies are identified by a trained anomaly recognition model, which is trained on an image dataset containing a large number of plastic particles and bubble samples. During the training process, data augmentation processing is performed on the samples, including image rotation, flipping, and cropping operations. The abnormal features are areas that appear to be plastic particles or bubbles, which are visually distinct from the surrounding normal areas in terms of color, grayscale, or texture in the image.

4. The method for identifying plastic particles in a row of ampoules according to claim 3, characterized in that, In S2a: When analyzing the gray-level co-occurrence matrix, the characteristic parameters of gray-level correlation, contrast, energy, and uniformity of the abnormal features and surrounding areas at different directions and distances are calculated. By combining roughness and directionality indicators in texture features, the edges of abnormal features themselves can be distinguished from the edges of liquid films.

5. The method for identifying plastic particles in a row of ampoules according to claim 4, characterized in that, In S3: Edge detection of anomalous features includes obtaining edge contour data of anomalous features through an edge detection operator. The edge detection operator is an operator that can identify regions with abrupt changes in grayscale in an image. The edge contour data contains the coordinate information of each pixel on the contour, forming a complete closed contour. The analysis process involves calculating the smoothness parameter of the edge contour. The smoothness parameter is obtained by measuring the degree of continuous change of the line connecting adjacent pixels on the edge contour, specifically by calculating the change range of the angle between the line connecting adjacent pixels. When the smoothness parameter reaches the set standard, that is, the edge contour is continuous and there are no obvious abrupt turns, and the angle between adjacent lines changes little and is uniform, it is initially judged to be a bubble. Otherwise, if the edge contour has obvious jaggedness or abrupt turns, and the included angle between adjacent lines varies greatly and is irregular, it is preliminarily judged to be plastic granules.

6. The method for identifying plastic particles in a row of ampoules according to claim 5, characterized in that, In S4: Transparency analysis yields a transparency parameter by calculating the ratio of light transmittance in abnormal feature areas to light transmittance in normal areas of the liquid inside the ampoule. The light transmittance is determined by analyzing the degree of light penetration in the corresponding area of ​​the image, specifically by using the gray value of the area in the image to reflect the intensity of light after penetration. When the transparency parameter reaches the set standard, that is, the light transmittance of the abnormal feature area is close to or reaches the light transmittance of the normal liquid area, the difference in gray value between the two is very small, and the light passes through almost without obstruction, it is initially judged to be a bubble. Otherwise, if the light transmittance of the abnormal feature area is significantly lower than that of the normal liquid area, the gray value of the two is significantly different, and there is obvious obstruction when the light passes through, it is initially judged to be plastic particles.

7. The method for identifying plastic particles in a row of ampoules according to claim 6, characterized in that, In S5: Comparing the size and positional changes of abnormal features in multiple images includes tracking the same abnormal feature through a feature matching algorithm. The feature matching algorithm adopts a matching method based on local invariant features, combined with the prediction of motion vectors of liquid film flow, eliminating false matching points caused by liquid film interference, and achieving corresponding matching across images by identifying the unique visual features of abnormal features. Record its size data and position coordinates in each image. The size data is reflected by the number of pixels contained in the abnormal feature region. The more pixels, the larger the abnormal feature. The position coordinates are reflected by the coordinates of the geometric center of the abnormal feature region in the image. The geometric center is the center position surrounded by the region boundary. Calculate the rate of change of the size and the positional offset of abnormal features in adjacent images; When the rate of change in size and the positional offset reach the set standards, that is, when the size of the abnormal feature shows obvious expansion or contraction over time, the number of pixels increases or decreases significantly, the position moves significantly over time, and the geometric center coordinates change significantly, it is initially judged to be a bubble. Otherwise, if the size and location of the abnormal features remain relatively stable, and the number of pixels and the coordinates of the geometric center change little or not at all, it is preliminarily judged to be plastic particles.

8. The method for identifying plastic particles in a row of ampoules according to claim 7, characterized in that, In S6: The detection and analysis of the liquid film state in the region of abnormal features includes identifying the distribution range by analyzing the gray-level gradient changes of the liquid film region in the image, determining the thickness by the difference in light reflection intensity of the liquid film region, and analyzing the flow state by analyzing the pixel displacement trajectory of the liquid film region in continuous images. An interference model is established based on the optical properties of liquid films, which reflects the influence of liquid films on light refraction and transparency. Based on the location of the abnormal features in the liquid film and the state of the liquid film, the correction values ​​of the edge smoothness parameter in S3, the correction value of the light transmittance ratio in S4, and the correction values ​​of the size change rate and position offset in S5 are calculated according to the interference model, and then the preliminary judgment results of S3, S4, and S5 are adjusted.

9. The method for identifying plastic particles in a row of ampoules according to claim 8, characterized in that, In S7: The comprehensive judgment includes setting weight values ​​for the preliminary judgment results of S3, S4 and S5 after S6 correction. The weight values ​​are dynamically adjusted according to the state of the liquid film. When the liquid film is thicker, the weight of S5 is increased, and when the liquid film is thinner, the weights of S3 and S4 are increased. A comprehensive judgment value is obtained through weighted calculation. The weighted calculation is to multiply the score corresponding to each preliminary judgment result by its weight and then sum them up. A positive value is assigned when the preliminary judgment is a bubble and a negative value is assigned when the preliminary judgment is a plastic particle. When the comprehensive judgment value reaches the set standard, it is determined to be an air bubble; otherwise, it is determined to be a plastic particle. Furthermore, in the process of comprehensive judgment, if there are contradictions in the preliminary judgment results, a second verification is carried out. The second verification includes re-examining the processing procedures and feature extraction results of each step to ensure the accuracy of the judgment.

Citation Information

Patent Citations

  • Row ampoule bottle identification system and identification method and storage medium

    CN115291765A

  • Sub-visible particle quality control method, system and equipment for intraocular injection

    CN116563249A

  • Automatic lamp inspection machine for BFS products

    CN119429606A

  • Method for determining stacking strength of foam surface particles and method for optimizing particle size distribution of foam stabilizing particles

    CN119578192A

  • Image processing device, image processing method, and image processing program

    WO2013080868A1