Intelligent sorting control method and system for Chinese medicinal materials based on image recognition

By calculating the signal-to-noise ratio and clarity index of the image, adjusting the camera settings and performing image processing, combining edge detection and color analysis, adjusting the sorting robot arm path in real time, and optimizing the sorting control parameters, the problem of misjudgment in the sorting of Chinese medicinal materials was solved, and efficient and accurate sorting control was achieved.

CN119489050BActive Publication Date: 2025-09-05JIANGSU BAOWEI MASCH TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510060410.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-09-05
Estimated Expiration
2045-01-15

AI Technical Summary

Technical Problem

Existing technologies have difficulty achieving the optimal balance between speed and accuracy in sorting Chinese medicinal materials. In particular, misjudgments are prone to occur when light and background noise change, leading to sorting errors and repeated work, increasing costs and reducing production efficiency.

Method used

By calculating the signal-to-noise ratio and clarity index of the Chinese medicinal materials image, adjusting the camera exposure and focus settings, performing contrast and sharpening processing, and combining edge detection and color analysis, the morphological characteristics and color of the Chinese medicinal materials can be identified, the path of the sorting robot arm can be adjusted in real time, and the sorting control parameters can be optimized to reduce misjudgments and improve sorting efficiency.

Benefits of technology

It significantly improves the accuracy and efficiency of Chinese medicinal materials sorting, reduces misjudgments, enhances the flexibility and operational efficiency of the sorting system, and ensures the quality and efficiency of Chinese medicinal materials sorting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119489050B_ABST
    Figure CN119489050B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of sorting control technology, specifically to an intelligent sorting control method and system for Chinese medicinal materials based on image recognition, comprising the following steps: based on an image acquisition device, collecting original Chinese medicinal material images, calculating the signal-to-noise ratio and clarity index in the original Chinese medicinal material images, adjusting the exposure and focus settings of a camera according to the calculation results, and performing contrast and sharpening processing on the original images. The present invention, by performing signal-to-noise ratio and clarity analysis on the original images and adjusting the exposure and focus settings of the camera accordingly, significantly improves the details of the medicinal material images, enables edge detection and color analysis to be performed more accurately, ensures the accurate capture of Chinese medicinal material features, reduces misjudgments caused by poor image quality, and directly corrects classification errors by adjusting the sorting robot arm in real time, thereby enhancing the flexibility and efficiency of the entire sorting system, thereby ensuring the accuracy of Chinese medicinal material sorting while also greatly improving the efficiency of operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of sorting control, and in particular to an intelligent sorting control method and system for Chinese medicinal materials based on image recognition. Background Art

[0002] Sorting control technology involves the use of automated and intelligent systems to classify, sort, and distribute items. It integrates multiple technologies such as machine vision, image processing, artificial intelligence, mechanical engineering, and control systems. In modern production and logistics, sorting control systems can significantly improve efficiency and accuracy, reduce labor costs and error rates, especially in industries such as food, pharmaceuticals, and mail processing. High-speed cameras are used to capture object images, and image recognition technology is used to identify and classify object features. Control algorithms are then used to guide equipment such as robotic arms or conveyor belts to complete precise sorting.

[0003] Among them, the intelligent sorting control method of Chinese medicinal materials based on image recognition is a process of automatically classifying and sorting Chinese medicinal materials using image recognition technology. The image of the Chinese medicinal materials is captured by a camera, and then the image recognition algorithm analyzes the image to identify different characteristics of Chinese medicinal materials, such as shape, size, color and texture. After the recognition process, the sorting machinery is controlled according to the preset classification standards to accurately sort the Chinese medicinal materials to the designated location. The main purpose is to improve the speed and accuracy of sorting Chinese medicinal materials and ensure the quality and efficiency of Chinese medicine preparation.

[0004] Existing technologies struggle to achieve an optimal balance between speed and accuracy, especially under changing production conditions. For example, changes in lighting and background noise can affect the accuracy of image recognition. Existing technologies lack sufficient flexibility in image processing, and are prone to misjudgment for items with large variations in appearance, such as Chinese medicinal materials. These technical limitations can lead to sorting errors, increased repetitive work and material waste, thereby reducing overall production efficiency and increasing costs. For example, in the pharmaceutical industry, incorrect sorting can lead to serious quality problems. Summary of the Invention

[0005] The purpose of the present invention is to solve the shortcomings of the prior art and to propose an intelligent sorting control method and system for Chinese medicinal materials based on image recognition.

[0006] In order to achieve the above-mentioned purpose, the present invention adopts the following technical solution: a method for intelligent sorting and control of Chinese medicinal materials based on image recognition, comprising the following steps:

[0007] S1: Based on the image acquisition device, the original Chinese medicinal material image is collected, the signal-to-noise ratio and clarity index of the original Chinese medicinal material image are calculated, the exposure and focus settings of the camera are adjusted according to the calculation results, and the contrast and sharpness processing are performed on the original image to obtain an optimized Chinese medicinal material image;

[0008] S2: performing edge detection and color analysis on the optimized Chinese medicinal material image to identify the morphological characteristics and color of the Chinese medicinal material, comparing the identification result with the image of the Chinese medicinal material that meets the quality standards, judging and marking the Chinese medicinal material that does not meet the quality standards, and obtaining quality non-conformity information;

