Bottled oral liquid quality detection method and system based on image recognition

Through the quality detection method based on image recognition, the quality abnormalities of bottled oral liquids are automatically identified and classified, which solves the problems of slow manual inspection speed and high error rate, and achieves efficient and accurate quality control, reduces costs and meets regulatory requirements.

CN120219291APending Publication Date: 2025-06-27JIANGXI HEYING PHARMA CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202510220716.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

Traditional quality control relies on manual visual inspection, which has problems such as slow speed, easy fatigue, high error rate and poor consistency, and increases labor costs and material waste.

Method used

Using a quality detection method based on image recognition, images of bottled oral liquid are collected through a high-resolution camera, image preprocessing, appearance detection, liquid level detection, label detection, microbial pollution warning and abnormal classification and feedback are performed, and abnormality is automatically identified and classified using machine learning algorithms.

Benefits of technology

Significantly improves the accuracy and consistency of inspections, reduces manual intervention, improves production line speed and throughput, reduces labor and material costs, meets strict regulatory requirements, and provides traceable product history.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120219291A_ABST
    Figure CN120219291A_ABST
Patent Text Reader

Abstract

The invention discloses a bottled oral liquid quality detection method and system based on image recognition, and aims to improve the production efficiency and product quality of pharmacy and food and beverage industries, clear bottled liquid images are automatically collected through a high-resolution camera and an industrial camera, and the bottled oral liquid quality detection method and system based on image recognition are obtained through preprocessing steps of graying, binaryzation, Gaussian filtering and the like. And the image quality and the detail definition are optimized. A Faster R-CNN algorithm is utilized to detect bottle mouth integrity and bottle body appearance defects, including seal integrity, foreign matter detection and bottle cap state, so as to ensure product closeness and appearance integrity. Whether the liquid filling amount is qualified or not is judged by analyzing the liquid level height and transparency of the liquid, and the possible microbial contamination risk is early warned. And finally, classification and feedback are carried out on detected anomalies in combination with a machine learning algorithm, real-time alarm and data recording are realized, and a reliable basis is provided for optimization of a production process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automated image processing and detection, and particularly to a method and system for quality detection of bottled oral liquids based on image recognition. Background Art

[0002] Traditional quality control often relies on manual visual inspection. This method is slow and prone to fatigue. Especially after long hours of work, it may lead to an increase in the error rate. Different operators may have different judgment criteria, which results in poor consistency in quality assessment and affects the stability of product quality. Employing a large number of workers for quality inspection increases labor costs, and this cost continues to grow as wage levels rise. Manually recording inspection results is not only time-consuming but also prone to clerical errors or loss of records, which is not conducive to subsequent quality traceability and analysis. Modern manufacturing pursues a higher level of automation to improve efficiency and reduce the uncertainties brought by human intervention. Image recognition technology can help achieve this goal. By introducing a quality inspection system based on image recognition, enterprises can significantly improve the above problems and achieve the purposes of increasing production efficiency, ensuring product quality, reducing operating costs, and meeting strict regulatory requirements. Summary of the Invention

