Traditional Chinese medicine waste residue deterioration detection and sorting method
By combining multispectral imaging with the YOLO11 algorithm, we have achieved efficient and accurate detection and automatic sorting of moldy residues from traditional Chinese medicine waste. This solves the problems of low efficiency and low accuracy in existing technologies and ensures the safe and resource-based utilization of traditional Chinese medicine waste resources.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-03-27
Smart Images

Figure CN121747731A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of traditional Chinese medicine waste treatment and intelligent manufacturing technology, and in particular to a method for detecting and automatically sorting moldy residues of traditional Chinese medicine waste based on multispectral imaging technology and YOLO11 deep learning algorithm. Background Technology
[0002] Traditional Chinese medicine (TCM), as the core carrier of my country's traditional medical culture, generates a large amount of waste resources during its production, processing, and storage. This includes the residue after extraction, and non-medicinal parts such as roots, stems, and leaves from the harvesting process. Statistics show that the total amount of TCM waste resources generated annually in my country exceeds 50 million tons. Currently, these waste resources are mostly disposed of through incineration, landfill, or simple composting, which not only causes serious waste of resources but also may pollute the environment due to residual active ingredients and moldy substances in the waste residue.
[0003] The mold growth problem in waste traditional Chinese medicine (TCM) resources is a key bottleneck restricting their resource utilization. These resources are rich in nutrients such as polysaccharides and flavonoids, making them susceptible to contamination by various molds during storage, including those from the Zygomycetes (Mucor, Rhizopus), Ascomycetes (Aspergillus flavus, Penicillium), and Deuteromycetes (Aspergillus glaucus, Fusarium). Moldy residue not only produces toxins (such as aflatoxin) but also alters its chemical composition. Direct use in animal feed or fertilizers poses a serious threat to animal health and poses risks to the quality and safety of agricultural products.
[0004] Existing methods for detecting mold growth in waste Chinese medicinal herbs have significant limitations: Manual inspection method: Relying on manual observation of the color and shape changes of the residue to judge the mold situation, it is inefficient (the processing capacity is less than 100 kg per hour), highly subjective, and cannot identify early mold and internal mold, which is prone to missed detection or false detection. Single-spectral detection method: This method uses only visible light or near-infrared single-band imaging technology for detection, which cannot fully capture the characteristic differences of molds in different spectral bands. The accuracy rate of identifying morphologically similar molds (such as Penicillium and Aspergillus glaucus) is less than 60%. Traditional algorithm detection methods: Image recognition is performed using traditional algorithms such as support vector machines (SVM) and convolutional neural networks (CNN). The model training cycle is long, the generalization ability to multiple types of mold is weak, and it cannot achieve real-time positioning and sorting linkage of moldy areas.
[0005] Therefore, there is an urgent need to develop a technology for detecting and sorting the deterioration of Chinese herbal medicine waste residue that combines high accuracy, high efficiency, and real-time performance. This technology would address the core problems of existing methods, such as "low identification accuracy, slow processing efficiency, and inability to link sorting," and provide technical support for the safe and resource-based utilization of Chinese herbal medicine waste resources. Summary of the Invention
[0006] To address the problems of low efficiency, low accuracy, and inability to link with sorting in existing methods for detecting mold growth in waste Chinese medicinal herbs, this invention provides a method for detecting and sorting deteriorated waste Chinese medicinal herbs. By acquiring the omnidirectional spectral characteristics of the herbs through a multispectral imaging system and combining it with the YOLO11 algorithm, the method achieves accurate identification and location of moldy herbs. Finally, a linked sorting device completes the automatic removal of moldy parts, thereby improving the efficiency and accuracy of detecting and sorting waste Chinese medicinal herbs.
[0007] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: A method for detecting and sorting deterioration of waste Chinese medicinal herbs includes the following steps: Step 1: Construct a multispectral dataset of mold growth in traditional Chinese medicine, select 12 common molds in traditional Chinese medicine as target detection objects, collect multispectral images and perform preprocessing to obtain an effective dataset; Step 2: Build a multispectral imaging detection hardware system, including an image acquisition module, a multispectral imaging module, a calculation and processing module, and a sorting execution module; Step 3: Train a YOLO11-based mold detection model, optimize the feature extraction module and loss function, and train and validate the model using the MSD-TCMWR dataset; Step 4: The waste residue of Chinese medicine is fed, multispectral image acquisition, image fusion and mold identification, and pneumatic sorting to remove the deteriorated residue, and the test data is recorded at the same time.
[0008] As a further preferred embodiment of the method for detecting and sorting the deterioration of waste medicinal residues of traditional Chinese medicine according to the present invention, in step 1, a multispectral dataset of mold growth in traditional Chinese medicine is constructed, specifically including: Step 1.1, Mold Sample Screening: Based on the common mold types in waste Chinese medicine residues, 12 types of typical molds with high contamination frequency and high toxicity risk were screened as target detection objects; Step 1.2, Multispectral Image Acquisition: Using multispectral imaging equipment, images were acquired in the visible light 400-760nm and near-infrared 760-1100nm spectral ranges for different Chinese herbal medicine waste residue matrices, including Astragalus membranaceus residue, Isatis indigotica residue, and Angelica sinensis residue; different mold growth stages, including spore stage, mycelial stage, and toxin-producing stage; and different levels of contamination, including mild mold (mold area < 5%), moderate mold (5% ≤ mold area < 20%), and severe mold (mold area ≥ 20%). At least 1000 valid images were acquired for each mold category.
[0009] As a further preferred embodiment of the method for detecting and sorting the deterioration of waste Chinese medicinal materials in this invention, image preprocessing includes quality screening, deduplication, and annotation and metadata recording; quality screening uses the Python OpenCV library to retain images with a sharpness value ≥50, an average brightness value of 30-220, and a highlight / dark area ratio ≤10%; deduplication uses the Python imagehash library to delete duplicate images with a hash value similarity ≥0.95.
[0010] As a further preferred embodiment of the method for detecting and sorting the deterioration of waste medicinal residues of traditional Chinese medicine according to the present invention, in step 2, Image acquisition module: It uses an industrial-grade high-definition camera with a resolution of ≥5 million pixels, and an ultra-wide-angle lens with a field of view of ≥120° to achieve all-round image acquisition of Chinese herbal medicine waste residue; Multispectral imaging module: Selected with spectral resolution ≤5nm and detectivity ≥10 12 Jones' multispectral sensor is equipped with a lens group covering 8 specific spectral bands including 450nm, 550nm, 650nm, 750nm, 850nm, 950nm, 1000nm, and 1050nm, enabling multi-band synchronous imaging, supporting multi-channel parallel acquisition, and a rate of ≥30 frames / second. In multispectral imaging, the relationship between the intensity of absorption of a certain wavelength by the residue and the concentration of the absorbing substance and the thickness of the liquid layer is as follows: ; in, It is absorbance. It is the intensity of the incident light. It is the intensity of the transmitted light. It is the molar absorptivity. It refers to the optical path intensity, which is the thickness of the cuvette. It refers to the concentration of the sample solution, usually the molar concentration; Simultaneously, the Doppler effect formula is used to analyze spectral changes: ; in, It is the natural frequency of the target reflection. It is the observation frequency received by the spectrometer. It refers to the speed at which the spectrometer is used relative to samples containing mold. It measures the velocity of the sample relative to the spectrometer; Different spectral images can be obtained by using different wavelengths of light, and multiple images can be fused into one image using a weighted average formula; ; ; in, It is the image obtained after fusion. It is the first Spectral images, It is the first The image at the pixel level The weight of the position, It is the first The image at the pixel level Pixel value at; By using multispectral imaging, several images of medicinal residue in different bands are acquired for the same spatial scene. The acquired data constitute a multispectral set. The horizontal and vertical coordinates of the images correspond to the wavelength and signal value of the spectrum, respectively. The data set is composed of multiple two-dimensional images arranged along the spectral dimension and according to a specific spectral sampling interval. Computational processing module: Equipped with a high-performance computer and a built-in image acceleration chip, it is used to realize the real-time transmission and processing of multispectral images, and to store the MSD-TCMWR dataset and model training data; The sorting execution module uses pneumatic sorting nozzles with a response time of ≤0.1s and a conveyor belt with a transmission rate of 0.5-1m / s. It is used to accurately remove moldy medicine residue based on the coordinates of the moldy area output by the calculation and processing module.
[0011] As a further preferred embodiment of the method for detecting and sorting the deterioration of waste medicinal residues of traditional Chinese medicine according to the present invention, in step 3, training a mold recognition model based on YOLO11 specifically includes: YOLO11 algorithm framework optimization: Feature extraction module: It adopts a combination structure of C3K2 module and C2PSA module. The C3K2 module can flexibly replace the Bottleneck and C3 modules by switching the parameter C3K=TRUE / FALSE, which enhances the model's ability to extract mold features at different scales. The C2PSA module introduces the pyramid attention PSA block, which strengthens the capture of key features of moldy areas through multi-head attention mechanism. By constructing the network framework, feature extraction capabilities are enhanced through multi-head attention mechanisms and feedforward neural networks; residual structures are selectively added to optimize gradient propagation and network training performance; and FFN is used to map input features to a higher-dimensional space, capturing the complex nonlinear relationships of input features and allowing the model to learn richer feature representations. Loss function design: The following loss function is used: ; in It is a classic metric for measuring the degree of overlap between two bounding boxes. It represents the ratio of the intersection to the union of the predicted and ground truth boxes, and the calculation formula is: ; It is the Euclidean distance between the centers of the predicted bounding box and the ground truth bounding box; It is the diagonal length of the bounding box; It is a small constant used to avoid division by zero errors; These are weighting coefficients; It is a function used to measure the similarity of aspect ratios, expressed as: ; To improve the identification priority of toxin-producing molds, the following weighting is applied based on mold category: a weighting coefficient of 1.5 is set for toxin-producing molds such as Aspergillus flavus and Fusarium, and a weighting coefficient of 1.0 is set for other molds. Model training and optimization: The dataset was divided into training, validation and test sets in a 7:2:1 ratio. Data augmentation techniques such as random flipping, brightness adjustment and Gaussian noise were used to expand the training set. Set the training parameters: initial learning rate 0.01, batch size = 16, training epochs = 100, and use cosine annealing learning rate scheduling strategy. During training, the model parameters are adjusted in real time using the validation set. When the mold identification accuracy on the validation set does not improve for 10 consecutive rounds, training is stopped and the optimal model is saved. Model performance verification: The trained YOLO11 mold recognition model was verified using a test set. Evaluation metrics included recognition accuracy ≥95%, mold area localization accuracy IoU ≥0.85, and detection speed ≥25 frames / second.
[0012] As a further preferred embodiment of the method for detecting and sorting deterioration of traditional Chinese medicine waste residue in this invention, in step 4, the multispectral image fusion adopts the weighted average method, and the fusion formula is the weight of each band, ranging from 0.1 to 0.2.
[0013] As a further preferred embodiment of the method for detecting and sorting deterioration of traditional Chinese medicine waste residue in this invention, in step 4, the sorting execution module adopts a pneumatic nozzle with a response time ≤0.1s and a conveyor belt transmission rate of 0.5-1m / s. Based on the coordinates of the moldy area, the moldy residue is accurately removed, and the detection time, source, mold rate, and mold type distribution of each batch of residue are recorded and stored in the database to support subsequent traceability.
[0014] The application of a method for detecting and sorting the deterioration of waste Chinese medicinal herbs in the resource utilization of waste Chinese medicinal herbs: the qualified residue after sorting is used to prepare feed additives or organic fertilizers.
[0015] Compared with the prior art, the present invention, employing the above technical solution, has the following technical effects: This invention provides a method for detecting and sorting spoiled medicinal waste residue from traditional Chinese medicine (TCM). It utilizes a multispectral imaging system to acquire the omnidirectional spectral characteristics of the residue, combined with the YOLO11 algorithm to accurately identify and locate moldy residue. Finally, a sorting device automatically removes the moldy portion, improving the efficiency and accuracy of TCM waste residue detection and sorting. This invention solves the problems of low efficiency, poor accuracy, and inability to perform integrated sorting in traditional detection methods, significantly improving the accuracy (≥95%) and processing efficiency (≥200 kg / hour) of mold detection in TCM waste residue, providing quality assurance for the subsequent resource utilization of TCM waste. Attached Figure Description
[0016] Figure 1 This is a flowchart of a method for detecting and sorting deterioration of waste Chinese medicinal herbs according to the present invention; Figure 2 This is a schematic diagram illustrating the labeling of some molds in this invention; Figure 3 This is a schematic diagram of multispectral imaging for identifying moldy Chinese medicine in this invention; Figure 4 This is the network structure diagram of the C3K2 of the YOLO11 algorithm in this invention; Figure 5 This is a network structure diagram of the C2PSA algorithm of the YOLO11 algorithm in this invention; Figure 6 This is a schematic diagram illustrating the identification of moldy parts in traditional Chinese medicine waste residue according to the present invention. Detailed Implementation
[0017] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings: 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 of ordinary skill in the art without creative effort are within the scope of protection of the present invention. The present invention will be described in detail below with reference to the accompanying drawings and preferred embodiments. The purpose and effects of the present invention will become clearer. It should be understood that the specific embodiments described herein are merely illustrative of the present invention and are not intended to limit the present invention.
[0018] A method for detecting and sorting the deterioration of waste medicinal residue from traditional Chinese medicine based on multispectral imaging and the YOLO11 algorithm, such as... Figure 1 As shown, the specific steps include: Step 1: Construct a multispectral dataset of mold growth in traditional Chinese medicine Mold Sample Screening: Based on common mold types in waste Chinese medicine residues, 12 typical molds with high contamination frequency and high toxicity risk, including those from the Zygomycetes (Mucor, Rhizopus), Ascomycetes (Aspergillus flavus, Penicillium), and Deuteromycetes (Aspergillus glaucus, Fusarium), were selected as target detection objects. 1.2 Multispectral Image Acquisition: Multispectral imaging equipment was used to acquire multi-band images in the visible light (400-760nm) and near-infrared (760-1100nm) spectral ranges for different Chinese medicine waste residue matrices (such as Astragalus membranaceus residue, Isatis indigotica residue, Angelica sinensis residue), different mold growth stages (spore stage, mycelial stage, toxin-producing stage), and different contamination levels (mild mold: mold area <5%; moderate mold: 5% ≤ mold area <20%; severe mold: mold area ≥20%). No less than 1000 valid images were acquired for each mold category. Image preprocessing: Quality screening: Based on the Python OpenCV library, image sharpness (using variance method, retaining images with a sharpness value ≥50) and brightness (retaining images with a mean brightness of 30-220 and a highlight / shadow area ratio ≤10%) are calculated, and blurry, overexposed, and underexposed images are removed; Deduplication: The image hash value is calculated using the Python imagehash library. A hash value similarity threshold of 0.95 is set to delete duplicate or highly similar images. Labeling and Metadata Recording: The LabelImg tool was used to label the moldy areas in the image, and the labeling information (mold type, degree of mold, type of residue matrix, spectral band) was recorded, such as... Figure 2 As shown, the final dataset contains 12,000 valid images.
[0019] Step 2: Build a multispectral imaging detection hardware system The multispectral imaging detection hardware system includes an image acquisition module, a multispectral imaging module, a computation and processing module, and a sorting execution module. The functions of each module are as follows: Image acquisition module: An industrial-grade high-definition camera (resolution ≥ 5 million pixels) is selected, paired with an ultra-wide-angle lens (field of view ≥ 120°) to achieve all-round image acquisition of Chinese herbal medicine waste residue, reduce blind spots and reduce the number of shots per inspection; Multispectral imaging module: Utilizing high resolution (spectral resolution ≤ 5 nm) and high sensitivity (detectivity ≥ 10⁻⁶) 12Jones' multispectral sensor is equipped with a lens group covering eight specific spectral bands (450nm, 550nm, 650nm, 750nm, 850nm, 950nm, 1000nm, and 1050nm). The lens group uses multi-layer optical coating technology to achieve simultaneous imaging of multiple bands and avoid the loss of information in a single band. It supports multi-channel parallel acquisition (acquisition rate ≥30 frames / second) to improve data acquisition efficiency. In multispectral imaging, the relationship between the intensity of absorption of a certain wavelength by the residue and the concentration of the absorbing substance and the thickness of the liquid layer is as follows: ; in, It is absorbance. It is the intensity of the incident light. It is the intensity of the transmitted light. It is the molar absorptivity. It refers to the optical path intensity, which is the thickness of the cuvette. It is the concentration of the sample solution, usually the molar concentration.
[0020] Simultaneously, the Doppler effect formula is used to analyze spectral changes: ; in, It is the natural frequency of the target reflection. It is the observation frequency received by the spectrometer. It refers to the speed at which the spectrometer is used relative to samples containing mold. It measures the velocity of the sample relative to the spectrometer; Different spectral images can be obtained by using different wavelengths of light. Multiple images can be fused into a single image using a weighted average formula.
[0021] ; ; in, It is the image obtained after fusion. It is the first Spectral images, It is the first The image at the pixel level The weight of the position, It is the first The image at the pixel level pixel value at
[13] .
[0022] Ultimately, through multispectral imaging, such as Figure 3As shown, several images of medicinal residue in different bands were collected for the same spatial scene. The collected data constituted a multispectral set. Generally, the horizontal and vertical coordinates of the image correspond to the wavelength and signal value of the spectrum, respectively. This data set is composed of multiple two-dimensional images arranged along the spectral dimension and according to a specific spectral sampling interval. Calculation and processing module: Configured with a high-performance computer (CPU: Intel Core i9-13900K; GPU: NVIDIA RTX 4090; memory ≥ 64GB), with a built-in image acceleration chip, to realize real-time transmission and processing of multispectral images, and store MSD-TCMWR dataset and model training data; 2.4 Sorting execution module: Adopts pneumatic sorting nozzles (response time ≤ 0.1s), paired with a conveyor belt (transmission rate 0.5-1m / s, adjustable), to accurately remove moldy medicine residue based on the coordinates of the moldy area output by the calculation and processing module.
[0023] Step 3: Train a YOLO11-based mold detection model YOLO11 algorithm framework optimization: Feature extraction module: Employs a combination of the C3K2 and C2PSA modules. The C3K2 module allows for flexible replacement of the Bottleneck and C3 modules by switching parameters (C3K=TRUE / FALSE). Figure 4 As shown, this enhances the model's ability to extract mold features at different scales; such as Figure 5 As shown, the C2PSA module introduces the PSA (Pyramid Attention) block, which enhances the capture of key features of the moldy area through a multi-head attention mechanism.
[0024] By constructing these network frameworks, feature extraction capabilities can be enhanced through multi-head attention mechanisms and feedforward neural networks. Residual structures can be selectively added to optimize gradient propagation and network training performance. Simultaneously, using FFN allows input features to be mapped to a higher-dimensional space, capturing the complex nonlinear relationships of input features and allowing the model to learn richer feature representations. Loss function design, using the following loss function: ; in It is a classic metric for measuring the degree of overlap between two bounding boxes. It represents the ratio of the intersection to the union of the predicted and ground truth boxes, and the calculation formula is: ; It is the Euclidean distance between the centers of the predicted bounding box and the ground truth bounding box; It is the diagonal length of the bounding box; It is a small constant used to avoid division by zero errors; These are weighting coefficients; It is a function used to measure the similarity of aspect ratios, expressed as: .
[0025] To improve the identification priority of toxin-producing molds, the weight of mold category is combined (a weight coefficient of 1.5 is set for toxin-producing molds such as Aspergillus flavus and Fusarium, and a weight coefficient of 1.0 is set for other molds). Model training and optimization: The dataset was divided into training, validation and test sets in a 7:2:1 ratio. Data augmentation techniques such as random flipping, brightness adjustment and Gaussian noise addition were used to expand the training set. Set the training parameters: initial learning rate 0.01, batch size = 16, training epochs = 100, and use cosine annealing learning rate scheduling strategy; During training, the model parameters are adjusted in real time using the validation set. When the mold identification accuracy on the validation set does not improve for 10 consecutive rounds, training is stopped and the optimal model is saved. Model performance verification: The trained YOLO11 mold recognition model was verified using a test set. Evaluation metrics included recognition accuracy (≥95%), mold region localization accuracy (IoU≥0.85), and detection speed (≥25 frames / second).
[0026] Step 4: Detection and sorting of deterioration of waste Chinese medicinal herbs Medicinal residue feeding and image acquisition: The waste medicinal residue of Chinese medicine is evenly spread on the conveyor belt (with a thickness of 5-10mm). The conveyor belt carries the medicinal residue through the image acquisition module and the multispectral imaging module in sequence, and simultaneously acquires visible light images and near-infrared spectral images of 8 bands of the medicinal residue. Multispectral image fusion and feature extraction: The computational processing module receives multispectral image data and performs image fusion using a weighted average method. The fusion formula is as follows: ; in, The pixel value of the fused image at each pixel (number of spectral bands); It is the first Spectral images, For the first The weights of each band image are determined (based on the significance of mold features in each band, ranging from 0.1 to 0.2); after fusion, mold features are extracted using the YOLO11 model trained in step 3, such as... Figure 6 As shown, the output includes the mold type, degree of mold growth, and coordinates of the moldy area. Sorting of moldy medicinal residue: The sorting execution module controls the pneumatic nozzles to spray airflow at the corresponding positions according to the coordinates of the moldy area output by the calculation and processing module, so as to remove the moldy medicinal residue from the conveyor belt and complete the sorting. It will be understood by those skilled in the art that the above descriptions are merely preferred examples of the invention and are not intended to limit the invention. Although the invention has been described in detail with reference to the foregoing examples, those skilled in the art can still modify the technical solutions described in the foregoing examples or make equivalent substitutions for some of the technical features. All modifications and equivalent substitutions made within the spirit and principles of the invention should be included within the scope of protection of the invention. All technical features in this embodiment can be freely combined according to actual needs.
[0027] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A traditional Chinese medicine waste residue metamorphic detection and sorting method, characterized in that, Specifically comprising the following steps: Step 1: Constructing Traditional Chinese Medicine Moldy Multi-Spectral Dataset, Screening 12 Common Mold Types in Traditional Chinese Medicine as Target Detection Objects, Collecting Multi-Spectral Images and Preprocessing to Obtain Effective Dataset; Step 2: Building Multi-Spectral Imaging Detection Hardware System, Including Image Acquisition Module, Multi-Spectral Imaging Module, Computing Processing Module and Sorting Execution Module; Step 3: Training Mold Recognition Model Based on YOLO11, Optimizing Feature Extraction Module and Loss Function, Training and Validating Model through MSD-TCMWR Dataset; Step 4: Traditional Chinese Medicine Waste Residues are fed, multi-spectral image acquisition, image fusion and mold recognition, pneumatic sorting, completing the removal of deteriorated residues, while recording detection data.
2. The method for detecting and sorting deterioration of traditional Chinese medicine waste residues according to claim 1, characterized in that, In Step 1, the Traditional Chinese Medicine Moldy Multi-Spectral Dataset is constructed, which specifically includes: Step 1.1, Mold Sample Screening: According to the common mold types of traditional Chinese medicine waste residues, 12 typical molds with high contamination frequency and high toxicity risk are selected as target detection objects; Step 1.2, Multi-Spectral Image Acquisition: Using multi-spectral imaging equipment, in the visible light 400-760nm and near-infrared 760-1100nm spectral range, for different traditional Chinese medicine waste residue substrates including Astragalus root residue, Isatis root residue, Angelica root residue, different mold growth stages including spore stage, mycelium stage, toxin production stage, different contamination levels including mild mold: mold area <5%; moderate mold: 5%≤mold area<20%; severe mold: mold area≥20%, collect multi-band images, collect not less than 1000 valid images for each mold category.
3. The method for detecting and sorting the deterioration of traditional Chinese medicine waste residues according to claim 1, characterized in that, Image preprocessing includes quality screening, de-duplication processing, and annotation and metadata recording; Quality screening based on Python OpenCV library retains images with clarity value ≥50, brightness mean value 30-220, and high light / dark area ratio ≤10%; de-duplication processing deletes duplicate images with a hash value similarity ≥0.95 through the Python imagehash library.
4. The method for detecting and sorting the deterioration of traditional Chinese medicine waste residues according to claim 1, characterized in that, In Step 2, Image Acquisition Module: Select an industrial-grade high-definition camera with a resolution of ≥5 million pixels, and a super wide-angle lens with a field of view of ≥120°, for full-range image acquisition of traditional Chinese medicine waste residues; Multispectral imaging module: Choose spectral resolution ≤5nm, detection rate ≥10 12 Jones' multispectral sensor, equipped with 8 specific spectral band lenses including 450nm, 550nm, 650nm, 750nm, 850nm, 950nm, 1000nm, 1050nm, realizes multi-band synchronous imaging, supports multi-channel parallel acquisition, rate ≥30 frames / second; In multi-spectral imaging, the strength of absorption of a certain wavelength by the residue is related to the concentration of the absorbing substance and its liquid layer thickness: ; wherein, is the absorbance, is the intensity of the incident light, is the intensity of the transmitted light, is the molar absorption coefficient, is the path length intensity, i.e. the thickness of the cuvette, is the concentration of the sample solution, typically the molar concentration; At the same time, the Doppler effect formula is used to analyze the spectral changes: ; wherein, is the natural frequency of the target reflection, is the observed frequency received by the spectrometer, is the speed of application of the spectrometer relative to the moldy sample, is the speed of movement of the detection sample relative to the spectrometer; Different spectral images can be obtained by using different wavelengths, and multiple images can be fused into one image by using the weighted average formula; ; ; wherein, is the image obtained after fusion, is the first spectrum image, is the first image weight of the pixel point in the first image, is the pixel value of the pixel point in the first image, in the first image. Through multi-spectral imaging, several images of different wavebands of the residue are collected for the same spatial scene, and the collected data constitutes a multi-spectral set. The horizontal and vertical coordinates of the image correspond to the wavelength and signal value of the spectrum, respectively. The data set is composed of multiple two-dimensional images arranged along the spectral dimension with a specific spectral sampling interval; Computing Processing Module: Configure a high-performance computer with an image acceleration chip built-in for real-time transmission and processing of multi-spectral images, and store the MSD-TCMWR dataset and model training data; The sorting execution module: adopt pneumatic sorting nozzle, response time ≤0.1s, matched with conveying belt, transmission rate 0.5-1m / s, used for accurate removal of moldy slag according to the moldy area coordinates output by the calculation processing module.
5. The method for detecting and sorting the deterioration of traditional Chinese medicine waste residues according to claim 1, characterized in that, In step 3, the mold identification model based on YOLO11 is trained, which specifically includes: YOLO11 algorithm framework optimization: The feature extraction module: adopts the combined structure of C3K2 module and C2PSA module, wherein the C3K2 module realizes the flexible replacement of bottleneck and C3 module by switching parameters C3K=TRUE / FALSE, and enhances the extraction ability of the model to different scale mold features; the C2PSA module introduces pyramid attention PSA block, and strengthens the capture of key features of moldy area through multi-head attention mechanism; Through the composition of network framework, the feature extraction ability is enhanced through multi-head attention mechanism and feedforward neural network; selectively add residual structure to optimize gradient propagation and network training effect; at the same time, FFN is used to map the input features to a higher dimensional space, capture the complex nonlinear relationship of input features, and allow the model to learn more rich feature representation; Loss function design: adopt loss function: ; where is a classical metric to measure the overlap between two rectangular boxes, which represents the ratio of the intersection to the union of the predicted and ground-truth boxes, and is calculated as: ; is the Euclidean distance between the centers of the predicted and ground-truth boxes; is the diagonal length of the bounding box; is a small constant to avoid division by zero error; is the weight coefficient; is a function to measure the similarity of the aspect ratio, which is represented as: ; In order to improve the identification priority of toxin-producing mold, combined with mold category weight: set the weight coefficient of aspergillus flavus, fusarium and other toxin-producing molds to 1.5, and set the weight coefficient of other molds to 1.0; Model training and optimization: divide the data set into training set, validation set and test set according to the proportion of 7:2:1, and use random flip, brightness adjustment and Gaussian noise addition data enhancement method to expand the training set; Set the training parameters: initial learning rate 0.01, batch size batchsize=16, training rounds epoch=100, and adopt cosine annealing learning rate scheduling strategy; During the training process, the model parameters are adjusted in real time through the validation set, and when the mold identification accuracy of the validation set has no improvement for 10 consecutive rounds, the training is stopped, and the optimal model is saved; Model performance verification: the test set is used to verify the trained YOLO11 mold identification model, and the evaluation indexes include identification accuracy ≥95%, mold area positioning accuracy IoU ≥0.85, and detection speed ≥25 frames / second.
6. The method for detecting and sorting the deterioration of traditional Chinese medicine waste residues according to claim 1, characterized in that, In step 4, the weighted average method is used for multispectral image fusion, and the fusion formula is each band weight, ranging from 0.1 to 0.
2.
7. The method according to claim 1, characterized in that, In step 4, the sorting execution module adopts pneumatic nozzle with response time ≤0.1s, and the conveying belt has a transmission rate of 0.5-1m / s. According to the moldy area coordinates, the moldy slag is accurately removed, and the detection time, source, moldy rate and mold category distribution of each batch of slag are recorded and stored in the database to support subsequent traceability.
8. The application of the traditional Chinese medicine waste residue metamorphic detection and sorting method according to any one of claims 1-7 in the resource utilization of traditional Chinese medicine waste residue, characterized in that, The qualified slag after sorting is used for preparing feed additives or organic fertilizer.