[0009] S3: Based on the quality discrepancy information, analyze the classification decision process of each Chinese medicinal material, compare the current medicinal material characteristics with the classification standard, identify potential errors in classification, and adjust the path of the sorting robot arm or re-sort the incorrectly classified Chinese medicinal materials to obtain sorting adjustment instructions;

[0010] S4: Based on the sorting adjustment instruction, statistical analysis is performed on the sorting efficiency and error rate, and image processing and sorting control parameters are adjusted according to the analysis results to optimize the sorting efficiency of Chinese medicinal materials and obtain a sorting control optimization result.

[0011] The present invention is improved in that the steps of calculating the signal-to-noise ratio and the clarity index are specifically as follows:

[0012] S111: Based on the image acquisition device, collect the original Chinese medicinal material image, perform Gaussian filtering to remove potential noise, convert the image to grayscale form, and standardize the data to obtain a standardized Chinese medicinal material image;

[0013] S112: Based on the standardized Chinese medicinal material image, the formula:

[0014] ;

[0015] and

[0016] ;

[0017] Calculating the signal-to-noise ratio and clarity index ,in, represents the signal power of the image, represents the noise power, represents the gradient modulus of the image, is the total number of pixels in the image.

[0018] The present invention is improved in that the steps of obtaining the optimized Chinese medicinal material image are specifically as follows:

[0019] S121: adjusting the exposure and focus settings of the camera according to the signal-to-noise ratio and the clarity index to optimize the overexposure or underexposure problem of the image, thereby obtaining an exposure-adjusted Chinese medicinal material image;

[0020] S122: By adjusting the grayscale mapping curve of the image, the contrast of the exposure-adjusted Chinese medicinal material image is optimized to refine the light and dark areas of the image, and the blurred version of the medicinal material image is sharpened using the USM algorithm to highlight key edges, thereby obtaining an optimized Chinese medicinal material image.

[0021] The present invention is improved in that the steps of identifying the morphological characteristics and color are specifically as follows:

[0022] S211: performing edge detection and color analysis on the optimized Chinese medicinal material image, using the Sobel operator to perform edge detection, identifying vertical and horizontal edges in the image, optimizing the image contour of the Chinese medicinal material, and obtaining a morphological feature map of the Chinese medicinal material;

[0023] S212: Analyze the morphological characteristics of the Chinese medicinal materials and evaluate the color of the Chinese medicinal materials using the formula:

[0024] ;

[0025] The morphological characteristics and color recognition results are obtained, among which, It is the rating of Chinese herbal medicine. represents the morphological characteristic score, Indicates the score of color characteristics, and is the weight coefficient.

[0026] The present invention is improved in that the steps for obtaining the quality non-conformity information are specifically as follows:

[0027] S221: Based on the recognition result, compare with the images of Chinese medicinal materials that meet the quality standards, identify Chinese medicinal materials with quality scores below the standard threshold, and obtain a preliminary list of unqualified Chinese medicinal materials;

[0028] S222: Analyze the quality issues of the preliminary list of unqualified Chinese medicinal materials using the formula:

[0029] ;

[0030] Calculating the quality deviation index , and obtain the quality problem analysis results, among which, Represents the scores of multiple quality indicators measured, is the corresponding quality standard threshold, is the number of quality indicators;

[0031] S223: Based on the quality problem analysis results, the reasons and characteristic descriptions of each Chinese medicinal material that does not meet the quality standards are recorded and organized into quality non-conformity information.

[0032] The present invention is improved in that the step of identifying potential errors in classification is specifically as follows:

[0033] S311: Based on the quality non-conformity information, analyzing the data of the classification decision process of each Chinese medicinal material, and determining the difference between the medicinal material characteristics and the standard characteristics, to obtain a medicinal material characteristic difference record set;

[0034] S312: Analyze the medicinal material characteristic difference record set using the formula:

[0035] ;

[0036] Calculate the classification error for each medicinal material , we get the classification error recognition result, where Representation characteristics The weight of Indicates the current monitoring characteristic value of the medicinal material. represents the standard value of the corresponding feature in the classification standard, is the total number of features.

[0037] The present invention is improved in that the steps of obtaining the sorting adjustment instruction are specifically as follows:

[0038] S321: Analyze the identified potential errors, and redesign the control parameters of the sorting robot arm, including the motion path and operation logic, for each error type and occurrence frequency, to obtain adjusted execution parameters;

[0039] S322: Based on the adjusted execution parameters, simulate and test the redesigned control parameters to evaluate their impact on sorting accuracy and efficiency using the formula:

[0040] ;

[0041] Calculate performance improvement percentage , get the sorting adjustment instruction, where, is the adjustment factor, Represents the sorting speed obtained by simulation test under the new path, Represents the sorting speed obtained from the simulation test under the original path.

[0042] The present invention is improved in that the steps for obtaining the sorting control optimization result are specifically as follows:

[0043] S411: Based on the sorting adjustment instruction, collect the correct sorting quantity and the incorrect sorting quantity of each batch and organize them into a preliminary sorting data set;