[0003] A method for quality detection of bottled oral liquids based on image recognition includes the following steps; S1. Image acquisition: Use a high-resolution camera, industrial camera, and sensor to capture image data of bottled oral liquids. Automatically collect through a production line to ensure that the images are clear, without blur or distortion, and suitable for subsequent processing; S2. Image preprocessing: Convert the color image into a grayscale image and perform binary processing for subsequent edge detection and object segmentation. Apply denoising algorithms (such as Gaussian filtering, mean filtering, etc.) to remove noise in the image, improve image quality, enhance image contrast, brightness, etc., so that details are clearer and more convenient for subsequent detection; S3. Appearance detection: Detect the bottle mouth area through image recognition algorithms (such as YOLO, Faster R-CNN, etc.) to determine whether the bottle mouth is intact. The detection includes whether the sealing is complete, whether there are foreign objects, whether the bottle cap is loose or deformed, judge whether the bottle mouth is well sealed, check whether the bottle cap is tight, and whether there are signs of leakage. Detect whether there are scratches, cracks, or other obvious appearance defects on the bottle body through image processing technology. Through edge detection or morphological analysis, identify whether the bottle body is deformed, stained, or has impurities; S4. Liquid level detection: Use the color and edge information in the image to identify the liquid level height of the liquid, check whether it reaches the standard liquid volume, and determine whether the filling volume of the liquid is qualified and whether there is overflow or shortage by identifying the liquid edge in the bottle, liquid color difference, and the contact line between the liquid surface and the bottle body; S5. Label Detection: Use optical character recognition (OCR) technology to detect the label on the bottle, ensure that the label is complete, clear, and the information is accurate. Check whether the label is flat and accurately aligned, avoiding label misalignment or wrinkles. Identify the label content through OCR technology to ensure the correctness of information such as production batch number, expiration date, formula, etc.; S6. Microbial Contamination Warning: Analyze the transparency of the liquid in the bottle through image processing technology to detect abnormalities such as sediment or bubbles. Abnormal substances may affect the liquid transparency and thus appear as irregular particles or suspended matter in the image, which requires further detection and confirmation; S7. Abnormality Classification and Feedback: Combine machine learning algorithms to classify the detected abnormalities (such as unqualified liquid level, sealing problem, label missing, etc.). When the system detects an abnormality, it can automatically mark and send an alarm signal to notify the operator for further processing. Collect and store data for subsequent analysis and improvement of the production process.

[0004] Furthermore, a quality inspection method for bottled oral liquid based on image recognition In step S5, use optical character recognition OCR technology to detect the label on the bottle, and the specific steps are as follows; S51. Image Preprocessing: Use the Otsu algorithm for global binarization. It can automatically select an optimal threshold to separate the background and foreground text regions in the image, enhance the image contrast, make the text part more prominent, and help the OCR recognition algorithm better recognize the text; S52. Label Region Extraction: Use the Canny edge detection algorithm or Sobel operator to detect the edges in the image to help locate the label region. Use contour extraction methods (such as findContours in OpenCV) to extract the label region on the bottle. Screen out the label region through the characteristics of shape and size. Use deep learning algorithms such as Faster R-CNN or YOLO to automatically detect and locate the label region in the image. Use the coordinates of the located label region to crop the label region and provide it to the OCR algorithm for text recognition; S53. OCR Recognition: After extracting the label region, use OCR technology to recognize the text content on the label. Use CNN to extract the features in the label image. After processing through convolutional layers, pooling layers, etc., perform more efficient text recognition. Especially for labels with complex backgrounds or distortions, CNN can better extract text features; S54. Label layout inspection: By analyzing the rectangular contour of the label area, detect whether the label is flat. If the label is bent or misaligned, its shape will deviate from the rectangle. Use morphological operations (such as erosion and dilation) to determine whether the label is flat. When the label is distorted or rotated, use the affine transformation algorithm for geometric correction to restore the normal shape of the label. Use image local contrast analysis and texture analysis techniques to detect whether there are wrinkles or folds on the label, which will affect the OCR recognition accuracy; S55. Label information verification: Extract the production batch number from the OCR recognition result and compare it with the batch number information stored in the database to ensure that the production batch number is accurate. Extract the expiration date information recognized by OCR and verify whether its format is correct and meets the production requirements; S56. Abnormality detection and feedback: If the label information recognition is inconsistent, or there are problems with the label layout (misalignment, deformation, etc.), the system should immediately mark and trigger an alarm. When the OCR recognition and verification results do not match, a warning can be sent to the manual review personnel for further processing; S57. Data storage and report generation: Store the label information recognized by OCR (such as production batch number, expiration date, formula information, etc.) in the database for quality traceability and later statistical analysis. Generate an automated quality inspection report, recording the label inspection results of each bottled oral liquid, including whether there are label misalignments and information errors.

