Medicinal materials production quality detection method based on image recognition
Through image recognition technology, the preservation, drying, fabrication and purification status of all herbal medicinal materials has been comprehensively evaluated, which has solved the problems of insufficient comprehensive quality inspection and lax process control in the existing technology, and improved the standardization and efficiency of medicinal materials production.
Patent Information
- Application Number
- CN202411563692.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-11-05
AI Technical Summary
The prior art cannot comprehensively and systematically evaluate the storage status, dry status, preparation status and clean status of the medicinal materials in the quality inspection of all herbal medicines, resulting in insufficient comprehensive and accurate quality control and the inability to effectively control the entire production process.
Using an image recognition-based method, the overall image and detailed images of the medicinal materials are collected through the camera equipment, and the morphological integrity, dry state, preparation state and clean state are detected, and a comprehensive judgment is made in combination with multiple evaluation indicators to ensure that the quality of the medicinal materials meets the unified standards.
A comprehensive and accurate assessment of the quality of all herbal medicinal materials has been achieved, the standardization and consistency of the production process has been improved, the production process has been optimized, and the production efficiency and quality stability of medicinal materials have been improved.
Smart Images

Figure CN119091259B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of medicinal material production quality detection, and relates to a medicinal material production quality detection method based on image recognition. Background Art
[0002] With the increasing popularity and wide recognition of traditional Chinese medicine around the world, the importance of quality control of medicinal materials has become increasingly prominent. Especially for whole-herb medicinal materials, quality control is more critical due to their morphological characteristics and the particularity of their growth environment. High-quality whole-herb medicinal materials can not only effectively guarantee the efficacy of the medicine, but also greatly improve the safety and treatment effect of patients.
[0003] In recent years, with the rapid development of computer vision and image recognition technology, the production quality detection method of whole herbal medicinal materials based on image recognition has gradually become a research hotspot, providing a new solution for the quality control of whole herbal medicinal materials.
[0004] However, existing technologies have obvious shortcomings. On the one hand, they lack comprehensive, systematic and accurate analysis. Specifically, it is impossible to conduct a comprehensive evaluation of multiple key aspects of whole-herb medicinal materials, such as the preservation state, drying state, processing state and purification state, which cover the important links that may affect the quality of whole-herb medicinal materials from raw materials to finished products. At present, some existing technologies often only focus on one or two aspects. For example, some only focus on the evaluation of a single factor such as appearance or degree of dryness, which makes it difficult to fully reflect the quality of whole-herb medicinal materials and cannot be deeply grasped and analyzed at a sufficient level of detail.
[0005] On the other hand, it is impossible to effectively control the quality of the entire herbal medicinal material production process, and it is impossible to integrate the evaluation indicators of each link to draw conclusions and then form a complete quality inspection system. The existing image recognition technology may only be scattered detection in the quality analysis of whole herbal medicinal material production, and it is impossible to systematically link the various links together. Summary of the invention
[0006] In view of this, in order to solve the problems raised in the above background technology, a method for detecting the production quality of medicinal materials based on image recognition is proposed.
[0007] The objective of the present invention can be achieved through the following technical solutions: The present invention provides a method for detecting the production quality of medicinal materials based on image recognition, comprising: S1. placing the target medicinal materials to be detected on an image acquisition platform, capturing the overall image of the target medicinal materials with a preset focal length through a camera device, detecting the morphological integrity, morphological regularity and apparent glossiness of the target medicinal materials, and calculating the preservation status evaluation index of the target medicinal materials.
[0008] S2. Use the camera to collect detailed images of each component of the target medicinal material, including roots, stems, and leaves, and calculate the dryness evaluation index of the target medicinal material based on the texture characteristics of each component of the target medicinal material.
[0009] S3. Promote the camera equipment to perform image recognition and analysis on the key point features and key area features of the target medicinal materials, where the key points include the leaf tips and stem nodes, and the key areas include the striped areas and raised areas, and calculate the processing status evaluation index of the target medicinal materials.
[0010] S4. Use video equipment to conduct a comprehensive scan of the surface of the target medicinal materials, analyze the cleanliness of the surface of the target medicinal materials and the degree of non-drug residues on the surface, and calculate the evaluation index of the clean status of the target medicinal materials.
[0011] S5. Combined with the corresponding evaluation indicators of the target medicinal materials’ storage status, drying status, processing status and purification status, comprehensively judge whether the production quality of the target medicinal materials is qualified. If it is judged to be qualified, a qualified label will be assigned. If it is judged to be unqualified, the abnormal production process links of the target medicinal materials will be traced back and feedback will be provided.
[0012] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) The present invention detects the morphological integrity, morphological regularity and apparent glossiness of the target medicinal material based on the overall image of the target medicinal material, providing a comprehensive and in-depth perspective for the evaluation of the preservation status of the medicinal material, and ensuring the reliability and accuracy of the calculation of the preservation status evaluation index of the target medicinal material.
[0013] (2) The present invention calculates the drying state evaluation index of the target medicinal material according to the texture characteristics of each component of the target medicinal material, accurately quantifies the drying state of the medicinal material, and provides a reliable basis for quality control in the production process.
[0014] (3) The present invention effectively grasps the processing maturity of the target medicinal materials by performing image recognition analysis on the key point features and key area features of the target medicinal materials, thereby helping to determine whether the medicinal materials have undergone an appropriate processing process and achieving accurate evaluation of the processing status of the target medicinal materials.
[0015] (4) The present invention identifies the impurity features and non-medicinal features in the target medicinal material image, analyzes the surface cleanliness of the target medicinal material and the degree of non-drug residue on the surface, so as to ensure the efficiency and accuracy of the clean state assessment of the target medicinal material.
[0016] (5) The present invention combines the corresponding evaluation indicators of the storage state, drying state, processing state and purification state of the target medicinal materials to accurately judge the production quality qualification of the target medicinal materials, which not only ensures that the medicinal materials meet the unified quality requirements in each production link and improves the standardization and consistency of medicinal material production, but also traces the abnormal production links when it is judged to be unqualified, helps optimize the production process, and improves production efficiency and quality stability. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0018] Figure 1 The present invention is a flowchart of the steps for implementing the method.
[0019] Figure 2 for Figure 1 Detailed implementation steps of step S1 in FIG. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0021] See also Figure 1 As shown, the present invention provides a method for detecting the production quality of medicinal materials based on image recognition, comprising: S1. placing the target medicinal materials to be detected on an image acquisition platform, capturing the overall image of the target medicinal materials with a preset focal length through a camera device, detecting the morphological integrity, morphological regularity and apparent glossiness of the target medicinal materials, so as to calculate the preservation status evaluation index of the target medicinal materials.
[0022] See also Figure 2As shown, specifically, the calculation of the preservation status evaluation index of the target medicinal material includes: S11. outlining the shape contour of the target medicinal material according to the overall image of the target medicinal material, and obtaining the continuity state coefficient of the shape contour of the target medicinal material by analyzing the local curvature of each pixel of the shape contour and the distance between it and the adjacent pixels; by converting the overall image of the target medicinal material into a binary image, screening each pixel in the shape contour whose pixel grayscale value is greater than a preset grayscale threshold and retrieving its corresponding connected area, marking it as each foreground area, and outputting the contour hierarchy of each foreground area to analyze the inner density state coefficient of the target medicinal material morphological contour; taking the cumulative value of the continuity state coefficient and the inner density state coefficient of the target medicinal material morphological contour as the morphological integrity of the target medicinal material.
[0023] It should be noted that the analysis process of the continuity coefficient of the target medicinal material shape contour is as follows: if the local curvature of a pixel in the target medicinal material shape contour is less than the preset curvature threshold and the distance between it and the adjacent pixel is greater than the preset distance threshold, it means that the pixel is a discontinuous pixel point, and the number of discontinuous pixels in the target medicinal material shape contour is counted. , with the formula Get the continuous state coefficient of the target medicinal material shape contour.
[0024] It should be noted that if the output value of the contour hierarchy of a foreground area is -1, it means that there is a hole in the foreground area. The foreground area is marked as a hole area. The number of hole areas in the target medicinal material shape contour is counted, which is consistent with the calculation method of the continuous state coefficient of the target medicinal material shape contour to obtain the inner density state coefficient of the target medicinal material shape contour.
[0025] It should be noted that the specific analysis process of the above-mentioned output of the hierarchical structure of the contour of each foreground area is: retrieve the boundary pixel points of the contour of each foreground area in a preset direction, the boundary pixel is essentially a pixel point that presents a transition characteristic from the background grayscale pixel value to the foreground area grayscale pixel value at the image grayscale value level, and continuously performs tracking operations on the boundary pixel points of the contour of each foreground area in the preset direction, and encodes the state indicators of each boundary pixel point and its adjacent pixel points. If the grayscale pixel value of a pixel point is within the preset interval of the background grayscale pixel value, the state indicator of the pixel point is edited as a background pixel. Conversely, if the grayscale pixel value of a pixel point is outside the preset interval of the background grayscale pixel value, the state indicator of the pixel point is edited as a foreground pixel.
[0026] When a certain boundary pixel point of a foreground area contour is identified, if the state indicators of its inner adjacent pixel points are all background pixels, its outer adjacent pixel points are all foreground pixels, and the area of the closed sub-region formed by its inner adjacent pixel points is greater than or equal to the preset area threshold, then the output of the foreground area contour hierarchy structure is -1, otherwise the output of the foreground area contour hierarchy structure is 1, thereby outputting each foreground area contour hierarchy structure.
[0027] If the output value of the contour hierarchy of a foreground area is -1, it means that there is a hole in the foreground area. The foreground area is marked as a hole area. The number of hole areas in the target medicinal material shape contour is counted, and the calculation method of the continuous state coefficient of the target medicinal material shape contour is consistent with the calculation method of the continuous state coefficient of the target medicinal material shape contour to obtain the inner density state coefficient of the target medicinal material shape contour.
[0028] It should also be noted that the output analysis process of the above-mentioned foreground area contour hierarchy can be completed by a contour detection algorithm based on topological structure analysis, such as the Suzuki algorithm, the seed filling algorithm, etc. The above-mentioned boundary pixel retrieval conditions are: the grayscale pixel values of the outer adjacent pixels of the boundary pixel are within the preset interval of the background grayscale pixel values, and the grayscale pixel values of the inner adjacent pixels are outside the preset interval of the background grayscale pixel values. It can be understood as the grayscale pixel values of the outer adjacent pixels of the boundary pixel are 0, while the grayscale pixel values of the inner adjacent pixels are not 0.
[0029] S12. Identify and divide the shape contours of the various components of the target medicinal material, evaluate the proportion coordination of the overall plant of the target medicinal material, the regularity of the leaf edges, and the twisting of the rhizome, so as to analyze the morphological regularity of the target medicinal material.
[0030] S13. Obtain the pixel grayscale value of each pixel in the overall image of the target medicinal material after converting the binary image, and analyze the apparent glossiness of the target medicinal material through the mean calculation results and standard deviation calculation results.
[0031] It should be noted that the calculation formula for the apparent gloss of the above-mentioned target medicinal materials is: ,in are the mean and standard deviation calculation results of the pixel grayscale values of each pixel in the overall image of the target medicinal material, It is the overall pixel grayscale reference value of the preset image.
[0032] S14. The morphological integrity, morphological regularity and apparent glossiness of the target medicinal material are respectively accumulated with the products of their corresponding preset weights to obtain the preservation status evaluation index of the target medicinal material.
[0033] Specifically, the analysis of the morphological regularity of the target medicinal material includes: measuring the length and width of the shape contour of each component of the target medicinal material, comparing the length and width of the shape contour of each component, collecting the size ratios between the components of the target medicinal material as a whole plant, and comparing them with the corresponding size coordination ratio intervals between the components of the target medicinal material variety medicinal specification stored in the WEB cloud. If the size ratios between the components of the target medicinal material as a whole plant are all within their corresponding size coordination ratio intervals, then the proportion coordination evaluation index of the target medicinal material as a whole plant is set to 1. Otherwise, the size ratios between the components of the target medicinal material as a whole plant that are outside their corresponding size coordination ratio intervals are counted and recorded as inharmonious ratios. The deviations between the inharmonious ratios and their corresponding size coordination ratio intervals are calculated and accumulated, and the accumulated values are recorded as , according to the formula The proportion coordination evaluation index of the whole plant of the target medicinal material is obtained. .
[0034] It is particularly noted that the calculation process of the deviation between the above-mentioned inharmonious proportions and their corresponding size coordinated proportion intervals is as follows: if an inharmonious proportion is smaller than the lower limit value of its corresponding size coordinated proportion interval, the lower limit value of its corresponding size coordinated proportion interval is subtracted from the inharmonious proportion, and the difference is further analyzed by ratio with the lower limit value of its corresponding size coordinated proportion interval to obtain the deviation between the inharmonious proportion and its corresponding size coordinated proportion interval; if an inharmonious proportion is larger than the upper limit value of its corresponding size coordinated proportion interval, the inharmonious proportion is subtracted from the upper limit value of its corresponding size coordinated proportion interval, and the difference is further analyzed by ratio with the upper limit value of its corresponding size coordinated proportion interval to obtain the deviation between the inharmonious proportion and its corresponding size coordinated proportion interval, thereby calculating the deviation between each inharmonious proportion and its corresponding size coordinated proportion interval.
[0035] The target medicinal material leaf morphological contour was extracted and imported into Matlab software for optimal function fitting operation. The optimal fitting function of the target medicinal material leaf morphological contour was obtained and the first-order and second-order derivatives were performed in sequence. The curvature radius of each pixel point on the target medicinal material leaf morphological contour was calculated. The curvature radius standard deviation calculation result of the pixel point on the target medicinal material leaf morphological contour was accumulated and inverted with the preset constant to determine the regularity evaluation index of the target medicinal material leaf edge. .
[0036] Similarly, the contours of the root and stem of the target medicinal material are extracted and imported into the Matlab software to calculate the curvature radius of each pixel point on the contours of the root and stem of the target medicinal material. The mean calculation results of the curvature radius of the pixel points on the contours of the root and stem of the target medicinal material are recorded as , according to the formula Determine the twisting evaluation index of the target medicinal material rhizome, where It is the preset reference pixel curvature radius.
[0037] By formula The morphological regularity of the target medicinal material is obtained by analysis.
[0038] The embodiment of the present invention detects the morphological integrity, morphological regularity and apparent glossiness of the target medicinal material based on the overall image of the target medicinal material, provides a comprehensive and in-depth perspective for the evaluation of the preservation status of the medicinal material, and ensures the reliability and accuracy of the calculation of the preservation status evaluation index of the target medicinal material.
[0039] S2. Use the camera to collect detailed images of each component of the target medicinal material, including roots, stems, and leaves, and calculate the dryness evaluation index of the target medicinal material based on the texture characteristics of each component of the target medicinal material.
[0040] It should be noted that the specific implementation operation of the above-mentioned propulsion camera device usually includes two main methods: one is physical movement, adjusting the position of the camera device, and the other is optical zoom, adjusting the built-in focal length of the camera device.
[0041] Specifically, the calculation of the dry state evaluation index of the target medicinal material includes: constructing the corresponding grayscale co-occurrence matrix according to the detailed image of each component of the target medicinal material, and calculating the dry texture feedback indicator of each component of the target medicinal material through each feedback parameter of the grayscale co-occurrence matrix, including energy, entropy, contrast and correlation. ,in is the number of each component, .
[0042] Extract the reasonable range of dry texture feedback indicators of each component of the target medicinal material production requirements and specifications stored in the WEB cloud, and obtain the reference dry texture feedback indicators of each component of the target medicinal material production requirements and specifications And the corresponding dry texture feedback indicator reasonable deviation threshold , according to the formula The dry state evaluation index of the target medicinal material is obtained through analysis.
[0043] Specifically, the The calculation formula is: ,in The target medicinal materials are The energy, entropy, contrast and correlation of the gray-level co-occurrence matrix of the detail image of each component, The preset weights correspond to the energy, entropy, contrast and correlation of the gray-level co-occurrence matrix respectively.
[0044] The embodiment of the present invention calculates the drying state evaluation index of the target medicinal material according to the texture features of each component of the target medicinal material, accurately quantifies the drying state of the medicinal material, and provides a reliable basis for quality control in the production process.
[0045] S3. Promote the camera equipment to perform image recognition and analysis on the key point features and key area features of the target medicinal materials, where the key points include the leaf tips and stem nodes, and the key areas include the striped areas and raised areas, and calculate the processing status evaluation index of the target medicinal materials.
[0046] Specifically, the calculation of the processing status evaluation index of the target medicinal material includes: obtaining the distance between each key node of the target medicinal material and its adjacent key nodes , the offset angle between each key node and its relative key node And the area ratio of the closed area formed by the key nodes , is the number of each key node, , according to the formula
[0047] Analyze the processing maturity of the target medicinal materials based on key node characteristics, including They are the distance between adjacent key nodes of the preset benchmark reference, the offset angle between the relative key nodes, and the area ratio of the closed area formed by the key nodes connected. is the number of key nodes.
[0048] Obtain the relative color coefficient, relative distribution coefficient and relative size coefficient of each key area of the target medicinal material, screen the various spotted areas and raised areas of the target medicinal material, and analyze the processing maturity of the target medicinal material based on the characteristics of the key areas.
[0049] It should be noted that the process of obtaining the relative color coefficient, relative distribution coefficient and relative size coefficient of each key area of the above-mentioned target medicinal material is as follows: converting the collected target medicinal material image into the HSV color space, constructing a color histogram of each key area in the HSV color space, multiplying the reference hue value of the horizontal coordinate corresponding to each color channel by the proportion of the number of pixels in the corresponding vertical coordinate, and accumulating them to obtain the color characteristic index of each key area of the target medicinal material. Similarly, constructing an overall color histogram of the non-key area in the HSV color space, obtaining the color characteristic index of the non-key area of the target medicinal material, and performing a ratio analysis on the color characteristic index of each key area of the target medicinal material and the color characteristic index of the non-key area to obtain the relative color coefficient of each key area of the target medicinal material.
[0050] Import the collected target medicinal material images into the image software to generate a coordinate system, obtain the coordinates of the center position of each key area in the target medicinal material image, calculate the distance between the center position of each key area and the center position of the target medicinal material image based on the Euclidean distance calculation formula, perform ratio analysis on the above distances and the preset reference distances to obtain the reference distance ratio of the center position of each key area to the center position of the target medicinal material image, calculate the relative angle of the center position of each key area to the center position of the target medicinal material image based on the inverse tangent function, perform ratio analysis on the above distances and the preset reference relative angles to obtain the reference angle ratio of the center position of each key area to the center position of the target medicinal material image, and add the reference distance ratio and reference angle ratio of the center position of each key area to the center position of the target medicinal material image to obtain the relative distribution coefficient of each key area of the target medicinal material.
[0051] According to the number of pixels contained in each key area in the target medicinal material image, the conversion is performed at a preset ratio to obtain the area of each key area of the target medicinal material, and the ratio analysis is performed with the preset reference area to obtain the relative size coefficient of each key area of the target medicinal material.
[0052] The processing maturity of the target medicinal materials is averaged for key node characteristics and key area characteristics to obtain the reference processing maturity of the target medicinal materials. If it is within the reasonable processing maturity range of the target medicinal materials production requirements and specifications stored in the WEB cloud, the processing status evaluation index of the target medicinal materials is set to 1. Otherwise, the absolute deviation value between the reference processing maturity of the target medicinal materials and the reasonable processing maturity range of its production requirements and specifications is calculated, and the reciprocal of the cumulative value of the deviation and 1 is used as the processing status evaluation index of the target medicinal materials.
[0053] Specifically, the calculation formula for the processing maturity of the target medicinal material for key regional characteristics is:
[0054] ,in are the relative color coefficient, relative distribution coefficient and relative size coefficient of each pattern area of the target medicinal material, is the number of each stripe area, , are the relative color coefficient, relative distribution coefficient and relative size coefficient of each raised area of the target medicinal material, is the number of each raised area, , They are the relative color coefficient, relative distribution coefficient and relative size coefficient of the preset reference. The preset weights for the striped area and the raised area are respectively, They are the corresponding numbers of the target medicinal material’s spotted area and raised area respectively.
[0055] The embodiment of the present invention effectively grasps the processing maturity of the target medicinal material by performing image recognition analysis on the key point features and key area features of the target medicinal material, thereby helping to determine whether the medicinal material has undergone an appropriate processing process and achieving accurate evaluation of the processing status of the target medicinal material.
[0056] S4. Use video equipment to conduct a comprehensive scan of the surface of the target medicinal materials, analyze the cleanliness of the surface of the target medicinal materials and the degree of non-drug residues on the surface, and calculate the evaluation index of the clean status of the target medicinal materials.
[0057] Specifically, the calculation of the target medicinal material purification status evaluation index includes: identifying and segmenting each impurity region and each non-medicinal region in the target medicinal material according to the medicinal material impurity feature sequence and the target medicinal material non-medicinal feature sequence stored in the WEB cloud, and obtaining the area of each impurity region in the target medicinal material according to the number of pixels in the region. and the area of each non-medicinal area ,in is the number of each impurity region, , is the number of each non-medicinal area, .
[0058] Based on the corresponding outlines of each impurity region and each non-medicinal region in the target medicinal material, the corresponding impurity type of each impurity region in the target medicinal material and the corresponding position of each non-medicinal region are judged, and the corresponding influence weights of each impurity region and each non-medicinal region in the target medicinal material are set, which are recorded as , .
[0059] It should be noted that the evaluation of the impurity types corresponding to each impurity area and the corresponding parts of each non-medicinal area in the above-mentioned target medicinal materials is mainly based on comparing the corresponding contours of each impurity type and the corresponding parts of each non-medicinal area marked in the standard atlas of the target medicinal materials, and the judgment is based on the similarity of the compared contours.
[0060] Get the total surface area of the target medicinal material , according to the formula ,
[0061] The surface cleanliness and non-drug residue levels of the target medicinal materials are obtained respectively, and the surface cleanliness threshold is standardized based on the target medicinal material production requirements stored in the WEB cloud. And the threshold value of non-drug residue on the surface , calculate the evaluation index of the purification status of the target medicinal material , .
[0062] The embodiment of the present invention identifies impurity features and non-medicinal features in the target medicinal material image, analyzes the surface cleanliness of the target medicinal material and the degree of non-medicinal residue on the surface, so as to ensure the efficiency and accuracy of the clean state assessment of the target medicinal material.
[0063] S5. Combined with the corresponding evaluation indicators of the target medicinal materials’ storage status, drying status, processing status and purification status, comprehensively judge whether the production quality of the target medicinal materials is qualified. If it is judged to be qualified, a qualified label will be assigned. If it is judged to be unqualified, the abnormal production process links of the target medicinal materials will be traced back and feedback will be provided.
[0064] Specifically, the comprehensive judgment condition for whether the production quality of the target medicinal material is qualified is that the evaluation indicators of the storage state, drying state, processing state and purification state of the target medicinal material are all within the corresponding reasonable evaluation indicator range of the target medicinal material production requirement specification stored in the WEB cloud.
[0065] Specifically, the tracing of abnormal production process links of target medicinal materials includes: the storage state, drying state, processing state and purification state of the target medicinal materials correspond to the packaging link, drying link, processing link and purification link respectively.
[0066] Retrieve the evaluation indicators of the target medicinal materials' preservation state, drying state, processing state and purification state, and find the state objects that are outside the corresponding reasonable evaluation indicator range of the target medicinal materials' production requirements and specifications, mark them as abnormal states, and trace the production process links corresponding to the abnormal states as abnormal production process links.
[0067] The embodiment of the present invention combines the corresponding evaluation indicators of the storage state, drying state, processing state and purification state of the target medicinal material to accurately judge the production quality qualification of the target medicinal material, which not only ensures that the medicinal material meets the unified quality requirements in each production link and improves the standardization and consistency of medicinal material production, but also traces the abnormal production links when it is judged to be unqualified, helps optimize the production process, and improves production efficiency and quality stability.
[0068] The above contents are merely examples and explanations of the concept of the present invention. Those skilled in the art may make various modifications or additions to the specific embodiments described or replace them in a similar manner. As long as they do not deviate from the concept of the invention or exceed the scope defined by the present invention, they shall all fall within the protection scope of the present invention.
Claims
1. A method for detecting the production quality of medicinal materials based on image recognition, characterized in that: The method includes: S1. Place the target medicinal material to be tested on the image acquisition platform, collect the overall image of the target medicinal material with a preset focal length through a camera device, detect the morphological integrity, morphological regularity and apparent gloss of the target medicinal material, and calculate the preservation status evaluation index of the target medicinal material; S2. Propel the camera equipment to collect detailed images of each component of the target medicinal material, including roots, stems, and leaves, and calculate the dryness evaluation index of the target medicinal material according to the texture characteristics of each component of the target medicinal material; S3. Use the camera to perform image recognition and analysis on the key point features and key area features of the target medicinal materials, where the key points include the leaf tips and stem nodes, and the key areas include the stripe areas and the raised areas, and calculate the processing status evaluation index of the target medicinal materials; S4. Use the camera to comprehensively scan the surface of the target medicinal material, analyze the cleanliness of the surface of the target medicinal material and the degree of non-drug residue on the surface, and calculate the evaluation index of the clean state of the target medicinal material; S5. Combine the corresponding evaluation indicators of the target medicinal material's storage state, drying state, processing state, and purification state to comprehensively judge whether the target medicinal material's production quality is qualified. If it is judged to be qualified, a qualified label will be assigned. If it is judged to be unqualified, the abnormal production process link of the target medicinal material will be traced and feedback will be provided; The calculation of the preservation status evaluation index of the target medicinal material includes: S11. outlining the shape contour of the target medicinal material according to the overall image of the target medicinal material, and obtaining the continuous state coefficient of the shape contour of the target medicinal material by analyzing the local curvature of each pixel of the shape contour and the distance between each pixel and the adjacent pixel; By converting the whole image of the target medicinal material into a binary image, filtering out each pixel whose grayscale value in the shape contour is greater than a preset grayscale threshold and retrieving its corresponding connected area, marking it as each foreground area, and outputting the contour hierarchy of each foreground area to analyze the inner density state coefficient of the morphological contour of the target medicinal material; The cumulative value of the continuous state coefficient and the internal density state coefficient of the target medicinal material morphological contour is taken as the morphological integrity of the target medicinal material; S12. Identify and divide the shape contours of each component of the target medicinal material, evaluate the proportion coordination of the overall plant of the target medicinal material, the regularity of the leaf edges, and the twisting of the rhizome, so as to analyze the morphological regularity of the target medicinal material; S13. Obtaining the pixel grayscale value of each pixel in the overall image of the target medicinal material after converting the binary image, and analyzing the apparent glossiness of the target medicinal material through the mean calculation result and the standard deviation calculation result; S14. The morphological integrity, morphological regularity and apparent glossiness of the target medicinal material are respectively accumulated with the products of their corresponding preset weights to obtain the preservation status evaluation index of the target medicinal material; The analysis of the morphological regularity of the target medicinal material includes: measuring the length and width of the shape contour of each component of the target medicinal material, comparing the length and width of the shape contour of each component with each other, collecting the size ratios between the components of the target medicinal material as a whole plant, comparing them with the corresponding size coordination ratio intervals between the components of the medicinal specification of the target medicinal material variety stored in the WEB cloud, and analyzing the proportion coordination evaluation index of the target medicinal material as a whole plant. ; The target medicinal material leaf morphological contour was extracted and imported into Matlab software for optimal function fitting operation. The optimal fitting function of the target medicinal material leaf morphological contour was obtained and the first-order and second-order derivatives were performed in sequence to calculate the curvature radius of each pixel point on the target medicinal material leaf morphological contour. The regularity evaluation index of the target medicinal material leaf edge was further determined based on the standard deviation calculation results of the curvature radius of the pixel points on the target medicinal material leaf morphological contour. ; Similarly, the root and stem morphological contours of the target medicinal materials were extracted and imported into the Matlab software to calculate the curvature radius of each pixel point on the root and stem morphological contours of the target medicinal materials. The torsion evaluation index of the root and stem of the target medicinal materials was determined based on the mean curvature radius of the pixel points on the root and stem morphological contours of the target medicinal materials. ; By formula Analyze and obtain the morphological regularity of the target medicinal material; The calculation of the dry state evaluation index of the target medicinal material includes: constructing the corresponding grayscale co-occurrence matrix according to the detailed image of each component of the target medicinal material, and calculating the dry texture feedback index of each component of the target medicinal material through each feedback parameter of the grayscale co-occurrence matrix, including energy, entropy, contrast and correlation. ,in is the number of each component, ; Extract the reasonable range of dry texture feedback indicators of each component of the target medicinal material production requirements and specifications stored in the WEB cloud, and obtain the reference dry texture feedback indicators of each component of the target medicinal material production requirements and specifications And the corresponding dry texture feedback indicator reasonable deviation threshold , according to the formula Analyze and obtain the dryness evaluation index of the target medicinal material; Said The calculation formula is: ,in The target medicinal materials are The energy, entropy, contrast and correlation of the gray-level co-occurrence matrix of the detail image of each component, The preset weights correspond to the energy, entropy, contrast and correlation of the gray-level co-occurrence matrix respectively; The calculation of the processing status evaluation index of the target medicinal material includes: obtaining the distance between each key node of the target medicinal material and its adjacent key node, the offset angle between each key node and its relative key node, and the area ratio of the closed area formed by each key node, and analyzing the processing maturity of the target medicinal material based on the key node characteristics; Obtain the relative color coefficient, relative distribution coefficient and relative size coefficient of each key area of the target medicinal material, screen each spotted area and each raised area of the target medicinal material, and analyze the processing maturity of the target medicinal material based on the characteristics of the key areas; The processing maturity of the target medicinal material is averaged for key node features and key area features to obtain the reference processing maturity of the target medicinal material. If it is within the reasonable processing maturity range of the target medicinal material production requirements and specifications stored in the WEB cloud, the processing status evaluation index of the target medicinal material is set to 1. Otherwise, the absolute deviation value of the reference processing maturity of the target medicinal material and its production requirements and specifications reasonable processing maturity range is calculated, and the reciprocal of the cumulative value of the reference processing maturity and 1 is used as the processing status evaluation index of the target medicinal material; The calculation formula for the processing maturity of the target medicinal material based on the key regional characteristics is: ,in are the relative color coefficient, relative distribution coefficient and relative size coefficient of each pattern area of the target medicinal material, is the number of each stripe area, , are the relative color coefficient, relative distribution coefficient and relative size coefficient of each raised area of the target medicinal material, is the number of each raised area, , They are the relative color coefficient, relative distribution coefficient and relative size coefficient of the preset reference. The preset weights for the striped area and the raised area are respectively, They are the corresponding numbers of the target medicinal material’s spotted area and raised area respectively; The calculation of the target medicinal material purification status evaluation index includes: identifying and segmenting each impurity region and each non-medicinal region in the target medicinal material according to the medicinal material impurity feature sequence and the target medicinal material non-medicinal feature sequence stored in the WEB cloud, and obtaining the area of each impurity region in the target medicinal material according to the number of pixels in the region. and the area of each non-medicinal area ,in is the number of each impurity region, , is the number of each non-medicinal area, ; Based on the corresponding outlines of each impurity region and each non-medicinal region in the target medicinal material, the corresponding impurity type of each impurity region in the target medicinal material and the corresponding position of each non-medicinal region are judged, and the corresponding influence weights of each impurity region and each non-medicinal region in the target medicinal material are set, which are recorded as , ; Get the total surface area of the target medicinal material , according to the formula , The surface cleanliness and non-drug residue levels of the target medicinal materials are obtained respectively, and the surface cleanliness threshold is standardized based on the target medicinal material production requirements stored in the WEB cloud. And the threshold value of non-drug residue on the surface , calculate the evaluation index of the purification status of the target medicinal material , .
2. The method for detecting the quality of medicinal material production based on image recognition according to claim 1, characterized in that: The comprehensive judgment condition for the qualified production quality of the target medicinal materials is that the evaluation indicators of the storage state, drying state, processing state and purification state of the target medicinal materials are all within the corresponding reasonable evaluation indicator range of the target medicinal materials production requirements and specifications stored in the WEB cloud.
3. The method for detecting the quality of medicinal material production based on image recognition according to claim 2, characterized in that: The tracing of abnormal production process links of target medicinal materials includes: the storage state, drying state, processing state and purification state of the target medicinal materials correspond to the packaging link, drying link, processing link and purification link respectively; Retrieve the evaluation indicators of the target medicinal materials' preservation state, drying state, processing state and purification state, and find the state objects that are outside the corresponding reasonable evaluation indicator range of the target medicinal materials' production requirements and specifications, mark them as abnormal states, and trace the production process links corresponding to the abnormal states as abnormal production process links.
Citation Information
Patent Citations
Traditional Chinese medicine material data processing method and system
CN118552158A
Traditional Chinese medicine quality detection system based on image recognition
CN118674954A