Cordyceps sinensis hepialid larva infection phenotypic characteristic detection method
By collecting Cordyceps sinensis images through a multi-band light source and imaging module, and combining the YOLOv5 model and image processing algorithm, the subjective error problem of traditional detection methods is solved, and the automated and accurate detection of Cordyceps sinensis mycelium is achieved, thereby improving detection efficiency and consistency.
Patent Information
- Application Number
- CN202510733949.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2025-09-12
AI Technical Summary
Traditional Cordyceps detection methods rely on manual observation, which has large subjective errors and low efficiency and cannot meet the needs of Cordyceps production.
A multi-band light source and imaging module are used to collect Cordyceps sinensis images. Combined with the YOLOv5 target detection model and image processing algorithm, the mycelial morphological parameters are extracted, the infection area and density are calculated, and the grade classification is performed using the quality coefficient Q.
It realizes the automated and accurate detection of Cordyceps sinensis mycelium, reduces subjective errors, improves detection efficiency and consistency, and meets the precise needs of factory farming.
Smart Images

Figure CN120635558A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cordyceps sinensis breeding and cultivation, and in particular to a method for detecting phenotypic characteristics of cordyceps sinensis bat moth larvae infection. Background Art
[0002] Cordyceps sinensis is a precious traditional Chinese medicinal ingredient, considered one of the "three treasures of Chinese medicine" along with ginseng and deer antler. Its quality and growth conditions significantly impact its medicinal value and market competitiveness. Cordyceps sinensis is native to the eastern region of the Qinghai-Tibet Plateau. Wild production is relatively small, and its abundance has been declining in recent decades, putting it at risk of resource depletion. Artificially cultivated Cordyceps sinensis holds enormous market potential. Cordyceps cultivation and processing require comprehensive quality control, including testing and analysis of the mycelium.
[0003] Traditional Cordyceps testing relies on manual observation and measurement to estimate the time it takes for larvae to become infected with the fungus, assess the efficiency of infection within the mycelium within the host, and determine the quality of the host by observing characteristics such as appearance, color, texture, and size. This method requires skill and experience, and the results are subject to operator influence, making it prone to errors and inefficient, making it unsuitable for Cordyceps production.
[0004] The development of machine vision technology has provided new methods for mycelial phenotype detection, making automated and intelligent mycelial phenotype detection possible. Therefore, there is an urgent need to develop a technical method that can objectively and efficiently detect the mycelial phenotype of Cordyceps sinensis. Summary of the Invention
[0005] The present invention overcomes the deficiencies of the prior art and provides a method for detecting phenotypic characteristics of Cordyceps sinensis bat moth larvae infection.
[0006] To achieve the above object, the present invention adopts the following technical solution: a method for detecting the phenotypic characteristics of Cordyceps sinensis bat moth larvae infection, comprising the following steps:
[0007] S1, collecting images of Cordyceps sinensis;
[0008] S2. Constructing a Cordyceps sinensis target detection model, and using the Cordyceps sinensis target detection model to extract mycelium images from the Cordyceps sinensis images;
[0009] S3, measuring mycelial morphological parameters of the mycelium image extracted in S2, and obtaining the growth rate based on the growth time;
[0010] S4, extracting feature blocks from the mycelium image extracted in S2, and calculating the mycelial infection area and infection density in the Cordyceps sinensis host;
[0011] S5. Classify the Cordyceps sinensis image according to the mycelium morphological parameters, growth rate, infection area and infection density obtained in S3 and S4, and make a judgment on whether it is suitable for harvesting.
[0012] In a preferred embodiment of the present invention, in S1, the method for collecting images of Cordyceps sinensis comprises the following steps:
[0013] S11, configuring a multi-band light source and an imaging module to perform layered imaging of mycelium and parasite bodies;
[0014] The multi-band light source is composed of three independently controlled monochromatic LED arrays: ultraviolet-blue light 300 to 450nm, green-yellow light 500 to 600nm, and red-near infrared 650 to 900nm bands;
[0015] The imaging module includes a high-speed camera and a rapidly switchable narrow-band filter;
[0016] S12, using the light source and imaging module of S11, collecting a sub-band image sequence to obtain a multispectral image;
[0017] S13. Fusion and enhancement of multispectral images to obtain Cordyceps sinensis images.
[0018] In a preferred embodiment of the present invention, the acquisition of the sub-band image sequence in S12 includes the following steps:
[0019] S121, using a UV-blue light source and corresponding filters with an exposure time of 5-20 ms to photograph the insect surface;
[0020] S122, switching to a green-yellow light source and corresponding filters, extending the exposure time to 20-100 ms, and capturing the gradient transition zone formed by mycelium invading the middle tissue;
[0021] S123: Use a red-near infrared light source and corresponding filters, and use an exposure time of 100-500ms to penetrate the insect body to obtain deep images.
[0022] In a preferred embodiment of the present invention, the fusion and enhancement of the multispectral image in S13 includes the following steps:
[0023] S131. Perform spatial registration on the three sets of band images based on the SIFT feature matching algorithm;
[0024] S132. Separate the target signal using image subtraction technology to generate a deep mycelium enhancement image and a middle transition zone detail image;
[0025] S133, performing histogram equalization processing on the single-band image;
[0026] S134. Synthesize a three-band data pseudo-color image, set ultraviolet-blue light as the blue channel, green light as the green channel, and near-infrared as the red channel, and visually display the mycelium distribution through color overlay.
[0027] In a preferred embodiment of the present invention, the construction of the Cordyceps sinensis target detection model in S2 includes the following steps:
[0028] S21. Collect a number of Cordyceps sinensis images and create an electronic image positioning dataset;
[0029] S22. Build a Cordyceps sinensis target detection model based on YOLOv5, input the electronic image positioning dataset for training, and output an image with the mycelium position and morphology marked.
[0030] In a preferred embodiment of the present invention, the preparation of the electronic image positioning data set includes the following steps:
[0031] S211, cleaning and preprocessing the collected images, including removing duplicate images, unifying the size and format;
[0032] S212, performing enhancement processing on the pre-processed image, including geometric transformation rotation, flipping, scaling and illumination adjustment of contrast, brightness, and noise injection;
[0033] S213. Manually annotate the enhanced image, where the annotated content includes the mycelium position and morphological characteristics, such as fullness, local sparseness, or emptiness.
[0034] In a preferred embodiment of the present invention, the measurement of mycelial morphological parameters in S3 comprises the following steps:
[0035] S31, performing an adaptive binarization operation on the extracted mycelium image to separate the mycelium from the background;
[0036] S32. Segment the hyphae bundles using connected domain analysis, extract the outlines and perform minimum circumscribed rectangle processing, calculate the hyphae bundle diameters using the local width measurement method, and calculate the average diameter and standard deviation;
[0037] S33, obtaining outer contour information of the mycelium image after the binarization operation through a contour detection algorithm;
[0038] S34, calculating and obtaining the outer contour with the largest area among all outer contour information, obtaining the minimum circumscribed rectangle of the largest outer contour, and extracting the length and width of the rectangle;
[0039] Calculate the growth rate based on the growth time: Where V is the mycelium volume of the current sample, and t is the growth time of the current sample.
[0040] In a preferred embodiment of the present invention, the extraction of the feature blocks in S4 includes the following steps:
[0041] S41, performing grayscale and binarization processing on the extracted mycelium image;
[0042] S42, randomly select non-repeated points, and extract a circular block of fixed size with a radius of 16 pixels around each point;
[0043] S43, eliminating invalid blocks containing background pixels and retaining pure mycelium areas;
[0044] S44, counting the number of white pixels based on the binary image and calculating the infected area in combination with the spatial resolution;
[0045] S45. Skeletonize the characteristic blocks, extract the hyphae branch topology, calculate the number of intersections and branch length density per unit area, and calculate the infection density based on the density discrimination rule.
[0046] In a preferred embodiment of the present invention, the harvesting judgment in S5 includes the following steps:
[0047] S51. Calculate the quality coefficient Q based on the growth rate V, infection area A, and infection density D:
[0048] Q = (A / 80%) × (V / V avg )×α D , where V avg is the historical average growth rate, α D is the infection density level weight coefficient;
[0049] Step S52: performing graded harvesting according to the calculated quality coefficient Q value, including:
[0050] When Q ≥ 1.0, harvest immediately;
[0051] When 0.8≤Q<1.0, it is marked as priority 2 and harvested in batches;
[0052] When Q < 0.8, the output delay monitoring or discard instruction;
[0053] When the mycelium infection density D meets the medium or high level, the effective infection area is compensated: Among them, when the infection density D is high, A effective The upper limit is 130% of the original infected area.
[0054] In a preferred embodiment of the present invention, an emergency harvest countdown trigger mechanism is also included:
[0055] When the mycelium diameter is greater than 30 μm and the growth rate V is greater than 1.1Vavg Calculate the emergency harvest countdown: And forced harvesting after the countdown ends.
[0056] The present invention solves the defects existing in the background technology and has the following beneficial effects:
[0057] (1) The present invention provides a method for detecting the phenotypic characteristics of Cordyceps sinensis bat moth larvae infection. The method collects mycelium images and creates a positioning data set, establishes a target detection model and combines it with an image processing algorithm to extract mycelium, analyzes the growth rate and annotates the mycelium morphology; extracts characteristic blocks and calculates the mycelium infection area and infection density; finally, the Cordyceps sinensis images are graded based on mycelium morphological parameters, growth rate, infection area and infection density, and a judgment is made as to whether the Cordyceps sinensis is suitable for harvesting. This method eliminates subjective errors through automated processing, improves detection efficiency and consistency, and meets the precision requirements of factory farming.
[0058] (2) The present invention uses light sources of different wavelengths and waveforms to illuminate Cordyceps sinensis and capture multiple images to collect Cordyceps sinensis images. Ultraviolet (UV) bands clearly show clusters of white spots of hyphae colonizing the joints of the insect body, while near-infrared images reveal the internal hyphae network. In the pseudo-color composite image, the red-dominant area is clearly demarcated from the blue-green background, allowing for rapid identification of hyphae distribution characteristics without manual interpretation, providing a non-destructive testing solution for Cordyceps sinensis quality grading.
[0059] (3) The present invention dynamically optimizes the exposure time, specifically using short exposure (5–20 ms) of ultraviolet-blue light to suppress overexposure caused by high surface reflection and preserve the mycelial microstructure in the joint fissure (such as colonization points with a diameter of <20 μm); extending the green light to 20–100 ms to enhance the capture of the refractive difference of metabolites in the middle layer and reduce the measurement error of the width of the transition zone strip; and long red-near infrared exposure (100–500 ms) to ensure that weak signals in the deep layer are fully captured and penetrate samples with a thickness of up to 8 mm, which improves the imaging capability compared with single light source.
[0060] (4) The Cordyceps sinensis target detection model constructed by the present invention achieves precise positioning and morphological analysis of mycelium by fusing high-resolution images collected by multi-band light sources with the YOLOv5 algorithm. The model can automatically identify the three-dimensional distribution characteristics of mycelium within the insect body, distinguishing surface colonization spots, mid-layer invasion transition zones, and deep network structures. Through multi-channel superposition of pseudo-color images, it clearly presents the invasion path of mycelium from the surface to the interior. It can accurately extract and annotate the boundaries between mycelium and the insect body, as well as possible local sparse and empty areas. Compared with traditional manual cross-section observation, this model significantly reduces subjective errors and realizes non-destructive, high-throughput automated detection.
[0061] (5) The present invention solves the subjectivity and lag of traditional manual experience judgment through quantitative calculation of the quality coefficient Q (comprehensive infection area A, density D and growth rate V).
[0062] (6) The present invention allows high-density mycelium (D>300μm / μm) based on the density compensation rule 2 ) has an effective area of 130%, so that samples that were originally discarded due to insufficient local area can be re-evaluated as qualified through density advantage, reducing raw material waste.
[0063] (7) The present invention triggers the countdown harvest through a preset mycelium aging warning mechanism, reducing the mycelium autolysis rate caused by over-maturity from 19% in traditional harvesting to below 3%, thereby ensuring product stability. The linear coefficient in the countdown formula Ensure that the speed of response is positively correlated with the degree of growth abnormality. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments described in the present invention. Those skilled in the art can also derive other drawings based on these drawings without inventive efforts.
[0065] Figure 1 2. It is a diagram of an intelligent detection method for phenotypic characteristics of Cordyceps sinensis larvae infection according to a preferred embodiment of the present invention;
[0066] Figure 2 1 is a flow chart of a method for collecting images of Cordyceps sinensis according to a preferred embodiment of the present invention;
[0067] Figure 3 is a flow chart of a method for acquiring sub-band image sequences according to a preferred embodiment of the present invention;
[0068] Figure 4 It is a flow chart of a multispectral image fusion and enhancement method according to a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0069] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0070] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the scope of protection of the present invention is not limited to the specific embodiments disclosed below.
[0071] like Figure 1 As shown, the present invention provides a method for detecting the phenotypic characteristics of Cordyceps sinensis bat moth larvae infection, comprising the following steps:
[0072] S1, collecting images of Cordyceps sinensis;
[0073] S2. Constructing a Cordyceps sinensis target detection model, and using the Cordyceps sinensis target detection model to extract mycelium images from the Cordyceps sinensis images;
[0074] S3, measuring mycelial morphological parameters of the mycelium image extracted in step S2, and obtaining the growth rate based on the growth time;
[0075] S4. Extracting feature blocks from the mycelium image extracted in step S2, and calculating the mycelial infection area and infection density in the Cordyceps sinensis host;
[0076] S5. Classify the Cordyceps sinensis image according to the mycelial morphological parameters, growth rate, infection area and infection density obtained in steps S3 and S4, and make a judgment on whether it is suitable for harvesting.
[0077] Based on the above steps, a machine vision-based, automated, intelligent method for detecting the phenotypic characteristics of Cordyceps sinensis mycelium was proposed. This method collects mycelial images and generates a localization dataset. A target detection model is then built, combined with an image processing algorithm, to extract mycelium, analyze growth rates, and annotate mycelial morphology. Feature blocks are then extracted and the infected area and density are calculated. Finally, Cordyceps sinensis images are classified based on mycelial morphological parameters, growth rates, infected area, and density, allowing for a decision on appropriate harvesting. This method eliminates subjective errors through automated processing, improving detection efficiency and consistency, and meeting the precision requirements of industrial aquaculture.
[0078] Each step is described in detail below.
[0079] In step S1, multi-light source contrast imaging technology is used to illuminate the Cordyceps sinensis using light sources of different wavelengths and waveforms. Multiple images are taken with a camera to produce images that clearly show the difference between the mycelium and the insect body. Each light source reveals different characteristics of the sample. By comparing and analyzing these images, the distribution of mycelium within the insect body can be more accurately identified.
[0080] like Figure 2 As shown, the specific method for collecting Cordyceps sinensis images includes the following steps:
[0081] Step S11: configuring a multi-band light source and an imaging module to achieve layered imaging of the mycelium and the parasite.
[0082] The multi-band light source consists of three independently controlled monochromatic LED arrays: ultraviolet-blue (300–450nm), green-yellow (500–600nm), and red-near-infrared (650–900nm) bands.
[0083] Ultraviolet-blue light penetrates the chitinous shell on the surface of the insect body, and is used to capture the initial colonization of mycelium in the joints or surface cracks of the insect body; the green light band has a stronger ability to penetrate the middle layer of the insect body's muscle and fat tissue, revealing the interaction boundary between the mycelium and the host tissue; red light-near infrared penetrates the internal structure of the insect body, showing the diffuse distribution of the deep mycelial network.
[0084] The imaging module contains a high-speed camera and rapidly switchable narrow-band filters to ensure that signals in each band are captured independently.
[0085] like Figure 3 As shown, step S12 of executing the sub-band image sequence acquisition specifically includes:
[0086] S121. Use a UV-blue light source and corresponding filters with an exposure time of 5-20ms to photograph the insect surface. The mycelium appears as a highly reflective bright spot due to its chitin component, while the insect cuticle shows a fine texture.
[0087] S122. Switch to the green-yellow light source and the corresponding filter, extend the exposure time to 20-100 ms, and capture the gradient transition zone formed by the invasion of mycelium in the middle layer of tissue. This area appears as a light and dark streak structure in the image due to the difference in refractive index between mycelial metabolites and parasite tissue.
[0088] S123. Using a red-near-infrared light source and corresponding filters, an exposure time of 100-500ms is used to penetrate the insect body to obtain deep images. At this time, the mycelium's transmittance in the near-infrared band makes it appear as a uniformly distributed bright white area, which contrasts with the low transmittance characteristics of the insect's internal organs.
[0089] Through dynamic optimization of exposure time, specifically short exposure (5-20ms) of ultraviolet-blue light is used to suppress overexposure caused by high surface reflection and preserve the mycelial microstructure of the joint fissure (such as colonization points with a diameter of <20μm); green light is extended to 20-100ms to enhance the capture of refractive differences of metabolites in the middle layer and reduce the measurement error of the width of the transition zone strip; red light-near infrared long exposure (100-500ms) ensures that weak signals in the deep layer are fully captured and penetrates samples with a thickness of up to 8mm, which improves the imaging capability compared to single light source.
[0090] like Figure 4As shown, step S13 of multispectral image fusion and enhancement specifically includes:
[0091] S131. Perform spatial registration on the three sets of band images based on marker points or SIFT feature matching algorithm to eliminate pixel offset caused by device vibration or sample micro-movement.
[0092] S132. Separate target signals using image subtraction technology: subtract the ultraviolet-blue image from the red-near-infrared image to generate an enhanced image of the deep mycelium, and subtract the red image from the green image to enhance the details of the middle transition zone;
[0093] S133, performing histogram equalization processing on the single-band image to stretch the grayscale difference between the mycelium and the background;
[0094] S134. Synthesize a three-band pseudo-color image, setting the ultraviolet-blue light as the blue channel (surface structure), the green light as the green channel (middle layer transition), and the near-infrared as the red channel (deep mycelium). The spatial dynamics of mycelium invading from the surface of the insect body to the inside are intuitively displayed through color overlay.
[0095] The above steps capture images of Cordyceps sinensis based on differences in physical and optical properties. Ultraviolet (UV) images clearly reveal clusters of white hyphae colonizing the joints of the fungus, while near-infrared (NIR) images reveal the internal hyphal network. In the pseudo-color composite image, the dominant red area is clearly demarcated from the blue-green background, enabling rapid identification of hyphal distribution without manual interpretation, providing a non-destructive testing solution for Cordyceps sinensis quality grading.
[0096] In step S2, a Cordyceps sinensis target detection model is constructed based on YOLOv5 and trained, and the trained Cordyceps sinensis target detection model is used to extract mycelium images from the Cordyceps sinensis images.
[0097] The training method of the Cordyceps sinensis target detection model includes:
[0098] Step S21 : Collect a number of Cordyceps sinensis images collected in step S1 , process them, and generate an electronic image positioning dataset of Cordyceps sinensis in the host.
[0099] Step S22: Build a Cordyceps sinensis target detection model based on YOLOv5, input a Cordyceps sinensis electronic image positioning dataset, train the Cordyceps sinensis target detection model, and output a mycelium image. The mycelium image is marked with the positions of the mycelium and the insect body, as well as the mycelium morphology.
[0100] It should be noted that a large number of Cordyceps sinensis images are collected by the method of step S1, the number of which is as large as possible, and includes images of Cordyceps sinensis with various mycelium morphologies, different infection areas, infection densities, and growth times.
[0101] Furthermore, the method for preparing the Cordyceps sinensis electronic image positioning dataset includes the following steps:
[0102] Step S211 : Cleaning and preprocessing the collected Cordyceps sinensis images, including removing duplicate images, unifying image sizes, and formatting, to ensure the integrity and accuracy of the generated data set.
[0103] Step S212: performing enhancement processing on the pre-processed image to expand the data set, including: geometric transformation (rotation, flipping, scaling) and lighting adjustment (contrast, brightness, noise injection), to simulate Cordyceps sinensis images under different conditions.
[0104] Step S213: Manually annotate the enhanced image, where the annotation content includes: mycelium position and mycelium morphology. It should be noted that mycelium position: the positions of mycelium and the insect body are marked in the image. The mycelium morphology includes: full mycelium inside the insect body, sparse mycelium in some parts, or hollow mycelium.
[0105] Step S214: Divide the labeled images into a training set, a validation set, and a test set in a ratio of 70:15:15.
[0106] The constructed Cordyceps sinensis target detection model achieves precise positioning and morphological analysis of mycelium by fusing high-resolution images acquired using a multi-band light source with the YOLOv5 algorithm. The model automatically identifies the three-dimensional distribution of mycelium within the fungus, distinguishing between surface colonization spots, mid-layer invasion transition zones, and deep network structures. Through multi-channel overlay of pseudo-color images, it clearly visualizes the mycelium's invasion path from the surface to the interior. It accurately extracts and annotates the boundaries between mycelium and the fungus, as well as possible localized sparse and void areas. Compared to traditional manual cross-sectional observation, this model significantly reduces subjective errors, enabling non-destructive, high-throughput automated detection.
[0107] Step S3: measuring mycelial morphological parameters of the mycelium image extracted in step S2, and obtaining the growth rate in combination with the growth time.
[0108] Specific mycelial morphological parameters measured include:
[0109] Step S31 : performing an adaptive binarization operation on the mycelium image extracted in step S2 to separate the mycelium from the complex background.
[0110] Step S32: Use connected domain analysis to segment the hyphae bundles in the binary image into several independent regions, extract the outlines of several hyphae bundles, perform minimum circumscribed rectangle processing on the outline of each hyphae bundle, extract the center line along the hyphae growth direction, calculate the diameter by local width measurement, and statistically analyze the diameters of multiple hyphae bundles in the same image to calculate the average diameter and standard deviation.
[0111] Step S33: Obtain the outer contour information of the mycelium image after the binarization operation through a contour detection algorithm.
[0112] Step S34: Calculate and obtain the outer contour with the largest area among all outer contour information, obtain the minimum circumscribed rectangle of the largest outer contour, and extract the length and width of the rectangle.
[0113] Furthermore, since the shape of the Cordyceps sinensis mycelium is approximately cylindrical, the length and width of the largest outer contour are used as the length and diameter of the approximate cylinder to calculate its volume, and then the growth rate is calculated based on the growth time: Where V is the mycelium volume of the current sample, and t is the growth time of the current sample.
[0114] The growth rate information of different mycelia is calculated and used as one of the bases for grading the quality of Cordyceps sinensis.
[0115] Step S4: extracting characteristic blocks from the mycelium image extracted in step S2, and calculating the mycelial infection area and infection density in the Cordyceps sinensis host.
[0116] The extraction of feature blocks includes the following steps:
[0117] Step S41 : grayscale and binarize the mycelium image extracted in step S2 to separate the mycelium from the complex background.
[0118] Step S42: Randomly select non-repeated points in the binarized image, and extract square or circular blocks of fixed size with each point as the center, preferably circular blocks with a radius of 16 pixels.
[0119] In step S43, if the extracted block contains black pixels, i.e., background pixels, the block is considered to contain a non-mycelium area. Such invalid blocks are removed, and a preset number of feature blocks are extracted. The purpose is to retain the pure mycelium area and avoid background noise interference.
[0120] Furthermore, the calculation of the mycelial infection area in the Cordyceps sinensis host comprises the following steps:
[0121] Step S44: Based on the binary image obtained in step S41, where the mycelium is white pixels and the background is black pixels, the number of all white pixels in the binary image is calculated, and the total number of pixels in the image is counted;
[0122] According to the pre-calibrated spatial resolution, the number of white pixels was multiplied by the single pixel area to obtain the mycelium infection area.
[0123] Furthermore, the calculation of the mycelial infection density in the Cordyceps sinensis host includes the following steps:
[0124] Step S45: Based on the pure mycelium feature block extracted in step S43, locate the feature block in the original grayscale image, calculate the pixel grayscale mean μ and standard deviation σ, and eliminate invalid blocks based on the calculation results, specifically:
[0125] If μ<100 or σ>80, it is marked as an invalid block and does not enter the subsequent calculation;
[0126] Only valid blocks with μ ≥ 100 and σ ≤ 80 are retained.
[0127] The effective blocks were skeletonized, the hyphae branch topology was extracted, and the following parameters were calculated:
[0128] Number of intersections (J): Unit area (mm 2 ) the number of hyphal intersections within;
[0129] Branch length density (L): per unit area (mm 2 ) Total length of hyphae skeleton (μm)
[0130] Calculate the density level based on the density discrimination rule:
[0131]
[0132] Assign weights to the differences in density and perform comprehensive density calculations:
[0133]
[0134] Among them, the weight of high-density blocks is 1.0, medium-density is 0.6, and low-density is 0.3;
[0135] Comprehensive density determination threshold:
[0136]
[0137] Step S5: Classify the Cordyceps sinensis images based on the mycelium morphological parameters, growth rate, infection area and infection density obtained in steps S3 and S4, and make a judgment on whether the Cordyceps sinensis is suitable for harvesting.
[0138] Specifically, the quality grades of Cordyceps sinensis are classified according to the diameter of the mycelial bundles and the morphology of the mycelium.
[0139] Table 1 shows the classification method of Cordyceps sinensis quality grades.
[0140] Table 1. Cordyceps sinensis quality grade classification
[0141]
[0142]
[0143] Step S51: Calculate the quality coefficient Q based on the growth rate V, infection area A, and infection density D:
[0144] Q = (A / 80%) × (V / V avg )×α D , where V avg is the historical average growth rate, α D is the infection density level weight coefficient, specifically:
[0145] High density: α D =1.2;
[0146] Medium density: α D =1.0;
[0147] Low density: α D =0.8.
[0148] Step S52: performing graded harvesting according to the calculated quality coefficient Q value, including:
[0149] When Q ≥ 1.0, harvest immediately;
[0150] When 0.8≤Q<1.0, it is marked as priority 2 and harvested in batches;
[0151] When Q is less than 0.8, the output delay monitoring or abandonment instruction is performed.
[0152] Furthermore, when the mycelial infection density D meets the medium or high level, the effective infection area is compensated: Among them, when the infection density D is high, A effective The upper limit is 130% of the original infected area.
[0153] Based on the density compensation rule, high density hyphae (D>300μm / μm 2 ) has an effective area of 130%, so that samples that were originally discarded due to insufficient local area can be re-evaluated as qualified through density advantage, reducing raw material waste.
[0154] When the mycelium diameter is greater than 30 μm and the growth rate V is greater than 1.1V avg Calculate the emergency harvest countdown: And forced harvesting after the countdown ends.
[0155] The preset mycelium aging warning mechanism triggers the countdown harvest, reducing the mycelium autolysis rate caused by over-maturity from 19% in traditional harvesting to below 3%, ensuring product stability. Ensure that the speed of response is positively correlated with the degree of growth abnormality.
[0156] The present invention solves the subjectivity and hysteresis of traditional manual experience judgment through quantitative calculation of the quality coefficient Q (comprehensive infection area A, density D and growth rate V).
[0157] The above description is based on the ideal embodiment of the present invention. Based on the above description, relevant personnel can make various changes and modifications without departing from the technical scope of this invention. The technical scope of this invention is not limited to the content of the specification and must be determined according to the scope of the claims.
Claims
1. A method for detecting the phenotypic characteristics of Cordyceps sinensis bat moth larvae infection, characterized in that: The following steps are involved: S1, collecting images of Cordyceps sinensis; S2. Constructing a Cordyceps sinensis target detection model, and using the Cordyceps sinensis target detection model to extract mycelium images from the Cordyceps sinensis images; S3, measuring mycelial morphological parameters of the mycelium image extracted in S2, and obtaining the growth rate based on the growth time; S4, extracting feature blocks from the mycelium image extracted in S2, and calculating the mycelial infection area and infection density in the Cordyceps sinensis host; S5. Classify the Cordyceps sinensis image according to the mycelium morphological parameters, growth rate, infection area and infection density obtained in S3 and S4, and make a judgment on whether it is suitable for harvesting.
2. The method for detecting phenotypic characteristics of Cordyceps sinensis bat moth larvae infection according to claim 1, characterized in that: In S1, the method for collecting images of Cordyceps sinensis includes the following steps: S11, configuring a multi-band light source and an imaging module to perform layered imaging of mycelium and parasite bodies; The multi-band light source is composed of three independently controlled monochromatic LED arrays: ultraviolet-blue light 300 to 450nm, green-yellow light 500 to 600nm, and red-near infrared 650 to 900nm bands; The imaging module includes a high-speed camera and a rapidly switchable narrow-band filter; S12, using the light source and imaging module of S11, collecting a sub-band image sequence to obtain a multispectral image; S13. Fusion and enhancement of multispectral images to obtain Cordyceps sinensis images.
3. The method for detecting the phenotypic characteristics of infection by Cordyceps sinensis bat moth larvae according to claim 2, characterized in that: The acquisition of the sub-band image sequence in S12 includes the following steps: S121, using a UV-blue light source and corresponding filters with an exposure time of 5-20 ms to photograph the insect surface; S122, switching to a green-yellow light source and corresponding filters, extending the exposure time to 20-100 ms, and capturing the gradient transition zone formed by mycelium invading the middle tissue; S123: Use a red-near infrared light source and corresponding filters, and use an exposure time of 100-500ms to penetrate the insect body to obtain deep images.
4. The method for detecting phenotypic characteristics of Cordyceps sinensis bat moth larvae infection according to claim 2, characterized in that: The fusion and enhancement of the multispectral image in S13 includes the following steps: S131. Perform spatial registration on the three sets of band images based on the SIFT feature matching algorithm; S132. Separate the target signal using image subtraction technology to generate a deep mycelium enhancement image and a middle transition zone detail image; S133, performing histogram equalization processing on the single-band image; S134. Synthesize a three-band data pseudo-color image, set ultraviolet-blue light as the blue channel, green light as the green channel, and near-infrared as the red channel, and visually display the mycelium distribution through color overlay.
5. The method for detecting phenotypic characteristics of infection by Cordyceps sinensis bat moth larvae according to claim 1, characterized in that: The Cordyceps sinensis target detection model is constructed in S2, including the following steps: S21. Collect a number of Cordyceps sinensis images and create an electronic image positioning dataset; S22. Build a Cordyceps sinensis target detection model based on YOLOv5, input the electronic image positioning dataset for training, and output an image with the mycelium position and morphology marked.
6. The method for detecting phenotypic characteristics of Cordyceps sinensis bat moth larvae infection according to claim 5, characterized in that: The preparation of the electronic image positioning data set includes the following steps: S211, cleaning and preprocessing the collected images, including removing duplicate images, unifying the size and format; S212, performing enhancement processing on the pre-processed image, including geometric transformation rotation, flipping, scaling and illumination adjustment of contrast, brightness, and noise injection; S213. Manually annotate the enhanced image, where the annotated content includes the mycelium position and morphological characteristics, such as fullness, local sparseness, or emptiness.
7. The method for detecting phenotypic characteristics of Cordyceps sinensis bat moth larvae infection according to claim 1, characterized in that: The measurement of mycelial morphological parameters in S3 includes the following steps: S31, performing an adaptive binarization operation on the extracted mycelium image to separate the mycelium from the background; S32. Segment the hyphae bundles using connected domain analysis, extract the outlines and perform minimum circumscribed rectangle processing, calculate the hyphae bundle diameters using the local width measurement method, and calculate the average diameter and standard deviation; S33, obtaining outer contour information of the mycelium image after the binarization operation through a contour detection algorithm; S34, calculating and obtaining the outer contour with the largest area among all outer contour information, obtaining the minimum circumscribed rectangle of the largest outer contour, and extracting the length and width of the rectangle; Calculate the growth rate based on the growth time: Where V is the mycelium volume of the current sample, and t is the growth time of the current sample.
8. The method for detecting phenotypic characteristics of Cordyceps sinensis bat moth larvae infection according to claim 1, characterized in that: The extraction of the feature blocks in S4 includes the following steps: S41, performing grayscale and binarization processing on the extracted mycelium image; S42, randomly select non-repeated points, and extract a circular block of fixed size with a radius of 16 pixels around each point; S43, eliminating invalid blocks containing background pixels and retaining pure mycelium areas; S44, counting the number of white pixels based on the binary image and calculating the infected area in combination with the spatial resolution; S45. Skeletonize the characteristic blocks, extract the hyphae branch topology, calculate the number of intersections and branch length density per unit area, and calculate the infection density based on the density discrimination rule.
9. The method for detecting phenotypic characteristics of Cordyceps sinensis bat moth larvae infection according to claim 1, characterized in that: The harvesting judgment in S5 includes the following steps: S51. Calculate the quality coefficient Q based on the growth rate V, infection area A, and infection density D: Q = (A / 80%) × (V / V avg )×α D , where V avg is the historical average growth rate, α D is the infection density level weight coefficient; Step S52: performing graded harvesting according to the calculated quality coefficient Q value, including: When Q ≥ 1.0, harvest immediately; When 0.8≤Q<1.0, it is marked as priority 2 and harvested in batches; When Q < 0.8, the output delay monitoring or discard instruction; When the mycelium infection density D meets the medium or high level, the effective infection area is compensated: Among them, when the infection density D is high, A effective The upper limit is 130% of the original infected area.
10. The method for detecting phenotypic characteristics of Cordyceps sinensis bat moth larvae infection according to claim 9, characterized in that: It also includes an emergency harvest countdown trigger mechanism: When the mycelium diameter is greater than 30 μm and the growth rate V is greater than 1.1V avg Calculate the emergency harvest countdown: And forced harvesting after the countdown ends.