[0005] Furthermore, a quality inspection method for bottled oral liquids based on image recognition, In step S6, by analyzing the transparency of the liquid in the bottle, detect whether there are abnormalities in precipitates and bubbles. The specific steps are as follows; S61. Liquid transparency analysis: According to the position of the liquid in the image preprocessed in S2, select the liquid area for transparency analysis. By calculating the average gray value or color information of the liquid area in the image, the transparency of the liquid can be inferred. Higher transparency usually means the liquid is more transparent, otherwise there may be turbidity or opacity; S62. Precipitate detection: Use image processing technology to analyze whether there are precipitates with abnormal colors and shapes in the liquid. Precipitates usually appear as non-uniform color areas or irregular shapes in the liquid; S63. Bubble detection and morphology analysis: Use edge detection and morphological operations to detect bubbles in the liquid. Bubbles appear as circular or elliptical areas in the liquid. Determine whether there are abnormalities by detection and counting; S64. Abnormality judgment and feedback: According to the analysis results of transparency, precipitates and bubbles, judge whether the liquid meets the quality standards. When abnormalities are detected, automatically issue an alarm or mark to help adjust the production process in real time to ensure that the liquid quality meets the requirements; S65. Data recording and analysis: Record the detected transparency, sediment, and bubble information in the database for quality traceability and statistical analysis.

[0006] Furthermore, a quality inspection method for bottled oral liquids based on image recognition In step S7, combine machine learning algorithms to classify the detected anomalies: unqualified liquid level, sealing problems, label missing. The specific steps are as follows; S71. Data preparation: Prepare a dataset containing normal and abnormal situations, covering possible anomalies such as unqualified liquid level, sealing problems, and label missing. Each sample needs to include the following information: Image data: High-resolution image data containing the bottle body, bottle mouth, liquid level, and label area. Abnormal category label: Each sample has a corresponding abnormal category label: "unqualified liquid level", "sealing problem", "label missing"; S72. Feature extraction and selection: Performing feature extraction on the image data is a key step in anomaly classification. Commonly used feature extraction methods include: Color features: Extract the color histogram and color distribution features of different regions in the image. Shape features: Extract shape information through contour detection and edge detection methods. Texture features: Use methods such as gray-level co-occurrence matrix (GLCM) and local binary pattern (LBP) to describe the texture features of the image; S73. Model selection and training: Divide the dataset into a training set, a validation set, and a test set. Standardize and normalize the input features to ensure that the numerical ranges of different features are consistent. Train a random forest model on the training set and adjust the model hyperparameters through the validation set to optimize the model's performance. Use the test set to evaluate the generalization ability and accuracy of the model, and optimize the model according to the evaluation results; S74. Anomaly classification and implementation: When the model training is completed and reaches satisfactory performance indicators, apply it to the actual bottled oral liquid detection task: Input the real-time collected bottled oral liquid image into the trained model, classify the image, identify and mark anomalies such as unqualified liquid level, sealing problems, and label missing, automatically trigger an alarm, notify the operator for further inspection and processing, send alarm information, and record abnormal data for subsequent analysis and improvement of the production process.

[0007] Furthermore, a quality inspection system for bottled oral liquids based on image recognition. The quality inspection system for bottled oral liquids based on image recognition is used to implement a quality inspection method for bottled oral liquids based on image recognition; The quality inspection system for bottled oral liquids based on image recognition includes: an image acquisition module, an image preprocessing module, a defect detection module, a result determination and feedback module, a data management and report generation module; Among them, the image acquisition module: includes a high-resolution camera, appropriate lighting equipment: LED lights, ring lights, as well as the required conveyor belt and other automation devices to ensure that the bottles pass through the detection point in the correct manner; Image preprocessing module: performs denoising, contrast adjustment, and sharpening operations to improve the image quality, and performs unified processing on the images obtained under different batches or conditions in terms of size and color space; Defect detection module: determines whether there are defects according to the preset quality standards and thresholds, and machine learning classifier: for situations where it is not easy to define rules, a trained model is used for classification decision-making; Result determination and feedback module: decides whether the product meets the quality requirements according to the information provided by the previous modules. When defective products are found, an alarm is immediately sent to notify the operator, and it is connected to the robotic arm and other equipment on the production line to remove the defective products from the production line; Data management and report generation module: stores all detection records, including image files, detection results, and timestamp information, and regularly generates statistical reports to help management understand the product quality trend and provide a basis for improvement.

