Rape salt stress classification method based on 3D convolutional neural network
By combining a 3D convolutional neural network-based classification method for rapeseed salt stress with multiple technical means, the problems of insufficient feature extraction and class imbalance in traditional methods are solved, and high accuracy and stable classification of rapeseed salt stress state are achieved.
Patent Information
- Application Number
- CN202511915599.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-18
- Publication Date
- 2026-03-10
AI Technical Summary
Traditional classification methods for rapeseed salt stress rely on manual feature extraction and machine learning algorithms, which suffer from insufficient feature extraction, limited model performance, and class imbalance. They also struggle to effectively utilize the three-dimensional information of hyperspectral data, resulting in insufficient classification accuracy and robustness.
A rapeseed salt stress classification method based on 3D convolutional neural network is adopted. It combines a fusion channel attention mechanism, adaptive convolutional kernel size design and fully connected layer structure with residual connections, temperature-gray value linkage correction technology and salt stress sensitive band priority normalization technology to construct a hyperspectral data preprocessing pipeline. The model is optimized by validation set loss-gradient dual-factor learning rate adjustment and sample dynamic resampling-loss weighted fusion technology.
It significantly improves the classification accuracy and robustness of rapeseed under salt stress, enhances the accuracy and availability of hyperspectral data, and ensures stable classification performance of the model under different salt stress conditions.
Smart Images

