Method and system for detecting cracking ratio of rice based on multi-mode optical feature fusion
Through the rice waist blast detection method that combines three-stage light source irradiation and multimodal features, combined with adaptive gamma correction and Gabor filtering, the shortcomings of light robustness and feature extraction algorithms in the prior art are solved, and high-precision and efficient rice waist blast rate detection are achieved.
Patent Information
- Application Number
- CN202510612857.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-13
- Publication Date
- 2025-08-29
AI Technical Summary
The existing rice blasting waist detection technology has problems such as insufficient robustness of the lighting system, sensitivity to noise, and lack of adaptability to threshold segmentation methods, resulting in low detection accuracy and difficulty in adapting to dynamic production line environments.
A three-stage light source irradiation scheme is adopted to combine adaptive gamma correction, anisotropic diffusion filtering and multi-spectral Gabor filtering, and feature fusion and discrimination are combined with a lightweight convolutional network to achieve high-precision detection of rice waist rate.
It significantly improves detection accuracy and adaptability, and can efficiently identify micro cracks in dynamic production line environments to meet industrial inspection needs.
Smart Images

Figure CN120564032A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of rice optical detection methods, and in particular to a rice cracking rate detection method and system based on multimodal optical feature fusion. Background Art
[0002] Traditional methods for detecting rice cracking rely primarily on manual sensory inspection, which is subject to high subjectivity, low efficiency, and poor consistency. While automated detection techniques based on image processing have advanced in recent years, with wavelet transforms and visual recognition as key research areas, several technical bottlenecks remain.
[0003] Among existing technologies, the wavelet transform detection method proposed in Document 1, "Research on Rice Cracking Detection Technology Based on Wavelet Transform" (Huang Xingyi et al., 2004), extracts crack features through local maximum detection on a binary scale. While achieving an accuracy of 92%, the algorithm has significant limitations: 1) It relies on a specific lighting angle (parallel to the long axis of the unpolished rice), making stable lighting conditions difficult to achieve in actual production line environments; 2) The computational complexity of wavelet multi-scale fusion is high, placing stringent demands on hardware processing speed; and 3) It fails to effectively address pseudo-edge interference caused by specular reflections on the rice grain surface, resulting in a high false detection rate. Furthermore, this method fails to consider the need for graded detection of different cracking degrees, resulting in insufficient sensitivity to fine cracks.
[0004] While the OTSU-EDT watershed algorithm employed in Document 2, "Research on a Device for Detecting Rice Kernel Popping Rate Based on Visual Recognition Technology" (Li Jinqiong, 2023), improved counting accuracy to 98.3%, it still suffers from significant drawbacks: 1) The watershed algorithm is sensitive to initial markings and prone to over-segmentation when grains are highly adherent; 2) Morphological processing can distort crack morphology, particularly leading to a loss of accuracy in feature extraction of curved cracks; and 3) the fixed threshold strategy employed struggles to adapt to morphological differences across rice varieties, requiring frequent parameter adjustments. Experimental data show that the recognition rate for popped kernels is only 92%, demonstrating the lack of specificity of existing edge detection algorithms in complex textured backgrounds.
[0005] Existing technologies suffer from three common deficiencies: First, the illumination system lacks robustness. Reference 1 requires fiber optic illumination at a specific angle, while Reference 2 relies on a closed acquisition box, making both approaches unsuitable for dynamic production line environments. Second, feature extraction algorithms are sensitive to noise. Reference 1's wavelet denoising is less effective in low-contrast images, while Reference 2's median filtering blurs fine cracks. Finally, traditional threshold segmentation methods lack adaptability. Reference 1 uses a manually set gradient threshold, while Reference 2's OTSU algorithm fails in images with unclear bimodal peaks. This results in reduced detection stability in complex scenarios, such as irregularly shaped rice grains and damaged edges. These deficiencies severely restrict the widespread application of detection systems in industrial settings. Summary of the Invention
[0006] Purpose of the invention: In order to overcome the deficiencies in the prior art, the present invention provides a rice cracking rate detection method and system based on multimodal optical feature fusion, which has high detection accuracy and can distinguish between tiny cracks and texture interference problems.
[0007] Technical solution: To achieve the above-mentioned purpose, the present invention provides a method for detecting the cracked rice ratio based on multimodal optical feature fusion, the method comprising:
[0008] Control the upper and lower light sources to execute a three-stage light source illumination scheme during the image acquisition cycle and acquire images; specifically, in stage T1, only the upper light source is turned on; in stage T2, only the lower light source is turned on; in stage T3, both the upper and lower light sources are turned on simultaneously; each stage is accompanied by adjustments to the corresponding light source parameters;
[0009] Implement adaptive gamma correction on reflectance images acquired during the T1 phase:
[0010]
[0011] Where: γ(x,y) is the adaptive gamma correction coefficient; I1(x,y) is the pixel value at the coordinate (x,y) in the acquired image; is the gradient amplitude of the pixel at coordinate (x, y); σ is the local standard deviation of the a×a window centered on the target pixel, where a is an odd number; ∈ is the zero gradient overflow prevention constant, which can be 0.001, etc.
[0012] Perform edge-preserving denoising on transmission images collected at the T2 stage:
[0013]
[0014] in: represents the rate of change of the intensity of image I2 over time t; is the gradient operator; is the scale parameter in anisotropic diffusion filtering;
[0015] Perform multispectral texture feature extraction on the fused image collected at the T3 stage:
[0016]
[0017] Among them: G θ (x,y) is the Gabor filter response value of the pixel at (x,y); I3(u,v) is the input image pixel value; x′ and y′ are the rotation coordinate system; γ is the ellipticity; σ′ is the standard deviation of the Gaussian envelope; λ is the sine wavelength; ψ is the phase offset; θ is the filter direction angle;
[0018] Construct fusion features:
[0019] F(x,y)=K1·N(S2)+K2·N(S3)+K3·∑ θ ∣G θ (x,y)|·M θ (x,y);
[0020] Where: N(·) is the normalization operator; M θ is the directional mask matrix; N(S2) is the normalized result of the reflected image after adaptive gamma correction; N(S3) is the normalized result of the transmitted image after anisotropic diffusion filtering; ∑ θ ∣G θ (x,y)|·M θ (x, y) is the weighted sum of the multi-directional Gabor filter response amplitudes; K1, K2, and K3 are weighting coefficients;
[0021] A convolutional network is used to identify kernel burst and calculate the kernel burst rate. The fused features F(x, y) serve as the input to the convolutional network. In this step, the convolutional network determines whether each kernel in the image has burst. The kernel burst rate is then calculated based on the number of kernels with burst and the total number of kernels.
[0022] Furthermore, the controlling of the upper and lower light sources to execute a three-stage light source illumination scheme during the image acquisition cycle specifically includes:
[0023] In the T1 stage, the color temperature of the upper light source is adjusted based on the following formula:
[0024]
[0025] Where: C T1 is the color temperature; T is the image acquisition period, T1=0-0.2T; t is the current time;
[0026] In stage T2, the brightness of the lower light source is linearly increased to 150% of the reference value;
[0027] In the T3 stage, the color temperature of the upper light source is fixed at 5500K, and the color temperature of the lower light source is adjusted according to the following formula: The brightness ratio of the upper light source to the lower light source is 1:1.3.
[0028] Furthermore, in the T1 stage, the color temperature is mapped based on the color temperature-brightness contrast mapping model. Performing real-time optimization, the color temperature-brightness contrast mapping model is expressed as:
[0029]
[0030] Where Q(C) represents the contrast score, Q(C)∈(0,1), when C∈(-∞,+∞); C is the color temperature value of the light source; C0 is the reference color temperature; k0 is the sensitivity parameter.
[0031] Furthermore, the multispectral texture feature extraction of the fused image collected at the T3 stage includes:
[0032] Construct a four-scale eight-directional Gabor filter bank, specifically: wavelength λ∈{0.3W,0.5W,0.7W,0.9W}, direction angle θ=22.5°×k1(k1=0,1,…,7);
[0033] Calculate the phase congruency feature:
[0034]
[0035] Among them, E θ(x,y) is the local energy, A θ(x,y) is the amplitude, and ∈0 is the zero-proof constant.
[0036] Furthermore, the convolutional network uses depthwise separable convolutional layers and dynamic channel attention modules as basic architectural units, forming a multi-level feature extraction system by stacking them layer by layer. The depthwise separable convolutional layers use a computational mode that decouples space and channels to achieve lightweight feature encoding, while the dynamic channel attention module adaptively weights the convolution output features in the channel dimension, highlighting crack-related channels through weight recalibration. The two constitute the core loop unit for the network's underlying feature processing.
[0037] The convolutional network uses a multi-scale feature pyramid fusion structure as a macro-architecture framework, cross-layer fusion of shallow high-resolution features, mid-layer expanded receptive field features, and deep global semantic features extracted by the basic structural unit, and achieves multi-scale waist-explosion morphology matching and integration through operations such as dilated convolution and deformable convolution;
[0038] The loss function of the convolutional network is: L = 0.7·FocalLoss+0.3·DiceLoss;
[0039] Where: L is the total loss value;
[0040] FocalLoss is α is the category balance factor, γ0 is the focusing parameter;
[0041] DiceLoss is A is the predicted probability matrix, B is the true label matrix, and |·| represents the pixel-by-pixel summation.
[0042] A rice cracking rate detection system based on multimodal optical feature fusion includes a machine base and a control unit. The machine base integrates a material drop control mechanism, a rice grinding mechanism, a conveying mechanism, and an optical image acquisition mechanism. The control unit is connected to the optical image acquisition mechanism and is capable of implementing the above-mentioned rice cracking rate detection method.
[0043] The feeding quantity control mechanism is arranged just above the rice milling mechanism and is used to quantitatively transport rice grains to the rice milling mechanism;
[0044] The conveying mechanism is configured as a belt conveying structure for conveying the rice grains after being peeled by the rice milling mechanism to the optical image acquisition mechanism;
[0045] The optical image acquisition mechanism includes a light transmission detection platform, a camera and an upper light source above the light transmission detection platform, a lower light source below the light transmission detection platform, and a translation drive module that drives the detection platform. The upper light source is a ring light source, and the lower light source is a surface light source.
[0046] Beneficial effects: The rice cracking rate detection method and system based on multimodal optical feature fusion of the present invention have the following beneficial effects:
[0047] (1) The present invention dynamically adjusts the three-stage light source parameters to synchronously acquire reflection, transmission and fusion images within a single image acquisition cycle. Combined with the adaptive gamma correction algorithm, the visibility of cracks is greatly improved. Anisotropic diffusion filtering improves the signal-to-noise ratio of texture noise. Multispectral Gabor filtering effectively separates cracks from the inherent texture of rice grains. Combined with a lightweight network structure, high detection accuracy and single-frame processing speed are achieved to meet detection requirements.
[0048] (2) In the dual-light source collaborative imaging design of the T3 stage, the color authenticity of the surface reflection imaging is ensured by fixing the color temperature of the upper light source to 5500K neutral white light, and at the same time, dynamic color temperature adjustment (4500K~5000K) and a brightness ratio of 1:1.3 are implemented on the lower light source, thereby realizing multi-dimensional optical feature enhancement and cross-modal information complementation: the initial low color temperature of the surface light source preferentially excites the transmission diffraction effect of the cracks inside the rice grains, and the color temperature increases nonlinearly with the image acquisition process, accurately matching the optical response characteristics of cracks of different depths; the 1.3-fold brightness compensation overcomes the attenuation of the transmitted light path, balances the grayscale dynamic range of the transmitted image and the reflected image, and effectively improves the cross-modal consistency of the crack edge in the feature fusion stage.
[0049] (3) By establishing a dynamic mapping relationship between color temperature and crack contrast, combined with the reference color temperature sensitivity parameter, the color temperature of the light source can be intelligently adjusted, significantly improving the accuracy of crack detection and the system's adaptability to the detection of multiple varieties of rice.
[0050] (4) The convolutional network achieves lightweight feature encoding and channel dimension adaptive enhancement through the collaborative design of deep separable convolution and dynamic channel attention modules, significantly improving the signal-to-noise ratio of crack features. Based on the multi-scale feature pyramid fusion structure, it combines the expansion of the receptive field of void convolution and the matching of the crack bending shape with deformable convolution to accurately capture crack defects of different scales and shapes. The hybrid loss function of FocalLoss and Dice Loss is used to specifically solve the problems of sample imbalance and boundary fuzziness, and enhance the accuracy of small crack recognition and edge positioning. The overall architecture takes into account both real-time performance and detection accuracy through the hierarchical collaboration of lightweight computing, multi-scale perception and loss optimization, meeting the needs of efficient detection of rice cracking rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 This is the structural diagram of the rice cracking rate detection system based on multimodal optical feature fusion;
[0052] Figure 2 This is a flow chart of the rice cracking rate detection method based on multimodal optical feature fusion.
[0053] In the figure: 10-machine base; 1-material blanking control mechanism; 2-grain grinding mechanism; 3-conveyance mechanism; 4-optical image acquisition mechanism; 41-light transmission detection table; 42-camera; 43-upper light source; 44-lower light source; 45-translation drive module. DETAILED DESCRIPTION
[0054] The present invention will be further described below with reference to the accompanying drawings.
[0055] like Figure 1 The rice cracking rate detection system based on multimodal optical feature fusion shown in the figure includes a machine base 10 and a control unit. The machine base 10 is integrated with a material drop control mechanism 1, a rice grinding mechanism 2, a conveying mechanism 3, and an optical image acquisition mechanism 4. The control unit is connected to the optical image acquisition mechanism 4 and can implement the rice cracking rate detection method of the present invention.
[0056] The drop control mechanism 1 is arranged just above the rice milling mechanism 2 and is used to quantitatively transport rice grains to the rice milling mechanism;
[0057] The conveying mechanism 3 is configured as a belt conveying structure for conveying the rice grains after being peeled by the rice milling mechanism 2 to the optical image acquisition mechanism 4;
[0058] The optical image acquisition mechanism 4 includes a light transmission detection platform 41, a camera 42 and an upper light source 43 above the light transmission detection platform 41, a lower light source 44 below the light transmission detection platform 41, and a translation drive module 45 that drives the light transmission detection platform 41. The translation drive module 45 can cooperate with the movement of the conveying mechanism 3 so that the rice transported by the conveying mechanism 3 is spread flat on the upper surface of the light transmission detection platform 41. The upper light source 43 is a ring light source, and the lower light source 44 is a surface light source.
[0059] Based on the above rice cracking rate detection system, Figure 2 As shown, the rice cracking rate detection method based on multimodal optical feature fusion of the present invention includes the following steps S101-S106:
[0060] Step S101: Control the upper and lower light sources to execute a three-stage light source illumination scheme during the image acquisition cycle and acquire images. Specifically, during stage T1, only the upper light source is turned on; during stage T2, only the lower light source is turned on; during stage T3, both the upper and lower light sources are turned on simultaneously. Each stage is accompanied by adjustments to the corresponding light source parameters.
[0061] Step S102: Adaptive gamma correction is performed on the reflection image collected during the T1 phase:
[0062]
[0063] Where: γ(x,y) is the adaptive gamma correction coefficient; I1(x,y) is the pixel value at the coordinate (x,y) in the acquired image; is the gradient amplitude of the pixel at the coordinate (x, y); σ is the local standard deviation of the a×a window centered on the target pixel, a is an odd number, and its value can be 5 or 7; ∈ is the zero gradient overflow prevention constant, and its value can be 0.001, etc.
[0064] Step S103: performing edge-preserving noise reduction on the transmission image collected during the T2 phase:
[0065]
[0066] in: represents the rate of change of the intensity of image I2 over time t; is a gradient operator that characterizes the spatial variation direction and magnitude of pixel intensity; It is the scale parameter in anisotropic diffusion filtering. When the value of κ is too small, excessive noise will be retained; when the value of κ is too large, the risk of edge blurring will increase. is the nonlinear diffusion coefficient based on the gradient amplitude, which is used to control the diffusion intensity. Indicates the edge strength at the pixel point, and the crack area has a high gradient value;
[0067] Step S104: extract multispectral texture features from the fused image collected during the T3 phase.
[0068]
[0069] Among them: G θ (x, y) is the Gabor filter response value of the pixel at (x, y); I3(u, v) is the input image pixel value; x′ and y′ are the rotation coordinate systems, specifically: x′ = xcosθ + ysinθ, y′ = -xsinθ + ycosθ; γ is the ellipticity, which represents the elliptical shape parameter of the Gaussian envelope and can enhance directional selectivity; σ′ is the standard deviation of the Gaussian envelope; λ is the sine wavelength, which matches the crack spatial frequency; ψ is the phase offset; θ is the filter direction angle; is the Gaussian envelope term, is the harmonic component, which is a complex exponential function. The θ in the above formula allows the filter to match cracks of any orientation, such as transverse, longitudinal, and oblique cracks. The wavelength λ is graded according to the geometric progression {0.3W, 0.5W, 0.7W, 0.9W} to ensure that cracks of different widths can be captured. The Gaussian envelope term can effectively suppress the surface texture noise of rice grains and improve the signal-to-noise ratio.
[0070] Step S105: Construct fusion features:
[0071] F(x,y)=K1·N(S2)+K2·N(S3)+K3·∑ θ ∣G θ (x,y)|·M θ (x,y);
[0072] Where: N(·) is the normalization operator; M θ is the directional mask matrix; N(S2) is the normalized result of the reflected image after adaptive gamma correction; N(S3) is the normalized result of the transmitted image after anisotropic diffusion filtering; ∑ θ ∣G θ (x,y)|·M θ (x, y) is the weighted sum of the multi-directional Gabor filter response amplitudes; K1, K2, and K3 are weighting coefficients;
[0073] Step S106: Using a convolutional network to identify cracked seeds and calculate the cracked rate; the fused features F(x, y) serve as input to the convolutional network. In this step, the convolutional network determines whether each kernel in the image has cracked. The cracked rate is then calculated based on the number of cracked kernels and the total number of kernels.
[0074] The present invention dynamically adjusts the three-stage light source parameters to synchronously acquire reflection, transmission and fusion images within a single image acquisition cycle. Combined with an adaptive gamma correction algorithm, the visibility of cracks is greatly improved. Anisotropic diffusion filtering improves the signal-to-noise ratio of texture noise. Multispectral Gabor filtering effectively separates cracks from the inherent texture of rice grains. Combined with a lightweight network structure, high detection accuracy and single-frame processing speed are achieved to meet detection requirements.
[0075] Preferably, the control of the upper and lower light sources in step S101 to perform a three-stage light source illumination scheme during the image acquisition cycle specifically includes:
[0076] In the T1 stage, the color temperature of the upper light source is adjusted based on the following formula:
[0077]
[0078] in: is the color temperature; T is the image acquisition period, T1=0-0.2T; t is the current time; The color temperature is a time-modulated sine function that achieves smooth, periodic changes in color temperature, avoiding the impact of sudden step changes on camera exposure. 5000 is the base color temperature, ensuring basic lighting intensity and avoiding image color casts caused by extreme color temperatures. 1000 is the color temperature fluctuation amplitude, which amplifies feature differences through changes of ±1000K, making the reflective characteristics of cracks and background easier to distinguish.
[0079] In stage T2, the brightness of the lower light source is linearly increased to 150% of the reference value;
[0080] In the T3 stage, the color temperature of the upper light source is fixed at 5500K, and the color temperature of the lower light source is adjusted according to the following formula: The brightness ratio of the upper light source to the lower light source is 1:1.3.
[0081] In the dual-light source collaborative imaging design of the T3 stage, the color authenticity of the surface reflection imaging is ensured by fixing the color temperature of the upper light source at 5500K of neutral white light, and at the same time implementing dynamic color temperature adjustment (4500K~5000K) and a brightness ratio of 1:1.3 for the lower light source, thereby achieving multi-dimensional optical feature enhancement and cross-modal information complementarity: the initial low color temperature of the surface light source preferentially excites the transmission diffraction effect of the internal cracks of the rice grains, and the color temperature increases nonlinearly with the image acquisition process, accurately matching the optical response characteristics of cracks of different depths; the 1.3-fold brightness compensation overcomes the attenuation of the transmitted light path, balances the grayscale dynamic range of the transmitted image and the reflected image, and effectively improves the cross-modal consistency of the crack edge in the feature fusion stage.
[0082] Preferably, in the T1 stage, the color temperature is mapped based on the color temperature-brightness contrast mapping model. Performing real-time optimization, the color temperature-brightness contrast mapping model is expressed as:
[0083]
[0084] Where Q(C) represents the contrast score, Q(C)∈(0,1). When C∈(-∞,+∞), in practical applications, the color temperature range is typically 4000K to 6000K, in which case Q(C)∈[0.12,0.88]. C is the color temperature of the light source; C0 is the reference color temperature; and k0 is the sensitivity parameter, which controls the steepness of the function curve. A larger k0 indicates a more sensitive effect of color temperature changes on contrast. By adjusting C0 and k0, the model can be adapted to different rice varieties. For example, japonica rice requires a higher C0, while indica rice requires a lower C0.
[0085] In actual use, by limiting the optimal interval, such as Q(C)∈[0.6,0.8], the optimal color temperature range can be inferred, and the color temperature of the light source can be optimized accordingly.
[0086] By establishing a dynamic mapping relationship between color temperature and crack contrast, and combining it with the benchmark color temperature sensitivity parameters, intelligent adjustment of the light source color temperature can be achieved, significantly improving the accuracy of crack detection and the system's adaptability to detection of multiple rice varieties.
[0087] Preferably, the multispectral texture feature extraction of the fused image collected in the T3 stage in the above step S104 includes the following steps S201-S202:
[0088] Step S201: construct a four-scale eight-directional Gabor filter bank, specifically: wavelength λ∈{0.3W, 0.5W, 0.7W, 0.9W}, direction angle θ=22.5°×k1(k1=0, 1, …, 7);
[0089] Step S202: Calculate the phase consistency feature:
[0090]
[0091] Among them, E θ(x,y) is the local energy, A θ(x,y) is the amplitude, ∈0 is the zero-proof constant, in this embodiment, its value is 10 -6 .
[0092] The four-scale wavelength parameters cover the typical spatial frequency characteristics of rice cracking, the phase consistency calculation effectively eliminates the influence of light intensity changes, the eight-directional filtering can reduce the response intensity difference of cracks in any direction, and combined with the LAB color space conversion, the separation between the cracks and the background texture of rice grains can be greatly improved.
[0093] Preferably, the convolutional network uses a depthwise separable convolutional layer and a dynamic channel attention module as basic architecture units, and forms a multi-level feature extraction system by stacking them layer by layer. The depthwise separable convolutional layer uses a spatial and channel decoupled computing mode to achieve lightweight feature encoding, and the dynamic channel attention module performs adaptive weighting of the convolution output features in the channel dimension, and highlights crack-related channels through weight recalibration. The two constitute the core loop unit of the network's underlying feature processing;
[0094] The convolutional network uses a multi-scale feature pyramid fusion structure as a macro-architecture framework, cross-level fusion of shallow high-resolution features, mid-level expanded receptive field features, and deep global semantic features extracted by the basic structural unit, and achieves multi-scale crack waist morphology matching and integration through operations such as dilated convolution and deformable convolution. In the multi-scale feature pyramid fusion structure, 3×3 standard convolution is used in shallow features (512×512) to extract edge details, 5×5 dilated convolution is used to expand the receptive field to cover the full length of the crack in mid-level features (256×256), and 7×7 deformable convolution is introduced into deep features (128×128) to adaptively match the crack bending morphology. Finally, the cross-level feature weighted fusion significantly improves the intersection-over-union ratio of crack boundaries.
[0095] The loss function of the convolutional network is: L = 0.7·FocalLoss+0.3·DiceLoss;
[0096] Where: L is the total loss value;
[0097] FocalLoss is α is the category balance factor, γ0 is the focusing parameter;
[0098] DiceLoss is A is the predicted probability matrix, B is the true label matrix, and |·| represents the pixel-by-pixel summation.
[0099] This convolutional network achieves lightweight feature encoding and adaptive enhancement of channel dimensions through the collaborative design of depthwise separable convolution and dynamic channel attention modules, significantly improving the signal-to-noise ratio of crack features. Based on a multi-scale feature pyramid fusion structure, it combines dilated convolution to expand the receptive field and deformable convolution to match crack curvature, accurately capturing crack defects of varying scales and shapes. A hybrid loss function combining FocalLoss and DiceLoss specifically addresses sample imbalance and boundary ambiguity, enhancing the accuracy of microcrack identification and edge localization. The overall architecture, through the hierarchical collaboration of lightweight computing, multi-scale perception, and loss optimization, balances real-time performance with detection accuracy, meeting the requirements for efficient detection of rice crack rates.
[0100] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for detecting the cracked rice kernel rate based on multimodal optical feature fusion, the method comprising: Control the upper and lower light sources to execute the three-stage light source illumination scheme during the image acquisition cycle and acquire images; Specifically: in stage T1, only the upper light source is turned on; in stage T2, only the lower light source is turned on; in stage T3, both the upper and lower light sources are turned on at the same time; each stage is accompanied by the adjustment of the corresponding light source parameters; Implement adaptive gamma correction on reflectance images acquired during the T1 phase: Where: γ(x,y) is the adaptive gamma correction coefficient; I1(x,y) is the pixel value at the coordinate (x,y) in the acquired image; is the gradient amplitude of the pixel at coordinate (x, y); σ is the local standard deviation of the a×a window centered on the target pixel; ∈ is the zero gradient overflow prevention constant; Perform edge-preserving denoising on transmission images collected at the T2 stage: in: represents the rate of change of the intensity of image I2 over time t; is the gradient operator; is the scale parameter in anisotropic diffusion filtering; Perform multispectral texture feature extraction on the fused image collected at the T3 stage: Among them: G θ (x,y) is the Gabor filter response value of the pixel at (x,y); I3(u,v) is the input image pixel value; x′ and y′ are the rotation coordinate system; γ is the ellipticity; σ′ is the standard deviation of the Gaussian envelope; γ is the sine wavelength; ψ is the phase offset; θ is the filter direction angle; Construct fusion features: F(x,y)=K1·N(S2)+K2·N(S3)+K3·∑ θ ∣G θ (x,y)∣·M θ (x,y)? Where: N(·) is the normalization operator; M θ is the directional mask matrix; N(S2) is the normalized result of the reflected image after adaptive gamma correction; N(S3) is the normalized result of the transmitted image after anisotropic diffusion filtering; ∑ θ ∣G θ (x,y)|·M θ (x, y) is the weighted sum of the multi-directional Gabor filter response amplitudes; K1, K2, and K3 are weighting coefficients; A convolutional network is used to identify the burst waist and calculate the burst waist rate; the fusion feature F(x,y) is used as the input of the convolutional network.
2. The method for detecting the cracked rice ratio based on multimodal optical feature fusion according to claim 1, characterized in that: The control of the upper and lower light sources to perform a three-stage light source illumination scheme during the image acquisition cycle specifically includes: In the T1 stage, the color temperature of the upper light source is adjusted based on the following formula: in: is the color temperature; T is the image acquisition period, T1=0-0.2T; t is the current time; In stage T2, the brightness of the lower light source is linearly increased to 150% of the reference value; In the T3 stage, the color temperature of the upper light source is fixed at 5500K, and the color temperature of the lower light source is adjusted according to the following formula: The brightness ratio of the upper light source to the lower light source is 1:1.
3.
3. The method for detecting the cracked rice ratio based on multimodal optical feature fusion according to claim 2, characterized in that: In the T1 stage, the color temperature is mapped based on the color temperature-brightness contrast mapping model. Performing real-time optimization, the color temperature-brightness contrast mapping model is expressed as: Where Q(C) represents the contrast score, Q(C)∈(0,1), when C∈(-∞,+∞); C is the color temperature value of the light source; C0 is the reference color temperature; k0 is the sensitivity parameter.
4. The method for detecting rice cracking rate based on multimodal optical feature fusion according to claim 1, characterized in that: The multispectral texture feature extraction of the fused image collected at the T3 stage includes: Construct a four-scale eight-directional Gabor filter bank, specifically: wavelength λ∈{0.3W,0.5W,0.7W,0.9W}, direction angle θ=22.5°×k1(k1=0,1,…,7); Calculate the phase congruency feature: Among them, E θ(x,y) is the local energy, A θ(x,y) is the amplitude, and ∈0 is the zero-proof constant.
5. The method for detecting rice cracking rate based on multimodal optical feature fusion according to claim 1, characterized in that: The convolutional network uses depthwise separable convolutional layers and dynamic channel attention modules as basic architectural units, and forms a multi-level feature extraction system by stacking them layer by layer. The convolutional network uses a multi-scale feature pyramid fusion structure as a macro-architecture framework, cross-layer fusion of shallow high-resolution features, mid-layer expanded receptive field features, and deep global semantic features extracted by the basic structural units to achieve multi-scale waist-explosion morphology matching and integration; The loss function of the convolutional network is: L = 0.7·FocalLoss+0.3·DiceLoss; Where: L is the total loss value; FocalLoss is α is the category balance factor, γ0 is the focusing parameter; DiceLoss is A is the predicted probability matrix, B is the true label matrix, and |·| represents the pixel-by-pixel summation.
6. A rice cracking rate detection system based on multimodal optical feature fusion, characterized in that: The invention comprises a machine base and a control unit, wherein the machine base is integrated with a material drop control mechanism, a rice grinding mechanism, a conveying mechanism and an optical image acquisition mechanism; the control unit is connected to the optical image acquisition mechanism and is capable of implementing the rice cracking rate detection method according to any one of claims 1 to 5; The material dropping control mechanism is arranged just above the grain grinding mechanism; The conveying mechanism is configured as a belt conveying structure for conveying the rice grains after being peeled by the rice milling mechanism to the optical image acquisition mechanism; The optical image acquisition mechanism includes a light transmission detection platform, a camera and an upper light source above the light transmission detection platform, a lower light source below the light transmission detection platform, and a translation drive module for driving the light transmission detection platform to move.