[0044] S412: Analyze the preliminary sorting data set and calculate the sorting efficiency and error rate using the formula:

[0045] ;

[0046] and

[0047] ;

[0048] The sorting performance index results are obtained, among which, Indicates the proportion of successful sorting, Indicates the proportion of sorting errors, is the number of correct sorts, is the total number of sorting times;

[0049] S413: Based on the sorting performance index result, adjust the image processing and sorting control parameters to optimize the sorting efficiency and accuracy of the Chinese medicinal materials and obtain a sorting control optimization result.

[0050] An intelligent sorting and control system for Chinese medicinal materials based on image recognition, the system comprising:

[0051] The image adjustment module collects the original Chinese medicinal material images based on the image acquisition device, calculates the signal-to-noise ratio and clarity index in the original Chinese medicinal material images, adjusts the exposure and focus settings of the camera, performs contrast and sharpening processing, and obtains optimized Chinese medicinal material images;

[0052] The quality detection module performs edge detection and color analysis on the optimized Chinese medicinal material image, identifies the morphological characteristics and color of the Chinese medicinal material, compares it with the image of the Chinese medicinal material that meets the quality standards, determines and marks the Chinese medicinal material that does not meet the quality standards, and obtains quality non-compliance information;

[0053] The sorting adjustment module compares the current medicinal material characteristics with the classification standards based on the quality discrepancy information, identifies potential errors in classification, and adjusts the path of the sorting robot arm or re-sorts the incorrectly classified Chinese medicinal materials to obtain sorting adjustment instructions;

[0054] The control optimization module performs statistical analysis on the sorting efficiency and error rate based on the sorting adjustment instructions, adjusts image processing and sorting control parameters, and obtains a sorting control optimization result.

[0055] Compared with the prior art, the advantages and positive effects of the present invention are:

[0056] In the present invention, by performing signal-to-noise ratio and clarity analysis on the original image and adjusting the exposure and focus settings of the camera accordingly, the details of the medicinal material image are significantly improved, edge detection and color analysis can be performed more accurately, ensuring the precise capture of the characteristics of Chinese medicinal materials and reducing misjudgments caused by poor image quality. By adjusting the sorting robot arm in real time, classification errors are directly corrected, thereby enhancing the flexibility and efficiency of the entire sorting system, thereby ensuring the accuracy of Chinese medicinal materials sorting while greatly improving the efficiency of the operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 The present invention proposes a flow chart of an intelligent sorting control method for Chinese medicinal materials based on image recognition;

[0058] Figure 2 Flowchart for calculating the signal-to-noise ratio and the clarity index in the present invention;

[0059] Figure 3 This is a flowchart for obtaining optimized Chinese medicinal material images in the present invention;

[0060] Figure 4 This is a flow chart for identifying morphological features and color in the present invention;

[0061] Figure 5 A flowchart for obtaining quality non-conformity information in the present invention;

[0062] Figure 6 A flowchart for identifying potential errors in classification in the present invention;

[0063] Figure 7 This is a flow chart for obtaining sorting adjustment instructions in the present invention;

[0064] Figure 8 This is a flow chart for obtaining the sorting control optimization results in the present invention. DETAILED DESCRIPTION

[0065] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0066] In the description of the present invention, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating directions or positional relationships, are based on the directions or positional relationships shown in the accompanying drawings and are only for the convenience of describing the present invention and simplifying the description. They do not indicate or imply that the devices or elements referred to must have a specific direction, be constructed and operate in a specific direction, and therefore should not be understood as limiting the present invention. In addition, in the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined. Example

[0067] See also Figure 1 The present invention provides a technical solution: an intelligent sorting control method for Chinese medicinal materials based on image recognition, comprising the following steps:

[0068] S1: Based on the image acquisition device, the original Chinese medicinal material image is collected, the signal-to-noise ratio and clarity index of the original Chinese medicinal material image are calculated, the exposure and focus settings of the camera are adjusted according to the calculation results, and the contrast and sharpness processing are performed on the original image to obtain an optimized Chinese medicinal material image;

[0069] S2: Perform edge detection and color analysis on the optimized Chinese medicinal material images to identify the morphological characteristics and color of the Chinese medicinal materials. Compare the identification results with the images of Chinese medicinal materials that meet the quality standards, determine and mark the Chinese medicinal materials that do not meet the quality standards, and obtain quality non-compliance information;

[0070] S3: Based on the quality discrepancy information, the classification decision process of each Chinese medicinal material is analyzed, the current medicinal material characteristics are compared with the classification standards, potential errors in classification are identified, and the path of the sorting robot arm is adjusted or the incorrectly classified Chinese medicinal materials are re-sorted to obtain sorting adjustment instructions;

[0071] S4: Based on the sorting adjustment instructions, statistical analysis is performed on the sorting efficiency and error rate. According to the analysis results, the image processing and sorting control parameters are adjusted to optimize the sorting efficiency and accuracy of Chinese medicinal materials and obtain the sorting control optimization results.