[0008] Advantages of the present invention: Image recognition technology can detect subtle defects that are difficult to detect by the naked eye, such as cracks, color changes, or label position offsets, thereby significantly improving the accuracy and consistency of detection. The automated detection process reduces the need for manual intervention, increases the speed and throughput of the production line, and at the same time reduces the downtime caused by human errors. Reduces the dependence on a large number of quality inspection personnel and saves labor costs; in addition, by reducing the defective rate, it indirectly reduces material waste and rework costs. The system can record detailed detection data, provide a traceable product history, helps to meet strict regulatory requirements, and provides support for product recall when necessary. The continuous monitoring and real-time feedback mechanism enables problems to be discovered and solved in the first time, ensuring high-quality output of each batch of products. Description of the Drawings

[0009] Figure 1 It is a flowchart of a quality inspection method for bottled oral liquids based on image recognition; Detailed Implementation Manner

[0010] A quality inspection method for bottled oral liquids based on image recognition includes the following steps; S1. Image acquisition: Use a high-resolution camera, industrial camera, and sensor to capture image data of bottled oral liquids, and automatically collect them through a production line to ensure that the images are clear, without blur or distortion, and are suitable for subsequent processing; S2. Image preprocessing: Convert the color image into a grayscale image and perform binarization processing for subsequent edge detection and object segmentation. Apply denoising algorithms (such as Gaussian filtering, mean filtering, etc.) to remove noise in the image, improve the image quality, enhance the image contrast, brightness, etc., making the details clearer for subsequent detection; S3. Appearance detection: Detect the bottle mouth area through image recognition algorithms (such as YOLO, Faster R-CNN, etc.) to determine whether the bottle mouth is intact. The detection includes whether the seal is complete, whether there are foreign objects, whether the bottle cap is loose or deformed, judge whether the bottle mouth is well sealed, check whether the bottle cap is tight, and whether there are signs of leakage. Detect whether there are scratches, cracks or other obvious appearance defects on the bottle body through image processing technology. Through edge detection or morphological analysis, identify whether the bottle body has deformation, stains or impurities; S4. Liquid level detection: Use the color and edge information in the image to identify the liquid level height, check whether the liquid volume reaches the standard. By identifying the liquid edge, liquid color difference and the contact line between the liquid surface and the bottle body in the bottle, determine whether the liquid filling amount is qualified and whether there is overflow or shortage; S5. Label detection: Use optical character recognition (OCR) technology to detect the label on the bottle body to ensure that the label is complete, clear and the information is accurate. Check whether the label is flat and the alignment is accurate to avoid label misalignment or wrinkles. Identify the label content through OCR technology to ensure that information such as production batch number, expiration date, formula, etc. is correct; S6. Microbial contamination warning: Analyze the transparency of the liquid in the bottle through image processing technology to detect whether there are abnormalities such as precipitates or bubbles. Abnormal substances may affect the liquid transparency and thus appear as irregular particles or suspended matter in the image, which needs to be further detected and confirmed; S7. Abnormality classification and feedback: Combine machine learning algorithms to classify the detected abnormalities (such as unqualified liquid level, sealing problems, label missing, etc.). When the system detects an abnormality, it can automatically mark and send an alarm signal to notify the operator for further processing, collect data and store it for subsequent analysis and improvement of the production process.

