Intelligent sorting control method and system for traditional Chinese medicinal materials based on image recognition
By calculating the signal-to-noise ratio and clarity index, optimizing the image of Chinese medicinal materials, combining edge detection and color analysis to identify features, and adjusting the path of sorting robotic arm, the problem of difficult to balance the speed and accuracy in Chinese medicinal materials is solved, and high efficiency is achieved , accurate sorting process.
Patent Information
- Application Number
- CN202510060410.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2045-01-15
AI Technical Summary
The prior art is difficult to achieve the optimal balance of speed and accuracy in the sorting of traditional Chinese medicinal materials. Especially when light and background noise change, the accuracy of image recognition is insufficient, resulting in misjudgment and sorting errors, which increases production cost and quality. question.
By calculating the signal-to-noise ratio and clarity index in the Chinese herbal medicine images, adjusting the camera's exposure and focus settings, and performing contrast and sharpening processing to optimize image quality. At the same time, the morphological characteristics and colors of Chinese medicinal materials are identified through edge detection and color analysis, and the Chinese medicinal materials that do not meet the quality are judged and marked, and the path of the sorting robot arm is adjusted to correct classification errors.
It significantly improves the details quality of Chinese medicinal materials images, reduces misjudgment, enhances the flexibility and efficiency of the sorting system, ensures accurate sorting of Chinese medicinal materials, and improves overall production efficiency.
Smart Images

