Edible mushroom detection system based on short-wave infrared multi-band fusion
The detection system, which integrates short-wave infrared multi-band fusion, has solved the problems of judging the maturity of edible fungi and detecting latent mold, enabling non-destructive, rapid, and accurate automated harvesting, thereby improving production efficiency and food safety.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-27
- Publication Date
- 2026-04-07
AI Technical Summary
Existing technologies have shortcomings in accurately judging the maturity of edible fungi, non-destructive detection of internal hidden defects, and adaptability to automated harvesting. They are difficult to achieve efficient, non-contact, and simultaneous accurate judgment of multiple indicators, and mechanical harvesting is prone to damage.
A detection system based on short-wave infrared multi-band fusion is adopted. By synchronously triggering short-wave infrared cameras, color cameras and environmental sensors to acquire multimodal data, the system uses a multimodal recognition model to extract feature absorption depth, invert moisture content and mold reflectivity, and combines the capture parameters output by the adaptive decision layer to achieve non-destructive, fast and accurate detection.
It enables non-destructive, rapid, and accurate detection of the internal quality of edible fungi, improves the automation level of factory harvesting, reduces the breakage rate, and ensures food safety and production efficiency.
Smart Images

Figure CN121569707B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of edible fungi harvesting control, and particularly relates to an edible fungi detection system based on short-wave infrared multi-band fusion. Background Technology
[0002] Factory harvesting of edible fungi is a crucial link in ensuring industry efficiency and product quality. However, existing technologies still have shortcomings in accurately judging maturity, non-destructive detection of internal hidden defects, and adaptability to automated harvesting. Current visual inspection methods relying on visible light cannot reliably identify maturity based on internal components, nor can they detect individuals with normal surface appearance but internal spoilage, posing quality and safety risks. At the same time, mechanical harvesting of mushrooms using fixed parameters easily leads to damage. Existing technical solutions to address these issues, such as visual morphology analysis, contact spectral detection, or mechanical feedback mechanisms, all have their own shortcomings. They may be unable to penetrate and detect internal quality, have low detection efficiency and are prone to causing damage, or have insufficient predictive capabilities, making it difficult to meet the actual needs of production lines for high-efficiency, non-contact, and simultaneous accurate judgment of multiple indicators. Summary of the Invention
[0003] To address the shortcomings of existing technologies, this invention proposes an edible fungus detection system based on short-wave infrared multi-band fusion. This system includes an acquisition module, a detection module, and a response module. The acquisition module simultaneously triggers a short-wave infrared camera, a color camera, and environmental sensors to acquire image data, infrared multi-band data, and temperature, humidity, and distance data of the edible fungi during conveyor belt operation. The detection module processes the above data using a constructed multimodal recognition model. This model extracts, in parallel, features such as characteristic absorption depth for quantifying chitin content, reflectance slope for retrieving moisture content, reflectance decrease for identifying mold metabolites, and features characterizing surface morphology and texture through an infrared band extraction layer, an image extraction layer, and an environmental feature extraction layer. These features are further fused, and through a mold detection layer and an adaptive decision layer, the system ultimately outputs the mold probability, maturity level, and recommended capture parameters. The response module executes mold warnings or adaptive capture based on the output results. This invention, through multimodal sensor fusion and robust processing against complex environmental interference, achieves non-destructive, rapid, and accurate detection of the internal quality of edible fungi, effectively improving the automation level of factory harvesting.
[0004] To achieve the above objectives, the present invention provides the following technical solution:
[0005] An edible fungus detection system based on short-wave infrared multi-band fusion includes:
[0006] The acquisition module is used to acquire multimodal data of edible fungi using a configured sensor array at a preset transmission speed and with optimized synchronization mechanism. The multimodal data of edible fungi includes image data of edible fungi, infrared multi-band data of edible fungi, and environmental data. The environmental data includes the temperature and humidity of the acquisition environment and the fixed working distance between the camera or light source and the surface of the mushroom being measured.
[0007] The detection module obtains a sequence of edible fungi response information based on multimodal data of edible fungi combined with a preset multimodal recognition model; the sequence of edible fungi response information includes at least the detection accuracy of maturity, moisture content and mold probability.
[0008] The response module, in response to the edible fungus response information sequence satisfying the corresponding preset trigger condition, selects a response action corresponding to the trigger condition from an action set including at least two response strategies; the response strategies include a mold warning response strategy and a maturity capture response strategy.
[0009] Specifically, the process of constructing a multimodal recognition model includes:
[0010] Set scene enhancement parameters, and based on the preset transmission speed and scene enhancement parameters, trigger the SWIR camera and RGB camera through the conveyor belt encoder pulse to simultaneously collect edible fungus image data and edible fungus infrared multi-band data and mark the corresponding scene label code;
[0011] Simultaneously, the configured temperature and humidity sensors and distance sensors are used to collect temperature and humidity data in the target scene, as well as distance data between the SWIR camera and the RGB camera corresponding to the edible mushroom bed.
[0012] The collected edible fungus image data, edible fungus infrared multi-band data, temperature and humidity data, and distance data are input into a Kalman filter for time alignment and enhancement preprocessing to obtain the preprocessed enhanced edible fungus image data, enhanced edible fungus infrared multi-band data, and temperature and humidity data and distance data.
[0013] Specifically, the multimodal recognition model includes an infrared band extraction layer, an image extraction layer, an environmental feature extraction layer, and a mold detection layer; the infrared band extraction layer includes a first band extraction branch, a second band extraction branch, and a third band extraction branch; the image extraction layer includes a first geometric extraction branch and a second texture extraction branch; the construction process of the multimodal recognition model also includes:
[0014] The enhanced edible fungus image data is input into the image extraction layer, and the configured first geometric extraction branch is called to extract the feature of the ratio of the cap curvature radius to the stipe height of the edible fungus. At the same time, the configured second texture extraction branch is called to extract the surface texture distribution map of the edible fungus.
[0015] The enhanced infrared multi-band data of edible fungi is input into the infrared band extraction layer, the configured first band extraction branch is called to extract the first infrared band features, and the absorption depth of the first infrared band is calculated.
[0016] Specifically, the process of constructing a multimodal recognition model also includes:
[0017] The second infrared band features are extracted by calling the configured second band extraction branch, the reflectance slope of the second infrared band is calculated, and the moisture content and moisture content regression loss of edible fungi are obtained by combining the second infrared band-moisture content mapping table.
[0018] Simultaneously call the third band extraction branch to extract the features of the third infrared band and calculate the decrease in reflectance of the third infrared band;
[0019] The temperature and humidity data and distance data are input into the environmental condition extraction layer to obtain environmental feature vectors;
[0020] The environmental feature vector, surface texture distribution map, reflectance reduction of the third infrared band, and absorption depth of the first infrared band are combined with a preset first weighting coefficient and input into the mold detection layer to obtain the mold probability detection value and detection confidence level.
[0021] Specifically, the multimodal recognition model also includes an adaptive decision layer; the adaptive decision layer includes a first discrimination sublayer, a maturity detection sublayer, a second discrimination sublayer, and a grasping strategy response sublayer;
[0022] The construction process of the multimodal recognition model also includes:
[0023] The mold probability detection value is input into the first discrimination sublayer and compared with a preset first discrimination threshold. When the mold probability detection value is greater than the first discrimination threshold, the first early warning response strategy parameter is directly output.
[0024] If the value is less than or equal to the first discrimination threshold, the ratio of the cap curvature radius to the stipe height of the edible fungus, the environmental feature vector, and the absorption depth of the first infrared band are input into the maturity detection sublayer to obtain the maturity of the edible fungus and the discrimination accuracy.
[0025] The maturity of the edible fungi is input into the second discrimination sublayer and compared with a preset maturity discrimination threshold. When the maturity of the edible fungi is less than or equal to the maturity discrimination threshold, the second early warning response strategy parameters are output.
[0026] When the maturity of edible fungi is greater than the maturity discrimination threshold, the maturity and moisture content of edible fungi are input into the grasping strategy response sub-layer to obtain the grasping response parameter sequence; the grasping response parameter sequence includes grasping force and gripper angle.
[0027] Specifically, the multimodal recognition model further includes an adaptive fine-tuning layer; the construction process of the multimodal recognition model also includes:
[0028] On the preset edible fungus detection-grabbing platform, in response to the first early warning response strategy parameters, the second early warning response strategy parameters, and the grabbing response parameter sequence, the response delay parameters, grabbing damage rate, and the sample quantity of spoiled edible fungi within a preset time length after the edible fungus is harvested are obtained in real time.
[0029] Based on response delay parameters, capture damage rate, detection confidence, moisture content regression loss, and discrimination accuracy, a fine-tuned response damage function is constructed. When the sample size of spoiled edible fungi within a preset time period is greater than the preset fine-tuning sample size, the response damage function is fine-tuned based on the enhanced edible fungi image data, enhanced edible fungi infrared multi-band data, and temperature, humidity, and distance data under the corresponding timestamps. The adaptive decision layer is then fine-tuned through the adaptive fine-tuning layer to obtain the fine-tuned multimodal recognition model.
[0030] Specifically, the second texture extraction branch extracts the surface texture distribution map of edible fungi, including:
[0031] Acquire enhanced edible fungi image data after Kalman filter preprocessing under greenhouse spray, strong light irradiation and sudden temperature change interference scenarios;
[0032] The enhanced edible fungus image data is subjected to an adaptive grayscale conversion that includes reflection suppression and water mist attenuation compensation, and image enhancement processing with dynamically adjustable parameters is performed to obtain a preprocessed grayscale image of edible fungus.
[0033] Based on the preprocessed grayscale image of edible fungi, the grayscale co-occurrence matrix method is used to extract global texture features and obtain an initial texture feature vector containing contrast, energy, entropy and correlation parameters.
[0034] Based on the preprocessed grayscale image of edible fungi, a local binary mode algorithm that is insensitive to changes in illumination is used to extract local texture features to resist surface highlight artifacts, and the local texture features are added to the initial texture feature vector to generate a supplemented texture feature vector.
[0035] Specifically, the second texture extraction branch extracts the surface texture distribution map of edible fungi, and also includes:
[0036] The supplemented texture feature vector is then subjected to compensatory normalization processing in conjunction with the ambient temperature and humidity data at the time of acquisition, in order to eliminate feature baseline drift caused by sudden environmental changes and obtain an environmentally robust standardized texture feature vector.
[0037] The environmentally robust normalized texture feature vector is mapped to a two-dimensional image space to generate a surface texture distribution map of edible fungi that characterizes the surface texture difference distribution.
[0038] Based on statistical methods and a prior texture knowledge base, a dynamic texture distribution uniformity threshold associated with the interference scene is set for the texture distribution distribution map of the edible fungi. Abnormal area detection and removal are performed to filter out abnormal texture areas caused by water mist residue, high-light overexposure and condensation artifacts, and obtain effective texture distribution information.
[0039] The effective texture distribution information and the corresponding environmentally robust standardized texture feature vector are output as a texture distribution map of edible fungi surface that can be used for multimodal fusion judgment in complex environments.
[0040] Specifically, obtaining the preprocessed grayscale image of edible fungi includes:
[0041] Highlight region detection is performed based on enhanced edible fungus image data to obtain the highlight mask matrix;
[0042] Reflectance component estimation and suppression are performed based on the specular mask matrix and enhanced edible fungus image data to obtain image data after reflection suppression.
[0043] Dark channel prior estimation is performed based on image data after reflection suppression to obtain water mist attenuation coefficient map;
[0044] Water mist attenuation compensation is performed based on the water mist attenuation coefficient map and the image data after reflection suppression to obtain preliminary compensated image data;
[0045] Adaptive weighted grayscale conversion is performed based on preliminary compensated image data and environmental sensor data to obtain an adaptive grayscale image;
[0046] Image enhancement based on adaptive grayscale image and environmental sensor data with dynamic parameter adjustment is used to obtain preprocessed grayscale images of edible fungi.
[0047] Specifically, the supplemented texture feature vector is generated, including:
[0048] Based on the preprocessed grayscale image of edible fungi, the calculation radius and the number of sampling points for defining the circular sampling neighborhood are set;
[0049] Based on each pixel in the preprocessed grayscale image of edible fungi and its set sampling parameters, the initial local binary mode code of the pixel is obtained, including: taking the grayscale value of the pixel as the center intensity; uniformly sampling within its circular neighborhood to obtain the grayscale values of multiple neighboring pixels; comparing the grayscale value of each neighboring pixel with the center intensity one by one; if the grayscale value of the neighboring pixel is greater than or equal to the center intensity, the corresponding binary bit is assigned a value of one, otherwise it is assigned a value of zero; after traversing all sampling points, a binary sequence is obtained as the initial code;
[0050] Based on the initial local binary pattern encoding, the corresponding rotation-invariant encoding value is obtained, including: treating the binary sequence as a cyclic string, generating all possible cyclic shift sequences through cyclic shift operations, and calculating the decimal value corresponding to each sequence; selecting the minimum value from all decimal values, and defining the minimum value as the rotation-invariant local binary pattern encoding value of the current pixel;
[0051] Traverse all pixels of the preprocessed grayscale image of edible fungi and repeatedly perform the initial local binary mode encoding and rotation invariant encoding process to obtain a local texture feature encoding map with the same size as the input image.
[0052] Based on the local texture feature coding map, a set of local texture statistical feature parameters are obtained, including: calculating a one-dimensional statistical histogram of the pixel values corresponding to all pixels in the local texture feature coding map, and extracting three preset statistical quantities, energy, entropy and variance, as feature parameters from the histogram.
[0053] Based on the set of local texture statistical feature parameters and the initial texture feature vector, the fused texture feature vector is obtained.
[0054] Compared with the prior art, the beneficial effects of the present invention are:
[0055] This invention addresses the shortcomings of existing technologies by systematically solving core challenges in the industrialized harvesting of edible fungi through multimodal sensor fusion and anti-interference optimization design. In particular, the system overcomes the limitations of traditional appearance inspection by directly quantifying the chitin content of the stipe and internal mold metabolites using short-wave infrared spectroscopy, enabling accurate judgment of maturity and early warning of latent mold growth, fundamentally improving quality control and food safety assurance capabilities. Secondly, by rapidly inverting moisture content through spectral analysis and combining it with cap morphological characteristics, the invention provides adaptive gripping force and angle parameters for the robotic arm, effectively reducing... The system reduces the crushing damage rate of mushrooms with low moisture content, thereby minimizing losses. Furthermore, it achieves high-precision synchronization of multi-source data through Kalman filtering and introduces dynamic environmental compensation algorithms for greenhouse spraying, strong light, and sudden temperature changes, ensuring the robustness and stability of data acquisition and feature extraction in complex industrial environments. In addition, the model's built-in adaptive decision-making and online fine-tuning mechanisms can continuously optimize decision parameters based on feedback such as actual harvesting damage rate and response delay, enabling the system to have self-evolution and long-term adaptability, significantly improving the automation, precision, and intelligence of harvesting operations. Attached Figure Description
[0056] Figure 1 This is a block diagram of the edible fungus detection system based on shortwave infrared multi-band fusion in Embodiment 1 of the present invention;
[0057] Figure 2 This is a flowchart illustrating the construction process of the multimodal recognition model in Embodiment 1 of the present invention. Detailed Implementation
[0058] Example 1
[0059] Please see Figure 1 One embodiment of the present invention provides an edible fungus detection system based on short-wave infrared multi-band fusion, comprising:
[0060] The acquisition module is used to acquire multimodal data of edible fungi using a configured sensor array under optimized synchronization mechanism at a preset transmission speed. The multimodal data of edible fungi includes image data, infrared multi-band data of edible fungi, and environmental data. The environmental data includes the temperature and humidity of the acquisition environment and the fixed working distance between the camera or light source and the surface of the mushroom being measured.
[0061] In this embodiment, the system presets the conveyor belt speed to 0.8 meters per second. To accurately acquire multi-dimensional information about edible fungi, the system integrates a data acquisition array composed of various specialized sensors. The core of this array includes: a short-wave infrared camera using an indium gallium arsenide sensor, with a spectral response range covering 900 to 1700 nanometers, a resolution of 640×512 pixels, and a frame rate of 60 frames per second, used to capture characteristic spectra reflecting the internal chemical components of mushrooms (such as chitin in the stipe and internal mold); a 20-megapixel RGB color camera, using a global shutter and operating synchronously at 60 frames per second, specifically used for high-definition capture of the external morphological features of mushrooms (such as the open cap state); and a dual-band ring active light source, integrating 850-nanometer visible light and 1300-nanometer short-wave infrared excitation light. The former is used for stable morphological imaging under complex lighting conditions, while the latter, due to its strong penetrability to water mist, is specifically used to excite and acquire the characteristic spectra of substances inside mushrooms. To ensure the physical consistency and comparability of the collected data, the system incorporates temperature and humidity sensors and distance sensors for environmental compensation. The former corrects for the impact of environmental temperature and humidity changes on the spectral baseline and water molecule absorption peaks, while the latter eliminates light intensity differences caused by minute positional fluctuations by real-time monitoring of the precise distance between the mushroom and the sensing module, thus normalizing the intensity of the spectral signal. Furthermore, all sensors in this embodiment work collaboratively through a precise synchronization mechanism: the encoder pulses of the conveyor belt are used as a unified trigger signal, ensuring that the short-wave infrared camera and the RGB color camera expose the same mushroom sample simultaneously, strictly controlling the spatiotemporal alignment error between the two to within 1 millisecond. This provides a highly consistent spatiotemporal foundation for subsequent multimodal data fusion. During the research and development and testing process, in order to enhance the robustness of the system in actual complex production environments, this application specifically simulated three typical interference scenarios: greenhouse spray (low visibility and water mist interference), strong light irradiation (high ambient light noise), and sudden temperature changes (sensor drift and changes in material properties). Through active testing and algorithm optimization under these extreme conditions, the entire system can not only work under ideal conditions, but also overcome on-site interference and stably output high-quality morphology, internal composition, and environmental compensation data. Ultimately, this lays a solid and reliable data foundation for achieving high-precision maturity judgment, latent mold warning, and adaptive harvesting mechanics control.
[0062] The detection module obtains a sequence of edible fungi response information based on multimodal data of edible fungi combined with a preset multimodal recognition model; the sequence of edible fungi response information includes at least the detection accuracy of maturity, moisture content and mold probability.
[0063] Please see Figure 2 It should be further explained that the construction process of the multimodal recognition model in this embodiment includes:
[0064] A1. Setting scene enhancement parameters: Based on the preset transmission speed and scene enhancement parameters, the SWIR camera and RGB camera are triggered by the conveyor belt encoder pulse to simultaneously acquire edible fungus image data and edible fungus infrared multi-band data, and mark the corresponding scene label codes. It should be further noted that this embodiment is based on the three scenarios of greenhouse spray, strong light irradiation and sudden temperature change set above. The specific scene parameters are set by those skilled in the art according to the set detection accuracy requirements and the scene setting experience corresponding to historical data acquisition, which will not be elaborated here. It should also be noted that in this embodiment, manual labeling is performed by those skilled in the art.
[0065] A2. Simultaneously, the configured temperature and humidity sensors and distance sensors are used to collect temperature and humidity data of the target scene and distance data of the SWIR camera and RGB camera corresponding to the edible mushroom bed.
[0066] A3. The collected edible fungus image data, edible fungus infrared multi-band data, temperature and humidity data, and distance data are input into a Kalman filter for time alignment and enhancement preprocessing to obtain the preprocessed enhanced edible fungus image data, enhanced edible fungus infrared multi-band data, and temperature and humidity data and distance data; it should be further explained that the time alignment and enhancement preprocessing process disclosed in this embodiment includes:
[0067] A301. Based on preset conveyor belt speed, simulated greenhouse spraying, strong light irradiation, and sudden temperature change enhancement parameters, as well as initial synchronous acquisition data, the mathematical forms and specific coefficients of the state equation and observation equation of the Kalman filter are determined. The state equation construction parameters include the feature dimension of the edible fungus image data, the spectral dimension of the edible fungus infrared multi-band data, the temporal variation coefficient of the temperature and humidity data, and the spatial fluctuation coefficient of the distance data. The observation equation construction parameters are matched with the actual acquisition accuracy and data transmission delay characteristics of the shortwave infrared camera, RGB color camera, temperature and humidity sensor, and distance sensor. The initial state vector value of the Kalman filter consists of the measured values of the edible fungus image data, edible fungus infrared multi-band data, temperature and humidity data, and distance data acquired during the first synchronous trigger acquisition.
[0068] A303. Obtain the time interval between continuous pulse signals of the conveyor belt encoder, and calculate the theoretical displacement of the edible fungus sample between two adjacent acquisition times based on the preset conveyor belt transmission speed; based on the theoretical displacement, dynamically correct the state transition matrix in the state equation of the Kalman filter, so that the state prediction process of the system can be associated with the actual spatial position change of the edible fungus on the conveyor belt, and provide a spatial motion correlation basis for the time alignment of subsequent multi-source data.
[0069] A304. The image data of edible fungi, the infrared multi-band data of edible fungi, the temperature and humidity data, and the distance data actually collected by the short-wave infrared camera, the RGB color camera, the temperature and humidity sensor, and the distance sensor during the current acquisition period are jointly constructed into the current observation vector of the Kalman filter; at the same time, based on the conveyor belt encoder pulse time that triggered this data acquisition, a precise acquisition timestamp is recorded for each data item in the observation vector;
[0070] A305. The state prediction layer of the Kalman filter, combined with the optimal state estimate obtained by A307 in the previous acquisition cycle and the state transition matrix corrected by A303, calculates and outputs the state prediction vector for the current acquisition cycle. The state prediction vector includes the predicted edible fungus image feature value, edible fungus infrared multi-band spectral value, temperature and humidity prediction value, and distance prediction value at the current moment.
[0071] A306. Calculate the difference between the observation vector constructed in step A304 and the state prediction vector obtained in step A305; solve for the Kalman gain at the current moment based on the preset sensor noise covariance matrix and process noise covariance matrix; wherein, the sensor noise covariance matrix is determined according to the factory calibration accuracy parameters of each sensor and the measurement error statistics in the actual test environment; the process noise covariance matrix is obtained by calibration based on historical test data under three typical interference scenarios: greenhouse spraying, strong light irradiation, and sudden temperature change.
[0072] A307. Using the Kalman gain calculated by A306, the state prediction vector obtained by A305 is weighted and corrected to obtain the optimal state estimate for the current acquisition cycle. This optimal state estimate enables the mathematical fusion and alignment of edible fungus image data, edible fungus infrared multi-band data, temperature and humidity data, and distance data with different acquisition timestamps to a unified theoretical acquisition time defined by the conveyor belt encoder pulse, thereby eliminating the time difference caused by hardware acquisition delay, communication transmission delay, and small fluctuations in the position of edible fungus.
[0073] Based on the optimal state estimate obtained from A307, the enhancement processing module at the back end of the Kalman filter performs noise suppression and edge enhancement operations on the edible fungus image data, spectral baseline correction and characteristic absorption peak enhancement operations on the edible fungus infrared multi-band data, and moving average smoothing processing on the temperature, humidity and distance data. Finally, the enhanced edible fungus image data, enhanced edible fungus infrared multi-band data, processed temperature and humidity data and processed distance data are output.
[0074] This process is based on the publicly available Kalman filter algorithm framework. It constructs a state-space model that integrates the physical characteristics of multiple sensors and dynamically corrects the state transition relationships using conveyor belt motion information. Its core principle lies in statistically fusing and correcting asynchronous, noisy sensor observation data into a unified spatiotemporal reference frame through a recursive optimal estimation process of "prediction-update." This method not only continuously optimizes state estimation using observation residuals and noise characteristics to achieve high-precision time alignment, but also further improves the quality of each modality's data through subsequent enhancement modules, thus providing a consistent and reliable data foundation for subsequent feature extraction and fusion decisions.
[0075] The multimodal recognition model includes an infrared band extraction layer, an image extraction layer, an environmental feature extraction layer, a mold detection layer, an adaptive decision layer, and an adaptive fine-tuning layer; the infrared band extraction layer includes a first band extraction branch, a second band extraction branch, and a third band extraction branch; the image extraction layer includes a first geometry extraction branch and a second texture extraction branch; the adaptive decision layer includes a first discrimination sublayer, a maturity detection sublayer, a second discrimination sublayer, and a grasping strategy response sublayer;
[0076] A4. Input the enhanced edible fungus image data into the image extraction layer, call the configured first geometric extraction branch to extract the feature of the ratio of cap curvature radius to stipe height of edible fungus, quantify the morphological maturity of edible fungus, and simultaneously call the configured second texture extraction branch to extract the surface texture distribution map of edible fungus.
[0077] It should be further explained that the process of extracting the ratio of cap curvature radius to stipe height of edible fungi in the first geometric extraction branch of this embodiment includes:
[0078] A401. Obtain the enhanced edible fungus image data after Kalman filter preprocessing, and perform the publicly disclosed weighted average grayscale conversion algorithm on the image data to convert it into a grayscale image; then, use the publicly disclosed adaptive threshold segmentation algorithm to process the grayscale image, separate the edible fungus target area and the background area, and obtain a binarized image containing only the edible fungus area.
[0079] A402. Perform a publicly disclosed morphological opening operation on the binarized image to remove minute noise points and burr interference in the image; then, use a publicly disclosed edge contour extraction algorithm to obtain the complete edge contour of the edible fungus from the processed binarized image; from all the extracted contours, select closed contours as the base contours for subsequent geometric feature extraction.
[0080] A403. Based on the basic contour, the cap region and stipe region are divided in its internal area using a publicly available region growing algorithm; a typical gray value range and texture uniformity threshold are set for the cap region; the largest connected region in the basic contour whose gray value meets the typical gray value range and whose texture features meet the texture uniformity threshold is marked as the cap region; and the remaining connected regions in the basic contour other than the cap region are marked as the stipe region.
[0081] A404. Extract the edge pixels of the cap region to form a cap outline point set; use the publicly available least squares method to perform arc fitting on the outline point set, and solve for the center coordinates and radius value of the best fitted arc. This radius value is the curvature radius of the edible mushroom cap.
[0082] A405. Within the stipe region, search for the highest and lowest points of the stipe region in the vertical direction along the image vertical direction, and use them as the upper and lower boundary points of the stipe; calculate the pixel distance between the upper and lower boundary points in the image coordinate system; based on the mapping relationship between the image pixel resolution and the actual physical size pre-calibrated by the camera, convert the pixel distance into the actual stipe height.
[0083] A406. Calculate the ratio of the cap radius of curvature to the stipe height of the edible fungus to obtain the ratio of cap radius of curvature to stipe height; input the ratio into a preset morphological maturity mapping model, the model establishes the correspondence between the ratio and the maturity level, and outputs a corresponding morphological maturity quantification value.
[0084] A407. Anomaly detection is performed on the extracted cap radius of curvature, stipe height, and ratio of cap radius of curvature to stipe height of edible fungi. An outlier detection method based on the statistical three sigma principle is used to remove feature values that exceed the preset reasonable range and retain effective morphological feature parameters. The effective morphological feature parameters are used as the output of the first geometric extraction branch.
[0085] It should be further explained that the first geometric extraction branch of this embodiment is based on the preprocessed enhanced edible fungus image data. It achieves accurate positioning of the target area of edible fungus through image segmentation and contour extraction. Then, it obtains the cap curvature radius and stipe height by means of arc fitting and boundary detection, respectively. The key feature reflecting the growth status of edible fungus is obtained by ratio calculation. This feature is directly related to morphological maturity. By quantifying the ratio and mapping it to the maturity dimension, the degree of morphological development of edible fungus can be intuitively characterized, providing reliable geometric feature support for multimodal recognition models to fuse morphological information to achieve high-precision maturity judgment.
[0086] It should be further explained that the process of extracting the surface texture distribution map of edible fungi by the second texture extraction branch in this embodiment includes:
[0087] A411. Acquire enhanced edible fungi image data after Kalman filter preprocessing under greenhouse spray, strong light irradiation and sudden temperature change interference scenarios;
[0088] A412. Perform adaptive grayscale conversion on the enhanced edible fungus image data, including reflection suppression and water mist attenuation compensation, and perform image enhancement processing with dynamically adjustable parameters to obtain a preprocessed grayscale image of edible fungus.
[0089] It should be further explained that the process of obtaining the preprocessed grayscale image of edible fungi in this embodiment includes:
[0090] A4121, based on enhanced edible fungus image data, perform highlight region detection and obtain the highlight mask matrix. Specifically, based on the input enhanced edible fungus image data, extract the red, green and blue channel image data respectively.
[0091] For each of the red, green, and blue color channel image data, its pixel intensity histogram is calculated, and based on a preset percentage threshold set in the distribution of each histogram, the bright pixel region in each color channel image data is identified.
[0092] The highlighted pixel regions identified from the red, green, and blue color channel image data are subjected to a logical AND operation to obtain an initial set of highlight regions;
[0093] A morphological closing operation is performed on the initial set of specular regions to connect adjacent specular regions that are broken due to noise or brightness fluctuations, ultimately generating a binarized specular mask matrix.
[0094] This step is based on the physical phenomenon that specular reflection is universally enhanced across the entire visible light spectrum. Specular reflection typically causes an abnormal increase in pixel intensity across all three RGB color channels simultaneously. By using a preset percentage threshold for the histogram distribution, abnormally bright pixels in each channel can be stably separated. By performing a logical AND operation, false highlight interference caused only by the object's inherent color or noise in a single color channel can be eliminated, ensuring that the detected area is a genuine specular reflection point. The subsequent morphological closing operation is a publicly available image processing technique used to smooth region boundaries and connect small discontinuities, thereby generating a complete and accurate binarized mask of the highlight region.
[0095] A4122, based on the specular mask matrix and enhanced edible fungus image data, performs reflectance component estimation and suppression to obtain the image data after reflectance suppression, specifically:
[0096] The generated specular mask matrix is applied to the enhanced edible fungus image data;
[0097] For a pixel that is marked as a highlight region in the highlight mask matrix, select the neighboring pixels that are not marked as highlight regions around it, and extract the color and intensity information of the neighboring pixels as samples;
[0098] Based on the samples, a spatially continuous function model is constructed using the radial basis function interpolation algorithm, and the model is used to reconstruct the color and intensity information that the pixels in the highlight region should have.
[0099] Replace the original overexposure values of the pixels in the highlight area with the reconstructed color and intensity information;
[0100] For pixels that are not marked as highlight areas in the highlight mask matrix, their original recorded color and intensity information is fully preserved.
[0101] Through the above process, image data after reflection suppression, which eliminates specular reflection interference, is finally obtained.
[0102] This process is based on the principles of image spatial continuity and neighboring pixel similarity. Overexposure of highlights caused by specular reflection can lead to the loss of local pixel information, but the actual texture and color information of this area are usually highly correlated with its normally exposed neighboring areas. Radial basis function interpolation, as a publicly available mathematical tool, can utilize known color and intensity values from surrounding non-highlight pixels to construct a smooth spatial function, predicting and filling in the lost information in the highlight areas. This achieves visually plausible image inpainting, providing a higher-quality input image for subsequent processing steps.
[0103] A4123, based on the image data after reflection suppression, performs prior estimation of the dark channel to obtain the water mist attenuation coefficient map, specifically:
[0104] The image data after reflection suppression is converted from RGB color space to HSV color space, and the saturation channel data and brightness channel data are extracted respectively.
[0105] Based on the brightness channel data, the dark channel prior principle is used to calculate the minimum brightness value of each pixel neighborhood within a set local window, thereby preliminarily estimating the preliminary transmittance data of ambient light in the scene.
[0106] At the same time, the preliminary transmittance data is corrected by combining the saturation channel data. Specifically, the preliminary transmittance is positively adjusted according to the level of saturation, with the transmittance value of the high saturation region being enhanced.
[0107] Through the above joint estimation and correction process, a water mist attenuation coefficient map that accurately corresponds to the spatial location of the image is finally obtained. This water mist attenuation coefficient map characterizes the degree of non-uniform attenuation caused by water mist in different areas of the image.
[0108] The core principle of this process lies in fusing dark channel priors and color saturation information to achieve accurate estimation of the degree of water mist attenuation. The dark channel prior is based on observations of at least one color channel with extremely low brightness values in local areas of a fog-free image, estimating preliminary transmittance through the brightness channel to reflect fog concentration. However, in bright or highly saturated object areas, this prior may fail, leading to an underestimation of transmittance. Therefore, a saturation channel is introduced for correction, as the scattering effect of water mist reduces the saturation of scene colors; thus, high-saturation areas indicate a weaker impact from water mist attenuation. By combining these two physical cues for joint estimation, the inherent bright areas of the scene can be more reliably distinguished from the brightness diffusion areas caused by fog, thereby generating a more accurate water mist attenuation coefficient map, providing a crucial basis for subsequent precise defogging compensation.
[0109] A4124, based on the water mist attenuation coefficient map and the image data after reflection suppression, performs water mist attenuation compensation to obtain preliminary compensated image data, specifically:
[0110] The water mist attenuation coefficient map obtained from A4123 is applied to the image data after reflection suppression obtained from A4122, specifically as follows:
[0111] Based on the water mist imaging physical model, the red, green, and blue channels in the image data after reflection suppression are inversely compensated using the water mist attenuation coefficient map. It should be further noted that the water mist imaging physical model in this embodiment was constructed by those skilled in the art based on the dark channel prior defogging algorithm combined with the water mist attenuation coefficient map.
[0112] The inverse compensation operation restores the intensity components of the light scattered and absorbed by the water mist in each color channel, specifically:
[0113] Step 1: Read the water mist attenuation coefficient map and the image data after reflection suppression, wherein the image data after reflection suppression includes RGB color channel information;
[0114] Step 2: Extract the transmittance value corresponding to each pixel position from the water mist attenuation coefficient map; at the same time, estimate the ambient light value representing the global atmospheric illumination intensity from the brightness information of the image data after reflection suppression.
[0115] Step 3: For each pixel in the image, calculate the observed intensity values of the pixel in the red, green, and blue channels according to the inverse formula of the atmospheric scattering physical model; the calculation process uses the transmittance value corresponding to the pixel extracted in Step 2 and the ambient light value.
[0116] Step 4: Through the calculations in Step 3, the original scene radiation intensity components before being scattered and absorbed by the water mist are recovered pixel by pixel and color channel by color channel.
[0117] Step 5: Recombine the intensity components of all pixels after they have been restored in each color channel to generate and output the preliminary compensated image data after water mist attenuation compensation.
[0118] The core of this step is to perform the inverse operation of the classical atmospheric scattering model. This publicly available model represents a foggy image as the result of the original scene radiation intensity being attenuated by transmittance and then mixed with ambient light. This method directly reverses the mathematical model using the estimated transmittance (water fog attenuation coefficient map) and ambient light value, thereby resolving and recovering the theoretical intensity value of each color channel before attenuation from the observed foggy image data, and realizing the quantitative removal of the water fog degradation effect.
[0119] Output the preliminary compensated image data after the above water mist attenuation compensation processing.
[0120] This process is based on a publicly available physical model for water mist imaging (atmospheric scattering model) and performs inverse calculations. This model represents the observed foggy image as a mixture of the original scene's radiance intensity attenuated by atmospheric transmittance and ambient light. In this method, the water mist attenuation coefficient map characterizes the spatial distribution of transmittance. By substituting this coefficient map into the model's inverse formula, each color channel of the image data after reflection suppression is solved independently. This allows for the estimation and recovery of the scene's original radiance intensity from the water mist-degraded image, effectively offsetting the light attenuation and contrast reduction caused by greenhouse sprays, and providing clearer image data for subsequent processing.
[0121] The A4125 performs adaptive weighted grayscale conversion based on preliminary compensated image data and environmental sensor data to obtain an adaptive grayscale image. Specifically:
[0122] Step 1: Read the preliminary compensated image data and the synchronously acquired ambient light intensity data. The preliminary compensated image data includes red channel image data, green channel image data and blue channel image data.
[0123] Step 2: Based on the ambient light intensity data, dynamically calculate the weight coefficients of the red, green, and blue color channels through a preset mapping relationship between light intensity and channel weights; wherein, when the ambient light intensity data exceeds the set strong light threshold, the mapping relationship automatically reduces the weight coefficients of the color channels that are sensitive to changes in light intensity.
[0124] Step 3: Multiply the red, green, and blue channel weighting coefficients by the intensity value of each pixel in the corresponding color channel of the preliminary compensated image data, respectively, and sum the three weighted results at the same pixel position to convert the pixel into a single-channel grayscale intensity value.
[0125] Step 4: Repeat the previous step for all pixels to finally obtain the complete adaptive grayscale image.
[0126] This process utilizes a publicly available weighted average grayscale algorithm and extends its weight adaptability. Its core principle lies in using ambient light intensity as prior information to dynamically adjust the contribution ratio of different color channels in grayscale conversion. Since different wavelengths of light exhibit different sensor response characteristics under varying lighting conditions—for example, short-wavelength channels are more prone to saturation or fluctuation under strong light—by reducing the weight of sensitive channels in real time, grayscale value deviations introduced by lighting changes can be suppressed, thereby generating a grayscale image with stronger lighting robustness, providing a foundation for subsequent stable texture analysis. The weighted summation and mapping relationship adjustments used are well-known techniques in image processing.
[0127] A4126, image enhancement based on adaptive grayscale image and environmental sensor data with dynamic parameter adjustment, to obtain preprocessed grayscale images of edible fungi, specifically:
[0128] Step 1, acquire input image data and environmental sensor data: use an adaptive grayscale image as input image data, and simultaneously acquire temperature and humidity sensor data and ambient light intensity data collected synchronously.
[0129] Step 2, adjust the spatial smoothing parameters based on humidity data and the edge protection parameters based on temperature data, specifically: based on the raw data stream output by the temperature and humidity sensor, analyze and separate the independent ambient humidity data stream and ambient temperature data stream;
[0130] Based on the real-time values in the environmental humidity data stream, a predefined humidity-spatial domain variance mapping function is invoked to calculate and obtain the spatial domain variance parameters required by the bilateral filtering algorithm under the current humidity conditions; the mapping function ensures that the output parameter values are positively correlated with the environmental humidity values;
[0131] Based on the real-time values in the ambient temperature data stream, the pre-generated temperature-color gamut variance calibration reference table is queried to determine and obtain the color gamut variance parameters that the bilateral filtering algorithm needs to use to optimize edge preservation under the current temperature conditions.
[0132] Based on the obtained spatial domain variance parameters and color domain variance parameters, the core computing unit of the bilateral filter is configured, and a complete bilateral filtering operation is performed on the input image data to finally obtain intermediate image data with effectively suppressed noise.
[0133] This step uses ambient temperature and humidity sensor data as the feedforward control signal for a publicly available bilateral filtering algorithm. Its core principle lies in the fact that the spectral characteristics of image noise change under high humidity conditions. By parameterizing the humidity to increase the spatial domain variance, the filter's smoothing ability for low-frequency water mist noise can be specifically enhanced. Simultaneously, temperature changes may cause subtle alterations to the optical reflectivity of the target surface, thus affecting the grayscale gradient of edge regions. By dynamically fine-tuning the color domain variance through temperature lookup, the filter's edge detection threshold can be adaptively calibrated, thereby maintaining the fidelity of texture feature extraction under complex environmental disturbances.
[0134] Step 3, constrain the contrast enhancement magnitude based on illumination intensity data, specifically as follows:
[0135] Based on the noise-suppressed intermediate image data, the input image to be processed is obtained; based on the synchronously acquired ambient light intensity sensor data, the real-time light intensity value is obtained.
[0136] The real-time light intensity value is compared with a preset first light intensity threshold and a second light intensity threshold. When the real-time light intensity value is greater than the first light intensity threshold, it is determined to be an excessively strong light condition. When the real-time light intensity value is less than the second light intensity threshold, it is determined to be an excessively weak light condition. Otherwise, it is determined to be a normal light condition. Based on this determination, the current light condition category is obtained.
[0137] Based on the current lighting condition category, the clipping and limiting parameters of the contrast-limited adaptive histogram equalization processing unit are dynamically adjusted. Specifically, when the lighting condition category is excessively strong or excessively weak lighting, the value of the clipping and limiting parameter is set to a first lower value according to a preset mapping relationship; when the lighting condition category is normal lighting, the value of the clipping and limiting parameter is set to a second higher value; thereby obtaining the final clipping and limiting parameters adapted to the current ambient lighting.
[0138] Based on the final cropping and limiting parameters, the contrast-limited adaptive histogram equalization processing unit is driven to calculate the input image to be processed, and obtain the final output image data after contrast optimization.
[0139] This step involves quantifying and categorizing ambient light intensity in real time, dynamically selecting and applying different parameter sets to a publicly available contrast-limited adaptive histogram equalization algorithm. The core principle is that excessively strong or weak lighting distorts the inherent contrast distribution of an image scene, and using fixed enhancement parameters amplifies distortion. This method actively limits the drastic grayscale changes in local areas by identifying extreme lighting scenes and switching to more conservative parameters (lower cropping). This improves image visibility while effectively avoiding enhancement artifacts introduced by ambient light interference, ensuring the accuracy and robustness of subsequent image feature extraction.
[0140] A413. Based on the preprocessed grayscale image of edible fungi, global texture features are extracted using the grayscale co-occurrence matrix method to obtain an initial texture feature vector containing contrast, energy, entropy and correlation parameters.
[0141] It should be further explained that the process of extracting global texture features using the gray-level co-occurrence matrix method in this embodiment includes:
[0142] A4131. Based on the preprocessed grayscale image of edible fungi, control parameters for generating a grayscale co-occurrence matrix are set. The control parameters include the number of grayscale levels, the calculation step size, and the angles in four directions: 0 degrees, 45 degrees, 90 degrees, and 135 degrees.
[0143] A4132. Based on the preprocessed grayscale image of edible fungi and the set control parameters, for each pixel in the image, along the four set directions and with the set calculation step size, find the neighboring pixels in the corresponding directions; count the frequency of the grayscale value of the center pixel and the grayscale values of the neighboring pixels in each direction co-occurring at the set grayscale level, and construct grayscale co-occurrence matrices in the four directions respectively.
[0144] A4133. Based on the generated gray-level co-occurrence matrices in four directions, calculate the four statistical parameters of contrast, energy, entropy and correlation for each matrix, and obtain the feature parameter set corresponding to each of the four directions.
[0145] A4134. Based on the feature parameter groups corresponding to the four directions, calculate the arithmetic mean of each statistical parameter type in the four directions to obtain the four global statistical features: global average contrast, global average energy, global average entropy, and global average correlation.
[0146] A4135. Based on the four global statistical features, they are combined according to a preset feature arrangement order to construct an initial texture feature vector;
[0147] A4136. Output the initial texture feature vector as data characterizing the global texture features of the edible fungus surface.
[0148] This process is based on a publicly available gray-level co-occurrence matrix (GLCM) texture analysis algorithm. It extracts texture features by quantifying the joint probability distribution of pixel pairs under specific spatial relationships and gray levels in an image. Its core principle lies in capturing the directionality and spatial patterns of the texture by calculating the GLCM in different directions and extracting statistics. By averaging and fusing features from multiple directions, a rotation-robust global texture description can be obtained. Contrast reflects the clarity and depth of the texture, energy characterizes the uniformity of the texture, entropy indicates the complexity and randomness of the texture, and correlation measures the directionality and linear dependence of the texture. This method ultimately generates a comprehensive feature vector that integrates information from multiple directions, providing a stable and reliable basis for subsequent quality assessment based on texture dimensions.
[0149] A414. Based on the preprocessed grayscale image of edible fungi, a local binary mode algorithm that is insensitive to changes in illumination is used to extract local texture features to resist surface highlight artifacts, and the local texture features are added to the initial texture feature vector to generate a supplemented texture feature vector.
[0150] It should be further explained that the process of extracting local texture features using a local binary mode algorithm that is insensitive to changes in illumination, in order to resist surface specular artifacts, includes:
[0151] A4141. Based on the preprocessed grayscale image of edible fungi, set the calculation radius and the number of sampling points for defining the circular sampling neighborhood;
[0152] A4142. Based on each pixel in the preprocessed grayscale image of edible fungi and its set sampling parameters, obtain the initial local binary mode code for that pixel. Specifically, the grayscale value of the pixel is used as the center intensity; the grayscale values of multiple neighboring pixels are uniformly sampled within its circular neighborhood; the grayscale value of each neighboring pixel is compared with the center intensity one by one. If the grayscale value of the neighboring pixel is greater than or equal to the center intensity, the corresponding binary bit is assigned a value of one; otherwise, it is assigned a value of zero; after traversing all sampling points, a binary sequence is obtained as the initial code.
[0153] A4143. Based on the initial local binary pattern encoding, obtain its corresponding rotation-invariant encoding value, specifically: treat the binary sequence as a cyclic string, generate all possible cyclic shift sequences through cyclic shift operations, and calculate the decimal value corresponding to each sequence; select the minimum value from all decimal values, and define the minimum value as the rotation-invariant local binary pattern encoding value of the current pixel.
[0154] A4144. Traverse all pixels of the preprocessed grayscale image of edible fungi and repeatedly execute the initial local binary mode encoding and rotation-invariant encoding process to obtain a local texture feature encoding map with the same size as the input image. Specifically:
[0155] Step 1: Select each pixel in the preprocessed grayscale image of edible fungi as the current pixel to be processed.
[0156] Step 2: For the current pixel to be processed, perform an initial local binary mode encoding process to obtain the initial local binary mode encoding of the pixel;
[0157] Step 3: Perform a rotation-invariant encoding value conversion process on the current pixel to be processed to obtain the rotation-invariant local binary mode encoding value of the pixel;
[0158] Step four: Assign the rotation-invariant local binary pattern encoding value obtained in step three to the pixel in the output local texture feature encoding map that has the same spatial position as the current pixel to be processed.
[0159] Step 5: Repeat steps 1 to 4 until all pixels in the preprocessed grayscale image of edible fungi have been processed, and finally obtain an image with the same height and width as the input image. This image is the local texture feature encoding map, where the grayscale value or numerical value of each pixel is its corresponding rotation-invariant local binary mode encoding value.
[0160] A4145. Based on the local texture feature coding map, a set of local texture statistical feature parameters are obtained, specifically: a one-dimensional statistical histogram of the pixel values corresponding to all pixels in the local texture feature coding map is calculated, and three preset statistical quantities, energy, entropy and variance, are extracted from the histogram as feature parameters.
[0161] A4146. Based on the set of local texture statistical feature parameters and the initial texture feature vector, obtain the fused texture feature vector; the specific method is: add the local texture statistical feature parameters as supplementary data to the end of the initial texture feature vector to form a comprehensive feature vector with expanded dimensions.
[0162] This process is based on a publicly available rotation-invariant local binary pattern algorithm. It generates codes by comparing the relative grayscale relationships between neighboring pixels and the center pixel, ensuring the features are inherently invariant to uniform illumination changes. Furthermore, a normalization operation using cyclic shifting to minimize the value further enhances the robustness of the features to image rotation. This process effectively resists local brightness anomalies caused by strong light illumination and stably captures the surface's micro-texture structure. The extracted statistical feature parameters are fused with global texture features, providing a more comprehensive and stable texture dimension input for the multimodal recognition model.
[0163] A415. The supplemented texture feature vector is combined with the ambient temperature and humidity data at the time of acquisition for compensatory normalization processing to eliminate feature baseline drift caused by sudden environmental changes and obtain an environmentally robust standardized texture feature vector.
[0164] It should be further explained that the process of compensatory normalization in this embodiment, which combines the ambient temperature and humidity data at the time of collection, includes:
[0165] Based on the supplemented texture feature vector and its acquisition time timestamp, strictly synchronized ambient temperature and humidity data are read from the system data cache.
[0166] Based on the ambient temperature and humidity data, a pre-generated and stored environmental compensation model is invoked to obtain the theoretical environmental drift compensation amount corresponding one-to-one with each feature dimension in the texture feature vector. The environmental compensation model is established through laboratory calibration, which establishes a mapping relationship from environmental data to the baseline drift amount of each feature dimension.
[0167] Based on the original feature values of each dimension in the supplemented texture feature vector and their corresponding theoretical environmental drift compensation, an element-wise subtraction operation is performed to obtain the intermediate feature vector after environmental baseline correction.
[0168] Based on the intermediate feature vector after environmental baseline correction, the maximum-minimum normalization algorithm is used to process it to obtain an environmentally robust standardized texture feature vector.
[0169] This process introduces a laboratory-calibrated environmental compensation model to quantify and subtract the systematic and predictable interference caused by changes in environmental temperature and humidity during image acquisition. The core principle is that environmental changes lead to a global baseline shift in texture features. By using the compensation model to predict and eliminate this shift caused by environmental covariates, the features are then normalized to reflect their numerical range, resulting in a final feature vector that more purely reflects the object's inherent properties. This significantly improves the stability of features under changing environments and the generalization ability of subsequent models. The environmental compensation models used (such as lookup tables, linear or multinomial regression models) and the max-min normalization algorithm are all publicly available existing algorithms.
[0170] A416. Map the environmentally robust normalized texture feature vector to a two-dimensional image space to generate a surface texture distribution map of edible fungi for characterizing the surface texture difference distribution.
[0171] It should be further explained that this embodiment maps the environmentally robust standardized texture feature vector to a two-dimensional image space, including: First, based on the total number of dimensions of the feature vector, calculating and determining the pixel size of a two-dimensional rectangular space, such that its total number of pixels is not less than the length of the feature vector, and defining a zero-value filling strategy for possible redundant pixel positions; Next, in the order of row-first and column-later, filling each numerical element in the feature vector into the corresponding pixel position of the two-dimensional grid to form the original feature value matrix; Then, performing linear normalization on all values in the matrix, mapping them to the standard eight-bit grayscale range of 0 to 255, thereby converting each feature value into the corresponding pixel grayscale value, generating a grayscale image matrix; Finally, encoding this grayscale image matrix into a standard image format file, outputting a texture distribution map of edible fungi surface that intuitively displays the texture feature intensity and spatial distribution pattern. The principle of this method is to use publicly queryable spatial gridding and linear scaling transformation algorithms to reconstruct a one-dimensional numerical feature sequence into a two-dimensional visual image, so that the statistical differences of texture features can be spatially visualized in the form of grayscale contrast, thereby assisting subsequent image segmentation or anomaly detection algorithms in qualitative or quantitative analysis.
[0172] A417. For the surface texture distribution map of the edible fungi, based on statistical methods and a prior texture knowledge base, a dynamic texture distribution uniformity threshold associated with the interference scene is set, and abnormal area detection and removal are performed to specifically filter out abnormal texture areas caused by water mist residue, high light overexposure and condensation artifacts, so as to obtain effective texture distribution information.
[0173] A418. Output the effective texture distribution information and the corresponding environment-robust standardized texture feature vector as a texture distribution map of edible fungi surface that can be used for multimodal fusion judgment in complex environments.
[0174] A5. Input the enhanced edible fungi infrared multi-band data into the infrared band extraction layer, call the configured first band extraction branch to extract the first infrared band features, and calculate the absorption depth of the first infrared band to quantify the chitin content of edible fungi.
[0175] It should be further explained that the absorption depth of the first infrared band calculated in this embodiment includes:
[0176] A501. Based on the enhanced edible fungi infrared multi-band data, call the first band extraction branch configured in the infrared band extraction layer, and extract the first infrared band spectral reflectance data with a center wavelength of 1210 nanometers from the enhanced edible fungi infrared multi-band data in the first band extraction branch.
[0177] A502. Perform spectral preprocessing on the first infrared band spectral reflectance data, and use a continuum removal algorithm to correct the background baseline of the original spectral reflectance curve to obtain a normalized spectral reflectance curve.
[0178] A503. Based on the normalized spectral reflectance curve, identify the minimum reflectance point near the 1210 nm wavelength and confirm this point as the target absorption peak position.
[0179] A504. Based on the normalized reflectance value at the target absorption peak position, calculate the absorption depth of the first infrared band; the specific calculation formula for the absorption depth is: the absorption depth equals one minus the normalized reflectance value at the target absorption peak position.
[0180] A505. Output the calculated absorption depth value as the first infrared band feature used to quantify the chitin content in the stipe of edible fungi.
[0181] This process is based on publicly available continuum removal algorithms and absorption depth calculation models in spectral analysis. Its core principle lies in the characteristic absorption of chitin in the stipe tissue of edible fungi near a wavelength of 1210 nm in the short-wave infrared spectrum. The intensity of this absorption directly reflects the concentration of chitin. By extracting a narrowband spectrum centered at this wavelength and using the continuum removal algorithm to eliminate the influence of spectral baseline drift, the depth of this characteristic absorption peak can be accurately located and calculated. This absorption depth value is positively correlated with chitin content, thus providing a direct and quantitative internal chemical indicator for judging the maturity of edible fungi.
[0182] A6. Call the configured second band extraction branch to extract the features of the second infrared band, calculate the reflectance slope of the second infrared band, and combine it with the second infrared band-moisture content mapping table to invert the moisture content of edible fungi and the moisture content regression loss.
[0183] It should be further explained that the water content and water content regression loss of edible fungi obtained by inversion in this embodiment include:
[0184] A601, based on the enhanced edible fungi infrared multi-band data, calls the second band extraction branch configured in the infrared band extraction layer to extract the second infrared band spectral reflectance data with a center wavelength of 1450 nanometers from the data;
[0185] A602. The second infrared band spectral reflectance data extracted from A601 is smoothed using the Savitzky-Golay filtering algorithm to suppress random noise and obtain the smoothed second infrared band spectral reflectance curve.
[0186] A603. On the smoothed second infrared band spectral reflectance curve obtained in A602, a wavelength range centered at 1450 nm and extended 15 nm to the left and right is selected as the characteristic calculation range. The spectral reflectance data points within this characteristic calculation range are linearly fitted using the least squares method to obtain a fitted straight line. The slope of this fitted straight line is calculated and used as the slope of the second infrared band reflectance.
[0187] A604, call the pre-generated and stored second infrared band-moisture content mapping table, input the second infrared band reflectance slope value calculated in A603 into the mapping table, and obtain the corresponding predicted value of edible fungus moisture content by table lookup or interpolation; the mapping table records the correspondence between the second infrared band reflectance slope value and the moisture content of edible fungus.
[0188] A605, obtain the laboratory measured true value of the moisture content of the edible fungi; compare the predicted value of the moisture content of the edible fungi obtained in A604 with the measured true value, and calculate the difference between the two; use the mean square error formula to calculate the difference and obtain the moisture content regression loss value;
[0189] This process is based on publicly available Savitzky-Golay filtering, least-squares linear fitting, and lookup table mapping algorithms. Its core principle lies in the strong absorption band of water molecules near the 1450 nm wavelength in the short-wave infrared spectrum, causing a significant downward trend in the reflectance curve at this wavelength. The higher the water content of edible fungi, the stronger this absorption effect, and the greater the absolute value of the downward slope of the reflectance curve in this region. By accurately calculating the reflectance slope of this characteristic wavelength band and utilizing the slope-water content mapping relationship established beforehand through extensive sample calibration, rapid and lossless inversion of water content can be achieved. The calculated regression loss value is used to assess the confidence of a single prediction or for model optimization.
[0190] A7. Simultaneously call the third band extraction branch to extract the features of the third infrared band and calculate the decrease in reflectance of the third infrared band to identify the characteristics of mold metabolites.
[0191] It should be further explained that in the quality and safety control of edible fungi, timely detection and removal of individuals that have undergone biochemical deterioration but have no visible mold spots on the surface is a key challenge, which constitutes the core motivation of this technical solution. The establishment of this process is based on a clear physicochemical principle: microorganisms that cause mold growth in edible fungi (such as Aspergillus flavus) synthesize and accumulate specific secondary metabolites, such as various aflatoxins, during their growth and metabolism. The carbon-hydrogen bonds and amino bonds in the molecular structure of these compounds exhibit a significant and distinctive absorption band in the 1550 nm to 1650 nm wavelength range of the short-wave infrared spectrum. When edible fungi are irradiated with light carrying energy in this band, if mold metabolites are present inside, these substances selectively absorb the light energy in this characteristic band, causing an overall attenuation of the reflected light signal received by the detector in this band, manifested as a distinct "drop trough" in the reflectance curve. By precisely quantifying the overall decrease in reflectance within this characteristic band relative to the unabsorbed baseline (usually with reflectance at 1550 nm as a reference), a quantifiable spectroscopic index directly related to the concentration of internal mold metabolites can be established. Therefore, the fundamental purpose of detecting the decrease in reflectance in the 1550-1650 nm band is to transform the invisible, internal mold growth biochemical process into a physical signal that can be non-destructively, rapidly, specifically captured, and quantitatively measured by optical sensors, thereby achieving precise early warning of hidden food safety risks.
[0192] It should be further explained that the calculation of the decrease in reflectivity in the third infrared band in this embodiment includes:
[0193] A701, based on the enhanced edible fungi infrared multi-band data, synchronously calls the third band extraction branch configured in the infrared band extraction layer to extract the third infrared band spectral reflectance data with a wavelength range of 1550 nm to 1650 nm from the enhanced edible fungi infrared multi-band data.
[0194] A702: The third infrared band spectral reflectance data extracted from A701 is smoothed and denoised using a moving average filtering algorithm to obtain the smoothed third infrared band spectral reflectance curve.
[0195] A703, on the smoothed third infrared band spectral reflectance curve, the entire band range from 1550 nm to 1650 nm is defined as the feature calculation interval; the spectral reflectance value corresponding to the starting point of the feature calculation interval, i.e., the wavelength of 1550 nm, is defined as the reference reflectance value.
[0196] A704, iterate through the spectral reflectance values corresponding to all sampling wavelength points within the feature calculation interval, calculate the difference between the spectral reflectance value at each wavelength point and the reference reflectance value; find the largest value among all differences, and define the largest difference as the decrease in reflectance of the third infrared band.
[0197] A705 outputs the third infrared band reflectance decrease value calculated by A704 as the third infrared band feature for identifying mold metabolites inside edible fungi.
[0198] This process is based on publicly available spectral data analysis and moving average filtering algorithms. Its core principle is that when edible fungi become moldy, specific substances produced by their internal metabolism (such as certain aflatoxin derivatives) exhibit broad characteristic absorption in the 1550 nm to 1650 nm wavelength range of the short-wave infrared spectrum, resulting in a significant decrease in the overall reflectance of this range relative to the starting wavelength. By calculating the maximum decrease in reflectance within the entire characteristic range, the strength of this absorption effect can be effectively quantified. This characteristic value is significantly correlated with the concentration of internal mold metabolites, thus providing crucial spectroscopic evidence for early, latent mold warnings.
[0199] A8. Input the temperature and humidity data and distance data into the environmental condition extraction layer to obtain the environmental feature vector;
[0200] A9. The environmental feature vector, surface texture distribution map, reflectivity reduction of the third infrared band, and absorption depth of the first infrared band are combined with a preset first weighting coefficient and input into the mold detection layer to obtain the mold probability detection value and detection confidence level.
[0201] It should be further explained that the process of obtaining the first weighting coefficient in this embodiment includes:
[0202] A901 collects a historical sample set of edible fungi containing real labels of moldy state. For each historical sample, it extracts and obtains its corresponding environmental feature vector, surface texture distribution map, reflectance decrease of the third infrared band and absorption depth of the first infrared band to form the original multimodal feature set.
[0203] A902, the original multimodal feature set obtained by A901 is standardized; the environmental feature vector and the one-dimensional texture feature vector obtained by global average pooling transformation of the surface texture distribution map are processed by the Z-score standardization algorithm; the two scalar features, the reflectivity reduction magnitude of the third infrared band and the absorption depth of the first infrared band, are processed by the max-min normalization algorithm; all processed features and the real label of the moldy state together constitute the standardized training dataset.
[0204] A903, the first weight coefficient to be optimized is set to include four sub-weight coefficients, which correspond to the processed environmental feature vector, one-dimensional texture feature vector, reflectance reduction magnitude feature and absorption depth feature respectively; the optimization objective function is defined as the negative value of the mold detection F1 score of a logistic regression classifier trained on the weighted fusion feature based on the standardized training dataset;
[0205] A904 uses either particle swarm optimization or grid search to perform an iterative search within a predefined weight coefficient search space, with the objective function defined in A903 as the target, to find the optimal combination of weight coefficients that minimizes the objective function value.
[0206] A905, the optimal weight coefficient combination obtained from A904 search is used to perform performance verification on an independent verification dataset to ensure that its mold classification performance index meets the preset threshold; the final verified weight coefficient combination is saved as the preset first weight coefficient.
[0207] This process is based on publicly available standardized algorithms and optimized search algorithms. Its core principle lies in the fact that features from different sources (environment, texture, internal metabolites, tissue components) have varying indicative abilities and reliability in indicating the final mold state. By utilizing historical data with real labels and establishing an optimization framework aimed at final classification performance, the optimal weight allocation that most effectively integrates multimodal information and maximizes mold identification accuracy can be automatically learned. This replaces manual experience-based settings, improving the objectivity and optimality of the mold detection model.
[0208] A10. The mold probability detection value is input into the first discrimination sub-layer and compared with a preset first discrimination threshold. When the mold probability detection value is greater than the first discrimination threshold, the first early warning response strategy parameter is directly output. It should be further noted that the first discrimination threshold in this embodiment is set to 0.9.
[0209] A11. If the value is less than or equal to the first discrimination threshold, the ratio of the cap curvature radius to the stipe height of the edible fungus, the environmental feature vector, and the absorption depth of the first infrared band are input into the maturity detection sublayer to obtain the maturity of the edible fungus and the discrimination accuracy.
[0210] It should be further explained that the method for detecting the maturity and accuracy of edible fungi in this embodiment includes:
[0211] A1101, the ratio of the cap curvature radius to the stipe height of edible fungi, the environmental feature vector, and the absorption depth of the first infrared band are input into the maturity detection sublayer.
[0212] A1102, the input edible fungus cap curvature radius to stipe height ratio feature and environmental feature vector are processed by Z-score normalization algorithm, and the absorption depth of the first infrared band is processed by maximum-minimum normalization algorithm to obtain the normalized morphological features, environmental features and component features.
[0213] A1103, based on a historical sample dataset with real maturity labels, extracts the corresponding standardized morphological features, environmental features and component features; adopts a grid search algorithm, with the optimization objective of maximizing the macro average F1 score of maturity classification, to optimize three sets of initial weights corresponding to morphological features, environmental features and component features respectively; saves the optimal weight combination obtained by optimization as the second weight coefficient;
[0214] In step A1104, the standardized morphological features, environmental features, and component features obtained in A1102 are multiplied by the corresponding sub-weights in the second weight coefficients obtained in A1103, and then weighted summed to obtain a weighted fusion feature. This weighted fusion feature is then input into a pre-trained multi-class logistic regression classifier to obtain the maturity category probability distribution of edible fungi. The category corresponding to the highest probability value in the probability distribution is output as the maturity discrimination result of edible fungi.
[0215] A1105: Based on the maturity category probability distribution output by the multi-class logistic regression classifier in A1104, calculate the entropy value of the distribution; based on the pre-defined mapping relationship between the entropy value and the classification accuracy, convert the current entropy value into the corresponding expected classification accuracy, which is used as the discrimination accuracy for this judgment.
[0216] A12. The maturity of the edible fungi is input into the second discrimination sublayer and compared with a preset maturity discrimination threshold. When the maturity of the edible fungi is less than or equal to the maturity discrimination threshold, the second early warning response strategy parameter is output. It should be further noted that the maturity discrimination threshold in this embodiment is 0.8.
[0217] A13. When the maturity of the edible fungus exceeds the maturity threshold, the maturity and moisture content of the edible fungus are input into the grasping strategy response sublayer to obtain a grasping response parameter sequence; the grasping response parameter sequence includes grasping force and gripper angle; it should be further noted that the formula for calculating the grasping force F in this embodiment is: F=(1-MC i / 100)×(1- × (Unit: Newtons N) where MC i For the first i The moisture content (in %) of each edible fungus was measured with a control error of <0.05N. For the first i The maturity assessment score of each edible fungus. This is a maturity-weighted coefficient, set by those skilled in the art.
[0218] The process of obtaining the gripper angle in this embodiment includes:
[0219] Based on the enhanced edible fungus image data preprocessed by Kalman filter, the first geometric extraction branch in the morphological feature extraction layer is called to execute the image segmentation and contour fitting algorithm, extract the cap curvature radius and stipe height ratio features of edible fungi, and obtain the cap curvature radius value that characterizes the degree of cap opening and spatial bending morphology from it.
[0220] The system invokes a pre-generated and stored gripper angle mapping lookup table, using the obtained cap curvature radius value as the lookup key. The lookup table defines a mapping relationship from continuous curvature radius values to discrete gripper vertical deflection angles. This mapping relationship is calibrated through mechanical simulation and experiments to ensure that when the curvature radius is less than a preset first threshold, a negative angle command of -15 degrees is output; when the curvature radius is greater than a preset second threshold, a positive angle command of +5 degrees or zero degrees is output. This achieves adaptive avoidance and matching of the gripper posture to the cap shape. The first and second thresholds are specifically set by those skilled in the art based on historical harvesting data.
[0221] The vertical deflection angle instruction of the gripper obtained from the lookup table is output as the gripper angle control parameter in the gripping response parameter sequence generated by the gripping strategy response sub-layer.
[0222] A14. On the preset edible fungus detection-grabbing platform, in response to the first early warning response strategy parameters, the second early warning response strategy parameters and the grabbing response parameter sequence, the response delay parameters, grabbing damage rate and the sample quantity of spoiled edible fungi within a preset time length after the edible fungi are picked are obtained in real time.
[0223] A15. Based on response delay parameters, capture damage rate, detection confidence, moisture content regression loss, and discrimination accuracy, a fine-tuned response damage function is constructed. When the sample size of spoiled edible fungi within a preset time period is greater than the preset fine-tuning sample size, the response damage function is fine-tuned based on the enhanced edible fungi image data, enhanced edible fungi infrared multi-band data, and temperature, humidity, and distance data under the corresponding timestamps. The adaptive decision layer is then fine-tuned through the adaptive fine-tuning layer to obtain the fine-tuned multimodal recognition model.
[0224] The response module, in response to the edible fungus response information sequence satisfying a corresponding preset trigger condition, selects a response action corresponding to the trigger condition from an action set including at least two response strategies; the response strategies include a mold warning response strategy and a maturity grasping response strategy. It should be further noted that this embodiment uses a servo motor, a robotic arm, a pneumatic gripper, and an edible fungus detection-grabbing platform, combined with the edible fungus response information sequence, to perform real-time mold warning and grasping operations for edible fungi that have passed inspection.
[0225] This application, through modular design and multi-technology integration, constructs a multimodal detection and response system for edible fungi, demonstrating significant technical advantages and application value. Its beneficial effects stem from the precise solution of practical production pain points through core technological features, with clear logical derivation that aligns with industry needs. The acquisition module, serving as the data foundation, integrates a short-wave infrared camera, an RGB color camera, and temperature, humidity, and distance sensors to construct a multi-dimensional acquisition array. Combined with a precise synchronization mechanism triggered by a conveyor belt encoder pulse, it achieves precise spatiotemporal alignment of multimodal data. Simultaneously, it conducts active testing and algorithm optimization for typical complex scenarios such as greenhouse spraying, strong light irradiation, and sudden temperature changes. Coupled with the penetrating excitation of a dual-band ring active light source and the compensation calibration of environmental sensors, it effectively overcomes the problems of traditional single-sensor data acquisition being susceptible to environmental interference and exhibiting poor spatiotemporal consistency. This provides high-quality data support covering morphology, internal composition, and environmental conditions for subsequent analysis, significantly improving the system's robustness in actual production environments. The detection module, as the core support, employs a Kalman filter algorithm combined with conveyor belt motion information to dynamically correct the state transition matrix, achieving time alignment and noise suppression for multi-source data. Simultaneously, backend enhancement processing optimizes image edges and corrects spectral baselines, addressing industry pain points such as asynchronous multi-sensor data, noise, and baseline drift, laying a reliable foundation for feature extraction. The multimodal recognition model accurately extracts geometric features such as the cap curvature radius and stipe height ratio through the image extraction layer. Combined with reflection suppression, water mist attenuation compensation, and adaptive grayscale processing, it comprehensively captures surface texture information using a grayscale co-occurrence matrix and local binary mode algorithm. The infrared band extraction layer quantifies chitin content, moisture content, and mold metabolite characteristics through three dedicated branches. The environmental feature extraction layer integrates temperature, humidity, and distance information, forming a comprehensive feature system encompassing cover morphology, internal composition, and environmental influences. This effectively compensates for the judgment bias caused by traditional detection relying on only a single feature.
[0226] Based on this, the first and second weight coefficients are optimized offline using particle swarm optimization or grid search algorithms combined with historical labeled data, replacing manual experience settings to ensure the scientific and rational nature of feature fusion. The hierarchical discrimination mechanism of the mold detection layer and maturity detection layer achieves accurate early warning of latent mold and quantitative judgment of maturity, solving the core problems of traditional methods' difficulty in identifying internal mold and subjective maturity judgment. The adaptive decision layer outputs a hierarchical early warning response strategy based on the detection results. The grasping strategy response sublayer dynamically adjusts the grasping force and gripper angle according to maturity and moisture content, achieving adaptability to edible fungi of different qualities and significantly reducing the damage rate during harvesting. The adaptive fine-tuning layer constructs a fine-tuning response damage function based on parameters such as response delay, grasping damage rate, and detection confidence in actual operation, and continuously optimizes the model in combination with deteriorated sample data, effectively solving the model performance drift problem caused by environmental changes in long-term operation and ensuring the stability of the system's detection accuracy. The response module achieves accurate early warning of latent mold and maturity judgment through the coordinated operation of servo motors, robotic arms, and pneumatic grippers. The control system transforms detection results into precise early warnings and grasping actions, achieving closed-loop management from detection to execution. In summary, this application, through a technical chain of multi-sensor synchronous acquisition, precise preprocessing, full-dimensional feature extraction, intelligent weight optimization, hierarchical decision-making, and dynamic fine-tuning, effectively addresses industry pain points such as poor robustness of edible fungi detection in complex production environments, difficulty in identifying latent mold, inaccurate maturity judgment, and easy damage during grasping. It not only improves the accuracy and reliability of detection but also achieves intelligent collaboration between detection and harvesting, providing strong support for edible fungi quality control and intelligent production, and significantly improving production efficiency and product quality.
[0227] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments under the guidance of the present invention without departing from the spirit and scope of the claims. All of these variations are within the protection scope of the present invention.
Claims
1. An edible fungus detection system based on short-wave infrared multi-band fusion, characterized in that, include: The data acquisition module is used to acquire multimodal data of edible fungi using a configured sensor array with optimized synchronization mechanism at a preset transmission speed. The edible fungi multimodal data includes edible fungi image data, edible fungi infrared multiband data, and environmental data; the environmental data includes the temperature and humidity of the acquisition environment and the fixed working distance between the camera or light source and the surface of the mushroom being measured. The detection module obtains a sequence of edible fungi response information based on multimodal data of edible fungi combined with a preset multimodal recognition model; the sequence of edible fungi response information includes at least the detection accuracy of maturity, moisture content and mold probability. The response module, in response to the edible fungus response information sequence satisfying the corresponding preset trigger condition, selects a response action corresponding to the trigger condition from an action set including at least two response strategies; The response strategies include a mold early warning response strategy and a maturity capture response strategy. The construction process of the multimodal recognition model includes: The collected edible fungus image data, edible fungus infrared multi-band data, temperature and humidity data, and distance data are input into a Kalman filter for time alignment and enhancement preprocessing to obtain preprocessed enhanced edible fungus image data, enhanced edible fungus infrared multi-band data, and temperature, humidity, and distance data. The multimodal recognition model includes an infrared band extraction layer, an image extraction layer, an environmental feature extraction layer, and a mold detection layer. The image extraction layer includes a first geometric extraction branch and a second texture extraction branch. The enhanced edible fungus image data is input into the image extraction layer. The configured first geometric extraction branch is invoked to extract the ratio of the cap curvature radius to the stipe height feature, and simultaneously, the configured second texture extraction branch is invoked to extract the surface texture distribution map of the edible fungus. The second texture extraction branch extracts the surface texture distribution map of the edible fungus, including: Acquire enhanced edible fungi image data after Kalman filter preprocessing under greenhouse spray, strong light irradiation and sudden temperature change interference scenarios; The enhanced edible fungus image data is subjected to an adaptive grayscale conversion that includes reflection suppression and water mist attenuation compensation, and image enhancement processing with dynamically adjustable parameters is performed to obtain a preprocessed grayscale image of edible fungus. Based on the preprocessed grayscale image of edible fungi, the grayscale co-occurrence matrix method is used to extract global texture features and obtain an initial texture feature vector containing contrast, energy, entropy and correlation parameters. Based on the preprocessed grayscale image of edible fungi, a local binary mode algorithm is used to extract local texture features to resist surface highlight artifacts, and the local texture features are added to the initial texture feature vector to generate a supplemented texture feature vector.
2. The edible fungus detection system based on short-wave infrared multi-band fusion as described in claim 1, characterized in that, The construction process of the multimodal recognition model also includes: Set scene enhancement parameters, and based on the preset transmission speed and scene enhancement parameters, trigger the SWIR camera and RGB camera through the conveyor belt encoder pulse to simultaneously collect edible fungus image data and edible fungus infrared multi-band data and mark the corresponding scene label code; Simultaneously, the configured temperature and humidity sensors and distance sensors are used to collect temperature and humidity data of the target scene, as well as distance data of the SWIR camera and RGB camera corresponding to the mushroom bed.
3. The edible fungus detection system based on short-wave infrared multi-band fusion as described in claim 2, characterized in that, The infrared band extraction layer includes a first band extraction branch, a second band extraction branch, and a third band extraction branch; The construction process of the multimodal recognition model also includes: The enhanced infrared multi-band data of edible fungi is input into the infrared band extraction layer, the configured first band extraction branch is called to extract the first infrared band features, and the absorption depth of the first infrared band is calculated.
4. The edible fungus detection system based on short-wave infrared multi-band fusion as described in claim 3, characterized in that, The construction process of the multimodal recognition model also includes: The second infrared band features are extracted by calling the configured second band extraction branch, the reflectance slope of the second infrared band is calculated, and the moisture content and moisture content regression loss of edible fungi are obtained by combining the second infrared band-moisture content mapping table. Simultaneously call the third band extraction branch to extract the features of the third infrared band and calculate the decrease in reflectance of the third infrared band; The temperature and humidity data and distance data are input into the environmental condition extraction layer to obtain environmental feature vectors; The environmental feature vector, surface texture distribution map, reflectance reduction of the third infrared band, and absorption depth of the first infrared band are combined with a preset first weighting coefficient and input into the mold detection layer to obtain the mold probability detection value and detection confidence level.
5. The edible fungus detection system based on short-wave infrared multi-band fusion as described in claim 4, characterized in that, The multimodal recognition model further includes an adaptive decision layer; the adaptive decision layer includes a first discrimination sublayer, a maturity detection sublayer, a second discrimination sublayer, and a capture strategy response sublayer; The construction process of the multimodal recognition model also includes: The mold probability detection value is input into the first discrimination sublayer and compared with a preset first discrimination threshold. When the mold probability detection value is greater than the first discrimination threshold, the first early warning response strategy parameter is directly output. If the value is less than or equal to the first discrimination threshold, the ratio of the cap curvature radius to the stipe height of the edible fungus, the environmental feature vector, and the absorption depth of the first infrared band are input into the maturity detection sublayer to obtain the maturity of the edible fungus and the discrimination accuracy. The maturity of the edible fungi is input into the second discrimination sublayer and compared with a preset maturity discrimination threshold. When the maturity of the edible fungi is less than or equal to the maturity discrimination threshold, the second early warning response strategy parameters are output. When the maturity of edible fungi is greater than the maturity discrimination threshold, the maturity and moisture content of edible fungi are input into the grasping strategy response sub-layer to obtain the grasping response parameter sequence; the grasping response parameter sequence includes grasping force and gripper angle.
6. The edible fungus detection system based on short-wave infrared multi-band fusion as described in claim 5, characterized in that, The multimodal recognition model further includes an adaptive fine-tuning layer; the construction process of the multimodal recognition model also includes: On the preset edible fungus detection-grabbing platform, in response to the first early warning response strategy parameters, the second early warning response strategy parameters, and the grabbing response parameter sequence, the response delay parameters, grabbing damage rate, and the sample quantity of spoiled edible fungi within a preset time length after the edible fungus is harvested are obtained in real time. Based on response delay parameters, capture damage rate, detection confidence, moisture content regression loss, and discrimination accuracy, a fine-tuned response damage function is constructed. When the sample size of spoiled edible fungi within a preset time period is greater than the preset fine-tuning sample size, the response damage function is fine-tuned based on the enhanced edible fungi image data, enhanced edible fungi infrared multi-band data, and temperature, humidity, and distance data under the corresponding timestamps. The adaptive decision layer is then fine-tuned through the adaptive fine-tuning layer to obtain the fine-tuned multimodal recognition model.
7. The edible fungus detection system based on short-wave infrared multi-band fusion as described in claim 6, characterized in that, The second texture extraction branch extracts the surface texture distribution map of edible fungi, and also includes: The supplemented texture feature vector is then subjected to compensatory normalization processing in conjunction with the ambient temperature and humidity data at the time of acquisition, in order to eliminate feature baseline drift caused by sudden environmental changes and obtain an environmentally robust standardized texture feature vector. The environmentally robust normalized texture feature vector is mapped to a two-dimensional image space to generate a surface texture distribution map of edible fungi that characterizes the surface texture difference distribution. Based on statistical methods and a prior texture knowledge base, a dynamic texture distribution uniformity threshold associated with the interference scene is set for the texture distribution distribution map of the edible fungi. Abnormal area detection and removal are performed to filter out abnormal texture areas caused by water mist residue, high-light overexposure and condensation artifacts, and obtain effective texture distribution information. The effective texture distribution information and the corresponding environmentally robust standardized texture feature vector are output as a texture distribution map of edible fungi surface that can be used for multimodal fusion judgment in complex environments.
8. The edible fungus detection system based on short-wave infrared multi-band fusion as described in claim 7, characterized in that, Obtain the preprocessed grayscale image of edible fungi, including: Highlight region detection is performed based on enhanced edible fungus image data to obtain the highlight mask matrix; Reflectance component estimation and suppression are performed based on the specular mask matrix and enhanced edible fungus image data to obtain image data after reflection suppression. Dark channel prior estimation is performed based on image data after reflection suppression to obtain water mist attenuation coefficient map; Water mist attenuation compensation is performed based on the water mist attenuation coefficient map and the image data after reflection suppression to obtain preliminary compensated image data; Adaptive weighted grayscale conversion is performed based on preliminary compensated image data and environmental sensor data to obtain an adaptive grayscale image; Image enhancement based on adaptive grayscale image and environmental sensor data with dynamic parameter adjustment is used to obtain preprocessed grayscale images of edible fungi.
9. The edible fungus detection system based on short-wave infrared multi-band fusion as described in claim 8, characterized in that, Generate the supplemented texture feature vector, including: Based on the preprocessed grayscale image of edible fungi, the calculation radius and the number of sampling points for defining the circular sampling neighborhood are set; Based on each pixel in the preprocessed grayscale image of edible fungi and its set sampling parameters, the initial local binary mode code of the pixel is obtained, including: taking the grayscale value of the pixel as the center intensity; uniformly sampling within its circular neighborhood to obtain the grayscale values of multiple neighboring pixels; comparing the grayscale value of each neighboring pixel with the center intensity one by one; if the grayscale value of the neighboring pixel is greater than or equal to the center intensity, the corresponding binary bit is assigned a value of one, otherwise it is assigned a value of zero; after traversing all sampling points, a binary sequence is obtained as the initial code; Based on the initial local binary pattern encoding, the corresponding rotation-invariant encoding value is obtained, including: treating the binary sequence as a cyclic string, generating all possible cyclic shift sequences through cyclic shift operations, calculating the decimal value corresponding to each sequence, selecting the minimum value from all decimal values, and defining the minimum value as the rotation-invariant local binary pattern encoding value of the current pixel. Traverse all pixels of the preprocessed grayscale image of edible fungi and repeatedly perform the initial local binary mode encoding and rotation invariant encoding process to obtain a local texture feature encoding map with the same size as the input image. Based on the local texture feature coding map, a set of local texture statistical feature parameters are obtained, including: calculating a one-dimensional statistical histogram of the pixel values corresponding to all pixels in the local texture feature coding map, and extracting three preset statistical quantities, energy, entropy and variance, as feature parameters from the histogram. Based on the set of local texture statistical feature parameters and the initial texture feature vector, the fused texture feature vector is obtained.
Citation Information
Patent Citations
Mushroom house carbon dioxide adjusting method based on multi-mode growth stage recognition
CN120469491A
Edible mushroom quality nondestructive testing system based on deep learning
CN121353779A
Robot collaborative operation control method and system in edible mushroom planting process
CN121374656A