[0072] The optimized Chinese medicinal materials images include clarity improvement results, contrast enhancement results, and detail sharpening results. The quality non-conformity information includes marking deviation, color error, and morphological abnormality information. The sorting adjustment instructions specifically refer to path optimization information, error recognition correction results, and operation adjustment accuracy. The sorting control optimization results include response speed optimization rate, classification accuracy, and operation efficiency.

[0073] See also Figure 2 , the calculation steps of signal-to-noise ratio and clarity index are as follows:

[0074] S111: Based on the image acquisition device, collect the original Chinese medicinal material image, perform Gaussian filtering to remove potential noise, convert the image to grayscale form, and standardize the data to obtain a standardized Chinese medicinal material image;

[0075] The noise in the image is processed by a Gaussian filter, and the kernel size of the filter is adjusted according to the noise estimation value. The specific steps are as follows: first, the noise variance of the image is calculated, the standard deviation of the Gaussian filter kernel is determined, and it is matched with the image size and resolution. The filter is applied to perform convolution operation on the image pixel by pixel, while removing random noise in the low-frequency area. Then, the filtered image is converted into a grayscale image. The grayscale conversion is completed using the weighted average formula of the pixel value. The weight value is assigned according to the characteristics of the RGB channel, such as green has the highest weight, followed by the red and blue channels. After the channel is merged, a single grayscale value is generated. Then, the image data normalization operation is performed, and the grayscale value range is linearly mapped to the specified interval. This process is based on the maximum and minimum values ​​of the image for normalization transformation. The standardized data is in floating-point format, and the result file is output to finally obtain a standardized Chinese medicinal material image.

[0076] S112: Based on standardized Chinese medicinal material images, the formula is:

[0077] ;

[0078] and

[0079] ;

[0080] Calculating the signal-to-noise ratio and clarity index ,in, Represents the signal power of the image, calculated from the mean of the square of the grayscale value of the image, indicating the energy level of the main information part of the image, and is used to measure the overall brightness of the image and the clarity of the information. Represents noise power, which is calculated from the mean of the square of the difference between the image gray value and its mean. It reflects the degree of random fluctuation in the image background and is used to evaluate the noise level in the image. Represents the gradient modulus of the image. The modulus of the image gradient can reflect the clarity of the image edge and the richness of the details. is the total number of pixels in the image;

[0081] There is an image with an average signal intensity of 150 (grayscale value range 0-255), a standard deviation of noise of 20, an image size of 100x100 pixels, and an image gradient sum of 5000. Substitute the values ​​into the formula to calculate the signal-to-noise ratio:

[0082] ;

[0083] ;

[0084] ;

[0085] Calculate the clarity index:

[0086] ;

[0087] The results show that the signal-to-noise ratio of 56.25 indicates that the main signal of the image is significantly stronger than the background noise, while the clarity index of 0.5 indicates that the image has a medium level of edge clarity and detail richness. These two parameters can be used to determine the processing quality of the image and whether further optimization is needed.

[0088] See also Figure 3 ,The optimized steps for acquiring Chinese medicinal materials images are as follows:

[0089] S121: adjusting the exposure and focus settings of the camera according to the signal-to-noise ratio and the clarity index to optimize the overexposure or underexposure problem of the image, thereby obtaining an exposure-adjusted Chinese medicinal material image;

[0090] The camera's exposure settings are adjusted based on the signal-to-noise ratio. By comparing the image's histogram distribution, areas with uneven brightness distribution in the image are identified. The exposure parameters are optimized using a piecewise linear adjustment method to avoid loss of bright details due to overexposure or loss of dark details due to underexposure. Secondly, the camera's focus settings are adjusted based on the calculated value of the clarity index. A stepped focus method is used to gradually change the camera's focus distance, capture multiple sample images, calculate their clarity index values, and select the focus parameters corresponding to the sample image with the highest clarity index as the final focus setting. After the above adjustments, an exposure-adjusted image of the Chinese medicinal materials is generated, ensuring that brightness and clarity are optimized in the camera settings.

[0091] S122: performing contrast optimization processing on the exposure-adjusted Chinese medicinal material image by adjusting the grayscale mapping curve of the image, refining the light and dark areas of the image, and sharpening the blurred version of the medicinal material image using the Unsaturated Mask (USM) algorithm to highlight key edges, thereby obtaining an optimized Chinese medicinal material image;

[0092] The brightness histogram distribution of the Chinese medicinal materials image after exposure adjustment is extracted, and the grayscale value mapping interval is redistributed based on the grayscale value range. The histogram stretching method is used to enhance the light and dark contrast of the image, and the dynamic range is expanded for the low-contrast area to improve the contrast level of the bright and dark parts. Then, the unsharp mask (USM) method is used to sharpen the blurred version of the image. First, a blurred version of the original image is generated as a low-frequency layer, and then the difference layer between the original image and the low-frequency layer is calculated. The difference layer is weightedly superimposed by adjusting the sharpening intensity to enhance the detail clarity of the edge part of the image. After contrast optimization and sharpening processing, the optimized Chinese medicinal materials image is finally obtained to ensure it has better visual quality and detail expression.

[0093] See also Figure 4 ,The identification steps of morphological characteristics and color are as follows:

[0094] S211: performing edge detection and color analysis on the optimized Chinese medicinal material image, using the Sobel operator to perform edge detection, identifying vertical and horizontal edges in the image, optimizing the image contour of the Chinese medicinal material, and obtaining a morphological feature map of the Chinese medicinal material;

[0095] The optimized Chinese medicinal materials image is converted into grayscale, and the grayscale value is used to represent the brightness distribution of each pixel to reduce computational complexity and redundant information. Then, the convolution kernel is used to extract the horizontal and vertical edge information of the grayscale image. The specific operation is to apply the Sobel operator to each pixel of the image, calculate the gradient size in the horizontal and vertical directions, and detect the edge contour in the image by the absolute value and direction of the gradient. Then, the extracted gradient information is combined to enhance the clarity of the edge features of the Chinese medicinal materials. Finally, the contour is optimized, and the noise and redundant edge lines in the image are removed by gradient amplitude thresholding. The optimization of the Chinese medicinal materials contour is completed, and the morphological feature map of the Chinese medicinal materials is obtained.

[0096] S212: Analyze the morphological characteristics of Chinese medicinal materials and evaluate their color using the following formula:

[0097] ;

[0098] The morphological characteristics and color recognition results are obtained, among which, It is a Chinese herbal medicine score, used to comprehensively evaluate the quality of Chinese herbal medicines. Represents the morphological feature score, obtained through edge detection algorithm, reflecting the accuracy and clarity of the Chinese medicinal material morphology. The score indicating the color characteristics reflects whether the color of the Chinese herbal medicine meets the quality standards through color analysis technology. and are weight coefficients, which adjust the influence of morphological characteristics and color characteristics on the total score respectively;

[0099] Scoring of morphological characteristics of Chinese medicinal materials The color characteristic score is 85. is 75, weight Set to 0.6, Set it to 0.4 and calculate the weighted score of morphological features according to the formula:

[0100] ;

[0101] Weighted score of color characteristics:

[0102] ;

[0103] calculate :

[0104] ;

[0105] The results showed that the overall quality score of the Chinese medicinal materials was 81, reflecting its high morphological quality and moderate color quality. The score can be used as a basis for subsequent quality classification and screening.

[0106] See also Figure 5 The specific steps for obtaining quality non-conformity information are as follows:

[0107] S221: Based on the recognition results, compare with the images of Chinese medicinal materials that meet the quality standards, identify Chinese medicinal materials with quality scores below the standard threshold, and obtain a preliminary list of unqualified Chinese medicinal materials;

[0108] By loading the morphological features and color score results of the identified Chinese medicinal materials, the scores are compared item by item with the reference scores of qualified Chinese medicinal materials images. The morphological feature score is calculated based on the matching degree between the edge integrity parameter obtained by edge detection and the edge feature of the reference image. The color score is calculated by analyzing the RGB component ratio of the Chinese medicinal materials and the color component of the standard image. According to the set standard threshold, Chinese medicinal materials with morphological scores or color scores below the standard threshold are screened out and marked as preliminary unqualified samples. Finally, a preliminary list of unqualified Chinese medicinal materials is generated for subsequent quality problem analysis.

[0109] S222: Analyze the quality issues of the preliminary list of unqualified Chinese medicinal materials using the formula:

[0110] ;

[0111] Calculating the quality deviation index , and obtain the quality problem analysis results, among which, Represents the scores of multiple quality indicators measured, involving morphological characteristics, color, ingredient content and other aspects. is the corresponding quality standard threshold. For each quality indicator, it is the minimum standard score that needs to be achieved to ensure the quality of the medicinal materials. is the number of quality indicators;

[0112] There are three quality indicators, with actual scores of 70, 80, and 60, and standard thresholds of 100, 90, and 85, respectively. The calculation is as follows:

[0113] ;

[0114] ;

[0115] ;

[0116] Total Quality Deviation Index:

[0117] ;

[0118] ;

[0119] The results showed that the overall quality deviation index was 17.46, indicating that there was a large quality deviation in the Chinese medicinal materials and further quality control measures were needed.

[0120] S223: Based on the quality problem analysis results, record the reasons and characteristics of each Chinese herbal medicine that does not meet the quality standards and organize them into quality non-conformity information;

[0121] The reasons and characteristic descriptions for each Chinese medicinal material that does not meet the quality standards are recorded. By checking the specific deviation items in the quality problem analysis one by one, it is analyzed whether the morphological feature deviation is caused by incomplete edge contour, abnormal shape or fragmentation, and whether the color feature deviation is due to imbalance in the RGB component ratio, abnormal overall color tone or uneven local color. The specific problem descriptions of the Chinese medicinal materials are further sorted out, including the deviation type and corresponding specific characteristics of the morphological problem, as well as the abnormal type and regional distribution characteristics of the color problem. Finally, the quality problems of all Chinese medicinal materials are recorded as text descriptions and organized into complete quality non-conformity information to support subsequent quality improvement work and reference analysis.

[0122] See also Figure 6 ,The steps to identify potential errors in classification are:

[0123] S311: Based on the quality non-conformity information, analyze the data of the classification decision process of each Chinese medicinal material, and determine the difference between the medicinal material characteristics and the standard characteristics, and obtain a medicinal material characteristic difference record set;