Figure CN119489050A_ABST
Abstract
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, and then control algorithms are 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 positions. 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] It is difficult for existing technologies 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 processing images, and are prone to misjudgment for items such as Chinese medicinal materials whose appearance features vary greatly. These technical limitations can lead to sorting errors, increased duplication of 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 scheme: a Chinese medicinal material intelligent sorting control method based on image recognition comprises the following steps: S1: Based on the image acquisition device, the original Chinese medicinal material image is acquired, the signal-to-noise ratio and the clarity index in 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; 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 wrongly classified Chinese medicinal materials to obtain sorting adjustment instructions; 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.
[0007] The present invention is improved 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 is used: ; and ; Calculate 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.
[0008] The present invention is improved in that the steps of 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, optimizing the overexposure or underexposure problem of the image, and 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, the light and dark areas of the image are refined, 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.
[0009] The present invention is improved in that the steps of 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 feature score, A score indicating color characteristics, and is the weight coefficient.
[0010] The present invention is improved in that the steps of obtaining the quality non-conforming information are specifically 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 whose quality scores are lower than 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: ; Calculate 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, 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.
[0011] The present invention is improved in that the step of identifying potential errors in classification is 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, and obtaining 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 , and obtain 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.
[0012] The present invention is improved in that the step of obtaining the sorting adjustment instruction is 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, a simulation test is performed on the redesigned control parameters to evaluate their impact on sorting accuracy and efficiency, using the formula: ; Calculate the 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.
[0013] The present invention is improved in that the steps of obtaining the sorting control optimization result are specifically as follows: S411: Based on the sorting adjustment instruction, collect the correct sorting quantity and the wrong 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 sortings, 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.
[0014] An intelligent sorting control system for Chinese medicinal materials based on image recognition, the system comprising: The image adjustment module collects the original Chinese medicinal material image based on the image acquisition device, calculates the signal-to-noise ratio and clarity index in the original Chinese medicinal material image, adjusts the exposure and focus settings of the camera, performs contrast and sharpening processing, and obtains an optimized Chinese medicinal material image; 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 Chinese medicinal material image that meets the quality standards, determines and marks the Chinese medicinal material that does not meet the quality standards, and obtains quality non-conformity information; The sorting adjustment module compares the current medicinal material characteristics with the classification standard based on the quality non-conformity information, identifies potential errors in classification, and adjusts the path of the sorting robot arm or re-sorts the wrongly classified Chinese medicinal materials to obtain a sorting adjustment instruction; The control optimization module performs statistical analysis on the sorting efficiency and error rate based on the sorting adjustment instruction, adjusts the image processing and sorting control parameters, and obtains the sorting control optimization result.
[0015] Compared with the prior art, the advantages and positive effects of the present invention are: 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, and accurate capture of the characteristics of Chinese medicinal materials is ensured, and misjudgment caused by poor image quality is reduced. 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 and greatly improving the efficiency of the operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 The present invention proposes a flow chart of a Chinese medicinal material intelligent sorting control method based on image recognition; Figure 2 is a flow chart for calculating the signal-to-noise ratio and the clarity index in the present invention; Figure 3 This is a flowchart of obtaining the optimized Chinese medicinal material images in the present invention; Figure 4 This is a flow chart for identifying morphological features and color in the present invention; Figure 5 A flowchart for obtaining quality non-conformity information in the present invention; Figure 6 A flowchart for identifying potential errors in classification in the present invention; Figure 7 This is a flow chart for obtaining sorting adjustment instructions in the present invention; Figure 8 This is a flow chart for obtaining the sorting control optimization results in the present invention. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with 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.
[0018] 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 positions or positional relationships, are based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, in the description of the present invention, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined. Example
[0019] See also Figure 1 The present invention provides a technical solution: a method for intelligent sorting and control of Chinese medicinal materials based on image recognition, comprising the following steps: S1: Based on the image acquisition device, the original Chinese medicinal material image is acquired, the signal-to-noise ratio and the clarity index in 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: 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, judge and mark the Chinese medicinal materials that do not meet the quality standards, and obtain 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 standards, identify potential errors in classification, and adjust the path of the sorting robot arm or re-sort the wrongly classified Chinese medicinal materials to obtain sorting adjustment instructions; S4: Based on the sorting adjustment instructions, 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 and accuracy of Chinese medicinal materials and obtain sorting control optimization results.
[0020] 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.
[0021] See also Figure 2, the calculation steps of signal-to-noise ratio and clarity index are 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; 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 operations on the image pixel by pixel, and random noise in the low-frequency area is removed at the same time. 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 allocated according to the characteristics of the RGB channels, such as the green weight is the highest, followed by the red and blue channels. After the channels are merged, a single grayscale value is generated, and then the image data standardization operation is performed to linearly map the grayscale value range 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 herbal medicine image.
[0022] S112: Based on standardized Chinese medicinal material images, the formula is: ; and ; Calculate 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, calculated from the mean of the square of the difference between the image gray value and its mean, reflecting the degree of random fluctuation in the image background and 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; 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: ; ; ; Calculate the clarity index: ; 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. The two parameters can be used to determine the processing quality of the image and whether it needs further optimization.
[0023] See also Figure 3 , the optimized steps for acquiring Chinese medicinal materials images are as follows: S121: adjusting the exposure and focus settings of the camera according to the signal-to-noise ratio and the clarity index, optimizing the overexposure or underexposure problem of the image, and obtaining an exposure-adjusted Chinese medicinal material image; The exposure settings of the camera are adjusted according to the signal-to-noise ratio. By comparing the histogram distribution of the image, the areas with uneven brightness distribution in the image are determined. The exposure parameters are optimized using the piecewise linear adjustment method to avoid loss of bright details due to overexposure or loss of dark details due to underexposure. Secondly, the focus settings of the camera are adjusted according to the calculated value of the clarity index. The step focus method is adopted to gradually change the focus distance of the camera, take 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 settings. After the above adjustments, an exposure-adjusted Chinese medicinal material image is generated to ensure that the brightness and clarity are optimized in the camera settings.
[0024] S122: by adjusting the grayscale mapping curve of the image, performing contrast optimization processing on the exposure-adjusted Chinese medicinal material image, refining the light and dark areas of the image, and using the USM algorithm to sharpen the blurred version of the medicinal material image, highlighting key edges, and obtaining an optimized Chinese medicinal material image; The brightness histogram distribution in 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, the optimized Chinese medicinal materials image is finally obtained to ensure that it has better visual quality and detail expression.
[0025] See also Figure 4 , the identification steps of morphological characteristics and color are 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; 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 contour of the Chinese medicinal materials is completed, and the morphological feature map of the Chinese medicinal materials is obtained.
[0026] S212: Analyze the morphological characteristics of Chinese medicinal materials and evaluate their color using the formula: ; The morphological characteristics and color recognition results are obtained, among which, It is a Chinese herbal medicine score, which is used to comprehensively evaluate the quality of Chinese herbal medicine. Represents the morphological feature score, obtained through edge detection algorithm, reflecting the accuracy and clarity of the morphology of Chinese medicinal materials. The score indicating the color characteristics reflects whether the color of the Chinese medicinal materials meets the quality standards through color analysis technology. and are weight coefficients, which adjust the influence of morphological characteristics and color characteristics in the total score respectively; 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: ; Weighted score of color characteristics: ; calculate : ; 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.
[0027] See also Figure 5The specific steps for obtaining quality non-conformity information are as follows: S221: Based on the recognition results, compare with the images of Chinese medicinal materials that meet the quality standards, identify the Chinese medicinal materials whose quality scores are lower than the standard threshold, and obtain a preliminary list of unqualified Chinese medicinal materials; 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 the Chinese medicinal materials images with qualified quality. The score calculation of the morphological features is based on the matching degree between the edge integrity parameters obtained by edge detection and the edge features 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, the Chinese medicinal materials with morphological scores or color scores lower than the standard threshold are screened out. The Chinese medicinal materials will be marked as preliminary unqualified samples, and finally a preliminary list of unqualified Chinese medicinal materials is generated for subsequent quality problem analysis; S222: Analyze the quality issues of the preliminary list of substandard Chinese medicinal materials using the formula: ; Calculate 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; There are three quality indicators, the corresponding actual scores are 70, 80 and 60, and the standard thresholds are 100, 90 and 85, respectively. The calculation is as follows: ; ; ; Total quality deviation index: ; ; 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.
[0028] S223: Based on the quality problem analysis results, record the reasons and characteristic descriptions of each Chinese herbal medicine that does not meet the quality standards and organize them into quality non-conformity information; 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 characteristic deviation is caused by incomplete edge contour, abnormal shape or fragmentation, and whether the color characteristic deviation is due to unbalanced RGB component proportions, abnormal overall hue 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 problems, as well as the abnormal types and regional distribution characteristics of the color problems. 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.
[0029] See also Figure 6 ,The steps to identify potential errors in classification are as follows: 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; 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, and recording and marking the items that do not meet the standards as abnormal categories. The abnormal category data is 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, and the causes and impact of the classification errors caused by the high-frequency abnormal features are analyzed. Finally, according to the above calculation and analysis results, a set of medicinal material characteristic difference records is generated.
[0030] S312: Analyze the record set of medicinal material characteristics differences using the formula: ; Calculate the classification error for each medicinal material , and obtain 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. It represents 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; 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: ; ; ; ; The results showed that the total classification error was 4.5, and the value reflected the total deviation between the characteristics of the medicinal materials and the standards, which was helpful in identifying and optimizing the classification process of Chinese medicinal materials.
[0031] See also Figure 7 , the specific steps for obtaining the sorting adjustment instruction are as follows: 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 occurrence frequency, to obtain adjusted execution parameters; 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, determine whether the root cause of the error is related to the control logic and motion path, and identify the specific cause of the error by comparing the current robot arm motion parameters with the standard parameters for the classification of target medicinal materials. For example, the motion path deviation causes the target medicinal materials to not be grasped or the control logic misjudgment causes the medicinal materials to be sorted to the wrong position. 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 points, 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.
[0032] 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 the 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; The simulated sorting speed under the new path is times / minute, the speed under the old path is times / minute, adjustment factor (factors are based on historical adjustment effects, determined through statistical analysis), the performance improvement percentage is calculated as: ; ; 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.
[0033] See also Figure 8 , the specific steps for obtaining the sorting control optimization results are: S411: Based on the sorting adjustment instruction, collect the correct sorting quantity and the wrong sorting quantity of each batch and organize them into a preliminary sorting data set; Automatically extract relevant data from the sorting operation of each batch, including the number of correct sorting and the number of incorrect sorting. The data comes directly from the log file of the sorting machine. The log file records the sorting operation of each batch, including the sorting time, the total number of sorting times and the sorting status of each material. The original log data needs to be cleaned up when sorting the data, such as eliminating invalid records caused by equipment failure, and classifying and summarizing all sorting data according to the batch number, and further standardizing the data into a unified format so that it can be quickly called in subsequent analysis. Finally, the sorted data will be used to generate a preliminary sorting data set for calculating sorting performance indicators and optimizing parameter analysis.
[0034] 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 sortings, is the total number of sorting times; If the total number of sortings in a day times, the number of correct sorting Substitute the formula to calculate the sorting efficiency. Calculated as: ; Error rate The calculation is as follows: ; The results show that the efficiency of the current sorting system is very high, reaching 95%, while the error rate is controlled at 5%, showing high accuracy in performing sorting tasks and providing strong data support for subsequent parameter adjustments and optimizations.
[0035] 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 the sorting control optimization results; By analyzing the calculated sorting efficiency and error rate, we adjust the image processing related parameters, such as image resolution, color range and shape recognition threshold, so as to optimize the recognition accuracy of image processing for the appearance characteristics of Chinese medicinal materials. At the same time, we further refine the sorting control parameters, adjust the motion path and grasping force of the robot arm, and ensure consistency in the classification of medicinal materials of different sizes and weights. By testing the adjusted parameter combination, we monitor the changing trends of sorting efficiency and error rate to ensure that all parameter adjustments can effectively improve the sorting performance after verification. Finally, we generate and record the sorting control optimization results.
[0036] The intelligent sorting control system for Chinese medicinal materials based on image recognition includes: The image adjustment module collects the original Chinese medicinal material image based on the image acquisition device, calculates the signal-to-noise ratio and clarity index in the original Chinese medicinal material image, adjusts the exposure and focus settings of the camera, performs contrast and sharpening processing, and obtains an optimized Chinese medicinal material image; 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; The sorting adjustment module compares the current medicinal material characteristics with the classification standards based on the quality non-conformity information, identifies potential errors in classification, and adjusts the path of the sorting robot arm or re-sorts the wrongly 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 the image processing and sorting control parameters, and obtains the sorting control optimization results.
[0037] The above are only preferred embodiments of the present invention and are not intended to limit the present invention in other forms. Any technician familiar with the profession may use the technical contents disclosed above to change or modify them into equivalent embodiments with equivalent changes and apply them to other fields. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the technical solution of the present invention still falls within the protection scope 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 acquired, the signal-to-noise ratio and the clarity index in 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; 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 wrongly classified Chinese medicinal materials to obtain sorting adjustment instructions; 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 is used: ; and ; Calculate 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, optimizing the overexposure or underexposure problem of the image, and 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, the light and dark areas of the image are refined, 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 is 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 feature score, A score indicating 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 quality non-conformity information are specifically 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 whose quality scores are lower than 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: ; Calculate 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, 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.
6. The intelligent sorting control method for Chinese medicinal materials based on image recognition according to claim 1 is characterized in that: 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, and obtaining 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 , and obtain 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.
7. 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, a simulation test is performed on the redesigned control parameters to evaluate their impact on sorting accuracy and efficiency, using the formula: ; Calculate the 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.
8. The method for intelligent sorting and controlling Chinese medicinal materials based on image recognition according to claim 1, 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 wrong 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 sortings, 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.
9. The intelligent sorting control system for Chinese medicinal materials based on image recognition is characterized by: According to any one of claims 1 to 8, 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 image based on the image acquisition device, calculates the signal-to-noise ratio and clarity index in the original Chinese medicinal material image, adjusts the exposure and focus settings of the camera, performs contrast and sharpening processing, and obtains an optimized Chinese medicinal material image; 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 Chinese medicinal material image that meets the quality standards, determines and marks the Chinese medicinal material that does not meet the quality standards, and obtains quality non-conformity information; The sorting adjustment module compares the current medicinal material characteristics with the classification standard based on the quality non-conformity information, identifies potential errors in classification, and adjusts the path of the sorting robot arm or re-sorts the wrongly classified Chinese medicinal materials to obtain a sorting adjustment instruction; The control optimization module performs statistical analysis on the sorting efficiency and error rate based on the sorting adjustment instruction, adjusts the image processing and sorting control parameters, and obtains the sorting control optimization result.
Citation Information
Patent Citations
Visual inspection image acquisition and analysis method
CN116309504A
Defective product sorting program verification method and device and storage medium
CN117862068A
High-speed sorting method and system based on multi-target image recognition
CN118396014A
Traditional Chinese medicine material data processing method and system
CN118552158A
Assembly line automatic sorting system based on image processing guidance
CN118736473A
Cited By
Full-automatic integrated traditional Chinese medicine detection method and equipment
CN119757775A
Door and window material recycling and sorting control method and device
CN120450694A