[0011] Furthermore, a quality inspection method for bottled oral liquid based on image recognition, In step S5, the optical character recognition OCR technology is used to detect the label on the bottle body, and the specific steps are as follows; S51. Image preprocessing: Use the Otsu algorithm for global binarization. It can automatically select an optimal threshold to separate the background and foreground text areas in the image, enhance the image contrast, make the text part more prominent, and help the OCR recognition algorithm better recognize the text; S52. Label area extraction: Use the Canny edge detection algorithm or the Sobel operator to detect the edges in the image to assist in locating the label area. Use contour extraction methods (such as findContours in OpenCV) to extract the label area on the bottle. Filter out the label area based on the characteristics of shape and size. Use deep learning algorithms such as Faster R-CNN or YOLO to automatically detect and locate the label area in the image. Use the coordinates of the located label area to crop out the label area and provide it to the OCR algorithm for text recognition; S53. OCR recognition: After extracting the label area, use OCR technology to recognize the text content on the label. Use CNN to extract the features in the label image. After processing through convolutional layers, pooling layers, etc., perform more efficient text recognition. Especially for labels with complex backgrounds or distortions, CNN can better extract text features; S54. Label layout inspection: By analyzing the rectangular contour of the label area, detect whether the label is flat. If the label is bent or misaligned, its shape will deviate from a rectangle. Use morphological operations (such as erosion and dilation) to determine whether the label is flat. When the label is distorted or rotated, use the affine transformation algorithm for geometric correction to restore the normal shape of the label. Use image local contrast analysis and texture analysis techniques to detect whether there are wrinkles or folds on the label, which can affect the OCR recognition accuracy; S55. Label information verification: Extract the production batch number from the OCR recognition result and compare it with the batch number information stored in the database to ensure the accuracy of the production batch number. Extract the expiration date information recognized by OCR and verify whether its format is correct and meets the production requirements; S56. Anomaly detection and feedback: If the label information recognition is inconsistent or there are problems with the label layout (misalignment, deformation, etc.), the system should immediately mark and trigger an alarm. When the OCR recognition and verification results do not match, a warning can be sent to the manual review personnel for further processing; S57. Data storage and report generation: Store the label information recognized by OCR (such as production batch number, expiration date, formula information, etc.) in the database for quality traceability and later statistical analysis. Generate an automated quality inspection report to record the label inspection results of each bottle of oral liquid, including whether there are label misalignments and information errors.

[0012] Furthermore, a quality inspection method for bottled oral liquid based on image recognition, In step S6, by analyzing the transparency of the liquid in the bottle, detect whether there are abnormal precipitates and bubbles. The specific steps are as follows; S61. Liquid transparency analysis: Based on the position of the liquid in the preprocessed image in S2, select the liquid area for transparency analysis. By calculating the average grayscale value or color information of the liquid area in the image, the transparency of the liquid can be inferred. A higher transparency usually means the liquid is more transparent, otherwise there may be turbidity or opacity; S62. Precipitate detection: Analyze whether there are precipitates with abnormal colors and shapes in the liquid through image processing techniques. Precipitates usually appear as non-uniform color areas or irregular shapes in the liquid; S63. Bubble detection and morphology analysis: Use edge detection and morphological operations to detect bubbles in the liquid. Bubbles appear as circular or elliptical areas in the liquid. Determine whether there are abnormalities by detection and counting; S64. Abnormality judgment and feedback: Based on the analysis results of transparency, precipitates, and bubbles, judge whether the liquid meets the quality standards. When an abnormality is detected, an alarm is automatically issued or marked to help adjust the production process in real time to ensure that the liquid quality meets the requirements; S65. Data recording and analysis: Record the detected transparency, precipitate, and bubble information in the database for quality traceability and statistical analysis.