[0124] The actual data of relevant Chinese medicinal materials are extracted from the classification decision records, and the data groups containing characteristic values ​​are analyzed, such as key parameters such as the shape, color, size and density of the medicinal materials. The corresponding preset characteristic values ​​in the classification standard document are called and checked item by item. First, the actual characteristic values ​​of the medicinal materials are directly calculated with the classification standard characteristics, including quantifying the numerical differences by taking absolute values. At the same time, the items that do not meet the standards are recorded and marked as abnormal categories. The abnormal category data are then input into the difference classification program for further sorting. The high-frequency abnormal features are determined by sorting the characteristic parameters according to the abnormal frequency. The causes and impact of the classification errors caused by the high-frequency abnormal features are analyzed. Finally, based on the above calculation and analysis results, a set of medicinal material characteristic difference records is generated.

[0125] S312: Analyze the medicinal material characteristic difference record set using the formula:

[0126] ;

[0127] Calculate the classification error for each medicinal material , we get the classification error recognition result, where Representation characteristics The weight of reflects the importance of the feature in the classification criteria. Indicates the current monitoring characteristic value of the medicinal material, that is, the characteristic value measured from the actual data. Indicates the standard value of the corresponding feature in the classification standard, which is the expected feature performance when making classification decisions. is the total number of features;

[0128] There are three medicinal material characteristics, and their standard values ​​are =[10, 20, 30], the actual observed value is =[12, 18, 33], the weights are =[0.5, 1.0, 0.5], substitute the values ​​into the formula for calculation:

[0129] ;

[0130] ;

[0131] ;

[0132] ;

[0133] The results showed that the total classification error was 4.5, and the value reflected the total deviation between the medicinal material characteristics and the standard, which was helpful for identifying and optimizing the classification process of Chinese medicinal materials.

[0134] See also Figure 7 , the specific steps for obtaining sorting adjustment instructions are:

[0135] S321: Analyze and identify potential errors, and redesign the control parameters of the sorting robot arm, including the motion path and operation logic, for each error type and frequency, to obtain adjusted execution parameters;

[0136] Extract all the error records that have occurred, classify and count the errors by type, record the frequency of each error, associate the classified data with the robot arm control parameters, and determine whether the root cause of the error is related to the control logic and motion path. By comparing the current robot arm motion parameters and the standard parameters for the classification of target medicinal materials, identify the specific cause of the error, such as the motion path deviation resulting in the failure to grasp the target medicinal materials or the control logic misjudgment resulting in the medicinal materials being sorted to the wrong location. For the error records, redesign the control parameters of the sorting robot arm. During the redesign process, adjust the specific position of the grasping path point, optimize the force parameters during the grasping action, and introduce physical properties such as the weight and shape of the medicinal materials into the judgment of the control logic, so as to design a new set of motion paths and operation logic. The newly designed parameters will be used as the adjusted execution parameters.

[0137] S322: Based on the adjusted execution parameters, simulate and test the redesigned control parameters to evaluate their impact on sorting accuracy and efficiency using the formula:

[0138] ;

[0139] Calculate performance improvement percentage , get the sorting adjustment instruction, where, is an adjustment factor that weighs the importance of the performance difference between the old and new paths based on the historical effects of similar adjustments in the past. Represents the sorting speed obtained by simulation test under the new path, Represents the sorting speed obtained by simulation test under the original path;

[0140] The simulated sorting speed under the new path is times / minute, the speed under the old path is times / minute, adjustment factor (The factor is based on historical adjustment effects and determined through statistical analysis), the performance improvement percentage is calculated as:

[0141] ;

[0142] ;

[0143] The results show that by adjusting the control parameters, the new sorting strategy improves efficiency by 32% compared to the old strategy, which means that the sorting speed is significantly improved, thereby reducing production delays and improving the efficiency of the overall production line.

[0144] See also Figure 8 ,The specific steps for obtaining the sorting control optimization results are:

[0145] S411: Based on the sorting adjustment instructions, the correct sorting quantity and the error quantity of each batch are collected and organized into a preliminary sorting data set;

[0146] Automatically extract relevant data from the sorting operations of each batch, including the number of correct sortings and the number of incorrect sortings. The data comes directly from the sorting machine's log file, which records the sorting operations of each batch, including sorting time, total sorting times and the sorting status of each material. When sorting data, the original log data needs to be cleaned up, such as eliminating invalid records caused by equipment failure, and classifying and summarizing all sorting data according to batch numbers. The data is further standardized into a unified format so that it can be quickly called up in subsequent analysis. Finally, the sorted data is used to generate a preliminary sorting data set for calculating sorting performance indicators and optimizing parameter analysis.

[0147] S412: Analyze the preliminary sorting data set and calculate the sorting efficiency and error rate using the formula:

[0148] ;

[0149] and

[0150] ;

[0151] The sorting performance index results are obtained, among which, Indicates the proportion of successful sorting, Indicates the proportion of sorting errors, is the number of correct sorts, is the total number of sorting times;