Figure CN121640184A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of agricultural artificial intelligence, crop variety breeding, and rapeseed salt stress identification, specifically a rapeseed salt stress classification method based on 3D convolutional neural networks. Background Technology
[0002] With the acceleration of agricultural modernization, precision agriculture and smart agriculture have become key means to improve crop yield and quality. During the crop growth process, environmental stress such as salt stress poses a serious threat to crop growth and yield. As an important oil crop, rapeseed also often faces the challenge of salt stress during its growth process.
[0003] Traditional methods for classifying salt stress in rapeseed mainly rely on manual feature extraction and machine learning algorithms. These methods have several limitations when processing hyperspectral data. First, manual feature extraction often depends on expert knowledge and experience, making it difficult to comprehensively cover all salt stress-related features, resulting in insufficient feature extraction. Second, traditional machine learning algorithms are prone to the curse of dimensionality when processing high-dimensional hyperspectral data, leading to a decline in model performance. Furthermore, these methods typically ignore the spatial-spectral joint features in the data, failing to fully utilize the three-dimensional information of hyperspectral data, thus limiting the improvement of classification accuracy. More importantly, traditional methods often lack effective strategies when dealing with class imbalance problems, resulting in weak model recognition capabilities for a minority of classes.
[0004] To address the problems of insufficient feature extraction, limited model performance, and inadequate handling of class imbalance in traditional rapeseed salt stress classification methods, this invention proposes a rapeseed salt stress classification method based on 3D convolutional neural networks, which is of particular importance. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of existing technologies and provide a rapeseed salt stress classification method based on 3D convolutional neural networks. It can effectively improve the classification accuracy and robustness of the model for rapeseed salt stress by using a 3D-CNN model with channel attention mechanism, combined with adaptive convolutional kernel size design and fully connected layer structure with residual connections. At the same time, the method introduces temperature-grayscale value linkage correction technology and salt stress sensitive band priority normalization technology in the hyperspectral data preprocessing stage, which significantly improves the accuracy and usability of the data.
[0006] To solve the above-mentioned technical problems, this invention provides the following technical solution: a rapeseed salt stress classification method based on 3D convolutional neural networks, the specific steps of which are as follows:
[0007] S1. Salt stress treatment and hyperspectral data acquisition of rapeseed: Natural populations composed of rapeseed germplasm were selected and cultivated to the 4-5 leaf stage under controlled conditions. Normal group and salt stress treatment group were set up. Salt stress treatment adopted soil moisture-salt concentration dual closed-loop control technology. Hyperspectral imaging system with a wavelength range of 400-1000nm was used to collect hyperspectral data of rapeseed plants at multiple time periods from side and top viewing angles.
[0008] S2. Hyperspectral Data Preprocessing and Data Cube Construction: The raw hyperspectral data collected in S1 are sequentially corrected and standardized. The correction adopts temperature-grayscale value linkage correction technology, and the standardization adopts salt stress sensitive band priority standardization technology. The processed data is organized into a hyperspectral data cube according to the sample-spatial dimension-spectral dimension, and expanded into a tensor [channels, depth, height, width] that conforms to the model input format. At the same time, the association mapping between the dataset and the salt stress state label is constructed.
[0009] S3. Construction of a 3D-CNN Model with Integrated Channel Attention Mechanism: A 3D-CNN model is constructed, comprising an input layer, a 3D convolutional module, a 3D pooling module, a channel attention module, and a classification module. The input layer receives the four-dimensional tensor from S2 and augments the training set with data augmentation. The 3D convolutional module employs an adaptive kernel size design, extracting spatial-spectral joint features by stacking 3D convolutional layers. The 3D pooling module is interspersed between the 3D convolutional modules to compress the feature dimension. The channel attention module, after being embedded in the 3D convolutional module, adaptively selects key spectral bands. Its compression operation uses weighted global average pooling, and its activation operation uses a fully connected layer structure with residual connections. The classification module maps the extracted features to a salt stress state probability distribution.
[0010] S4. Model Training, Optimization, and Rapeseed Salt Stress Classification: The dataset constructed in S2 is divided into training, validation, and test sets according to a preset ratio; training parameters are configured to iteratively train the model in S3. The optimizer uses a validation set loss-gradient dual-factor learning rate adjustment technique, and the loss function uses a sample dynamic resampling-loss weighted fusion technique; the model performance is monitored through the validation set, and the optimal weights are selected. The optimal model weights are selected using a multi-index achievement-comprehensive optimization weight selection technique; the optimal weights are loaded to perform salt stress classification on the test set samples, and the classification results are output.
[0011] Furthermore, the salt stress treatment in S1 employs a dual closed-loop control technology of soil moisture and salt concentration, aiming to solve the problem of deviation in actual stress intensity caused by changes in soil moisture when the traditional fixed salt concentration is applied. The specific implementation steps are as follows: Pretreatment stage: The weight of dry soil in the pots is uniformly set to 2 kg. Sodium chloride is added according to the initial salt concentration and the corresponding mass is added. After mixing evenly, water is poured until the relative humidity of the soil is 60%, and the soil is left to stand for 24 hours to allow the salt to fully dissolve; Stress monitoring stage: A soil moisture sensor is used to collect moisture data once a day at depths of 5 cm, 10 cm, and 15 cm in the potted soil. The average value of the three points is taken as the real-time soil moisture; Salt replenishment calculation stage: When the real-time humidity deviates from the target value... When the humidity is 60%, the required amount of sodium chloride to be added is calculated as follows: Salt addition amount (g) = (standard humidity - real-time humidity) × dry soil weight × initial salt concentration / 100, ensuring dynamic compensation of salt concentration with humidity changes; Precise salt addition stage: Weigh the amount of salt to be added using a micro-scale electronic scale, dissolve sodium chloride in 50mL of deionized water, and slowly inject it into the soil along the edge of the pot to avoid excessive local salt concentration; Validation stage: Measure the soil conductivity again 12 hours after salt addition to ensure that the conductivity deviation is controlled within ±5%, achieving stable control of salt stress intensity. This technology can reduce the deviation rate between the actual soil salt concentration and the set value at different times to below 3%, ensuring accurate matching between hyperspectral data and stress state.
[0012] Furthermore, the correction in S2 employs a temperature-grayscale value linkage correction technique to eliminate the influence of ambient temperature on the detector response of the imaging system. The specific implementation steps are as follows: Model establishment stage: 11 temperature gradients are set within the range of 15℃-35℃. Under each gradient, the dark field grayscale value is collected with the light source turned off, and the white field grayscale value of a standard polytetrafluoroethylene white board is collected. The corresponding temperature and grayscale values are recorded, and temperature-dark field grayscale deviation tables and temperature-white field grayscale deviation tables are established. Real-time acquisition stage: When acquiring rapeseed hyperspectral data, the ambient temperature is simultaneously acquired through the temperature sensor built into the imaging system. Simultaneously, dark field and white field grayscale values are collected at the same temperature; Deviation compensation stage: the deviation table is consulted based on the real-time temperature to calculate the dark field grayscale compensation value and the white field grayscale compensation value; Reflectance calculation stage: the final reflectance is calculated according to the formula: corrected reflectance = (original hyperspectral grayscale value - compensated dark field grayscale value) / (compensated white field grayscale value - compensated dark field grayscale value); Accuracy verification stage: the reflectance of the corrected standard white board is compared with the theoretical value to ensure that the error is ≤2%. This technology can reduce the temperature-induced reflectance deviation from 8%-12% to below 3%, ensuring the cross-temperature consistency of hyperspectral data.
[0013] Furthermore, the standardization in S2 employs a salt stress-sensitive band priority standardization technique, aiming to highlight the characteristics of salt stress-sensitive bands and avoid the smoothing of sensitive band information by traditional standardization. The specific implementation steps are as follows: Sensitive band screening: Calculate the Pearson correlation coefficient between the reflectance of each band and the Na⁺ content of rapeseed leaves, and screen bands with |r|≥0.7 as salt stress-sensitive bands, with the rest being non-sensitive bands; Weight setting: Calculate the weight of sensitive bands using the information entropy method, with lower information entropy resulting in higher weights, and uniformly set a fixed weight of 0.5 for non-sensitive bands; Band-specific standardization: For sensitive bands, the standardized value is calculated as (original reflectance - mean of the band) / standard deviation of the band × corresponding weight; for non-sensitive bands, the standardized value is calculated as (original reflectance - mean of the band) / standard deviation of the band. This technique can avoid smoothing of sensitive band information and reduce interference from redundant information in non-sensitive bands, preserving key stress signals for subsequent feature extraction.
[0014] Furthermore, the 3D convolution module in S3 adopts an adaptive kernel size design, with the kernel size dynamically adjusted according to the spectral and spatial resolutions. This aims to improve the efficiency of joint extraction of spatial and spectral features. Specifically, the formula for calculating the spectral dimension of the 3D convolution kernel is as follows: ,in The spectral dimension of the 3D convolution kernel is a positive integer, either 3 or 5, to ensure coverage of features across continuous spectral bands. This is the resolution coefficient, with a value of [value missing]. , The average band spacing, For band The actual band spacing is determined by the spectral response function of the hyperspectral system. This adaptive kernel design can improve the efficiency of joint extraction of spatial-spectral features while reducing computational redundancy caused by invalid parameters.
[0015] Furthermore, the squeezing operation of the channel attention module in S3 employs weighted global average pooling to highlight the spectral characteristics of the leaf region and avoid interference from background pixels on the channel weights. The specific weighted global average pooling formula is as follows: ,in For the first The compressed eigenvalues of each channel reflect the effective characteristic strength of that channel. The output feature map of the 3D convolutional module is in the first... The first channel, the first Feature values of spatial location For the first The pixel weight for spatial location takes a value of 0 or 1, where 1 represents a rapeseed leaf area and 0 represents a background area. , The spatial height and width of the feature map are determined by the downsampling operation of the 3D pooling module. Traditional global average pooling will include background pixel features in the calculation, resulting in channel weight bias. However, this weighted pooling can increase the contribution ratio of blade region features, ensuring that the weights learned by the channel attention module can accurately reflect the importance of salt stress sensitive bands.
[0016] Furthermore, the activation operation of the channel attention module in S3 adopts a fully connected layer structure with residual connections to avoid the loss of feature information during the activation process. The specific activation function formula is as follows: ,in For the first The excitation weight coefficients of each channel range from [0, 1]. A higher weight indicates a greater contribution of that channel to salt stress classification. Use the Sigmoid activation function to ensure that the weight coefficients are within a reasonable range. , These are the weight matrices for the two fully connected layers. The residual coefficient is... As a channel descriptor, this activation function, compared to the traditional residual-free structure, can improve the discrimination of channel weights by 20% and improve the accuracy of weight allocation for salt-stress-sensitive bands.
[0017] Furthermore, the optimizer in S4 employs a validation set loss-gradient dual-factor learning rate adjustment technique to address the slow convergence or overfitting issues caused by traditional fixed learning rates. The specific implementation steps are as follows: Initialization phase: Set the initial learning rate to 0.001, and simultaneously set the loss reduction threshold and gradient norm threshold. The iteration interval is 5 rounds as the adjustment cycle. Indicator monitoring phase: After every 5 iterations, calculate the validation set loss reduction rate and calculate the L2 norm of the model parameter gradient through backpropagation. Adjustment coefficient calculation: If the loss reduction rate ≥ 5% and the gradient norm ≥ 1.0, set the adjustment coefficient to 0.9; if the loss reduction rate < 2% and the gradient norm < 0.5, set the adjustment coefficient to 1.1; otherwise, set the adjustment coefficient to 1.0. Learning rate update: Calculate the new learning rate as updated learning rate = current learning rate × adjustment coefficient, and control it within the range of 1e-5 to 1e-3 to avoid excessive fluctuations.
[0018] Furthermore, the loss function in S4 employs a dynamic resampling-loss weighted fusion technique to address the class imbalance problem in salt stress samples. The specific implementation steps are as follows: Sample statistics: Before training, the number of samples in the normal group and the salt stress treatment group within the data set is counted to determine the proportion of samples in each class; Dynamic resampling: When loading samples in each training round, the sampling probability is set in reverse according to the class proportion, increasing the sampling probability for classes with fewer samples to ensure that the proportion of each class in each batch of training samples is close to 1:1; Loss weighting allocation: When calculating the loss, for class samples that still have a low proportion after dynamic resampling, their single-sample loss value is additionally multiplied by a weighting coefficient, with the coefficient being larger as the sample proportion decreases; Total loss calculation: The loss values of all samples are averaged to obtain the total loss for this round of training; Balanced validation: After every 10 iterations, the recall rate of each class in the validation set is statistically analyzed to ensure that the difference in recall rate between classes is ≤8%. If it exceeds this, the sampling probability and weighting coefficient are adjusted until balance is achieved. This technique avoids the model biasing towards classes with more samples, making the classification performance of each class under salt stress more balanced.
[0019] Furthermore, the optimal model weight selection in S4 employs a multi-index achievement-comprehensive optimization weight selection technique to avoid model performance deviations caused by a single accuracy index. The specific implementation steps are as follows: Determine core evaluation indicators: Select indicators that reflect the comprehensiveness of classification, including overall accuracy of the validation set, recall of each class, and F1 score of each class, covering overall correctness and class-level recognition ability; Set indicator achievement benchmarks: Combine the classification requirements of rapeseed salt stress, set a minimum achievement threshold for each indicator to ensure no serious indicator imbalance; Temporarily save weights: After each iteration, if all indicators reach the corresponding benchmark, the current model weights are temporarily saved as candidate weights; otherwise, they are not saved; Comprehensive optimization: After training, from all candidate weights, the weight with the smallest difference in recall among classes and the highest F1 score is selected as the optimal weight, prioritizing the balance of class performance; Generalization verification: Verify the performance of the optimal weight using a test set. If the deviation between the test set indicators and the validation set indicators is within a reasonable range, the weight is finally determined; otherwise, re-selection is performed. This technique avoids the model ignoring class imbalance due to the excellence of a single indicator, ensuring that the optimal weight has stable classification ability in practical applications.
[0020] Compared with existing technologies, this 3D convolutional neural network-based method for classifying rapeseed salt stress has the following advantages:
[0021] I. This invention effectively improves the classification accuracy of rapeseed under salt stress by using a 3D-CNN model with a channel attention mechanism, combined with adaptive convolutional kernel size design and a fully connected layer structure with residual connections. In particular, the application of the channel attention module can adaptively select key spectral bands, avoiding interference from background pixels and redundant information, enabling the model to more accurately capture salt stress-sensitive features. At the same time, the optimizer uses a validation set loss-gradient dual-factor learning rate adjustment technique and a sample dynamic resampling-loss weighted fusion technique for the loss function, which further enhances the robustness and classification performance of the model, ensuring stable classification under different salt stress conditions.
[0022] Second, this invention introduces temperature-grayscale value linkage correction technology and salt stress sensitive band priority normalization technology in the hyperspectral data preprocessing stage, which significantly improves the accuracy and usability of the data. Temperature-grayscale value linkage correction technology effectively eliminates the influence of ambient temperature on the detector response of the imaging system, ensuring the cross-temperature consistency of hyperspectral data; while salt stress sensitive band priority normalization technology highlights the characteristics of salt stress sensitive bands, avoids the smoothing of sensitive band information by traditional normalization methods, and retains key stress signals for subsequent feature extraction. In addition, the adaptive convolution kernel size design of the 3D convolution module dynamically adjusts the convolution kernel size according to the spectral resolution and spatial resolution, which significantly improves the efficiency of joint extraction of spatial and spectral features, while reducing the computational redundancy caused by invalid parameters.
[0023] Other advantages, objectives and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination or study, or may be learned from the practice of the invention. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0025] Figure 1 The flowchart shows the classification method of rapeseed salt stress based on 3D convolutional neural network.
[0026] Figure 2 This is a schematic diagram of the process for classifying rapeseed salt stress based on a 3D convolutional neural network.
[0027] Figure 3 The flowchart shows the training and weight selection process of a rapeseed salt stress classification method based on a 3D convolutional neural network.
[0028] Figure 4 This is a graph showing the changes in training and validation metrics for a rapeseed salt stress classification method based on a 3D convolutional neural network. Detailed Implementation
[0029] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided below.
[0030] Example 1
[0031] Forty core germplasm samples from natural populations of Brassica napus were selected and cultivated in a laboratory artificial climate chamber. The temperature was controlled at 25±2℃, the relative humidity at 60±5%, and the photoperiod was 16h light / 8h dark. After cultivation to the 4-5 leaf stage, the samples were divided into a normal group and a salt stress treatment group, with 3 replicates in each group. Each pot was filled with 2kg of dry soil. The salt stress treatment adopted a dual closed-loop control technology of soil moisture and salt concentration. In the pretreatment stage, the amount of sodium chloride added was calculated based on the initial salt concentration. No sodium chloride was added to the normal group, and the salt concentration of the salt stress group was set at 5%. After the sodium chloride was mixed evenly with the dry soil, the soil relative humidity was watered to 60%, and the mixture was left to stand for 24 hours to allow the salt to dissolve completely.
[0032] like Figure 2 As shown, during the stress monitoring phase, soil moisture data was collected daily at depths of 5cm, 10cm, and 15cm in each pot using a soil moisture sensor. The average value of these three points was taken as the real-time soil moisture. When the real-time moisture deviated from 60%, the required amount of sodium chloride was calculated using the salt supplementation calculation method. After precise weighing with a micro-scale electronic balance, the sodium chloride was dissolved in 50mL of deionized water and slowly injected into the soil along the edge of the pot to avoid excessively high local salt concentrations. The soil conductivity was measured 12 hours after salt supplementation for verification. A hyperspectral imaging system covering the 400-1000nm band was used to collect hyperspectral data of rapeseed plants on the 7th and 14th days after salt stress treatment, using side and top views, respectively. The imaging system was preheated and stabilized for 30 minutes before each collection to ensure data consistency.
[0033] The acquired raw hyperspectral data were sequentially calibrated and standardized. Calibration employed a temperature-grayscale value linkage calibration technique. First, 11 temperature gradients were set within the range of 15℃-35℃. Under each gradient, the light source was turned off, and dark-field grayscale values and white-field grayscale values from a standard PTFE white board were acquired. The corresponding temperature and grayscale values were recorded, and temperature-dark-field grayscale deviation tables and temperature-white-field grayscale deviation tables were established. When acquiring rapeseed hyperspectral data, the ambient temperature was simultaneously acquired using the imaging system's built-in temperature sensor, and dark-field and white-field grayscale values at that temperature were also acquired. The compensation value was calculated based on the deviation tables using the real-time temperature data. The final reflectance was then obtained using the method for calculating the calibrated reflectance. The calibrated standard white board reflectance was compared with the theoretical value to ensure an error ≤2%. Standardization employed a salt-stress-sensitive band-priority standardization technique. First, the Pearson correlation coefficient between reflectance of each band and Na⁺ content in rapeseed leaves was calculated. Bands with |r|≥0.7 were selected as sensitive bands for salt stress. The weight of sensitive bands was calculated using the information entropy method, while non-sensitive bands were uniformly assigned a fixed weight of 0.5. Sensitive bands were processed according to the sensitive band standardization calculation method, and non-sensitive bands were processed according to the non-sensitive band standardization calculation method. The feature difference of sensitive bands before and after standardization was compared to ensure that the difference was improved. The processed data was organized into a hyperspectral data cube according to the sample-spatial dimension-spectral dimension and arranged into a four-dimensional tensor [1, 112, 224, 224] that meets the model input requirements. During training, the model automatically adjusts the shape of the training data according to the set batch_size, and at the same time, the association mapping between the dataset and the salt stress state label is constructed.
[0034] like Figure 1 As shown, a 3D-CNN model is constructed, comprising an input layer, a 3D convolutional module, a 3D pooling module, a channel attention module, and a classification module. The input layer receives a four-dimensional tensor constructed by S2, and the training set is expanded through data augmentation methods such as random flipping and brightness fine-tuning. The 3D convolutional module adopts an adaptive convolutional kernel size design, with the formula as follows: ,in The spectral dimension size of the 3D convolution kernel. For resolution coefficients, The average band spacing, For band The actual band interval is determined by extracting spatial-spectral joint features through stacking three 3D convolutional layers, fully capturing the correlation information between the spatial morphology and spectral response of rapeseed plants. A 3D pooling module is interspersed between the 3D convolutional modules, with one 3D pooling layer placed after every two 3D convolutional layers to compress feature dimensions, reduce computational load, and retain key features. The channel attention module is embedded in the 3D convolutional modules and then squeezed using weighted global average pooling, with the formula: ,in For the first The eigenvalues of each channel after compression. The output feature map of the 3D convolutional module is in the first... The first channel, the first Feature values of spatial location For the first Pixel weights based on spatial location , The spatial height and width of the feature map are represented by these dimensions, respectively. An activation operation is then performed through a fully connected layer structure with residual connections to adaptively select key spectral bands effective for salt stress classification. The classification module consists of two fully connected layers and a Sigmoid activation function. The specific activation function formula is as follows: ,in For the first The weighting coefficients of each channel after activation. It is the Sigmoid activation function. , These are the weight matrices for the two fully connected layers. The residual coefficient is... The channel descriptor maps the extracted high-dimensional features to the probability distributions of the three salt stress states.
[0035] The dataset constructed by S2 is divided into training, validation, and test sets in a 7:2:1 ratio. Training parameters are configured, with a batch size of 8 and a maximum iteration count of 150. The optimizer employs a validation set loss-gradient two-factor learning rate adjustment technique, with an initial learning rate of 0.001. Loss descent thresholds and gradient norm thresholds are set, with an adjustment cycle of 5 iterations. Every 5 iterations, the validation set loss descent rate and the L2 norm of the model parameter gradients are calculated, and adjustment coefficients are set according to different situations. The learning rate is updated using the same method as the updated learning rate calculation, and the learning rate is controlled within 1e... The loss function is within the range of -5 to 1e-3. The loss function adopts a dynamic resampling-loss weighted fusion technique. Before training, the number of samples in each category is counted. When loading samples in each training round, the sampling probability is set in reverse according to the proportion of each category to ensure that the proportion of each category in each batch of training samples is close to 1:1. For category samples that still have a low proportion after dynamic resampling, their single sample loss value is multiplied by a weighting coefficient. Finally, the average of the losses of all samples is calculated as the total loss for this round. After every 10 iterations, the recall rate of each category in the validation set is counted to ensure that the difference in recall rate between each category is ≤8%. If it exceeds 8%, the sampling probability and weighting coefficient are adjusted until they are balanced.
[0036] like Figure 3As shown, the optimal model weight selection adopts a multi-index achievement-comprehensive optimization weight selection technique. The core evaluation indicators include the overall accuracy of the validation set, the recall of each class, and the F1 score of each class, with a minimum threshold set. After each iteration, if all indicators meet the criteria, the current model weights are saved as candidate weights. After training, the weights with the smallest difference in recall among the candidate weights and the highest F1 score are selected as the optimal weights. The performance of these weights is verified using a test set. If the deviation between the test set indicators and the validation set indicators is ≤5%, the optimal weights are loaded to perform salt stress classification on the test set samples, and the final classification results are output. The highest accuracy on the test set can reach 75%, and the recall rate is 70%.
[0037] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.
Claims
1. A method for classification of salt stress of rape based on 3D convolutional neural network, characterized in that, The specific steps of the method are: S1, salt stress treatment of oilseed rape and collection of hyperspectral data: select a natural population composed of Brassica napus germplasm, cultivate to 4-5 leaf stage under controllable environment, set normal group and salt stress treatment group, adopt soil humidity-salt concentration double closed loop regulation technology for salt stress treatment; adopt hyperspectral imaging system with wave band range covering 400-1000nm, collect multi-period hyperspectral data of oilseed rape plants at side view and top view angles; S2, hyperspectral data preprocessing and data cube construction: sequentially correct and standardize the original hyperspectral data collected in S1, correct by temperature-gray value linkage correction technology, standardize by salt stress sensitive wave band priority standardization technology; organize the processed data into hyperspectral data cube according to sample-space dimension-spectrum dimension, and expand into four-dimensional tensor [channles, depth, height, width] conforming to model input format, and construct the association mapping of data set and salt stress state label at the same time; S3, construction of 3D-CNN model fused with channel attention mechanism: construct 3D-CNN model containing input layer, 3D convolution module, 3D pooling module, channel attention module and classification module; input layer receives four-dimensional tensor of S2 and expands training set through data augmentation; 3D convolution module adopts adaptive convolution kernel size design, extracts space-spectrum joint features through stacking 3D convolution layers; 3D pooling module is interspersed between 3D convolution modules to compress feature dimension; Channel attention module adaptively selects key spectral wave bands after embedding 3D convolution module, its squeezing operation adopts weighted global average pooling, and its excitation operation adopts full connection layer structure with residual connection; classification module maps extracted features to salt stress state probability distribution; S4, model training, optimization and oilseed rape salt stress classification: divide the data set constructed in S2 into training set, validation set and test set according to pre-set proportion; configure training parameters to iteratively train the model of S3, adopt validation set loss-gradient double factor learning rate adjustment technology for optimizer, and adopt sample dynamic resampling-loss weighted fusion technology for loss function; monitor model performance through validation set and select optimal weight, select optimal model weight by multi-index reaching standard-comprehensive optimal weight selection technology; load optimal weight to classify salt stress of test set samples, and output classification results.
2. The method of claim 1, wherein the 3D convolutional neural network-based classification method for salt stress of Brassica napus is characterized in that, The soil humidity-salt concentration double closed loop regulation technology is adopted in the salt stress treatment in S1, and the specific implementation steps are as follows: Pretreatment stage: the potting dry soil weight is uniformly set as 2 kg, the corresponding mass of sodium chloride is added according to the initial salt concentration, and after uniform mixing, water is poured to make the soil relative humidity 60%, and the salt is fully dissolved after standing for 24 hours; Stress monitoring stage: a soil humidity sensor is used, and the humidity data is collected once a day at the depths of 5 cm, 10 cm and 15 cm of the potting soil, and the average value of the three points is taken as the real-time soil humidity; Salt supplement calculation stage: when the real-time humidity deviates from 60%, the mass of sodium chloride to be added is calculated according to the formula: supplement amount (g) = (standard humidity-real-time humidity) x dry soil weight x initial salt concentration / 100; Precise salt supplement stage: the supplement amount is weighed using a micro electronic scale, the sodium chloride is dissolved in 50 mL of deionized water, and the sodium chloride is slowly injected into the soil along the edge of the pot to avoid local high salt concentration; Verification stage: the soil conductivity is measured again 12 hours after the salt supplement. 3.The method of claim 1, wherein, The temperature-gray value linkage correction technology is adopted in the correction in S2, and the specific implementation steps are as follows: Model establishment stage: 11 temperature gradients are set in the range of 15-35 DEG C, under each gradient, the dark field gray value is collected by closing the light source, the white field gray value of the standard polytetrafluoroethylene white board is collected, the corresponding temperature and gray value are recorded, and the temperature-dark field gray deviation table and the temperature-white field gray deviation table are established; Real-time collection stage: when the oilseed rape hyperspectral data is collected, the ambient temperature is synchronously acquired through the temperature sensor of the imaging system, and the dark field and white field gray values under the same temperature are collected; Deviation compensation stage: the real-time temperature is inquired from the deviation table, and the dark field gray compensation value and the white field gray compensation value are calculated; Reflectivity calculation stage: the final reflectivity is calculated according to the formula: corrected reflectivity = (original hyperspectral gray value-compensated dark field gray value) / (compensated white field gray value-compensated dark field gray value); Accuracy verification stage: the corrected standard white board reflectivity is compared with the theoretical value, and it is ensured that the error is less than or equal to 2%.
4. The method of claim 1, wherein the 3D convolutional neural network-based classification method for salt stress of Brassica napus is characterized by, The salt stress sensitive band priority standardization technology is adopted in the standardization in S2, and the specific implementation steps are as follows: Sensitive band screening: the Pearson correlation coefficient of the reflectivity of each band and the Na+ content of the oilseed rape leaf is calculated, the band with |r| greater than or equal to 0.7 is selected as the salt stress sensitive band, and the rest is the non-sensitive band; Weight setting: the information entropy method is used to calculate the weight of the sensitive band, the lower the information entropy, the greater the weight, and the non-sensitive band is uniformly set as a fixed weight of 0.5; Band-by-band standardization: the sensitive band is calculated according to the formula: standardized value = (original reflectivity-band mean value) / band standard deviation x corresponding weight, and the non-sensitive band is calculated according to the formula: standardized value = (original reflectivity-band mean value) / band standard deviation.
5. The method of claim 1, wherein the 3D convolutional neural network-based classification method for salt stress of Brassica napus is characterized by, The 3D convolution module in the S3 adopts an adaptive convolution kernel size design. A specific 3D convolution kernel spectral dimension size calculation formula is as follows: wherein is a spectral dimension size of the 3D convolution kernel, is a resolution coefficient, is an average band interval, is a band actual band interval.
6. The method of claim 1, wherein the 3D convolutional neural network-based classification method for salt stress of Brassica napus is characterized by, The squeezing operation of the channel attention module in S3 adopts weighted global average pooling, and the specific weighted global average pooling formula is: wherein is the squeezed feature value of the i-th channel, is the feature value of the 3D convolution module output feature map at the i-th channel, the j-th spatial position, is the feature value of the 3D convolution module output feature map at the i-th channel, the j-th spatial position, is the pixel weight of the i-th spatial position, , is the spatial height and width of the feature map, respectively. 7. The method of claim 1, wherein the 3D convolutional neural network-based classification method for salt stress of Brassica napus is characterized by, The excitation operation of the channel attention module in S3 adopts a full connection layer structure with a residual connection, and the specific excitation function formula is: wherein is the excitation weight coefficient of the i-th channel, is the excitation weight coefficient of the i-th channel, is a Sigmoid activation function, , are weight matrices of two full connection layers respectively, is a residual coefficient, is a channel descriptor. 8.The method of claim 1, wherein, The S4 optimizer adopts a validation set loss-gradient double-factor learning rate adjustment technology, and the specific implementation steps are as follows: initialization stage: set the initial learning rate to 0.001, and set the loss drop threshold and the gradient norm threshold, and the iteration interval is 5 rounds as the adjustment period; index monitoring stage: every 5 rounds of iteration is completed, the validation set loss drop rate is calculated, and the L2norm of the model parameter gradient is calculated through back propagation; adjustment coefficient calculation: if the loss drop rate is greater than or equal to 5% and the gradient norm is greater than or equal to 1.0, the adjustment coefficient is set to 0.9; if the loss drop rate is less than 2% and the gradient norm is less than 0.5, the adjustment coefficient is set to 1.1; otherwise, the adjustment coefficient is set to 1.0; Learning rate update: calculate the new learning rate according to the updated learning rate = current learning rate * adjustment coefficient, and control it in the range of 1e-5~1e-3. 9.The method of claim 1, wherein, The S4 loss function adopts a sample dynamic resampling-loss weighted fusion technology, and the specific implementation steps are as follows: sample statistics: count the number of normal group and salt stress group samples in the dataset before training to determine the proportion of each category of samples; dynamic resampling: when loading samples for each round of training, set the sampling probability inversely according to the category proportion, and increase the sampling probability of the category with fewer samples to ensure that the proportion of the number of each category in each batch of training samples is close to 1:1; loss weighted distribution: when calculating the loss, the single sample loss value of the category sample with a low proportion after dynamic resampling is multiplied by a weighting coefficient, and the lower the sample proportion, the larger the coefficient; total loss calculation: average the loss values of all samples to obtain the total loss of this round of training.
10. The 3D convolutional neural network-based classification method of salt stress of oilseed rape according to claim 1, characterized in that, The S4 optimal model weight screening adopts a multi-index standard-compliant-comprehensive optimization weight screening technology, and the specific implementation steps are as follows: determine the core evaluation index: select an index that can reflect the overall classification, including the overall accuracy of the validation set, the recall rate of each category, and the F1 score of each category, covering the overall correctness and category-level recognition ability; set the index standard: according to the classification requirements of oilseed rape salt stress, set the minimum standard for each index; temporary save the weight: after each iteration, if all indexes meet the corresponding standard, save the current model weight as a candidate weight, otherwise do not save; comprehensive optimization: after training, select the weight with the smallest difference in recall rate and the highest F1 score from all candidate weights as the optimal weight, which prioritizes balanced category performance; generalization verification: verify the performance of the optimal weight with the test set, if the deviation between the test set index and the validation set index is within a reasonable range, the weight is finally determined, otherwise it is reselected.