[0013] Furthermore, a quality inspection method for bottled oral liquids based on image recognition In step S7, combine machine learning algorithms to classify the detected abnormalities: unqualified liquid level, sealing problem, label missing. The specific steps are as follows; S71. Data preparation: Prepare a dataset containing normal and abnormal situations, covering possible abnormalities such as unqualified liquid level, sealing problem, and label missing. Each sample needs to include the following information: Image data: High-resolution image data containing the bottle body, bottle mouth, liquid level, and label area. Abnormal category label: Each sample has a corresponding abnormal category label: "unqualified liquid level", "sealing problem", "label missing"; S72. Feature extraction and selection: Performing feature extraction on the image data is a key step in abnormal classification. Common feature extraction methods include: Color features: Extract the color histogram and color distribution features of different regions in the image. Shape features: Extract shape information through contour detection and edge detection methods. Texture features: Use methods such as gray-level co-occurrence matrix (GLCM) and local binary pattern (LBP) to describe the texture features of the image; S73. Model selection and training: Divide the dataset into training set, validation set, and test set. Standardize and normalize the input features to ensure that the numerical ranges of different features are consistent. Train a random forest model on the training set and adjust the model hyperparameters through the validation set to optimize the model performance. Use the test set to evaluate the generalization ability and accuracy of the model, and optimize the model according to the evaluation results; S74. Abnormality Classification and Implementation: When the model training is completed and satisfactory performance indicators are achieved, it is applied to the actual bottled oral liquid detection task: The images of bottled oral liquids collected in real time are input into the trained model, the images are classified, and abnormal situations such as unqualified liquid levels, sealing problems, and missing labels are identified and marked, and an alarm is automatically triggered to notify the operator for further inspection and handling. Alarm information is sent and abnormal data is recorded for subsequent analysis and improvement of the production process.

[0014] Furthermore, a quality inspection system for bottled oral liquids based on image recognition, the quality inspection system for bottled oral liquids based on image recognition is used to implement a quality inspection method for bottled oral liquids based on image recognition; the quality inspection system for bottled oral liquids based on image recognition includes: an image acquisition module, an image preprocessing module, a defect detection module, a result determination and feedback module, and a data management and report generation module; Among them, the image acquisition module: includes a high-resolution camera, appropriate lighting equipment: LED lights, ring lights, as well as the required conveyor belt and other automation devices to ensure that the bottles pass through the detection point in the correct way; The image preprocessing module: performs denoising, contrast adjustment, and sharpening operations to improve the image quality, and performs unified processing on the images in terms of size and color space obtained under different batches or conditions; The defect detection module: determines whether there are defects according to the preset quality standards and thresholds, and a machine learning classifier: for situations where it is not easy to define rules, a trained model is used for classification decision-making; The result determination and feedback module: determines whether the product meets the quality requirements according to the information provided by the previous module. When unqualified products are found, an alarm is immediately sent to notify the operator, and it is connected to the robotic arm and other equipment on the production line to remove the unqualified products from the production line; The data management and report generation module: stores all inspection records, including image files, inspection results, and timestamp information, and regularly generates statistical reports to help management understand the product quality trend and provide a basis for improvement.

Claims

1. A method for quality detection of bottled oral liquid based on image recognition, characterized in that: The steps include: S1. Image acquisition: Use high-resolution cameras, industrial cameras, and sensors to capture image data of bottled oral liquids, and automatically collect them through the assembly line to ensure that the images are clear, blur-free, and distortion-free, suitable for subsequent processing; S2. Image preprocessing: Convert color images into grayscale images and perform binarization for subsequent edge detection and object segmentation. Apply Gaussian filtering to remove noise in the image, improve image quality, enhance image contrast and brightness, and make details clearer. S3. Appearance inspection: Use the image recognition algorithm Faster R-CNN to detect the bottle mouth area and determine whether the bottle mouth is intact. The inspection includes whether the seal is complete, whether there are foreign objects, whether the bottle cap is loose or deformed, whether the bottle mouth is well sealed, whether the bottle cap is tight, and whether there are signs of leakage. Use image processing technology to detect whether there are scratches or cracks on the bottle body. Use edge detection morphological analysis to identify whether the bottle body is deformed, stained, and impurities. S4. Liquid level detection: Use the color and edge information in the image to identify the liquid level and check whether the standard liquid volume is reached. By identifying the edge of the liquid in the bottle, the color difference of the liquid, and the contact line between the liquid surface and the bottle body, determine whether the liquid filling volume is qualified and whether there is overflow or insufficient liquid. S5. Label inspection: Use optical character recognition (OCR) technology to inspect the label on the bottle to ensure that the label is complete, clear, and the information is accurate. Check whether the label is flat and aligned correctly to avoid misalignment and wrinkles. Use OCR technology to identify the label content to ensure that the production batch number, expiration date, and formula information are correct. S6. Microbial contamination warning: By analyzing the transparency of the liquid in the bottle, detect whether there are abnormal sediments and bubbles. Abnormal substances will affect the transparency of the liquid, and then appear as irregular particles and suspended matter in the image, which requires further testing and confirmation; S7. Abnormal classification and feedback: Combined with machine learning algorithms, the detected abnormalities are classified into: unqualified liquid level, sealing problem, missing label. When the system detects an abnormality, it automatically marks and sends an alarm signal to notify manual further processing, collect data and store it for subsequent analysis and improvement of the production process.