[0152] If the total number of sorting times in a day times, of which the number of correct sorting Substitute the formula to calculate the sorting efficiency. Calculated as:

[0153] ;

[0154] Error rate The calculation is as follows:

[0155] ;

[0156] The results show that the current sorting system has a very high efficiency, reaching 95%, while the error rate is controlled at 5%, demonstrating high accuracy in performing sorting tasks and providing strong data support for subsequent parameter adjustment and optimization.

[0157] S413: Based on the sorting performance index results, adjust the image processing and sorting control parameters to optimize the sorting efficiency and accuracy of the Chinese medicinal materials, and obtain a sorting control optimization result;

[0158] By analyzing the calculated sorting efficiency and error rate, we adjust image processing-related parameters, such as image resolution, color range, and shape recognition threshold, to optimize the image processing's accuracy in identifying the appearance features of Chinese medicinal materials. At the same time, we further refine the sorting control parameters, adjust the robot's motion path and gripping force, and ensure consistency in the classification of medicinal materials of different sizes and weights. By testing the adjusted parameter combinations and monitoring the changing trends of sorting efficiency and error rate, we ensure that all parameter adjustments can effectively improve sorting performance after verification. Finally, we generate and record the sorting control optimization results.

[0159] The intelligent sorting and control system for Chinese herbal medicine based on image recognition includes:

[0160] The image adjustment module collects the original Chinese medicinal material images based on the image acquisition device, calculates the signal-to-noise ratio and clarity index in the original Chinese medicinal material images, adjusts the exposure and focus settings of the camera, performs contrast and sharpening processing, and obtains optimized Chinese medicinal material images;

[0161] The quality inspection module performs edge detection and color analysis on the optimized Chinese medicinal material images, identifies the morphological characteristics and color of the Chinese medicinal materials, compares them with the images of Chinese medicinal materials that meet the quality standards, determines and marks the Chinese medicinal materials that do not meet the quality standards, and obtains quality non-conformity information;

[0162] The sorting adjustment module compares the current medicinal material characteristics with the classification standards based on the quality discrepancy information, identifies potential errors in classification, and adjusts the path of the sorting robot arm or re-sorts the incorrectly classified Chinese medicinal materials to obtain sorting adjustment instructions;

[0163] The control optimization module performs statistical analysis on the sorting efficiency and error rate based on the sorting adjustment instructions, adjusts the image processing and sorting control parameters, and obtains the sorting control optimization results.

[0164] The above are merely preferred embodiments of the present invention and do not limit the present invention in any other form. Any technician familiar with the profession may use the technical content disclosed above to change or modify it into an equivalent embodiment with equivalent changes and apply it to other fields. However, any simple modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the content of the technical solution of the present invention shall still fall within the scope of protection of the technical solution of the present invention.

Claims

1. An intelligent sorting control method for Chinese medicinal materials based on image recognition, characterized in that: The following steps are involved: S1: Based on the image acquisition device, the original Chinese medicinal material image is collected, the signal-to-noise ratio and clarity index of the original Chinese medicinal material image are calculated, the exposure and focus settings of the camera are adjusted according to the calculation results, and the contrast and sharpness processing are performed on the original image to obtain an optimized Chinese medicinal material image; S2: performing edge detection and color analysis on the optimized Chinese medicinal material image to identify the morphological characteristics and color of the Chinese medicinal material, comparing the identification result with the image of the Chinese medicinal material that meets the quality standards, judging and marking the Chinese medicinal material that does not meet the quality standards, and obtaining quality non-conformity information; The steps for obtaining the quality non-conformity information are as follows: S221: Based on the recognition result, compare with the images of Chinese medicinal materials that meet the quality standards, identify Chinese medicinal materials with quality scores below the standard threshold, and obtain a preliminary list of unqualified Chinese medicinal materials; S222: Analyze the quality issues of the preliminary list of unqualified Chinese medicinal materials using the formula: ; Calculating the quality deviation index , and obtain the quality problem analysis results, among which, Represents the scores of multiple quality indicators measured, is the corresponding quality standard threshold, is the number of quality indicators; S223: Based on the quality problem analysis results, record the reasons and characteristic descriptions of each Chinese medicinal material that does not meet the quality standards, and organize them into quality non-conformity information; S3: Based on the quality discrepancy information, analyze the classification decision process of each Chinese medicinal material, compare the current medicinal material characteristics with the classification standard, identify potential errors in classification, and adjust the path of the sorting robot arm or re-sort the incorrectly classified Chinese medicinal materials to obtain sorting adjustment instructions; The steps of identifying potential errors in classification are specifically: S311: Based on the quality non-conformity information, analyzing the data of the classification decision process of each Chinese medicinal material, and determining the difference between the medicinal material characteristics and the standard characteristics, to obtain a medicinal material characteristic difference record set; S312: Analyze the medicinal material characteristic difference record set using the formula: ; Calculate the classification error for each medicinal material , we get the classification error recognition result, where Representation characteristics The weight of Indicates the current monitoring characteristic value of the medicinal material. represents the standard value of the corresponding feature in the classification standard, is the total number of features; S4: Based on the sorting adjustment instruction, statistical analysis is performed on the sorting efficiency and error rate, and image processing and sorting control parameters are adjusted according to the analysis results to optimize the sorting efficiency of Chinese medicinal materials and obtain a sorting control optimization result.

