A method and system for 360-degree full-view appearance detection of syringe graduation lines
By combining prism imaging lighting and deep learning algorithms, the problems of low efficiency and insufficient accuracy in syringe scale detection have been solved, achieving high-precision, low-cost automated detection that can adapt to high-density production line layouts and ensure medical safety and production efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2026-03-24
AI Technical Summary
Existing syringe scale line detection methods are inefficient and inaccurate. Manual inspection is prone to fatigue and has a high rate of missed detections. Basic visual inspection equipment is spatially redundant and has limited functionality, making it unable to identify detailed defects.
By employing prism imaging lighting technology, the reflected light from the four orthogonal fields of view around the syringe is folded onto the same imaging plane. Combined with a high-resolution camera and deep learning algorithms, a syringe appearance detection model is constructed through hierarchical sampling strategy and feature encoding. This enables multi-print and coverage detection branches, reducing hardware costs and improving detection accuracy.
It achieves defect identification from millimeter level to 0.1mm level, improving detection accuracy and efficiency, reducing costs, adapting to high-density production line layouts, and ensuring medical safety and production efficiency.
Smart Images

Figure CN120668659B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of medical syringe production detection, in particular to a syringe scale line 360-degree full-view appearance detection method and system. BACKGROUND
[0002] Manual inspection is an early detection method, which completely depends on the experience of workers. In actual operation, its efficiency is extremely low, and the detection speed of each worker is less than 50 per minute. Moreover, long-term repetitive work is prone to cause fatigue of workers, and thus leads to frequent missed detection, with a missed detection rate of 5%-10%. More importantly, manual inspection cannot quantify the defect size, and it is difficult to accurately judge the product quality, which cannot meet the quality control requirements of modern large-scale production.
[0003] With the development of technology, primary vision detection equipment has been applied to syringe scale line detection. Such equipment usually adopts a detection method in which multiple cameras are arranged in a circle. In a disc-type automatic equipment, this layout causes a prominent problem of redundant installation space, and the equipment is difficult to be reasonably installed in limited space. At the same time, early primary vision detection uses a low-resolution camera (such as 1.3 million pixels) combined with a simple threshold segmentation algorithm, and the function is very limited, which can only identify whether the scale line exists, and cannot identify the line width overflow, underprint, overprint and other detailed defects. Even if the equipment is used for preliminary detection, subsequent manual re-inspection is still required, which not only increases the labor cost, but also fails to fundamentally solve the problems of detection efficiency and accuracy.
[0004] Therefore, in order to solve the above problems, the present application provides a syringe scale line 360-degree full-view appearance detection method and system. SUMMARY
[0005] In view of the deficiencies of the prior art, the purpose of the present application is to provide a syringe scale line 360-degree full-view appearance detection method and system.
[0006] To achieve the above purpose, the present application provides the following technical solutions:
[0007] A syringe scale line 360-degree full-view appearance detection method, comprising the following steps:
[0008] The prism imaging lighting step reflects the light of the four orthogonal viewing fields of the syringe to be detected in the circumferential direction to the same imaging plane of the sampling device through the prism module, and uniformly lights the syringe to be detected through the light source group;
[0009] The data sampling processing step collects the four-direction field of view acquisition image of the to-be-inspected syringe through the sampling device, performs shape primitive decomposition and feature coding on the four-direction field of view acquisition image through a stratified sampling strategy, classifies the four-direction field of view acquisition image according to the geometric unit type in the image, and labels the image geometric type to obtain a to-be-inspected image.
[0010] The to-be-inspected defect identification step constructs a syringe appearance detection model, inputs the to-be-inspected image into the syringe appearance detection model, performs defect identification detection output after branch detection according to the image geometric type matching model detection branch, and outputs the syringe appearance defect result according to the branch detection result. When all branch detection results are defect-free, the syringe appearance defect result is qualified; otherwise, the syringe appearance defect result is defective.
[0011] As a further improvement of the present application, it further includes an interference error verification step, which includes selecting a syringe with a qualified syringe appearance defect result and implanting a known defect, and setting a rotating interference by periodically changing the syringe clamping angle and positioning accuracy through the disc machine control system. The syringe with the set rotating interference is detected again in real time for defects by the syringe scale line 360 full-view appearance detection system, and the defect omission rate and false positive rate in the disturbance period are output according to the detection result. When the defect omission rate and false positive rate are higher than the corresponding preset threshold, a correction instruction is output.
[0012] As a further improvement of the present application, it further includes a dynamic parameter correction step, when receiving the correction instruction, the defect omission rate, false positive rate and known defect type in the disturbance period are used to adjust the generalization parameters of the syringe appearance detection model for the rotating offset image through incremental learning, and the geometric deformation of the to-be-inspected image is error compensated according to the adjusted parameters.
[0013] As a further improvement of the present application, the prism imaging lighting step includes setting plane mirrors at a 45-degree inclination angle in the four-directions of the syringe to form a light splitting prism matrix, the light splitting prism matrix reflects the four-direction field of view image of the syringe to the corresponding sensor area of the sampling device, and four sub-image groups composed of four-direction field of view acquisition image are formed on the sampling device through four-way light signal folding.
[0014] As a further improvement of the application, the stratified sampling strategy comprises defining a scale line shape primitive library of the syringe, the shape primitive library comprising: standard horizontal scale lines, standard vertical scale lines, font structure frames, defect dirty areas and composite polygons; by inputting the four-direction field acquisition image into a deep learning-based semantic segmentation network, multi-scale features in the image are extracted through continuous downsampling and convolution in the encoder, and the detail features of the shallow layer and the semantic features of the deep layer of the image are fused through the jump connection, and the output branches are set according to the geometric unit types in the shape primitive library in the output layer, and the classification of the four-direction field acquisition image is completed by calculating the probability of each pixel point in the four-direction field acquisition image belonging to the geometric unit types in each output branch to obtain the image to be inspected.
[0015] As a further improvement of the application, the syringe appearance detection model constructs a multi-print detection branch and an overlay detection branch according to the geometric unit types of the image to be inspected through a preset mapping rule, when the geometric unit type is a horizontal scale line or a vertical scale line, a multi-print detection branch based on the pixel space distribution of the geometric unit is constructed to perform defect detection through line length threshold comparison and spacing analysis; when the geometric unit type is a font structure frame, a defect dirty area or a composite polygon, an overlay detection branch based on the contour integrity of the geometric unit is constructed to perform defect detection through coverage calculation and fracture feature recognition; when any detection branch detects a defect, the syringe appearance detection model outputs the syringe appearance defect result as existing defects.
[0016] As a further improvement of the application, the multi-print detection branch comprises: positioning the geometric unit of the horizontal scale line or the vertical scale line, outputting the primitive bounding box and the pixel coordinates, calculating the scale line pixel length based on the primitive bounding box and the pixel coordinates, and converting the actual length according to the preset physical size mapping relationship, comparing the actual length with the preset length threshold, and outputting the comparison result.
[0017] As a further improvement of the application, the overlay detection branch comprises: calibrating the pixel coordinates of the geometric unit of the font structure frame, the defect dirty area or the composite polygon, performing semantic segmentation, generating the corresponding mask area, and extracting the mask contour through edge detection, calculating the coverage rate of the effective pixels in the mask area, if the coverage rate is lower than the preset threshold, it is determined that the coverage is not comprehensive, if the length of the fracture segment in the mask contour is detected to be greater than the preset threshold, it is determined that there is a local missing defect, and the determination result is output.
[0018] A syringe scale line 360-degree full-view appearance detection system, comprising:
[0019] The prism imaging lighting module reflects the four orthogonal field of view of the syringe to be detected through the prism module to the same imaging plane of the sampling device, and uniformly lights the syringe to be detected through the light source group.
[0020] The data sampling processing module obtains four-direction field of view collection images of the syringe to be detected through the sampling device, decomposes and encodes the four-direction field of view collection images through a layered sampling strategy, classifies and labels the image geometric types to obtain the detected images according to the geometric unit types in the images.
[0021] The detected defect recognition module constructs a syringe appearance detection model, inputs the detected images into the syringe appearance detection model, performs defect recognition detection and output to obtain the branch detection result according to the image geometric type matching model detection branch, and judges and outputs the syringe appearance defect result according to the branch detection result. When all branch detection results are defect-free, the syringe appearance defect result is qualified; otherwise, the syringe appearance defect result is defective.
[0022] As a further improvement of the present application, the prism module includes five high-reflective plane lenses, which are orthogonally arranged at an angle of 45 degrees. The first lens reflects the 0-degree field of view light directly to the corresponding sensor area of the sampling device. The second lens reflects the 270-degree field of view light directly to the corresponding sensor area. The third lens reflects the 90-degree field of view light to the fourth lens, and enters the corresponding sensor area after two reflections. The fourth lens reflects the 180-degree field of view light to the fifth lens, and enters the corresponding sensor area after two reflections.
[0023] The beneficial effects of the present application are:
[0024] (1) The detection accuracy is improved, realizing the leap from millimeter level to 0.1mm level defect recognition, and accurately detecting the line width overflow, less printing, re-printing of the scale line, and the subtle defects of the font and pattern. For example, in the detection of 1ml syringe standard horizontal scale line, it can be accurately judged whether its length is within the range of 2mm-2.2mm, the error is controlled in a very small range, and the error of drug dose caused by subtle defects of scale line can be effectively avoided, providing a solid guarantee for medical safety.
[0025] (2) The production efficiency is improved. Through the combination of AI deep learning algorithm, disc machine and detection system, automatic printing of scale line and intelligent AI recognition are realized simultaneously. The quality of scale line is identified in real time while printing in batches, without separating the printing and detection links, greatly reducing the downtime, improving the space utilization of production line, and significantly improving the production efficiency.
[0026] (3) The detection cost has been reduced. By using the prism module optical path folding technology, the multi-camera detection scheme has been optimized into a single camera multi-screen synchronous acquisition, reducing the number of cameras from 4 to 1, which effectively reduces the hardware cost. In addition, since the installation space is shortened by at least 2 times, it is suitable for high-density production line layouts such as disc machines, reducing the cost of production space occupation. Furthermore, there is no need for multi-camera synchronous calibration, which reduces the maintenance complexity and further saves maintenance costs. Attached Figure Description
[0027] Figure 1 This is a flowchart of the method of the present invention;
[0028] Figure 2 This is a system schematic diagram of the present invention;
[0029] Figure 3 This is a flowchart of the verification and correction steps in an embodiment of the present invention;
[0030] Figure 4 This is a schematic diagram of system defect detection according to an embodiment of the present invention;
[0031] Figure 5 This is a schematic diagram illustrating the defects of an embodiment of the present invention. Detailed Implementation
[0032] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Identical components are denoted by the same reference numerals. It should be noted that the terms "front," "rear," "left," "right," "upper," and "lower" used in the following description refer to directions in the accompanying drawings, and the terms "bottom surface," "top surface," "inner," and "outer" refer to directions toward or away from the geometric center of a specific component, respectively.
[0033] A method for 360-degree omnidirectional visual inspection of syringe graduation lines, such as... Figure 1 As shown, it includes the following steps:
[0034] In the prism imaging lighting step, the four orthogonal fields of view reflected light from the syringe under test are folded into the same imaging plane of the sampling device through the prism module, and the syringe under test is uniformly illuminated through the light source group.
[0035] Specifically, such as Figures 2 to 4 As shown, the prism imaging lighting step further includes setting the plane mirrors at a 45-degree angle in the four directions of the syringe to form a beam splitting prism matrix. The beam splitting prism matrix reflects the four-directional field-of-view image of the syringe to the corresponding sensor area of the sampling device. The four optical signals are folded onto the sampling device to form four spatially separated sub-images to form a four-directional field-of-view acquisition image.
[0036] In actual production process, if the images of the circumferential four surfaces of the syringe to be detected are collected by the traditional four cameras, the required equipment arrangement space is large, and there is a problem of time sequence synchronization required for image collection. In order to solve the problems of redundant installation space and mechanical interference in the traditional multi-camera synchronous detection scheme in the disc type automatic equipment, a light path folding imaging method based on prism module is used to realize the optimization of the detection architecture of single camera multi-picture synchronous collection. In order to adapt to the demand of high-speed production, the lighting step of prism imaging is optimized. A high-precision plane mirror with reflectivity of 99.5% and stronger anti-scratching ability is arranged in the customized prism module at an angle of 45 degrees. When the syringe to be detected flows to the detection area with the disc, the customized point light source vertically irradiates from below, and the diameter of its light emitting surface accurately covers the diameter of the syringe tube, providing basic illumination. At the same time, the angle ring light irradiates from the side at an angle of 30 degrees, optimizing the light supplement effect, ensuring the uniform illumination of the tube surface, and reducing the shadow and overexposure phenomenon. At this time, the circumferential four orthogonal view fields of the syringe reflect light into the prism module. The reflected light with 0 degree view angle directly enters the sensor area A of the sampling device through the mirror M1; the reflected light with 270 degree view angle directly enters the sensor area D through the mirror M2; the reflected light with 90 degree view angle is refracted to the side through the mirror M3, and then enters the sensor area B through the mirror M5 after being reflected twice; the reflected light with 180 degree view angle is refracted to the side through the mirror M4, and then enters the sensor area C through the mirror M6 after being reflected twice. After folding of the four light signals, four sub-images are formed on the same imaging plane of the sampling device, the folding and uniform lighting of the four-way view field reflected light are completed, and high-quality image basis is provided for subsequent detection, so that the installation space is reduced and the detection precision is improved.
[0037] The data sampling processing step collects the four-way view field collection images of the syringe to be detected by the sampling device, decomposes and encodes the shape primitives of the four-way view field collection images through the layered sampling strategy, classifies the four-way view field collection images according to the geometric unit types in the images, and marks the image geometric types to obtain the detected images.
[0038] In the data sampling processing link, the frequent update of the syringe scale line style in the production process is optimized.
[0039] After the sampling device collects the four-way view field collection images of the syringe to be detected, the images are processed according to the pre-defined scale line shape primitive library. The shape primitive library clearly includes five types of basic geometric units, i.e. standard horizontal scale line, standard vertical scale line, font structure frame, defect dirt area and composite polygon.
[0040] The collected image is input into a deep learning-based semantic segmentation network. In the encoder, multi-scale features in the image are extracted through successive downsampling and convolution operations. For example, the image is first downsampled by a factor of 2, and 3x3 convolution kernels are used to extract preliminary features. Then, the image is downsampled by a factor of 4, and 5x5 convolution kernels are used to extract more abstract features. At the same time, the shallow detail features and deep semantic features are fused through a skip connection to ensure the integrity of the features.
[0041] In the output layer, five output branches are set according to the geometric element types in the shape primitive library. For each pixel point, the probability of belonging to the geometric element types in each output branch is calculated, thereby completing the classification of the four-way field of view collected image and marking the image geometry type to obtain the image to be inspected. In this way, the image can be processed more accurately, meeting the detection needs of different style scale lines and improving the labeling efficiency and defect recognition accuracy.
[0042] Specifically, as shown in Figures 2 to 4 The hierarchical sampling strategy includes defining a scale line shape primitive library of the syringe, which includes: standard horizontal scale line, standard vertical scale line, font structure frame, defect and dirt area, and composite polygon; by inputting the four-way field of view collected image into a deep learning-based semantic segmentation network, multi-scale features in the image are extracted through successive downsampling and convolution in the encoder, and shallow detail features and deep semantic features of the image are fused through a skip connection, and output branches are set in the output layer according to the geometric element types in the shape primitive library, and the probability of each pixel point in the four-way field of view collected image belonging to the geometric element types in each output branch is calculated to complete the classification of the four-way field of view collected image to obtain the image to be inspected.
[0043] For the standard horizontal scale line, according to different syringe specifications, accurate length intervals and width ranges are divided. For example, the length of the standard horizontal scale line of a 1ml syringe is accurate to 2mm-2.2mm, and the width is 0.15mm-0.18mm; the length of the standard horizontal scale line of a 5ml syringe is 3mm-3.3mm, and the width is 0.2mm-0.23mm. For the standard vertical scale line, in addition to the specified length and width range, the accuracy of the included angle between the vertical scale line and the horizontal scale line is also specified, which is required to be between 89.5 degrees and 90.5 degrees.
[0044] For the font structure frame, independent templates are established for different font styles, and there are clear standards for the outline of each character, stroke thickness, character spacing, etc. For example, the font structure frame of the "5" character in Arial font has a height of 2mm, a width of 1.5mm, a stroke thickness of 0.2mm, and a uniform character spacing of 0.3mm.
[0045] For defective dirty areas, according to the common defect types in past production, a detailed defect library is constructed. For example, circular dirt formed by ink accumulation, with a radius ranging from 0.1mm to 0.5mm; scratch defects, classified according to scratch length, width and depth, with a length of 1mm to 5mm, a width of 0.05mm to 0.2mm, and a depth of 0.01mm to 0.03mm, etc. Compound polygons are mainly aimed at complex patterns or logos on the syringe, such as enterprise logos, and the coordinates of each vertex, the length ratio of the edges, and the interior angles are accurately recorded and defined.
[0046] When inputting the four-way field of view acquisition image into the deep learning-based semantic segmentation network, an improved U-Net network structure is selected. In the encoder part, a 3x3 convolution kernel with a step of 2 is used for continuous downsampling, and the channel number is doubled after each downsampling. For example, the input image size is 256x256x3, after the first downsampling, the image size becomes 128x128, and the channel number becomes 64; after another downsampling, the image size becomes 64x64, and the channel number becomes 128, and so on. In this way, multi-scale features in the image can be efficiently extracted, from small-scale scale line detail features to large-scale overall structure features.
[0047] In the part of jump connection fusion of image shallow detail features and deep semantic features, a weighted fusion method is adopted. Higher weight is assigned to shallow detail features, because defects of scale lines often exist in subtle places. For example, the weight of shallow features is set to 0.6, and the weight of deep semantic features is set to 0.4. In this way, in the fusion process, the details such as whether the scale line edge is clear and whether there are fine scratches can be better preserved, and at the same time, the deep semantic features are combined to understand the overall structure, so as to improve the recognition ability of complex defects.
[0048] In the output layer, according to the five types of geometric unit in the shape primitive library, five output branches are set respectively. Each branch uses a Softmax activation function to calculate the probability of each pixel point in the four-way field of view acquisition image belonging to the corresponding geometric unit type. Taking the standard horizontal scale line branch as an example, for a certain pixel point in the image, if the probability of belonging to the standard horizontal scale line is greater than 0.8 after Softmax calculation, it is determined that the pixel point belongs to the standard horizontal scale line category. Through this accurate calculation and classification, more accurate images to be inspected are obtained, providing a solid data foundation for subsequent defect recognition, greatly improving the accuracy and reliability of detection, and meeting the purpose of precise appearance detection of syringe scale lines.
[0049] The step of identifying the to-be-inspected defect, the appearance detection model of the syringe is constructed, the to-be-inspected image is input into the appearance detection model of the syringe, the defect identification detection is carried out according to the image geometry type matching model detection branch, and the branch detection result is output, and the appearance defect result of the syringe is output according to the branch detection result. When all branch detection results are no defect, the appearance defect result of the syringe is qualified; otherwise, the appearance defect result of the syringe is output as existing defect.
[0050] When the geometry unit type is a horizontal scale line or a vertical scale line, the multi-print detection branch is started. First, the target detection algorithm is used to accurately position the geometry unit of the scale line, and the primitive bounding box and pixel coordinates are output. For example, the YOLO algorithm is used to quickly locate the scale line position. Then, based on the primitive bounding box and pixel coordinates, the scale line pixel length is calculated. According to the pre-determined physical size mapping relationship, the pixel length is converted into the actual length. Assuming that 100 pixels correspond to 1mm of actual length, the actual length is calculated and compared with the preset length threshold. If a certain horizontal scale line is shorter than the preset threshold by 0.1mm, it is determined as a line short defect, and the comparison result is output.
[0051] When the geometry unit type is a font structure box, a defect stain or a composite polygon, the coverage detection branch starts to work. Taking the font structure box as an example, the pixel coordinates are first calibrated, the corresponding mask area is generated by using the semantic segmentation algorithm, and the mask contour is extracted by using the Canny edge detection algorithm. The effective pixel ratio in the mask area is calculated to obtain the coverage rate, and if the coverage rate is lower than the preset threshold of 80%, it is determined that the coverage is not comprehensive. At the same time, it is detected whether there is a broken section in the mask contour, and if the length of the broken section exceeds the preset threshold of 0.5mm, it is determined as a local missing defect, and the determination result is output.
[0052] According to the branch detection results, when all branch detection results are no defect, the appearance defect result of the syringe is output as qualified; otherwise, the existing defect is output. In this way, the detection accuracy and reliability are improved, the medical safety is guaranteed, and the purpose of the application is achieved.
[0053] Specifically, as Figures 2 to 4As shown, the syringe appearance detection model constructs a multi-print detection branch and an overlay detection branch according to the geometric unit type of the image to be detected through a preset mapping rule. When the geometric unit type is a horizontal scale line or a vertical scale line, the multi-print detection branch based on the pixel space distribution of the geometric unit is constructed to perform defect detection through line length threshold comparison and spacing analysis. When the geometric unit type is a font structure frame, a defect stain, or a composite polygon, the overlay detection branch based on the contour integrity of the geometric unit is constructed to perform defect detection through coverage calculation and fracture feature recognition. When any detection branch detects a defect, the syringe appearance detection model outputs a syringe appearance defect result as existing defects.
[0054] When positioning the scale line, the YOLO algorithm is used as the target detection algorithm. According to the characteristics of the medical syringe scale line image, a large number of image data containing different specifications and styles of scale lines are used for training in the model training stage. These data cover common scale line styles and also contain special or variant situations that may occur in production. During training, the model learns the characteristics of the scale line, such as the color, texture, shape of the line, and the relative position relationship with the surrounding pattern, etc. In actual detection, when the four-way field of view image is input into the model, the model can quickly identify the geometric units of the horizontal or vertical scale line and output accurate primitive boundary boxes and pixel coordinates.
[0055] When calculating the pixel length of the scale line, the coordinate information of the primitive boundary box is used to determine the pixel length through a specific pixel calculation method. For example, the number of pixels along the direction of the scale line is counted, and the image resolution information is combined to ensure the accuracy of the calculation. Then, the actual length is converted according to the preset physical size mapping relationship. This mapping relationship is determined in the system calibration stage, and a high-precision standard scale mold is used for image acquisition. By comparing the actual scale length of the mold with the pixel length in the image, an accurate mapping ratio is obtained, such as 100 pixels corresponding to 1 mm. In the comparison of the actual length and the preset length threshold, the system compares the converted actual length with the threshold set according to the production standard. For a 1 ml syringe, the standard scale line length is 2 mm, and considering the production tolerance, the length threshold range is set to 1.9 mm-2.1 mm.
[0056] From the accuracy of defect detection, the multi-print detection branch can accurately identify the length abnormality of the scale line. In the detection of a certain production enterprise, the traditional detection method has a missed detection rate of 5%-10%, and after using this branch, the missed detection rate of defects such as multi-printing of scale lines and length abnormality of scale lines is reduced to within 1%. In terms of production quality control, through real-time detection, production equipment problems can be found in time. If consecutive products with overlong or over short scale lines appear, the system will issue a warning to prompt the staff to check and adjust the scale line printing module of the printing equipment, thereby reducing the defective product rate and improving the production efficiency. From the perspective of medical safety guarantee, the dosage error caused by scale line problems is effectively avoided, and strong guarantee is provided for patient safety.
[0057] Specifically, as shown in Figures 2 to 4 The multi-print detection branch includes positioning the geometric unit of the horizontal scale line or the vertical scale line, outputting the primitive bounding box and the pixel coordinates, calculating the scale line pixel length based on the primitive bounding box and the pixel coordinates, converting the actual length according to the preset physical size mapping relationship, comparing the actual length with the preset length threshold, and outputting the comparison result.
[0058] In the case of complex production environment, such as electromagnetic interference and unstable light in the factory workshop, it may affect the accuracy of the multi-print detection branch. In order to solve these problems, SORT algorithm is used as the target tracking algorithm when positioning the geometric unit of the horizontal scale line or the vertical scale line. This algorithm increases the deep learning recognition of scale line features on the basis of the original algorithm, which can more accurately lock the position of the scale line. Even in the case of sudden changes in light, it can also stably output the primitive bounding box and the pixel coordinates.
[0059] When calculating the pixel length of the scale line, the image correction algorithm is introduced to consider the distortion problem that may exist in the image acquisition process. By correcting the distortion of the acquired image, the calculation of the pixel length of the scale line is more accurate. For example, Zhang's calibration method is used to calibrate the camera to obtain the intrinsic and distortion parameters of the camera, and the acquired image is corrected. When converting the actual length according to the preset physical size mapping relationship, a dynamic calibration mechanism is used. After a certain period of time or a certain number of syringes are detected, a calibration block with a standard length is used to calibrate the mapping relationship to ensure the accuracy of the actual length calculation. For the preset length threshold, instead of using a fixed value, the length threshold is dynamically adjusted according to the process requirements of different production batches of syringes. For example, for a batch of 10ml syringes, due to the adjustment of the production process, the scale line length tolerance range is reduced, and at this time the system will automatically adjust the preset length threshold to ensure the accuracy and adaptability of the detection.
[0060] Specifically, as shown in Figures 2 to 4As shown, the coverage detection branch includes, by calibrating pixel coordinates of the font structure frame, defect stains or composite polygons, performing semantic segmentation, generating corresponding mask regions, and extracting mask contours through edge detection, calculating the effective pixel ratio in the mask region to obtain the coverage rate, if the coverage rate is lower than the preset threshold, it is determined that the coverage is not comprehensive, if the length of the broken segment in the mask contour is detected to be more than the preset threshold, it is determined that there is a local missing defect, and the determination result is output.
[0061] For glass syringes, when performing semantic segmentation, a segmentation algorithm based on multispectral images is used. In addition to ordinary visible light images, near-infrared spectral images are also collected, combining the information of the two kinds of images to more accurately identify the boundaries of the font structure frame, defect stains and composite polygons, thereby generating more accurate mask regions. When extracting the mask contour, morphological operations are used to optimize the edge. First, the edge is expanded using dilation operation, and then the edge is restored using erosion operation, which can remove the noise caused by reflection, making the extracted mask contour more accurate. For the calculation of the coverage rate, considering that the reflection of glass may cause some pixels to be misjudged as invalid pixels, an adaptive threshold calculation method is used. According to the overall brightness and contrast of the image, the judgment threshold of the effective pixels is dynamically adjusted to ensure the accuracy of the coverage rate calculation. For the preset threshold, according to the light transmittance and surface smoothness of the glass material, the coverage rate preset threshold is adjusted to 92% for glass syringes with high light transmittance and smooth surface.
[0062] For plastic syringes, due to the surface texture that may interfere with defect detection, the image is first denoised before calibrating the pixel coordinates. A denoising algorithm based on wavelet transform is used to remove the noise caused by surface texture and retain useful defect information. In the semantic segmentation process, the attention mechanism in deep learning is introduced to make the model pay more attention to the areas where defects may exist, improving the segmentation accuracy. When calculating the coverage rate, considering that the small recesses on the surface of the plastic material may affect the judgment of the effective pixels, a three-dimensional reconstruction technology is used to assist in calculation. By three-dimensional reconstruction of the surface of the syringe, more accurate surface information is obtained, so that the effective pixel ratio is more accurately calculated. For the preset threshold of the broken segment length, according to the elasticity and deformability of the plastic material, the broken segment length preset threshold is adjusted to 0.2mm for plastic syringes with greater elasticity, to more accurately detect local missing defects.
[0063] Specifically, as Figures 2 to 4As shown, it also includes an interference error verification step, including selecting syringes with appearance defect results output as qualified implanting known defects, and setting rotating interference by periodically changing the syringe clamping angle and positioning accuracy of the disc machine control system, real-time defect detection of the syringes after setting rotating interference through the syringe scale line 360 full-view appearance detection system, and outputting the defect omission rate and false positive rate in the disturbance period according to the detection results, and outputting a correction instruction when the defect omission rate and false positive rate are higher than the corresponding preset threshold.
[0064] In the interference error verification step, when selecting qualified syringes to implant known defects, all kinds of defects that may occur in actual production are fully considered. For example, in addition to implanting common 0.1mm scale line and font missing, 0.1mm dirt and other defects, some special defects will also be implanted according to the problems prone to occur in specific production processes, such as scale line blur caused by unstable ink quality, scale line edge jagged defect caused by mold wear, etc.
[0065] When setting rotating interference, the disc machine control system not only periodically changes the syringe clamping angle and positioning accuracy, but also simulates different rotating speeds and accelerations. On a high-speed production line, the rotating speed of the syringe is fast, and the interference test is performed with a speed change of ±20% based on the normal production speed; for acceleration, different acceleration changes in the start and stop stages are simulated, such as setting different accelerations of 0.5g, 1g, 1.5g (g is the acceleration of gravity) in the start stage, and setting different decelerations in the stop stage, so as to more comprehensively simulate the rotating conditions that may occur in actual production.
[0066] In the real-time defect detection process, in order to more accurately analyze the defect omission rate and false positive rate, in addition to recording the overall omission and false positive number, different types of defects are also counted separately. For example, scale line defects, font defects, dirt defects, etc. are classified and recorded to analyze the omission and false positive of each defect under different rotating interference conditions. At the same time, combined with production batch information for statistical analysis, because different batches of products may have differences due to factors such as raw materials and production environment, through batch analysis, potential problems can be found more accurately.
[0067] The corresponding threshold is not fixed, but is dynamically adjusted according to the improvement of production process, the improvement of product quality standard and the detection data in the past. If the omission rate and false positive rate of continuous batches of products under certain rotating interference conditions are low and stable at a certain level, the corresponding threshold can be appropriately reduced to improve the sensitivity of the detection system; on the contrary, if the production process changes greatly or new defect types appear, the threshold should be increased accordingly to ensure the reliability of the detection system.
[0068] Specifically, for example,Figures 2 to 4 The method also includes a dynamic parameter correction step, when receiving the correction instruction, adjusting the generalization parameters of the syringe appearance detection model for the rotation offset image through incremental learning according to the defect miss rate, false positive rate and known defect types in the disturbance period, and performing error compensation on the geometric deformation of the to-be-detected image according to the adjusted parameters.
[0069] When receiving the correction instruction, in the process of adjusting the generalization parameters of the syringe appearance detection model for the rotation offset image through incremental learning, a more advanced deep learning algorithm is used. For example, a model based on the Transformer architecture is used to effectively capture the feature changes in the rotation offset image by using its powerful attention mechanism. In the incremental learning process, the newly acquired data containing rotation interference and known defects are fused with the original training data, and the parameters of the model are updated through an optimization algorithm.
[0070] According to the defect miss rate, false positive rate and known defect types in the disturbance period, different parameters of the model are adjusted. For the case where the scale line defect miss rate is high, the parameters related to scale line feature extraction are adjusted, such as the weights of convolution kernels and the parameters of pooling layers, to enhance the model's recognition ability of scale lines; for the defect types with high false positive rate, the threshold parameters of the classifier are adjusted to optimize the decision boundary of the model.
[0071] In the error compensation of the geometric deformation of the to-be-detected image, an image registration-based method is used. First, the corresponding feature points are found between the rotation interference image and the standard image through a feature point matching algorithm, and then the geometric transformation parameters such as rotation angle, translation amount and scaling ratio of the image are calculated using these feature points. According to the calculated parameters, the to-be-detected image is geometrically transformed to achieve accurate compensation for the geometric deformation caused by rotation offset.
[0072] In order to verify the effect of dynamic parameter correction, a certain number of test samples are detected again after correction. These test samples include both previously problematic samples and new samples. By comparing the detection results before and after correction, the changes in defect miss rate and false positive rate are evaluated. If the correction effect is not satisfactory, parameter adjustment and detection are performed again until the desired detection accuracy is achieved. At the same time, the corrected parameters and detection results are recorded for subsequent production data analysis and model optimization.
[0073] A syringe scale line 360-degree full-view appearance detection system, comprising:
[0074] A prism imaging and lighting module folds the reflected light of the four orthogonal viewing fields of the to-be-detected syringe in the circumferential direction into the same imaging plane of the sampling device through a prism module, and uniformly illuminates the to-be-detected syringe through a light source group;
[0075] The data sampling processing module collects the four-direction field of view images of the syringe to be detected through the sampling device, performs shape primitive decomposition and feature coding on the four-direction field of view images through a stratified sampling strategy, classifies the four-direction field of view images according to the geometric unit types in the images, and labels the image geometric types to obtain the images to be detected.
[0076] The defect identification module constructs a syringe appearance detection model, inputs the images to be detected into the syringe appearance detection model, performs defect identification detection according to the image geometric type matching model detection branch, and outputs the branch detection result. According to the branch detection result, the syringe appearance defect result is output. When all branch detection results are defect-free, the syringe appearance defect result is qualified. Otherwise, the syringe appearance defect result is defective.
[0077] Specifically, the prism module includes five high-reflective plane lenses, which are orthogonally arranged at an angle of 45 degrees. The first lens directly reflects the 0-degree field of view reflected light to the corresponding sensor area of the sampling device. The second lens directly reflects the 270-degree field of view reflected light to the corresponding sensor area. The third lens refracts the 90-degree field of view reflected light to the fourth lens, and enters the corresponding sensor area after twice reflection. The fourth lens refracts the 180-degree field of view reflected light to the fifth lens, and enters the corresponding sensor area after twice reflection.
[0078] The above shows and describes the basic features, principles and advantages of the present application. It should be noted that the present application is not limited by the above embodiments, but only some embodiments, and several improvements and supplements made without departing from the spirit and scope of the present application are considered as the protection scope of the present application.
Claims
1. A method for 360-degree all-view appearance inspection of syringe scale lines, characterized in that, Includes the following steps: In the prism imaging lighting step, the four orthogonal fields of view reflected light from the syringe under test are folded into the same imaging plane of the sampling device through the prism module, and the syringe under test is uniformly illuminated through the light source group. The data sampling and processing steps involve acquiring a four-way field-of-view image of the syringe to be tested using the sampling device, performing shape primitive decomposition and feature encoding on the four-way field-of-view image using a hierarchical sampling strategy, classifying the four-way field-of-view image according to the geometric unit type in the image, and labeling the image geometry type to obtain the image to be tested. The defect identification step involves constructing a syringe appearance detection model, inputting the image to be inspected into the syringe appearance detection model, matching the branches according to the image geometry type, performing defect identification detection, and outputting the branch detection results. Based on the branch detection results, the syringe appearance defect result is determined and output. When all branch detection results are defect-free, the syringe appearance defect result is output as qualified. Conversely, the result for the syringe's appearance defect is "defect exists"; The hierarchical sampling strategy includes defining a primitive library of syringe scale lines, which includes: standard horizontal scale lines, standard vertical scale lines, font structure boxes, defect and dirt areas, and composite polygons; inputting the four-way field-of-view acquired image into a deep learning-based semantic segmentation network; extracting multi-scale features from the image in the encoder through continuous downsampling and convolution; fusing shallow detail features and deep semantic features of the image through skip connections; setting output branches in the output layer according to the geometric unit types in the primitive library; and classifying the four-way field-of-view acquired image to obtain the image to be inspected by calculating the probability that each pixel in the four-way field-of-view acquired image belongs to the geometric unit type in each output branch. The syringe appearance detection model constructs a multi-print detection branch and a coverage detection branch based on the geometric unit type of the image to be inspected, using preset mapping rules. When the geometric unit type is a horizontal or vertical scale line, a multi-print detection branch is constructed to detect defects based on the pixel spatial distribution of the geometric unit through line length threshold comparison and spacing analysis. When the geometric unit type is a font structure box, a defect or dirt, or a compound polygon, a coverage detection branch is constructed to detect defects based on the contour integrity of the geometric unit through coverage calculation and breakage feature recognition. When any detection branch detects a defect, the syringe appearance detection model outputs the syringe appearance defect result as having a defect. The multi-print detection branch includes locating the geometric units of the horizontal or vertical scale lines, outputting the primitive bounding boxes and pixel coordinates, calculating the pixel length of the scale line based on the primitive bounding boxes and pixel coordinates, converting it into the actual length according to a preset physical size mapping relationship, comparing the actual length with a preset length threshold, and outputting the comparison result. The coverage detection branch includes: calibrating pixel coordinates of geometric units of font structure boxes, defects, dirt, or composite polygons; performing semantic segmentation to generate corresponding mask regions; extracting mask contours through edge detection; calculating the effective pixel ratio in the mask region to obtain the coverage rate; if the coverage rate is lower than a preset threshold, it is determined to be incomplete coverage; if a broken segment with a length exceeding the preset threshold is detected in the mask contour, it is determined to be a local missing defect, and the determination result is output.
2. The method for 360-degree all-view appearance inspection of syringe scale lines according to claim 1, characterized in that, It also includes an interference error verification step, which involves selecting a syringe with a qualified appearance defect output as the syringe, implanting it with a known defect, and using a disc machine control system to periodically change the syringe clamping angle and positioning accuracy to set rotational interference. The syringe with the rotational interference set is then subjected to real-time defect detection again through a syringe scale 360-degree full-view appearance inspection system. Based on the detection results, the defect missed detection rate and false alarm rate within the disturbance period are output. When the defect missed detection rate and false alarm rate are higher than the preset corresponding threshold, a correction command is output.
3. The method for 360-degree all-view appearance inspection of syringe scale lines according to claim 2, characterized in that, It also includes a dynamic parameter correction step. When a correction instruction is received, the generalization parameters of the syringe appearance inspection model for the rotational offset image are adjusted by incremental learning based on the defect miss rate, false alarm rate and known defect type within the disturbance period. The geometric deformation of the image to be inspected is then compensated for based on the adjusted parameters.
4. The method for 360-degree all-view appearance inspection of syringe scale lines according to claim 1, characterized in that, The prism imaging lighting step includes setting a plane mirror at a 45-degree angle in the four directions of the syringe to form a beam-splitting prism matrix. The beam-splitting prism matrix reflects the four-directional field-of-view image of the syringe to the corresponding sensor area of the sampling device. The four optical signals are folded onto the sampling device to form four spatially separated sub-images, which together form a four-directional field-of-view acquisition image.
5. A 360-degree all-view appearance inspection system for syringe graduation lines, applicable to the 360-degree all-view appearance inspection method for syringe graduation lines as described in any one of claims 1 to 4, characterized in that, include: The prism imaging and lighting module folds the reflected light from the four orthogonal fields of view of the syringe under test into the same imaging plane of the sampling device through the prism module, and uniformly illuminates the syringe under test through the light source group. The data sampling and processing module acquires a four-way field-of-view image of the syringe to be tested through the sampling device, performs shape primitive decomposition and feature encoding on the four-way field-of-view image through a hierarchical sampling strategy, classifies the four-way field-of-view image according to the geometric unit type in the image, and marks the image geometry type to obtain the image to be tested. The defect identification module constructs a syringe appearance inspection model, inputs the image to be inspected into the syringe appearance inspection model, performs defect identification and detection output based on the image geometry type matching model after detecting branches, and outputs branch detection results based on the branch detection results. When all branch detection results are defect-free, the output syringe appearance defect result is qualified. Conversely, the result for the output syringe appearance defect is "defect exists".
6. The syringe scale line 360-degree all-view appearance inspection system according to claim 5, characterized in that, The prism module includes five highly reflective planar lenses arranged orthogonally at a 45-degree angle. The first lens reflects light from a 0-degree field of view directly to the corresponding sensor area of the sampling device; the second lens reflects light from a 270-degree field of view directly to the corresponding sensor area; the third lens refracts light from a 90-degree field of view to the fourth lens, and after a second reflection, the light enters the corresponding sensor area; the fourth lens refracts light from a 180-degree field of view to the fifth lens, and after a second reflection, the light enters the corresponding sensor area.
Citation Information
Patent Citations
Method for automatically detecting scales of injector needle cylinders by using machine vision system
CN102303019A
Measurement of syringe graduation marks using a vision system
CN108601893A