2. A method for quality detection of bottled oral liquid based on image recognition as claimed in claim 1, characterized in that: In step S5, optical character recognition (OCR) technology is used to detect the label on the bottle, and the specific steps are as follows; S51. Image preprocessing: Use the Otsu algorithm for global binarization, which can automatically select an optimal threshold to separate the background and foreground text areas in the image, enhance the image contrast, make the text part more prominent, and help the OCR recognition algorithm better recognize text; S52. Label area extraction: Use the Canny edge detection algorithm to detect the edges in the image to help locate the label area. Use the contour extraction method: findContours in OpenCV to extract the label area on the bottle. Filter the label area by shape and size characteristics. Automatically detect and locate the label area in the image. Use the located label area coordinates to crop the label area and provide it to the OCR algorithm for text recognition. S53.OCR recognition: After extracting the label area, use OCR technology to recognize the text content on the label, use CNN to extract features in the label image, and after processing by convolution layer and pooling layer, perform text recognition for complex background and distorted labels; S54. Label layout inspection: By analyzing the rectangular outline of the label area, check whether the label is flat. When the label is bent and misaligned, the shape will deviate from the rectangle. Morphological operations such as corrosion and expansion are used to determine whether the label is flat. When the label is twisted and rotated, the affine transformation algorithm is used to perform geometric correction to restore the normal shape of the label. Image local contrast analysis and texture analysis technology are used to detect whether the label has wrinkles or folds. S55. Label information verification: extract the production batch number from the OCR recognition result, compare it with the batch number information stored in the database to ensure that the production batch number is accurate, extract the expiration date information recognized by OCR, and verify whether its format is correct and meets production requirements; S56. Abnormal detection and feedback: When the label information recognition is inconsistent or there are problems with the label layout: misalignment, deformation, immediate marking and triggering of alarms; when the OCR recognition and verification results do not match, a warning is sent to the manual reviewer for further processing; S57. Data storage and report generation: The label information recognized by OCR: production batch number, expiration date, formula information is stored in the database for quality traceability and subsequent statistical analysis, and an automated quality inspection report is generated to record the label inspection results of each bottled oral liquid, including whether there is label misalignment or information error.

3. The method for quality detection of bottled oral liquid based on image recognition according to claim 1, characterized in that: In step S6, the transparency of the liquid in the bottle is analyzed to detect whether there are abnormal sediments and bubbles. The specific steps are as follows; S61. Liquid transparency analysis: According to the position of the liquid in the image preprocessed in S2, the liquid area is selected for transparency analysis. By calculating the average gray value or color information of the liquid area in the image, the transparency of the liquid can be inferred. A higher transparency usually means that the liquid is more transparent, otherwise it may be turbid or opaque. S62. Sediment detection: Use image processing technology to analyze whether there are sediments with abnormal color and shape in the liquid. Sediments usually appear as non-uniform color areas or irregular shapes in the liquid; S63. Bubble detection and morphological analysis: Use edge detection and morphological operations to detect bubbles in liquid. Bubbles appear as circular or elliptical areas in the liquid. Detection and counting are used to determine whether there are abnormalities. S64. Abnormality judgment and feedback: Based on the analysis results of transparency, sediment and bubbles, judge whether the liquid meets the quality standards. If an abnormality is detected, an alarm or mark will be automatically issued to help adjust the production process in real time to ensure that the liquid quality meets the requirements; S65.Data recording and analysis: The detected transparency, sediment and bubble information will be recorded in the database for quality traceability and statistical analysis.