2. The intelligent sorting control method for Chinese medicinal materials based on image recognition according to claim 1 is characterized in that: The calculation steps of the signal-to-noise ratio and the clarity index are specifically as follows: S111: Based on the image acquisition device, collect the original Chinese medicinal material image, perform Gaussian filtering to remove potential noise, convert the image to grayscale form, and standardize the data to obtain a standardized Chinese medicinal material image; S112: Based on the standardized Chinese medicinal material image, the formula: ; and ; Calculating the signal-to-noise ratio and clarity index ,in, represents the signal power of the image, represents the noise power, represents the gradient modulus of the image, is the total number of pixels in the image.

3. The intelligent sorting control method for Chinese medicinal materials based on image recognition according to claim 1 is characterized in that: The steps for obtaining the optimized Chinese medicinal material image are specifically as follows: S121: adjusting the exposure and focus settings of the camera according to the signal-to-noise ratio and the clarity index to optimize the overexposure or underexposure problem of the image, thereby obtaining an exposure-adjusted Chinese medicinal material image; S122: By adjusting the grayscale mapping curve of the image, the contrast of the exposure-adjusted Chinese medicinal material image is optimized to refine the light and dark areas of the image, and the blurred version of the medicinal material image is sharpened using the USM algorithm to highlight key edges, thereby obtaining an optimized Chinese medicinal material image.

4. The intelligent sorting control method for Chinese medicinal materials based on image recognition according to claim 1, characterized in that: The steps for identifying the morphological characteristics and color are specifically as follows: S211: performing edge detection and color analysis on the optimized Chinese medicinal material image, using the Sobel operator to perform edge detection, identifying vertical and horizontal edges in the image, optimizing the image contour of the Chinese medicinal material, and obtaining a morphological feature map of the Chinese medicinal material; S212: Analyze the morphological characteristics of the Chinese medicinal materials and evaluate the color of the Chinese medicinal materials using the formula: ; The morphological characteristics and color recognition results are obtained, among which, It is the rating of Chinese herbal medicine. represents the morphological characteristic score, Indicates the score of color characteristics, and is the weight coefficient.

5. The intelligent sorting control method for Chinese medicinal materials based on image recognition according to claim 1 is characterized in that: The steps for obtaining the sorting adjustment instruction are specifically as follows: S321: Analyze the identified potential errors, and redesign the control parameters of the sorting robot arm, including the motion path and operation logic, for each error type and occurrence frequency, to obtain adjusted execution parameters; S322: Based on the adjusted execution parameters, simulate and test the redesigned control parameters to evaluate their impact on sorting accuracy and efficiency using the formula: ; Calculate performance improvement percentage , get the sorting adjustment instruction, where, is the adjustment factor, Represents the sorting speed obtained by simulation test under the new path, Represents the sorting speed obtained from the simulation test under the original path.

6. The intelligent sorting control method for Chinese medicinal materials based on image recognition according to claim 1 is characterized in that: The steps for obtaining the sorting control optimization result are specifically as follows: S411: Based on the sorting adjustment instruction, collect the correct sorting quantity and the incorrect sorting quantity of each batch and organize them into a preliminary sorting data set; S412: Analyze the preliminary sorting data set and calculate the sorting efficiency and error rate using the formula: ; and ; The sorting performance index results are obtained, among which, Indicates the proportion of successful sorting, Indicates the proportion of sorting errors, is the number of correct sorts, is the total number of sorting times; S413: Based on the sorting performance index result, adjust the image processing and sorting control parameters to optimize the sorting efficiency and accuracy of the Chinese medicinal materials and obtain a sorting control optimization result.

7. The intelligent sorting and control system for Chinese medicinal materials based on image recognition is characterized by: According to any one of claims 1 to 6, the method for intelligent sorting and control of Chinese medicinal materials based on image recognition is implemented, and the system comprises: The image adjustment module collects the original Chinese medicinal material images based on the image acquisition device, calculates the signal-to-noise ratio and clarity index in the original Chinese medicinal material images, adjusts the exposure and focus settings of the camera, performs contrast and sharpening processing, and obtains optimized Chinese medicinal material images; The quality detection module performs edge detection and color analysis on the optimized Chinese medicinal material image, identifies the morphological characteristics and color of the Chinese medicinal material, compares it with the image of the Chinese medicinal material that meets the quality standards, determines and marks the Chinese medicinal material that does not meet the quality standards, and obtains quality non-compliance information; The sorting adjustment module compares the current medicinal material characteristics with the classification standards based on the quality discrepancy information, identifies potential errors in classification, and adjusts the path of the sorting robot arm or re-sorts the incorrectly classified Chinese medicinal materials to obtain sorting adjustment instructions; The control optimization module performs statistical analysis on the sorting efficiency and error rate based on the sorting adjustment instructions, adjusts image processing and sorting control parameters, and obtains a sorting control optimization result.

Citation Information

Patent Citations

  • Assembly line automatic sorting system based on image processing guidance

    CN118736473A