Traditional Chinese medicine decoction piece sorting system and device
Patent Information
- Application Number
- CN202611180065.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-05
- Publication Date
- 2026-10-30
AI Technical Summary
[0003]目前在传统的中药饮片生产线上,对于中药饮片的质量分类主要依赖于人工挑选操作,易受疲劳、经验差异影响,导致分选效率低,分选质量差,而目前机器对中药饮片颜色、纹理差异适配性不足,缺乏考虑环境干扰,光照强度变化时误判率较高,同时内部缺陷检测缺乏空间定位能力,仅能得到整幅饮片的平均光谱数据,无法识别局部虫蛀、小范围空心等微缺陷,提高了漏检率
[0031]一、本发明通过采用对数函数对可见光图像进行非线性补偿,通过调整光照强度影响系数以适应不同类型中药饮片,将实际光照强度下的图像校正至标准光照强度水平,采用线性函数对近红外光谱图像进行温度补偿,通过调整温度影响系数适应温度对光谱特征的影响,再通过表面缺陷检测单元引入湿度修正项,通过平方项函数动态消除湿度对中药饮片颜色、纹理的干扰,提高对中药饮片颜色、纹理差异适配性,充分考虑环境干扰对中药饮片分选的影响,降低误判率。
Smart Images

Figure CN122999542A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medicinal herb sorting technology, specifically to a system and apparatus for sorting traditional Chinese medicine medicinal herbs. Background Technology
[0002] Traditional Chinese medicine (TCM) decoction pieces are processed medicinal herbs that can be directly used in TCM clinical practice. They are one of the three pillars of China's TCM industry, an essential traditional tool for TCM clinical diagnosis and treatment, and a crucial raw material for prepared Chinese medicines. Their unique processing theories and methods embody the profound wisdom of ancient Chinese medicine. With the continuous improvement and maturation of their processing theories, they have become an important means of disease prevention and treatment in TCM clinical practice. During the production and processing of TCM decoction pieces, they need to be sorted according to their size and weight to distinguish different qualities.
[0003] Currently, in traditional Chinese medicine (TCM) decoction piece production lines, the quality classification of TCM decoction pieces mainly relies on manual sorting, which is easily affected by fatigue and experience differences, resulting in low sorting efficiency and poor sorting quality. At present, the machines are not adaptable enough to the differences in color and texture of TCM decoction pieces, do not take into account environmental interference, and have a high misjudgment rate when the light intensity changes. At the same time, the internal defect detection lacks spatial positioning ability, and can only obtain the average spectral data of the whole piece of decoction piece, which cannot identify micro-defects such as local insect infestation and small-scale hollowness, thus increasing the missed detection rate. Summary of the Invention
[0004] The purpose of this invention is to provide a sorting system and apparatus for traditional Chinese medicine decoction pieces, which solves the problems mentioned in the background art.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a sorting system for traditional Chinese medicine decoction pieces, comprising a multi-modal feature acquisition module, an image fusion module, a visual inspection module, a comprehensive rating module, and a dynamic sorting module;
[0006] The multi-mode feature acquisition module includes an image acquisition unit and a mechanical feature acquisition unit. The image acquisition unit is used to acquire images of Chinese herbal medicine slices, including visible light images and near-infrared spectral images. The mechanical feature acquisition unit acquires acceleration and morphological data of Chinese herbal medicine slices.
[0007] The image fusion module is used to perform fusion analysis on visible light images and near-infrared spectral images, and incorporates light intensity and temperature factors to obtain the fused image;
[0008] The visual inspection module includes a surface defect detection unit and an internal defect detection unit;
[0009] The surface defect detection unit is used to identify surface defects. By combining the interference of environmental humidity on the visual characteristics of defects, the degree of defects in Chinese herbal medicine slices is quantified to obtain a surface defect score. The internal defect detection unit analyzes the internal defects of Chinese herbal medicine slices based on near-infrared spectral images to obtain an internal defect score.
[0010] The comprehensive rating module is used to combine surface defect scores and internal defect scores, and incorporates hardness scores obtained from the analysis of acceleration and morphology data of Chinese herbal medicine slices, and finally obtains a comprehensive rating score.
[0011] The dynamic sorting module classifies products into grades based on comprehensive rating scores and stores them in hierarchical layers based on product grades.
[0012] Optionally, the image fusion module performs illumination correction on the visible light image by using a logarithmic function and nonlinear compensation based on the deviation between the actual illumination intensity and the standard illumination intensity, and introduces an illumination intensity influence coefficient to obtain an illumination correction term. The illumination correction term is then combined with the visible light image matrix to obtain the corrected visible light image matrix.
[0013] Temperature correction is applied to the near-infrared spectral image. This is done through a linear function and by linear compensation based on the deviation between the actual ambient temperature and the standard ambient temperature. A temperature influence coefficient is introduced to obtain the temperature correction term. The temperature correction term is then combined with the near-infrared spectral image matrix to obtain the corrected near-infrared spectral image matrix. Finally, the corrected visible light image matrix and the corrected near-infrared spectral image matrix are weighted and combined to obtain the fused multimodal image.
[0014] Optionally, after obtaining the fused multimodal image, foreground and background segmentation is first performed to remove background interference and delineate the Chinese herbal medicine slices region. Then, based on the Chinese herbal medicine slices region, surface defect region and internal defect region are delineated.
[0015] When dividing the surface defect area, the morphological features, texture features, and color features of Chinese herbal medicine slices are compared with the pre-collected qualified samples. Pixel clusters that exceed the preset threshold are the surface defect areas.
[0016] When dividing the internal defect area, the Chinese herbal medicine slice area is matched to the near-infrared data cube according to its spatial location. The area of the effective component characteristic spectral peak of each pixel is extracted and compared with the spectral peak area of qualified samples. The area of adjacent abnormal points with a deviation greater than a preset threshold is the internal defect area.
[0017] Optionally, when calculating the surface defect score, the surface defect detection unit first calculates the proportion of the surface defect area to the total area, the proportion of the defect depth to the maximum defect depth, and the normalized color difference of the Chinese herbal medicine slices, then weights and combines these three factors, and finally performs humidity correction based on the deviation between the actual ambient humidity and the standard ambient humidity to obtain the surface defect score S.sur When the surface defect score S sur If the value is greater than 0.6, the product is deemed unqualified.
[0018] Optionally, when calculating the internal defect score, the internal defect detection unit first calculates the difference in the area of the effective component characteristic peaks between the internal defect region and the normal region, then divides it by the area of the effective component characteristic peaks in the normal region to obtain the relative change rate of the characteristic peak area. Next, it calculates the deviation between the actual ambient temperature and the standard ambient temperature, and combines this with the temperature attenuation coefficient to obtain the temperature attenuation term. Finally, it combines the temperature attenuation term with the relative change rate of the characteristic peak area to obtain the internal defect score S. int When the internal defect score S int If the value is greater than 0.6, the product is deemed unqualified.
[0019] Optionally, the comprehensive rating module first divides the peak rebound acceleration by the gravitational acceleration to obtain the acceleration conversion value, and then multiplies it by the mass of the medicinal slice to obtain the numerator. It then combines the standard hardness score with an angle correction term consisting of a collision angle correction coefficient and a collision incident angle to obtain the denominator. Finally, it divides the numerator by the denominator to obtain the hardness score of the medicinal slice. Finally, it calculates the surface defect score S. sur Internal Defect Score int The overall rating score R is obtained by combining the hardness score with the weighted average score. gra .
[0020] Optional, obtain the overall rating score R. gra Then, the product grades are determined by setting corresponding thresholds through the dynamic sorting module, as follows:
[0021] When the overall rating score is R gra ≥0.9, and meets the surface defect score S sur If the value is ≤0.1, it is classified as a premium grade product;
[0022] When 0.8 ≤ comprehensive rating score R gra <0.9, and meets the surface defect score S sur Products with a hardness score ≤0.2 or ≥0.9 for traditional Chinese medicine decoction pieces are classified as Grade I products.
[0023] When 0.7 ≤ comprehensive rating score R gra <0.8, and must simultaneously meet the surface defect score S sur ≤0.3, Internal Defect Score int If either of the following two conditions is met: ≤0.2 or hardness score of Chinese herbal medicine slices ≥0.8, the product is classified as a Grade II product.
[0024] When 0.6 < overall rating score R gra When <0.7, and the internal defect score S is satisfied. int ≤0.4 or surface defect score Ssur If the value is ≤0.4, the product is judged as abnormal. After the sorting is completed, the product of this level will be re-sorted. If the value is abnormal three times in a row, the product will be directly judged as unqualified.
[0025] When the overall rating score is R gra If the value is ≤0.6, the product is deemed unqualified.
[0026] This application provides a sorting device for traditional Chinese medicine decoction pieces, including the aforementioned sorting system for traditional Chinese medicine decoction pieces, as well as a frame and a sorting machine body. A feeding hopper is fixedly installed on the top of the frame, and a discharge channel is fixedly connected to the bottom of the feeding hopper. The sorting machine body is fixedly installed on the surface of the frame and is connected to the bottom of the discharge channel. A touch screen is provided on the surface of the sorting machine body, and a plurality of sorting boxes are fixedly connected to the bottom of the sorting machine body.
[0027] The feeding hopper includes a vibrating feeder, and the mechanical feature acquisition unit is set in the discharge channel to collect acceleration and morphological data of Chinese herbal medicine slices;
[0028] The image acquisition unit, visual inspection module, and comprehensive rating module are all located inside the sorting machine body. The image acquisition unit acquires images of Chinese herbal medicine slices passing through the sorting machine body and performs fusion analysis through the image fusion module.
[0029] The sorting machine body includes a signal processor, and the dynamic sorting module includes an air jet assembly. The air jet assembly is located on the top of the sorting box and is connected to the signal processor. The dynamic sorting module classifies the product grades based on the comprehensive rating score obtained by the comprehensive rating module, and then activates the air jet assembly through the signal processor to blow the Chinese herbal medicine slices into the corresponding sorting box to complete the sorting.
[0030] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0031] I. This invention employs a logarithmic function to perform nonlinear compensation on visible light images, adjusts the light intensity influence coefficient to adapt to different types of Chinese herbal medicine slices, corrects images under actual light intensity to standard light intensity levels, uses a linear function to perform temperature compensation on near-infrared spectral images, adjusts the temperature influence coefficient to adapt to the influence of temperature on spectral characteristics, and introduces a humidity correction term through a surface defect detection unit. A square term function is then used to dynamically eliminate the interference of humidity on the color and texture of Chinese herbal medicine slices, improving the adaptability to color and texture differences in Chinese herbal medicine slices. This invention fully considers the impact of environmental interference on the sorting of Chinese herbal medicine slices, reducing the misjudgment rate.
[0032] Second, this invention uses an internal defect detection unit to match the sliced food area to spectral data pixel by pixel based on the spatial resolution of the near-infrared data cube. The area of the characteristic peak of the effective component is extracted from each pixel and compared with qualified samples. Adjacent abnormal points with deviations exceeding the threshold are aggregated into internal defect areas. By calculating the relative change rate of the characteristic peak area between the defect area and the normal area and combining it with temperature decay correction, the severity of internal defects is quantified. This can effectively identify micro-defects such as local insect infestation and small-scale hollowness, and reduce the false negative rate.
[0033] Third, this invention achieves intelligent sorting of Chinese herbal medicine slices by cooperating with a multi-modal feature acquisition module, an image fusion module, a visual inspection module, a comprehensive rating module, and a dynamic sorting module. It eliminates the need for manual selection, avoids the influence of fatigue and experience differences, and improves sorting efficiency and quality. Attached Figure Description
[0034] Figure 1 This is a block diagram of the system modules of the present invention;
[0035] Figure 2 This is a schematic diagram of the sorting process of the present invention;
[0036] Figure 3 This is an isometric view of the sorting device of the present invention.
[0037] In the diagram: 1. Frame; 2. Feed hopper; 3. Sorter body; 4. Touch screen; 5. Sorting box; 6. Discharge channel. Detailed Implementation
[0038] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0039] For examples, please refer to Figure 1 and Figure 2 This embodiment provides a sorting system for traditional Chinese medicine decoction pieces, including a multi-modal feature acquisition module, an image fusion module, a visual inspection module, a comprehensive rating module, and a dynamic sorting module;
[0040] The multi-mode feature acquisition module includes an image acquisition unit and a mechanical feature acquisition unit. The image acquisition unit is used to acquire images of Chinese herbal medicine slices, including visible light images and near-infrared spectral images. The mechanical feature acquisition unit acquires acceleration and morphological data of Chinese herbal medicine slices.
[0041] The image fusion module is used to perform fusion analysis on visible light images and near-infrared spectral images, and incorporates factors such as light intensity and temperature to obtain the fused image. The process is as follows:
[0042]
[0043] In the above formula, F fusion The composite image is a fused multimodal image that integrates the macroscopic morphological features of visible light with the microscopic composition features of near-infrared light.
[0044] w1 is the visible light image weight. The priority of the visible light image is dynamically adjusted according to the type of Chinese herbal medicine. For example, the visible light image weight w1 of Angelica sinensis, which has a complex appearance and texture, is set to 0.7, while that of Glycyrrhiza uralensis, which has a single color, is set to 0.4.
[0045] P vis This is a visible light image matrix, with pixel values ranging from 0 to 255.
[0046] k1 is the light intensity influence coefficient, with a value of 0.12, obtained from experimental testing, as follows:
[0047] The ambient temperature was kept constant at 25℃ and the humidity was kept constant at 60%. Only the light intensity was adjusted to vary in the range of 100 to 1000 lux. Visible light images of 10 typical Chinese herbal medicines, including Angelica sinensis, Poria cocos, Panax notoginseng, and Astragalus membranaceus, were collected. Each experiment was repeated 5 times and the average value was taken.
[0048] Using the average gray value G0 of the image under standard illumination intensity as a benchmark, the logarithmic relationship between image gray value and illumination intensity under different actual illumination intensities L is fitted.
[0049] The average light intensity influence coefficients k1 for root and rhizome slices, fruit slices, and whole herb slices were obtained by least squares fitting and were 0.118, 0.123, and 0.119, respectively. The weighted average of the three types of slices was taken, and the final value of the light intensity influence coefficient k1 was determined to be 0.12. Under this value, the structural similarity between the corrected image and the standard image under different lighting conditions was the highest.
[0050] L represents the actual light intensity;
[0051] L0 is the standard illumination intensity, which refers to the optimal illumination environment for visual inspection of Chinese herbal medicine slices. It meets the illumination requirements for sorting stations in the "Good Manufacturing Practice for Chinese Herbal Medicine Slices" and serves as a reference benchmark for illumination correction, adjusting the image under actual illumination to the standard illumination level.
[0052] For the illumination correction term, through the logarithmic function Nonlinear compensation for illumination deviation reduces image brightness when actual illumination intensity L > standard illumination intensity L0, and increases brightness when actual illumination intensity L < standard illumination intensity L0, avoiding feature loss caused by overexposure or underexposure. The intensity of illumination correction is controlled by the illumination intensity influence coefficient k1 to avoid excessive correction leading to image distortion, while ensuring a balanced correction effect in low-light or high-light environments.
[0053] w2 is the near-infrared spectral image weight, and the visible light image weight w1 + near-infrared spectral image weight w2 = 1;
[0054] P nir It is a near-infrared spectral image matrix, with pixel values ranging from 0 to 255;
[0055] k2 is the temperature influence coefficient, with a value of 0.08. The process of obtaining the light intensity influence coefficient k1 is the same. Under this value, the spectral characteristics of the corrected image and the standard image are most similar at different temperatures.
[0056] T represents the actual ambient temperature;
[0057] T0 is the standard ambient temperature, set as a reference value of 25℃. 25℃ is the optimal temperature for near-infrared spectral acquisition, at which point molecular vibrations are stable and spectral characteristics have the best repeatability. As a reference for temperature correction, the spectral image at the actual temperature is corrected to the standard temperature level.
[0058] For the temperature correction term, within the normal temperature range, the effect of temperature on the near-infrared spectrum is approximately linear, and a linear function is used. The effect of temperature on spectral response is compensated by decreasing the spectral response value when the temperature increases and increasing the response value when the temperature decreases, ensuring the consistency of spectral characteristics at different temperatures and balancing computational efficiency with correction accuracy. By introducing a temperature influence coefficient k2, the magnitude of temperature correction is controlled to avoid distortion of spectral characteristics caused by temperature changes.
[0059] By incorporating ambient light intensity and temperature factors, visible light images are fused with near-infrared spectral images to eliminate the interference of light and temperature fluctuations on image quality. This generates high-quality base images that simultaneously preserve the surface texture details and internal component characteristics of Chinese herbal medicine slices, providing more accurate image data for subsequent defect detection.
[0060] Furthermore, the fused multimodal image F is obtained. fusion Then, the surface defect area and the internal defect area are divided according to the following process:
[0061] For surface defect areas, multimodal images of fused standard qualified samples were collected in advance for different varieties and processing grades of Chinese medicinal herbs. fusion Extract standardized features as normal templates:
[0062] Morphological characteristics: the outline, edge curvature, and size range of the medicinal slices;
[0063] Texture characteristics: The surface texture of normal medicinal slices, such as the wrinkles of licorice and the distribution pattern of oil cells in dried tangerine peel;
[0064] Color characteristics: The range of HSV or CIELAB color space values in the normal area, such as the yellow-brown range of stir-fried Atractylodes macrocephala and the orange-yellow range of stir-fried Citrus aurantium.
[0065] Then, the fused multimodal image F fusion Perform foreground and background segmentation, remove background interference such as conveyor belts and dust, divide the Chinese medicine decoction piece area, and then compare it with the normal template one by one, and set the corresponding threshold to divide the normal surface area and the surface defect area, such as mold and discoloration defects. Convert the image to CIELAB color space, calculate the Euclidean distance between the color value of each pixel and the normal color range, and the pixel clusters with a distance exceeding the corresponding threshold are the discoloration or mold areas.
[0066] Internal defect region segmentation is achieved based on the spatial resolution of near-infrared spectral images, and multimodal images F fusion After dividing the Chinese herbal medicine slices area, the corresponding area of the near-infrared data cube is matched according to the spatial location. The characteristic spectral peak area of the effective component is extracted for each pixel, such as the characteristic peak of tanshinone in tanshinone and the characteristic peak of astragaloside A in astragalus. The characteristic spectral peak area of each pixel is compared with the spectral peak area of the sample slices. If the deviation is greater than the preset value, it is an internal abnormal point. The connected domain formed by all adjacent internal abnormal points is the internal defect region.
[0067] The visual inspection module includes a surface defect detection unit and an internal defect detection unit. The surface defect detection unit is used to identify surface defects such as cracks and mold on Chinese herbal medicine slices. It combines the interference of environmental humidity on the visual characteristics of defects to quantify the degree of defect and obtain a surface defect score. The process is as follows:
[0068]
[0069] In the above formula, S sur A surface defect score is used to quantify the severity of surface defects in Chinese herbal medicine slices. A value closer to 0 indicates no defects or very minor defects; a value closer to 1 indicates more severe surface defects and a higher quality risk. When the surface defect score S... sur A value greater than 0.6 indicates that the Chinese herbal medicine slices have serious defects and are judged as unqualified products. In actual operation, the judgment standard is adjusted according to the actual product needs. For example, for high-value products such as ginseng and cordyceps, the threshold is appropriately lowered to ensure the quality of the finished product.
[0070] Adef The pixel area of the defect region on the surface of the Chinese herbal medicine slices;
[0071] A tot The total pixel area of Chinese herbal medicine slices. The defect area is converted into a relative proportion to eliminate the interference of different sizes of medicinal slices on defect assessment.
[0072] β1 is the defect area influence coefficient, with a default value of 0.5. Area is the most intuitive indicator of the severity of a defect, and has the highest weight, reflecting that the larger the coverage area, the higher the quality risk.
[0073] d avg The average depth of the defect area;
[0074] d max This refers to the maximum defect depth of the corresponding variety of medicinal slices, i.e., the thickness of the medicinal slices. This represents the percentage of defect depth; the deeper the defect, the larger this value. Surface defect score S sur The higher the percentage, when it is 1, it indicates that the defect has penetrated the Chinese herbal medicine slices;
[0075] β2 is the defect depth influence coefficient, with a default value of 0.3. Depth affects the structural integrity of the medicinal slices, and its weight is secondary. For example, deep cracks are more likely to cause the medicinal slices to break than shallow scratches.
[0076] ΔC represents the color difference between the defective area and the normal area.
[0077] ΔC max This represents the maximum color difference for the corresponding variety of medicinal slices;
[0078] β3 is the color difference influence coefficient, with a default value of 0.2. Color difference reflects the intrinsic quality correlation of defects and is used as an auxiliary evaluation dimension, so it has the lowest default weight. In practical applications, it can be adjusted according to the type of Chinese herbal medicine, but the sum of all coefficients must be 1. For example, for high-value Chinese herbal medicine, such as ginseng slices, American ginseng slices, and deer antler slices, these types of Chinese herbal medicine require both intact appearance and dense structure. Deep cracks are prone to breakage and loss of effective ingredients, so the area and depth have higher weights, and color difference is only used as an auxiliary judgment. In this case, the defect area influence coefficient β1 and the defect depth influence coefficient β2 are both 0.4, and the color difference influence coefficient β3 is 0.2.
[0079] For example, the processing grade of traditional Chinese medicine slices such as charred hawthorn, roasted licorice, and processed Polygonum multiflorum is determined entirely by color. Color difference is the core factor in distinguishing between qualified and unqualified. Slight scratches and shallow cracks on the surface do not affect the efficacy, so the area and depth have the lowest weight. At this time, the defect area influence coefficient β1 and the defect depth influence coefficient β2 are both 0.2, and the color difference influence coefficient β3 is 0.6.
[0080] H represents ambient humidity;
[0081] H0 is the standard ambient humidity, referring to the standard relative humidity for the storage and sorting of Chinese herbal medicine slices;
[0082] k3 is the humidity interference coefficient, with a value of 0.005. The quantitative relationship between humidity deviation and defect identification error is obtained through experimental fitting. For every 10% deviation of humidity from the standard value, the original deviation of defect identification is about 5%, which is consistent with the color and texture changes caused by moisture absorption and water loss on the surface of Chinese herbal medicine slices. Fine adjustments can be made for special varieties. For Chinese herbal medicine slices with strong hygroscopicity, such as wolfberry and ophiopogon japonicus, this coefficient can be adjusted to 0.006. For slices with weak hygroscopicity, such as minerals and keratin, this coefficient can be adjusted to 0.004.
[0083] This is an environmental humidity correction item that dynamically eliminates the interference of environmental humidity. If the environmental humidity H is much less than or much greater than the standard environmental humidity H0, this item approaches 0, avoiding misjudging the temporary discoloration caused by the dampness of the medicinal slices under high humidity as an inherent defect, and reducing misjudgment caused by environmental factors.
[0084] The internal defect detection unit uses near-infrared spectroscopy to quantify the severity of internal defects in Chinese herbal medicine slices, such as hollowness, insect infestation, and loss of active ingredients. It also eliminates the interference of ambient temperature on spectral detection, resulting in an internal defect score. The specific process is as follows:
[0085]
[0086] In the above formula, S int Internal defects are scored, with higher scores indicating more serious internal defects;
[0087] P abn The characteristic peak area of the effective component in the internal defect region directly reflects the compositional changes caused by the internal defects. For example, in the insect-eaten region, the effective component is lost, and the characteristic peak area will be significantly smaller than that in the normal region; in the hollow region, because there is no effective component, the peak area is close to 0.
[0088] P nor The effective component characteristic peak area in the internal normal region, |P abn -P nor | represents the absolute value of the difference between the characteristic peak areas of the internal defect region and the normal region. The larger the absolute value of the difference, the more severe the defect.
[0089] The relative change rate of characteristic peak area converts the absolute value of the difference into a relative proportion, eliminating the interference of instrument and individual differences in medicinal slices, and more objectively reflecting the degree of abnormality of internal components.
[0090] k4 is the temperature attenuation coefficient, with a value of 0.03. It was obtained through controlled variable experiments and least squares fitting. The measurement process conforms to the industry standards for near-infrared spectroscopy detection and the characteristics of traditional Chinese medicine decoction pieces. The molecular vibrational response of near-infrared spectroscopy is exponentially negatively correlated with temperature: an increase in temperature will lead to an increase in molecular thermal motion, which will increase the half-width of characteristic spectral peaks and decrease the peak area. Therefore, it is necessary to use an exponential correction term to offset the influence of temperature fluctuations. The temperature attenuation coefficient k4 quantifies the degree of influence of temperature on the spectral peak area. For traditional Chinese medicine decoction pieces with high volatile oil content, such as peppermint and angelica, this coefficient can be adjusted to 0.035 to improve the detection accuracy of special traditional Chinese medicine decoction pieces.
[0091] T represents the actual ambient temperature;
[0092] T0 is the standard ambient temperature, set to a reference value of 25℃, which is the optimal temperature for near-infrared spectral acquisition.
[0093] As a temperature decay term, the exponential decay function is used to accurately correct the interference of ambient temperature on near-infrared spectral detection, avoiding misjudging temperature-induced spectral changes as compositional anomalies caused by internal defects, and ensuring the accuracy of internal defect assessment results.
[0094] By calculating the relative change rate of the characteristic peak area between the defective region and the normal region, and correcting it with the temperature decay term, the severity of internal defects can be quantified, which can effectively identify micro-defects such as local insect infestation and small-scale hollowness, and reduce the false negative rate.
[0095] When the internal defect score S int A value greater than 0.6 indicates serious internal defects. At this point, the Chinese herbal medicine slices have serious internal quality problems such as large-area insect infestation, severe hollowing, deep internal mold, and loss of more than 40% of the effective ingredients. The efficacy no longer meets the standards and the product is judged as unqualified. In actual operation, the judgment standard is adjusted according to the actual product needs. For example, for high-value Chinese herbal medicine slices such as ginseng and cordyceps, the threshold is appropriately lowered to ensure the quality of the finished product.
[0096] The comprehensive rating module combines surface defect scores and internal defect scores, and incorporates hardness scores obtained from the analysis of acceleration and morphology data of traditional Chinese medicine decoction pieces, ultimately yielding a comprehensive rating score. The process is as follows:
[0097]
[0098] In the above formula, R gra The score is a comprehensive rating, with higher scores indicating better overall quality of Chinese herbal medicine pieces.
[0099] γ1 is the surface defect influence coefficient, with a default value of 0.4. Generally, appearance defects have the greatest impact on the quality of Chinese herbal medicine slices.
[0100] S sur Surface defects are scored, with higher scores indicating more severe defects and higher quality risks.
[0101] γ2 is the internal defect influence coefficient, with a default value of 0.3, which reflects the key role of internal defects in drug efficacy stability and balances the proportion of appearance and internal quality.
[0102] S int Internal defects are scored, with higher scores indicating more serious internal defects;
[0103] γ3 is the hardness influence coefficient, with a default value of 0.3. The surface defect, internal defect, and hardness influence coefficients are adjusted according to the actual type of Chinese herbal medicine slices. For example, for root and rhizome slices such as ginseng, astragalus, and notoginseng, the surface defect influence coefficient γ1, internal defect influence coefficient γ2, and hardness influence coefficient γ3 are adjusted to 0.2, 0.5, and 0.3, respectively. The surface of such Chinese herbal medicine slices is prone to slight scratches due to slicing or storage, which have little impact on efficacy. Therefore, the weight of surface defects is reduced. However, internal cavities, insect infestation, or fibrosis can directly damage the structure of effective components, so internal defects are given the highest weight. Hardness directly reflects the density of the root and rhizome. Insufficient hardness may lead to the loss of effective components, so the influence of hardness is secondary.
[0104] V reb The peak rebound acceleration after the collision is obtained by actual measurement using a high-precision acceleration sensor.
[0105] G is the acceleration due to gravity, which is a fixed value. This is an acceleration conversion term, used to convert acceleration into a multiple of gravity;
[0106] m represents the quality of Chinese herbal medicine slices. This eliminates the influence of individual quality differences on the rebound results. Under the same hardness, the greater the quality, the lower the rebound acceleration. Introducing quality data can offset this effect and ensure that the hardness evaluation standards for small and large slices of the same type are consistent.
[0107] H ref The hardness score is a standard score for Chinese herbal medicine slices, with a value range from 0 to 1. It is obtained through testing of Chinese herbal medicine slice samples. Different types of Chinese herbal medicine slices have different scores, such as 0.85 for Angelica sinensis and 0.72 for Poria cocos.
[0108] λ is the collision angle correction coefficient, with a value of 0.003. It is obtained by fitting the impact experiment with controlled variables and mechanical simulation. It is obtained by calculating the relative ratio of rebound acceleration under different angles through multiple groups of different types of Chinese herbal medicine pieces, and then performing linear fitting. It is used to quantify the influence of the angle deviation from the vertical direction on the results. When Chinese herbal medicine pieces collide with a rigid sensor, the attenuation of rebound acceleration is approximately linearly related to the collision angle deviation. The greater the collision angle deviation from the vertical direction, the smaller the normal impact component and the lower the rebound acceleration.
[0109] θ is the incident angle when the Chinese herbal medicine pieces collide; it is 90° when they collide perpendicularly.
[0110] To score the hardness of Chinese herbal medicine slices, during the collision between the slice and the sensor, the kinetic energy loss rate is negatively correlated with the hardness. The harder the slice, the higher the proportion of elastic deformation during the collision, the greater the rebound acceleration, and the less energy loss. By introducing correction parameters such as slice mass and collision coefficient, the physical quantity of acceleration is converted into a standardized score, realizing the quantitative assessment of the hardness of Chinese herbal medicine slices. The higher the score, the closer the hardness of the slice is to the standard requirements. When the hardness score of Chinese herbal medicine slices is less than 0.6, it is judged as an unqualified product.
[0111] The dynamic sorting module obtains a comprehensive rating score R. gra Then, the product grades are determined by setting corresponding thresholds through the dynamic sorting module, as follows:
[0112] When the overall rating score is R gra ≥0.9, and meets the surface defect score S sur When the value is ≤0.1, it is judged as a special grade product, indicating that the Chinese herbal medicine slices are intact in appearance, without visible scratches, discoloration or damage, with high overall quality and the best efficacy stability;
[0113] When 0.8 ≤ comprehensive rating score R gra <0.9, and meets the surface defect score S sur When the hardness score of the Chinese herbal medicine slices is ≤0.2 or ≥0.9, it is judged as a first-class product, which allows for very slight surface defects, no obvious internal defects, excellent hardness, and strong resistance to breakage.
[0114] When 0.7 ≤ comprehensive rating score R gra <0.8, and must simultaneously meet the surface defect score S sur ≤0.3, Internal Defect Score int If either of the following two conditions is met: ≤0.2 or ≥0.8, the product is classified as a Grade II product. This grade of product is allowed to have slight surface discoloration or small area damage, or a small number of tiny cavities inside. The hardness meets the basic storage and transportation requirements.
[0115] When 0.6 < overall rating score R graWhen <0.7, and the internal defect score S is satisfied. int ≤0.4 or surface defect score S sur If the value is ≤0.4, the product is judged as abnormal. After the sorting is completed, the product of this level will be re-sorted. If the value is abnormal three times in a row, the product will be directly judged as unqualified.
[0116] When the overall rating score is R gra If the value is ≤0.6, the product is deemed unqualified.
[0117] The system automatically sorts Chinese herbal medicine pieces using a multi-modal feature acquisition module, an image fusion module, a visual inspection module, a comprehensive rating module, and a dynamic sorting module, eliminating the need for manual selection and improving sorting efficiency and quality.
[0118] Please see Figure 3 This application provides a sorting device for Chinese herbal medicine slices, including the above-mentioned sorting system for Chinese herbal medicine slices, as well as a frame 1 and a sorting machine body 3. A feeding hopper 2 is fixedly installed on the top of the frame 1, and a discharge channel 6 is fixedly connected to the bottom of the feeding hopper 2. The sorting machine body 3 is fixedly installed on the surface of the frame 1 and is connected to the bottom of the discharge channel 6. A touch screen 4 is provided on the surface of the sorting machine body 3, and a plurality of sorting boxes 5 are fixedly connected to the bottom of the sorting machine body 3.
[0119] The corresponding type of Chinese herbal medicine slices can be selected and the relevant parameters of the system can be adjusted before sorting via the touch screen 4 to facilitate subsequent sorting work.
[0120] The feed hopper 2 includes a vibrating feeder, and a mechanical feature acquisition unit is set in the discharge channel 6 to collect acceleration and morphological data of Chinese herbal medicine slices;
[0121] The image acquisition unit, visual inspection module, and comprehensive rating module are all located inside the sorting machine body 3. The image acquisition unit acquires images of Chinese herbal medicine slices passing through the sorting machine body 3 and performs fusion analysis through the image fusion module.
[0122] The sorting machine body 3 includes a signal processor, and the dynamic sorting module includes an air jet assembly. The air jet assembly is located on the top of the sorting box 5 and is connected to the signal processor. The dynamic sorting module classifies the product grades based on the comprehensive rating score obtained by the comprehensive rating module, and then activates the air jet assembly through the signal processor to blow the Chinese herbal medicine pieces into the corresponding sorting box 5 to complete the sorting.
[0123] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A sorting system for traditional Chinese medicine decoction pieces, characterized in that, It includes a multi-modal feature acquisition module, an image fusion module, a visual inspection module, a comprehensive rating module, and a dynamic sorting module; The multi-mode feature acquisition module includes an image acquisition unit and a mechanical feature acquisition unit. The image acquisition unit is used to acquire images of Chinese herbal medicine slices, including visible light images and near-infrared spectral images. The mechanical feature acquisition unit acquires acceleration and morphological data of Chinese herbal medicine slices. The image fusion module is used to perform fusion analysis on visible light images and near-infrared spectral images, and incorporates light intensity and temperature factors to obtain the fused image; The visual inspection module includes a surface defect detection unit and an internal defect detection unit; The surface defect detection unit is used to identify surface defects. By combining the interference of environmental humidity on the visual characteristics of defects, the degree of defects in Chinese herbal medicine slices is quantified to obtain a surface defect score. The internal defect detection unit analyzes the internal defects of Chinese herbal medicine slices based on near-infrared spectral images to obtain an internal defect score. The comprehensive rating module is used to combine surface defect scores and internal defect scores, and incorporates hardness scores obtained from the analysis of acceleration and morphology data of Chinese herbal medicine slices, and finally obtains a comprehensive rating score. The dynamic sorting module classifies products into grades based on comprehensive rating scores and stores them in layers according to product grade.
2. The traditional Chinese medicine decoction piece sorting system according to claim 1, characterized in that: The image fusion module performs illumination correction on the visible light image by using a logarithmic function and nonlinear compensation based on the deviation between the actual illumination intensity and the standard illumination intensity, and introduces an illumination intensity influence coefficient to obtain an illumination correction term. The illumination correction term is then combined with the visible light image matrix to obtain the corrected visible light image matrix. Temperature correction is applied to the near-infrared spectral image. This is done through a linear function and by linear compensation based on the deviation between the actual ambient temperature and the standard ambient temperature. A temperature influence coefficient is introduced to obtain the temperature correction term. The temperature correction term is then combined with the near-infrared spectral image matrix to obtain the corrected near-infrared spectral image matrix. Finally, the corrected visible light image matrix and the corrected near-infrared spectral image matrix are weighted and combined to obtain the fused multimodal image.
3. The traditional Chinese medicine decoction piece sorting system according to claim 2, characterized in that: After obtaining the fused multimodal image, foreground and background segmentation is first performed to remove background interference and delineate the Chinese herbal medicine slices region. Then, based on the Chinese herbal medicine slices region, surface defect region and internal defect region are delineated. When dividing the surface defect area, the morphological features, texture features, and color features of Chinese herbal medicine slices are compared with the pre-collected qualified samples. Pixel clusters that exceed the preset threshold are the surface defect areas. When dividing the internal defect area, the Chinese herbal medicine slice area is matched to the near-infrared data cube according to its spatial location. The area of the effective component characteristic spectral peak of each pixel is extracted and compared with the spectral peak area of qualified samples. The area of adjacent abnormal points with a deviation greater than a preset threshold is the internal defect area.
4. The traditional Chinese medicine decoction piece sorting system according to claim 3, characterized in that: When calculating the surface defect score, the surface defect detection unit first calculates the proportion of the surface defect area to the total area, the proportion of the defect depth to the maximum defect depth, and the normalized color difference of the Chinese herbal medicine slices. Then, it weights and combines these three factors, and finally corrects for humidity based on the deviation between the actual ambient humidity and the standard ambient humidity to obtain the surface defect score S. sur When the surface defect score S sur If the value is greater than 0.6, the product is deemed unqualified.
5. The traditional Chinese medicine decoction piece sorting system according to claim 3, characterized in that: When calculating the internal defect score, the internal defect detection unit first calculates the difference in the area of the characteristic peaks of the effective components between the internal defect region and the normal region, then divides it by the area of the characteristic peaks of the effective components in the normal region to obtain the relative change rate of the characteristic peak area. Next, it calculates the deviation between the actual ambient temperature and the standard ambient temperature, and combines this with the temperature attenuation coefficient to obtain the temperature attenuation term. Finally, it combines the temperature attenuation term with the relative change rate of the characteristic peak area to obtain the internal defect score S. int When the internal defect score S int If the value is greater than 0.6, the product is deemed unqualified.
6. The traditional Chinese medicine decoction piece sorting system according to claim 5, characterized in that: The comprehensive rating module first divides the peak rebound acceleration by the gravitational acceleration to obtain the acceleration conversion value, and then multiplies it by the mass of the medicinal slice to obtain the numerator. It then combines the standard hardness score with an angle correction term consisting of a collision angle correction coefficient and a collision incident angle to obtain the denominator. Finally, it divides the numerator by the denominator to obtain the hardness score of the medicinal slice. Finally, it calculates the surface defect score S. sur Internal Defect Score int The overall rating score R is obtained by combining the hardness score with the weighted average score. gra .
7. The traditional Chinese medicine decoction piece sorting system according to claim 6, characterized in that: Received a comprehensive rating score R gra Then, the product grades are determined by setting corresponding thresholds through the dynamic sorting module, as follows: When the overall rating score is R gra ≥0.9, and meets the surface defect score S sur If the value is ≤0.1, it is classified as a premium grade product; When 0.8 ≤ comprehensive rating score R gra <0.9, and meets the surface defect score S sur Products with a hardness score ≤0.2 or ≥0.9 for traditional Chinese medicine decoction pieces are classified as Grade I products. When 0.7 ≤ comprehensive rating score R gra <0.8, and must simultaneously meet the surface defect score S sur ≤0.3, Internal Defect Score int If either of the following two conditions is met: ≤0.2 or hardness score of Chinese herbal medicine slices ≥0.8, the product is classified as a Grade II product. When 0.6 < overall rating score R gra When <0.7, and the internal defect score S is satisfied. int ≤0.4 or surface defect score S sur If the value is ≤0.4, the product is judged as abnormal. After the sorting is completed, the product of this level will be re-sorted. If the value is abnormal three times in a row, the product will be directly judged as unqualified. When the overall rating score is R gra If the value is ≤0.6, the product is deemed unqualified.
8. A sorting device for traditional Chinese medicine decoction pieces, characterized in that, The system includes a sorting system for Chinese herbal medicine slices as described in any one of claims 1-7, a frame (1) and a sorting machine body (3), wherein a feeding hopper (2) is fixedly installed on the top of the frame (1), and a discharge channel (6) is fixedly connected to the bottom of the feeding hopper (2), the sorting machine body (3) is fixedly installed on the surface of the frame (1) and is connected to the bottom of the discharge channel (6), a touch screen (4) is provided on the surface of the sorting machine body (3), and a plurality of sorting boxes (5) are fixedly connected to the bottom of the sorting machine body (3); The feeding hopper (2) includes a vibrating feeder, and the mechanical feature acquisition unit is set in the discharge channel (6) for collecting acceleration and morphological data of Chinese herbal medicine slices; The image acquisition unit, the visual detection module and the comprehensive rating module are all located inside the sorting machine body (3). The image acquisition unit acquires images of Chinese herbal medicine slices passing through the sorting machine body (3) and performs fusion analysis through the image fusion module. The sorting machine body (3) includes a signal processor, and the dynamic sorting module includes an air jet assembly. The air jet assembly is located on the top of the sorting box (5) and is connected to the signal processor. The dynamic sorting module classifies the product grades based on the comprehensive rating score obtained by the comprehensive rating module, and then starts the air jet assembly through the signal processor to blow the Chinese medicine decoction pieces into the corresponding sorting box (5) to complete the sorting.