4. The method for quality inspection of bottled oral liquid based on image recognition according to claim 1, characterized in that: In step S7, the detected anomalies are classified into: unqualified liquid level, sealing problem, and missing label in combination with the machine learning algorithm. The specific steps are as follows; S71. Data preparation: Prepare a data set containing normal and abnormal situations, including possible abnormal situations such as unqualified liquid level, sealing problem, and missing label. Each sample needs to include the following information: Image data: Contains high-resolution image data of the bottle body, bottle mouth, liquid level, and label area. Abnormal category label: Each sample has a corresponding abnormal category label: "unqualified liquid level", "sealing problem", "missing label"; S72. Feature extraction and selection: Performing feature extraction on image data is a key step in anomaly classification. Feature extraction includes: color features: extracting color histograms and color distribution features of different regions in the image; shape features: extracting shape information through contour detection and edge detection methods; texture features: using the gray level co-occurrence matrix GLCM method to describe the texture features of the image; S73. Model selection and training: Divide the dataset into training set, validation set and test set, standardize and normalize the input features to ensure that the numerical ranges of different features are consistent, train the random forest model on the training set, and adjust the model hyperparameters through the validation set to optimize the performance of the model. Use the test set to evaluate the generalization ability and accuracy of the model, and optimize the model based on the evaluation results; S74. Abnormal classification and implementation: When the model training is completed and reaches satisfactory performance indicators, it will be applied to the actual bottled oral liquid inspection task: the real-time collected bottled oral liquid images are input into the trained model, the images are classified, and abnormal situations such as unqualified liquid level, sealing problems, and missing labels are identified and marked. The alarm is automatically triggered to notify the operator to conduct further inspection and processing, send alarm information, and record abnormal data for subsequent analysis and improvement of the production process.

5. A bottled oral liquid quality detection system based on image recognition, characterized in that: The image recognition-based bottled oral liquid quality detection system is used to implement the image recognition-based bottled oral liquid quality detection method as described in any one of claims 1 to 4; The bottled oral liquid quality inspection system based on image recognition comprises: an image acquisition module, an image preprocessing module, a defect detection module, a result determination and feedback module, and a data management and report generation module; The image acquisition module includes a high-resolution camera, appropriate lighting equipment: LED lights, ring lights, and the necessary conveyor belts and other automated devices to ensure that the bottles pass the inspection points in the correct way; Image preprocessing module: performs denoising, contrast adjustment, and sharpening operations to improve image quality, and performs unified processing of size and color space on images acquired under different batches or conditions; Defect detection module: determines whether there are defects based on preset quality standards and thresholds. Machine learning classifier: For situations where it is difficult to define rules, a trained model is used to make classification decisions; Result judgment and feedback module: determines whether the product meets the quality requirements based on the information provided by the previous module. When unqualified products are found, an alarm is immediately issued to notify the operator, and the robot arm and other equipment on the production line are connected to remove the unqualified products from the production line; Data management and report generation module: stores all test records, including image files, test results, and timestamp information, and generates statistical reports regularly to help management understand product quality trends and provide a basis for improvement.

Citation Information

Cited By

  • OCR traceability-based strip-type package sealing abnormity early warning method

    CN120672749A

  • Quality control method and system for reagent sample adding process

    CN121074502A

  • Label laminating effect detection method and system based on photographing identification

    CN121169873A

  • Pharmaceutical quality risk multi-mode measurement and control AI robot system and method

    CN121414231A