Oat broken grain spectral data enhancement and identification method for solving small sample problem
By combining a convolutional autoencoder with a deep generative network of a channel-spatial attention mechanism, representative and diverse hyperspectral data is generated, solving the problem of small samples in the identification of broken oat grains and achieving efficient and intelligent recognition results.
Patent Information
- Application Number
- CN202510716945.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-09-12
AI Technical Summary
Traditional visible light image recognition methods cannot fully reflect the intrinsic physical structure changes of oat kernels, and the recognition model lacks stability and generalization ability under small sample conditions. Existing data enhancement methods find it difficult to generate representative hyperspectral data, resulting in low accuracy in identifying damaged oat kernels.
A deep generative network combining convolutional autoencoder (CAE) and channel-spatial attention mechanism (CBAM) is used to obtain spectral data of oat grains through hyperspectral imaging technology, generate representative and diverse enhanced samples, and combine multiple classification models to improve recognition accuracy and robustness.
It significantly improves the recognition accuracy of damaged oat kernels and the robustness of the model, solves the recognition problem under small sample conditions, and provides an efficient and intelligent solution for grain quality testing.
Smart Images

Figure CN120635873A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of optical response detection, and in particular relates to a method for enhancing and identifying spectral data of broken oats for solving the problem of small samples. Background Art
[0002] As food security and quality issues gain increasing global attention, oats, a nutritious and functional food crop, have seen continued growth in demand both domestically and internationally in recent years. Oat quality plays a key role in its further processing and market pricing, with the structural integrity of the oats, in particular, significantly impacting the quality of the end product. However, during harvesting, transportation, and storage, oat kernels often suffer mechanical breakage, cracking, and other physical damage, impacting their appearance and inherent quality. Consequently, efficient and accurate detection and identification methods are urgently needed.
[0003] Traditional visible light image recognition methods are limited by subjective differences in surface color and morphology and cannot fully reflect the inherent physical structural changes of damaged kernels. Hyperspectral imaging technology, an emerging detection method that integrates imaging and spectral analysis, offers the advantages of being non-contact, high-throughput, and penetrating. It can acquire high-dimensional spectral information of oat kernels within the 400-1000nm wavelength range, effectively capturing their chemical composition and microstructural variations, making it an ideal technical approach for identifying damaged oat kernels.
[0004] However, in actual detection, because damaged oat kernels are a minority compared to normal kernels, problems such as sample imbalance and small sample sizes severely impact the stability and generalization capabilities of the recognition model. Traditional data augmentation methods, such as adding noise and transformations, struggle to generate representative hyperspectral data and can easily lead to overfitting or class confusion.
[0005] To this end, deep generative models have gradually become an effective means of solving the small sample problem. Convolutional autoencoders (CAEs) have excellent feature extraction and data reconstruction capabilities, while channel-spatial attention mechanisms (CBAMs) can further enhance the network's ability to focus on key spectral bands and spatial locations. Combining CAE with CBAM not only enables more comprehensive extraction of the spectral characteristics of damaged kernels, but also enables the generation of more realistic and diverse enhanced samples, providing data support for subsequent modeling and analysis, thereby improving recognition accuracy and model robustness in small sample scenarios and promoting the engineering application of hyperspectral technology in rapid grain quality testing. Summary of the Invention
[0006] To address the technical challenges of existing broken oat kernel identification, such as small sample sizes, weak sample generation capabilities, and insufficient model generalization, this paper proposes a method for broken oat kernel spectral data enhancement and identification. By constructing a deep generative network integrating a convolutional autoencoder (CAE) with a channel-spatial attention mechanism (CBAM), this method effectively enhances the hyperspectral data of broken kernels and combines multiple classification models to improve the accuracy and robustness of broken kernel identification. This method offers the advantages of being contactless, fast, efficient, and intelligent, significantly improving agricultural product quality identification and analysis capabilities in complex, small sample environments.
[0007] To achieve the above objectives, the present invention adopts a technical solution: a method for enhancing and identifying spectral data of broken oats for solving the problem of small sample sizes, which comprises the following steps:
[0008] Step 1: Select normal oats and damaged oats as research samples;
[0009] Step 2: Use a visible-shortwave near-infrared hyperspectral imaging system to collect high-dimensional spectral data of normal oat kernels and damaged oat kernels in the 400–1000 nm band;
[0010] Step 3: Build a deep generative network based on a convolutional autoencoder combined with a channel-spatial attention mechanism to extract deep features from the original spectra of the damaged grains and generate enhanced samples. Simultaneously, this deep generative network fusion model learns and generates the original damaged grain spectra to obtain enhanced spectral data, and evaluates its similarity and difference with the original spectra to ensure the representativeness and diversity of the generated data.
[0011] Step 4: The original spectral data of normal and damaged oat kernels are divided into a modeling set and a prediction set according to a certain ratio. The number of data in the prediction set remains unchanged. Different numbers and proportions of generated samples are added to the modeling set to construct partial least squares regression models, support vector machine models, and random forest models. By comparing the model performance under different enhancement strategies, the effect of data enhancement on the classification results is analyzed.
[0012] Step 5: Based on steps 3 and 4, evaluate the differences in the recognition accuracy of damaged kernels by different models before and after enhancement, and perform a visual display to analyze the classification ability and generalization performance of the model.
[0013] Furthermore, in step 1, 700 normal oats and 70 damaged oats are selected. The normal oats are oat grains without cracks, insect pests, or mildew, and the damaged oats are oat grains with mechanical breakage, cracks, or obvious structural defects.
[0014] Furthermore, in step 2, the acquisition parameters of the visible-shortwave near-infrared hyperspectral imaging system are: the object distance between the lens and the sample is 300 mm, the spectral resolution is 1.43 nm, the scanning speed is 6.5 mm / s, the image size is 804×1097, and the window smoothing point number is 3.
[0015] Furthermore, in the step 2, after collecting hyperspectral spectral information of all samples, the black and white correction method is used to reduce the dark current of the instrument itself and the influence of the sample itself on the reflection of the light source. Subsequently, image processing including threshold segmentation, corrosion, and expansion is used to automatically identify the acquired sample spectral image, extract the region of interest of each oat, and extract the average spectrum from it as input data for subsequent analysis.
[0016] Furthermore, in step three, the deep generative network model introduces channel attention and spatial attention modules based on the CAE architecture. The channel attention module focuses on the band area with strong characteristic response to enhance the model's perception of characteristic wavelengths. The spatial attention module is used to assign different importance to spectral segments at different positions.
[0017] Furthermore, at the input of the deep generative network, the original spectral curve of the damaged particle is received as a one-dimensional input signal. Through multi-layer convolution operations, the convolutional autoencoder extracts the spectral change characteristics of the local area and realizes the compressed representation of the spectrum into a high-dimensional latent space. Then, the weights are calculated in the channel dimension and spatial dimension respectively to form a dynamic weighting mechanism.
[0018] Furthermore, in step four, the original spectral data of normal oat kernels and damaged oat kernels are divided into a modeling set and a prediction set in a ratio of 3:2; 1 / 3, 2 / 3 and 1 times the number of damaged kernel samples are added to the modeling set respectively to construct a partial least squares regression model, a support vector machine model and a random forest model.
[0019] Furthermore, the accuracy, recall and precision of the partial least squares regression model, support vector machine model and random forest model on the calibration set and prediction set are calculated respectively, and the enhancement conditions with the best recognition accuracy are selected through comparative analysis.
[0020] Furthermore, in the above steps, (R2019b, MathWorks Inc., USA) was used for image processing, feature region selection, and spectral data processing and extraction. The CAE-CBAM network was constructed and trained using the PyTorch framework (1.13.1, Meta Platforms Inc., USA), and subsequent classification modeling and visualization analysis were also performed using this platform. This process effectively addresses the difficulty in identifying broken oat kernels in small sample sizes, enabling accurate and stable quality inspection and visualization inversion.
[0021] The beneficial effects of the present invention are as follows:
[0022] The present invention utilizes visible-near-infrared hyperspectral imaging technology, combined with the CAE-CBAM deep generative model, to achieve effective enhancement of the spectral data of damaged oat kernels, effectively solving the problem of low model recognition accuracy under small sample conditions. The generated samples have good representativeness and diversity, which improves the classification ability and stability of the model. Experimental results show that the enhanced model has significantly better accuracy in identifying damaged kernels than the original modeling results. The present invention provides a feasible technical solution and practical basis for the intelligent detection and quality grading of cereal crops such as oats; it can be applied to multiple application scenarios of agricultural products such as grain quality detection and grading. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 This is a flowchart of a method for enhancing and identifying spectral data of broken oats to solve the small sample problem.
[0024] Figure 2 RGB photos of normal and damaged oat kernels.
[0025] Figure 3 Generate a model structure diagram for depth based on spectral data (CAE combined with CBAM model).
[0026] Figure 4 This is the training loss curve graph of the generated model.
[0027] Figure 5 To generate the principal component analysis results of the data and the original data.
[0028] Figure 6 These are visualization results of inversion for several different placements. DETAILED DESCRIPTION
[0029] The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0030] like Figure 1This embodiment provides a method for enhancing and identifying broken oat kernel spectral data to address the small sample size problem. This method combines visible-near-infrared hyperspectral imaging technology with a multi-model classification strategy to improve the efficiency and accuracy of identifying broken oat kernels under small sample size conditions. The method includes the following steps:
[0031] Step 1: Select oat samples provided by Tianjin Customs and screen to obtain 700 normal oats and 70 damaged oats. The former have no cracks, insect damage or mildew, while the latter have obvious structural damage characteristics, such as Figure 2 .
[0032] Step 2: Use a visible-shortwave near-infrared hyperspectral imaging system to collect spectral data in the 400-1000 nm band. The acquisition parameters are: object distance 300 mm, spectral resolution 1.43 nm, scanning speed 6.5 mm / s, image size 804 × 1097 pixels, and window smoothing point count 3. Image processing methods are used to extract the effective spectral region for each sample.
[0033] Step 3: Build a deep generative model that combines a convolutional autoencoder (CAE) and a channel-spatial attention mechanism (CBAM) to learn the damaged particle spectra and generate enhanced samples. By comparing the differences and similarities between the generated spectra and the original spectra, we ensure the effectiveness and diversity of the data augmentation.
[0034] Step 4: Split the original data into a modeling set and a prediction set at a ratio of 3:2, keeping the prediction set unchanged. Add damaged grain augmentation data to the modeling set (at ratios of 1 / 3, 2 / 3, and 1), and construct PLS, SVM, and RF model classifiers.
[0035] Step 5: Compare and analyze the recognition effects of different enhancement ratios and model combinations, evaluate the improvement of data enhancement strategies on model accuracy and generalization ability, and visualize the results.
[0036] In this embodiment, step one specifically includes:
[0037] Imported oat samples provided by Tianjin Customs were selected. The sample sources are stable, the quality is controllable, and they are representative. In order to ensure the accuracy of subsequent modeling data and the scientific nature of the experiment, the initial samples were manually screened to remove particles with serious pollution, mildew, insect damage, and foreign matter attachment. After initial screening and re-inspection, a total of 770 oat grains were finally obtained, including 700 normal grains and 70 damaged grains. Normal grains have the characteristics of plump appearance, intact epidermis, consistent color, and no obvious structural abnormalities; damaged grains include samples with obvious cracks, mechanical breakage or structural defects on the surface, which can significantly reflect the common types of physical damage during processing or transportation. All samples were stored under dry conditions at room temperature and were numbered and classified before the experiment to ensure that the sample source and label information were consistent to meet the input requirements of model training.
[0038] In this embodiment, step 2 specifically includes:
[0039] Spectral data of oat samples were collected using the laboratory's visible-shortwave near-infrared hyperspectral imaging system. The wavelength range was set to 400-1000 nm, covering the main spectral response regions of the oat kernel surface and some internal structures. During the acquisition process, key spectrometer parameters were set as follows: an object distance of 300 mm to ensure stable focus and clear images; a spectral resolution of 1.43 nm to effectively distinguish subtle differences in oat reflectance across different wavelengths; a scanning speed of 6.5 mm / s to balance imaging efficiency and image quality; an image size of 804 × 1097 pixels to meet the spatial resolution requirements for a single oat kernel; and a window smoothing point count of 3 for preliminary noise reduction and to minimize environmental interference.
[0040] After collecting hyperspectral information for all samples, under the same acquisition conditions, a polytetrafluoroethylene white plate (reflectivity 99.99%) was scanned to obtain a completely white calibration plate image. The camera lens cap was then placed to obtain a completely black background image. A black-white correction method was used to reduce the dark current of the instrument itself and the influence of the sample itself on the light source reflection. The black-white correction formula is:
[0041]
[0042] Where R represents the corrected signal intensity, R0 represents the original signal intensity, B represents the calibrated signal intensity for a completely black image, and W represents the calibrated signal intensity for a completely white image. Image processing algorithms such as threshold segmentation and erosion / dilation are then used to automatically identify the acquired sample spectral images, extract the region of interest (ROI) for each oat grain, and extract the average spectrum from these regions as input data for subsequent analysis.
[0043] In this embodiment, step three specifically includes:
[0044] The CAE-CBAM fusion structure is used as the core generation model for spectral data enhancement, aiming to mine deep features from the original spectra of small samples of broken oat grains and generate representative and differentiated simulated data to improve the robustness and generalization ability of subsequent classification models. Figure 3 As shown in the figure, the overall model structure consists of three comparison schemes: the top figure shows a basic autoencoder (AE), the middle figure shows a convolutional autoencoder (CAE), and the bottom figure shows a CAE-CBAM model that incorporates the CBAM attention mechanism. The CAE-CBAM model, based on the traditional CAE architecture, introduces channel attention and spatial attention modules to adaptively learn key bands and structural regions in spectral data, enhancing the ability to express important information.
[0045] At the input end, the model receives the original spectral curve of the damaged grain (such as the green line) as a one-dimensional input signal. Through multi-layer convolution operations, the CAE module can extract the spectral variation characteristics of the local region and realize the compressed representation of the spectrum in a high-dimensional latent space. Unlike ordinary fully connected AE, the CAE structure can better capture local frequency variation information and is suitable for processing hyperspectral data with spatial fluctuation characteristics. After introducing the CBAM module, the model calculates weights in the channel dimension and spatial dimension respectively, forming a dynamic weighting mechanism. The channel attention module (ChannelAttention) can focus on the band area with strong characteristic response, thereby improving the model's perception of characteristic wavelengths; the spatial attention module (SpatialAttention) assigns different importance to spectral segments at different positions, highlighting the spectral segments with the most significant changes. This dual attention structure effectively suppresses redundancy and noise interference while retaining key spectral features, improving the authenticity and diversity of the generated samples.
[0046] like Figure 4 The following plots show the change in loss values for the CAE-CBAM model and the control model during training. The green curve represents the CAE-CBAM fusion model, and the blue curve represents the standard CAE model. It can be observed that both models rapidly decrease within the first 20 rounds of training, demonstrating rapid model convergence, indicating that the network architecture is capable of effectively learning the spectral characteristics of damaged particles. Notably, the CAE-CBAM model exhibits lower loss values in the early stages of training, with a more gradual overall decrease, ultimately converging to a smaller error range. This demonstrates that the model possesses superior learning and fitting capabilities during feature compression and restoration.
[0047] Figure 5The principal component analysis (PCA) dimensionality reduction plot shows the distribution of the enhanced spectral data and the original damaged grain samples in feature space. The dark red dots in the figure represent the original damaged grain spectra, while the light red dots represent the enhanced samples generated by the CAE-CBAM model. As can be seen, the generated data highly overlaps with the original data distribution in principal component space and exhibits a uniform distribution, demonstrating the good representativeness and diversity of the enhanced samples. Furthermore, the cumulative explained variance of PC1 and PC2 reaches 91.63%, indicating that the current principal components can effectively reflect the overall characteristic trends of the data.
[0048] comprehensive Figure 4 and Figure 5 The analysis results confirm that the CAE-CBAM fusion generative model can effectively generate data consistent with the original spectral characteristics under small sample conditions, improving the breadth of data spatial distribution and the model's learning ability. This enhancement strategy provides stable and high-quality training samples for subsequent classification modeling, helping to improve the model's generalization and robustness.
[0049] In this embodiment, steps four and five specifically include:
[0050] After completing the spectral data acquisition and enhanced sample generation, in order to further verify the actual effect of the data enhancement strategy in improving the model recognition ability, the present invention constructed a systematic modeling and analysis process based on the original data. First, the original sample data of normal grains and damaged grains are divided into a modeling set and a prediction set in a ratio of 3:2, and the prediction set data is kept unchanged to ensure the consistency and fairness of the evaluation. In the modeling set, different proportions of CAE-CBAM enhanced damaged grain samples are added, specifically enhanced data of 1 / 3, 2 / 3 and 1 times the number of original damaged grains, and comparative modeling is performed based on three typical classification models: partial least squares regression (PLS), support vector machine (SVM) and random forest (RF). After the model training is completed, its accuracy, recall rate and precision on the calibration set and prediction set are calculated respectively, and the results are organized into Tables 1 to 4.
[0051] Table 1 Modeling and recognition performance of original spectral data in three classification models (PLS, SVM and RF)
[0052]
[0053] Table 2 Comparison of classification modeling effects after adding 1 / 3 times the broken oat grains to generate data based on the original data
[0054]
[0055] Table 3 Comparison of classification modeling effects after adding 2 / 3 times the damaged oat grains to the original data
[0056]
[0057] Table 4 Comparison of classification modeling effects after adding an equal amount (1 times) of damaged oat grains to generate data based on the original data
[0058]
[0059] Table 1 shows the performance of the baseline model without augmented data. The SVM and RF models demonstrate strong classification capabilities, achieving prediction set accuracy of 90.67% and 90.99%, respectively. The PLS model, on the other hand, performs relatively poorly overall, achieving only 87.67% accuracy and 86.69% precision, demonstrating its sensitivity to small sample sizes. These results demonstrate that traditional modeling methods are susceptible to data distribution bias under conditions of sample imbalance.
[0060] When the modeling set incorporated augmented data, representing one-third of the original data (Table 2), the performance of all three models improved. In particular, the SVM and RF models saw their prediction set accuracy rise to 91.32% and 91.93%, respectively, with recall exceeding 92%. While the PLS model saw limited improvement, both accuracy and precision exceeded 87%, demonstrating the positive impact of augmented samples on the modeling process, effectively expanding the feature distribution and improving the model's ability to discriminate damaged kernels. Further increasing the augmentation ratio to two-thirds (Table 3) achieved peak model performance. The RF model achieved the highest performance, achieving an accuracy of 94.42% on the calibration set and 92.39% on the prediction set, while its precision increased to 94.84%. The SVM model also achieved a prediction accuracy of 92.96%, with all three metrics remaining high. At this stage, the model's recognition capabilities were significantly enhanced, and its generalization ability was good, indicating that moderate augmentation effectively supplemented and balanced the generated data.
[0061] However, when the augmentation ratio was increased to 1 (Table 4), while the performance of the SVM and RF models on the calibration set continued to improve (reaching 95.27% and 95.48% accuracy, respectively), the accuracy on the prediction set decreased slightly, falling to 91.60% and 89.99%, respectively. The PLS model also experienced a similar decline, suggesting that excessive augmentation can lead to model overfitting and weaken its generalization ability on real data. This trend suggests that while the data generated by CAE-CBAM is representative, the augmentation ratio should be controlled to balance learning ability and generalization performance.
[0062] To further verify the recognition ability of the constructed model for damaged oat kernels, this study demonstrated the recognition effects of different enhancement ratios and model combinations in the form of images. Figure 6The left side of the figure shows the sample image after the original image is collected, and the right side shows the pixel-level classification mask after model recognition, where the red area indicates damaged grains and the blue area indicates normal grains.
[0063] As can be seen intuitively from the figure, the classification model constructed after CAE-CBAM enhancement not only successfully segments the sample contours, but also has a high recognition sensitivity for damaged grains with subtle structural defects. Compared with the results of the original data modeling, the enhanced model still shows good resolution in scenes with dense damaged grains or high structural similarity, and accurately distinguishes samples with different apparent integrity. Further observation shows that in the enhanced classification results on the right side of the image, the number and distribution of red (damaged grains) areas basically correspond to the real samples, indicating that the enhanced samples have effectively improved the model's ability to learn damaged features. The recognition mask is clear and reasonably distributed, and there are no obvious concentrated areas of misjudgment or omissions, reflecting that the model has strong application adaptability in actual scenarios.
[0064] In summary, Figure 6 The classification visualization results verify that the CAE-CBAM data enhancement strategy proposed in this invention not only has the advantage of quantitative indicators in improving the oat grain damage identification task, but also has good image visualization recognition effect, providing a reliable image foundation and decision support for the subsequent intelligent recognition system of agricultural products.
[0065] In summary, the present invention discloses a method for enhancing and identifying broken oat kernel spectral data based on a CAE-CBAM deep generative model. To address the problems of scarcity and low recognition accuracy of broken oat kernels during post-harvest processing or distribution, a new strategy combining visible-near-infrared hyperspectral imaging and deep generative modeling is proposed. This method utilizes a hyperspectral imaging system to acquire spectral information of oat kernels in the 400-1000nm range and extracts single-kernel spectral features through image processing techniques. Under small sample conditions, a deep generative network is constructed that integrates a convolutional autoencoder (CAE) and a channel-spatial attention mechanism (CBAM) to achieve effective feature learning and enhanced sample generation for broken kernel spectra. The original and enhanced data are then combined to construct multiple classification models, including PLS, SVM, and RF, and the modeling effects of increasing different enhancement ratios are compared. Experimental results demonstrate that this method not only significantly improves the recognition accuracy and generalization ability of the model, but also demonstrates good image discrimination capabilities in visual evaluation, providing an efficient, stable, and scalable identification solution for grain crop quality screening, fine grading, and intelligent monitoring.
[0066] The above shows and describes the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the above embodiments do not limit the scope of protection of the present invention in any form. All technical solutions obtained by equivalent substitution, etc., fall within the scope of protection of the present invention. Parts not covered by the present invention are the same as the existing technology or can be implemented using existing technology.
Claims
1. A method for enhancing and identifying spectral data of broken oats for solving the problem of small sample size, characterized in that: The following steps are involved: Step 1: Select normal oats and damaged oats as research samples; Step 2: Using a visible-shortwave near-infrared hyperspectral imaging system to collect high-dimensional spectral data of normal and damaged oat kernels in the 400–1000 nm band; Step 3: Build a deep generative network model based on a convolutional autoencoder combined with a channel-spatial attention mechanism to extract deep features from the original spectra of the damaged grains and generate enhanced samples. Simultaneously, the deep generative network fusion model learns and generates the original damaged grain spectra to obtain enhanced spectral data, and evaluates its similarity and difference with the original spectra to ensure the representativeness and diversity of the generated data. Step 4: The original spectral data of normal and damaged oat kernels are divided into a modeling set and a prediction set according to a certain ratio. The number of data in the prediction set remains unchanged. Different numbers and proportions of generated samples are added to the modeling set to construct partial least squares regression models, support vector machine models, and random forest models. By comparing the model performance under different enhancement strategies, the effect of data enhancement on the classification results is analyzed. Step 5: Based on steps 3 and 4, evaluate the differences in the recognition accuracy of damaged kernels by different models before and after enhancement, and perform a visual display to analyze the classification ability and generalization performance of the model.
2. The method for enhancing and identifying spectral data of broken oats for solving the small sample problem according to claim 1, characterized in that: In the step 1, 700 normal oats and 70 damaged oats are selected, wherein the normal oats are oat grains without cracks, insect pests, or mildew, and the damaged oats are oat grains with mechanical breakage, cracks, or obvious structural defects.
3. The method for enhancing and identifying spectral data of broken oats for solving the small sample problem according to claim 1, characterized in that: In the step 2, the acquisition parameters of the visible-shortwave near-infrared hyperspectral imaging system are: the object distance between the lens and the sample is 300 mm, the spectral resolution is 1.43 nm, the scanning speed is 6.5 mm / s, the image size is 804×1097, and the window smoothing point number is 3.
4. A method for enhancing and identifying spectral data of broken oats for solving the problem of small sample size according to claim 1 or 3, characterized in that: In the second step, after hyperspectral spectral information of all samples is collected, a black and white correction method is used to reduce the dark current of the instrument itself and the influence of the sample itself on the reflection of the light source. Subsequently, image processing including threshold segmentation, corrosion, and expansion is used to automatically identify the acquired sample spectral images, extract the region of interest of each oat, and extract the average spectrum from it as input data for subsequent analysis.
5. The method for enhancing and identifying spectral data of broken oats for solving the problem of small sample size according to claim 1, characterized in that: In the step three, the deep generative network model introduces channel attention and spatial attention modules based on the CAE architecture. The channel attention module focuses on the band area with strong characteristic response to enhance the model's perception of characteristic wavelengths. The spatial attention module is used to assign different importance to spectral segments at different positions.
6. The method for enhancing and identifying spectral data of broken oats for solving the small sample problem according to claim 5, characterized in that: At the input of the deep generative network, the original spectral curve of the damaged grain is received as a one-dimensional input signal. After multiple layers of convolution operations, the convolutional autoencoder extracts the spectral change characteristics of the local area and realizes the compressed representation of the spectrum into a high-dimensional latent space. Then, the weights are calculated in the channel dimension and spatial dimension respectively to form a dynamic weighting mechanism.
7. The method for enhancing and identifying spectral data of broken oats for solving the problem of small sample size according to claim 1, characterized in that: In step 4, the original spectral data of normal oat kernels and damaged oat kernels are divided into a modeling set and a prediction set in a ratio of 3:2; 1 / 3, 2 / 3 and 1 times the number of damaged kernel samples are added to the modeling set, respectively, to construct a partial least squares regression model, a support vector machine model and a random forest model.
8. The method for enhancing and identifying spectral data of broken oats for solving the problem of small sample size according to claim 7, characterized in that: The accuracy, recall and precision of the partial least squares regression model, support vector machine model and random forest model on the calibration set and prediction set were calculated respectively, and the enhancement conditions with the best recognition accuracy were selected through comparative analysis.