Dual-band fusion hyperspectral flaxseed imperfect grain identification method based on 1D-CNN (1D-Convolutional Neural Network)

By fusing visible-near-infrared and short-wave infrared spectral data through the 1D-CNN network and constructing a deep convolutional neural network, the problems of low efficiency and insufficient accuracy in flaxseed defect detection were solved, and high-precision multi-category defect detection was achieved.

CN120635717APending Publication Date: 2025-09-12NANJING AGRICULTURAL UNIVERSITY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510793071.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Existing technologies for flaxseed defect detection have problems such as low manual sorting efficiency, sample destruction caused by chemical analysis, and insufficient accuracy of conventional machine vision detection. In addition, hyperspectral detection methods fail to fully utilize the complementary information of multi-band spectral data.

Method used

A dual-band fusion hyperspectral method based on 1D-CNN is used to combine visible-near-infrared and short-wave infrared spectral data to construct a deep convolutional neural network to achieve high-precision non-destructive detection of flax seed defects such as mold, breakage, germination and heat damage.

Benefits of technology

The simultaneous non-destructive detection of multiple types of defects in flax seeds has been achieved, with a detection accuracy of over 97.50%, significantly improving the comprehensiveness and accuracy of detection. The model has stronger feature extraction capabilities and robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120635717A_ABST
    Figure CN120635717A_ABST
Patent Text Reader

Abstract

The invention relates to a 1D-CNN (1D-Convolutional Neural Network)-based dual-band fused hyperspectral flaxseed incomplete grain identification method, which is characterized in that sample data of moldy grains, damaged grains, thermal damaged grains, germinated grains and normal grains are synchronously acquired through a visible-near infrared (400-1000nm) and short-wave infrared (1000-2000nm) dual-band hyperspectral imaging system; after black and white board correction and region-of-interest extraction, seamless splicing of dual-band spectral data is realized by adopting a linear interpolation technology, then data quality is optimized by preprocessing methods such as multivariate scatter correction and standard normal transformation, and finally, deep features are extracted by utilizing a 1D-CNN deep learning model with a three-layer convolution structure. According to the technology, the limitation of traditional single-band detection is broken through, the identification accuracy of the flaxseed imperfect grains is improved to 97.50%, and compared with a single-band detection method, the identification accuracy is remarkably improved by 3-5%.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of agricultural product quality detection, and in particular to a dual-band fusion hyperspectral flaxseed imperfect grain recognition method based on 1D-CNN (one-dimensional convolutional neural network). Background Art

[0002] In the field of agricultural product quality inspection, traditional flaxseed defect detection relies primarily on manual sorting and chemical analysis. Manual sorting is inefficient and highly subjective, and inspectors are prone to fatigue, leading to missed detections. Accurate identification of microscopic defects, such as those in the early stages of mold, is particularly challenging. While accurate, chemical analysis methods require sample destruction and require long testing cycles, failing to meet the real-time, non-destructive testing requirements of modern agricultural production lines. Conventional machine vision technology, limited to the visible light band, can only detect obvious surface damage and is ineffective for detecting internal defects such as germination and heat damage.

[0003] Hyperspectral imaging technology, an emerging nondestructive testing method, can simultaneously acquire both spatial and spectral information about the object being tested. Existing hyperspectral detection methods often use a single wavelength band for analysis. The visible light band is sensitive to color changes but struggles to detect early stages of mold. While the short-wave infrared band can reflect molecular vibrations, it is susceptible to interference from the sample's surface state. Traditional spectral analysis methods, such as partial least squares regression (PLSR), require complex spectral preprocessing and manual feature selection, resulting in poor stability and limited adaptability in practical industrial applications.

[0004] In recent years, deep learning technology has demonstrated strong potential in spectral analysis, but its application in agricultural product testing still faces challenges. Convolutional neural networks (CNNs) require a large number of labeled samples for training, while acquiring and labeling defective agricultural product samples is costly. Existing spectral CNN models often directly apply network structures from image processing, failing to fully consider the one-dimensional continuous nature of spectral data. Furthermore, research on fusion strategies for multi-band spectral data is insufficient, and simple data concatenation or feature addition fails to fully exploit the complementary information between different bands. These technical bottlenecks limit the practical application of hyperspectral detection technology in agricultural product quality control. Summary of the Invention

[0005] To address existing flaxseed defect detection technologies, which suffer from low manual sorting efficiency, sample destruction during chemical analysis, and insufficient precision from conventional machine vision, this paper proposes a 1D-CNN-based dual-band fusion hyperspectral flaxseed defect detection method. By fusing visible-near-infrared and shortwave infrared dual-band spectral data with a deep convolutional neural network, this method achieves high-precision nondestructive detection for multiple defects, including mold, breakage, sprouting, and heat damage.

[0006] To achieve the above objectives, the present invention provides the following technical solutions:

[0007] The present invention proposes a method for identifying imperfect flaxseed kernels based on dual-band fusion hyperspectral 1D-CNN, which includes the following steps:

[0008] Step 1: manually selecting normal flax seeds, heat-damaged kernel samples, broken kernel samples, sprouted kernel samples, and moldy kernel samples from unprocessed primary raw materials, and manually supplementing to prepare defective kernels;

[0009] Step 2: Using a hyperspectral imaging system, the hyperspectral data of the five flaxseed particles are collected simultaneously in the 400-1000 nm and 1000-2000 nm bands.

[0010] Step 3, correcting and extracting the five types of flaxseed hyperspectral data collected in step 2;

[0011] Step 4: Calculate the mean of the overlapping area to splice the data of the two bands into a new data set, and then preprocess the data;

[0012] Step 5: Based on the spliced ​​and fused dual-band original spectral data, a 1D-CNN binary classification model is constructed;

[0013] Step 6: Collect the hyperspectral data of the flax seeds to be predicted by referring to step 2, process the data by referring to steps 3 and 4, and input the preprocessed and fused dual-band data obtained in step 4 into the 1D-CNN model established in step 5 for classification and discrimination.

[0014] The hyperspectral imaging system consists of a visible-near-infrared (VIS) system and a short-wave infrared (SWIR) system. Specific parameters are as follows: the VIS-NIS system uses an ICLB1620 CCD camera (804×440 pixels) and an Inspector V10E imaging spectrometer (382.67-1010.64 nm), with a moving platform speed of 7 mm / s; the SWIR system uses an EM285CL camera (320×256 pixels) and an Inspector N25E imaging spectrometer (982.38-2562.36 nm), with a moving platform speed of 17 mm / s. Both systems were placed in a darkroom and preheated for 30 minutes before acquisition.

[0015] A 1D-CNN model was constructed using the PyTorch framework (version 1.8.0) running Python 3.8. The model consists of three convolutional layers (kernel sizes range from 5 to 25 points, stride 3), using a hybrid ELU and ReLU activation function and an adaptive average pooling layer. Accuracy, precision, recall, and F1 scores were calculated using the Scikit-learn toolkit, and feature visualization was performed using t-SNE.

[0016] According to the specific implementation effects provided by the present invention, the present invention discloses the following technical advantages:

[0017] Compared to existing technologies, this invention achieves the first simultaneous nondestructive detection of four types of defects: mold, breakage, sprouting, and heat damage, with a detection accuracy of over 97.50%. Through feature-level fusion of dual-band spectral data, the model can simultaneously capture the surface optical characteristics of flax seeds and internal molecular vibration information, significantly improving the comprehensiveness and accuracy of detection. The end-to-end 1D-CNN architecture effectively avoids the complex preprocessing steps required by traditional spectral analysis methods. The specially designed hybrid activation function (ELU+ReLU) and multi-scale convolution kernel (5-25 points) give the model stronger feature extraction capabilities, demonstrating excellent robustness while maintaining high accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 This is a flowchart of a dual-band fusion hyperspectral flaxseed imperfect grain recognition method based on 1D-CNN (one-dimensional convolutional neural network).

[0019] Figure 2 Flaxseed hyperspectral data extraction process.

[0020] Figure 3 Loss function curves of the training set and validation set during 1D-CNN training under dual bands.

[0021] Figure 4 t-SNE visualization scatter plot of the 1D-CNN binary classification results under dual bands. DETAILED DESCRIPTION

[0022] The technical solution of the present invention is further described in detail with reference to the following specific examples.

[0023] The purpose of the present invention is to provide a dual-band fusion hyperspectral flaxseed imperfect kernel identification method based on 1D-CNN. By jointly analyzing the physical characteristics of the 400-2000nm spectrum and the molecular bond vibration information, high-precision automatic identification of multiple types of defects in flaxseed, such as heat damage, mildew, breakage and germination, can be achieved.

[0024] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0025] like Figure 1 As shown, the present invention provides a method for identifying imperfect flaxseed kernels based on dual-band fusion hyperspectral 1D-CNN, comprising the following steps:

[0026] Step 1: Selecting moldy kernels, damaged kernels, and normal kernels from the primary flaxseed product, and then preparing sprouted kernels, moldy kernels, damaged kernels, and heat-damaged kernels in a laboratory according to international and domestic standard methods, ultimately collecting a total of 200 sprouted kernels, 200 moldy kernels, 200 damaged kernels, 200 heat-damaged kernels, and 800 normal kernels;

[0027] Step 2: synchronously collecting spectral data of different types of flaxseed particles in the 400-1000nm and 1000-2000nm bands;

[0028] Step 3: Perform black and white plate correction and spectral extraction based on the region of interest on the five types of flaxseed hyperspectral data collected in step 2;

[0029] Step 4: After unifying the two bands to the same wavelength coordinate through linear interpolation, the average is taken in the overlapping area, and the data of the non-overlapping area is retained to achieve seamless splicing. Then, the five types of flax seed data are preprocessed by automatic scaling, SG balance, first-order derivative, multivariate scattering correction, and standard normal transformation;

[0030] Step 5: A 1D-CNN binary classification model was constructed based on the concatenated and fused dual-band original spectral information. The sklearn.model_selection library (version 1.2.2) in Python 3.8 (Python Software Foundation, USA) was used to implement random stratified sampling with a training set:validation set ratio of 7:3, maintaining the original class distribution. A fixed random seed (random_state = 42) was set to ensure reproducible results. The 1D-CNN model, built using the PyTorch (1.8.0, Facebook Inc., USA) framework, used a three-layer convolutional structure (5-25 point kernels) to extract surface optical features and molecular vibrational features, respectively. End-to-end training was achieved using a hybrid of ELU and ReLU activation functions.

[0031] Step 6: Put the dual-band data that has undergone five different preprocessing in step 4 into the 1D-CNN model constructed in step 5 and evaluate its effect.

[0032] Step 1 specifically includes:

[0033] 800 flaxseed kernels with plump shapes and intact surfaces were selected as normal kernels and equilibrated in a constant temperature and humidity environment (temperature 25±1°C, relative humidity 50±5%) for 24 hours to ensure that the sample surface was free of impurities and that moisture was evenly distributed. Then, 200 flaxseed kernels were placed in a Petri dish lined with soaked filter paper and germinated in a constant temperature and humidity chamber set at 25±1°C and 85±5% in the dark. Samples were collected at 12, 24, 36, and 48 hours, and finally 200 germinated kernels were selected. Then, 3g of flaxseed kernels were weighed four times and placed in Petri dishes. 0.5mL of Aspergillus niger spore suspension was dripped into the Petri dishes. The dishes were then placed in a mold incubator set at 32±1°C and 90±5% relative humidity. Moldy flaxseed kernels were collected after 72 hours. The flax seeds were then placed in a forced air drying oven at 60°C, 80°C, 100°C, 120°C, and 140°C for 2 hours to simulate heat damage to the flax seeds. This yielded 200 heat-damaged kernels. The flax seeds were then manually sheared and damaged, crushed using a grinder, and naturally damaged kernels were selected from purchased primary flax seeds. This yielded a total of 200 damaged kernels.

[0034] Among them, step 2 specifically includes:

[0035] (1) Hyperspectral data of flaxseed samples in the 400-1000 nm band were collected using a visible-near-infrared hyperspectral imaging system (Vis-NIR, Wuling Optical Co., Ltd., Taiwan, China). The Vis-NIR system consists of an 804×440 pixel ICLB1620 CCD camera (Imperx Co., Boca Raton, FL, USA), an inspector V10E imaging spectrometer with a spectral resolution of 382.67-1010.64 nm (Specim, Oulu, Finland), a halogen light source, a mobile platform, and a computer (Dell). The shooting distance was set to 80-340 mm, the moving speed was 7 mm / s, and the light intensity was 3.5. When collecting hyperspectral images, the light source was first turned on and preheated for 30 minutes to ensure that the temperature and light intensity were consistent during the collection process. The light source and camera lens were 30.0 cm and 24.0 cm away from the sample, respectively. Fix the two high-spectrum light sources at a 45° angle above the sample. This setting can effectively reduce the shadow area. Arrange the flax seeds to be photographed neatly on a rectangular EVA foam board according to the specifications of 10×10, and adjust to the optimal focal length before shooting.

[0036] (2) The short-wave near-infrared spectral imaging system (SWIR, Wuling Optical Co., Ltd., Taiwan, China) consists of a 320×256 pixel EM285CL camera (Raptor Photonics Co., Larne, UK), an inspector N25E imaging spectrometer (Specim, Oulu, Finland) with a wavelength range from 982.38 nm to 2562.36 nm and a spectral resolution of 6.5 nm, a halogen light source, a mobile platform, and a Dell computer. The speed of the mobile platform was set to 17 mm / s, and the moving distance was set to 80 to 340 mm. The exposure time was set to 1.5 ms, and the intensity was set to 250. The light source and camera lens were 35.0 cm and 29.0 cm away from the sample, respectively. The two light sources of the hyperspectral spectrum were fixed at a 45° angle above the sample. This setting can effectively reduce the shadow area, and the shooting was performed after adjusting to the optimal focus.

[0037] To avoid the influence of light, both systems were placed in a dark box. Before data acquisition, both hyperspectral imaging systems were preheated for 30 minutes to avoid interference from the light source. Flax seeds were displayed in a 10×10 array on a mobile platform.

[0038] Step three specifically includes:

[0039] (1) In order to eliminate the potential interference of dark current and uneven distribution of light sources on spectral information, it is crucial to correct the spectrum collected in step 2. In the experiment, the black and white plate correction method is used to eliminate redundant information. Place a polytetrafluoroethylene standard calibration white plate with a reflectivity of up to 99.99%. Through this step, a full white reflection image is obtained. Cover the opaque lens cover of the camera to obtain a full black reflection image. Based on these two images, a formula is introduced to calculate the corrected relative reflection image. Formula 1 is the hyperspectral image correction formula:

[0040] R=(R0-B) / (WB) (1)

[0041] Where: R is the hyperspectral image after black and white correction; R0 is the original hyperspectral image; B is the all-black reflection image after covering the camera lens cap; W is the all-white reflection image collected by scanning the whiteboard.

[0042] (2) Use Matlab R2022a software to extract spectral information and analyze it. The steps for extracting single flax seed hyperspectral data are as follows: Figure 3As shown in the figure, the region of interest (ROI) is first extracted. Since the abnormal distribution of flax seeds is in various parts, this study uses a complete flax seed as the ROI to extract the average spectrum. Then, the mask image is constructed using the grayscale images of 879.61nm and 1007.32nm respectively. Since each hyperspectral image contains 100 flax seeds, a threshold algorithm is used to distinguish flax seeds from the background. The hyperspectral data extraction process is as follows: Figure 2 , where the average spectrum of all pixels in each region of interest is the original spectrum of the region, thereby obtaining the spectral data of each flax seed for subsequent data processing and analysis.

[0043] Step 4 specifically includes:

[0044] This code uses linear interpolation to unify the visible (Vis) and near-infrared (NIR) band data onto a combined continuous wavelength axis. The reflectance of the overlapping areas is averaged to achieve a smooth transition, while the original data is retained in the non-overlapping areas. The specific steps are: first, the wavelengths of the two bands are merged and sorted to remove duplicates. Then, the visible light and near-infrared data of each sample are linearly interpolated within the new interval (NaN is filled in places outside the original range). Finally, the arithmetic mean of the interpolation results is calculated at the overlapping wavelength position. The valid data is directly selected in the non-overlapping area, and the spectral curve covering both bands is finally generated, as shown in the following formula.

[0045]

[0046] First-order derivatives are used to solve the common baseline correction problem in hyperspectral data, which may be caused by instrumental or environmental factors. Savitzky-Golay smoothing (SG smoothing) is used to reduce noise and improve the signal-to-noise ratio of the data. Automatic scaling is applied to scale the data, which facilitates the comparison of spectral features between different samples and instruments. Scatter correction is a technique widely used to reduce scattering effects in hyperspectral data. In this study, two methods are used to implement scatter correction. One is the standard normal variable.

[0047] The first is standard normal variate (SNV), which rapidly eliminates physical interference by self-normalizing individual spectra. The second is multiplicative scatter correction (MSC), which linearly corrects the global average spectrum and separates the spectral scattering effect from the chemical absorption signal through mathematical transformation. In summary, this study used five processing methods: first-order derivative, SNV, MSC, SG smoothing, and automatic scaling to preprocess the spliced ​​dual-band spectra.

[0048] Step five specifically includes:

[0049] The 1D-CNN model was constructed using the sklearn.model_selection library (version 1.2.2) of Python 3.8 (Python Software Foundation, USA) based on the spliced ​​and fused dual-band raw spectral data and the PyTorch (1.8.0, Facebook Inc., USA) framework.

[0050] (1) The designed CNN adopts an input layer, three convolutional layers (Conv1, Conv2 and Conv3), three batch normalization (BN) layers, a fully connected (FC) layer and an output layer. Specifically, the kernel size in the three convolutional layers is 3×1, and the number of kernels is 16, 32 and 32 respectively. The BN layer is used to accelerate network convergence, and the rectified linear unit (ReLU) function implements the nonlinear transformation of the feature map as the activation function (Qianqian Li et al., 2021). Before connecting with the FC layer, the spectral data is flattened into a one-dimensional array. The FC layer consists of 16 nodes. The training hyperparameters of the CNN model are set as follows: the optimizer is stochastic gradient descent (SGD), the batch size is 64, the learning rate is 0.01, and the model is trained for 200 epochs.

[0051] (2) The model was trained using the Adam optimizer with an initial learning rate of 0.0001 and a weight decay coefficient of 0.001 to implement L2 regularization. During training, a batch size of 32 and a maximum number of epochs of 250 were used. An early stopping strategy (with a patience value of 15) was used to prevent overfitting. The binary cross entropy (BCELoss) loss function was used, and gradient clipping (threshold 1.0) was used to stabilize the training process.

[0052] During the training process, the loss functions of the training set and the validation set are recorded and the loss function curves are plotted as follows: Figure 3 As shown, to ensure that there is no overfitting or underfitting during the model training process. The code written by the present invention also includes t-SNE dimensionality reduction visualization of the classification results, such as Figure 4 As shown in the figure, defective particles and normal particles can be clearly distinguished, indicating that the model has achieved good results.

[0053] Step six specifically includes:

[0054] (1) The original spectral data of the visible band (400-1000nm), invisible band (1000-2000nm) and dual band (1000-2000nm) are put into the 1D-CNN model constructed in the step, and the overall accuracy, precision, recall rate, specificity and F1 score on the validation set are calculated as evaluation indicators to evaluate the effects of different band data sets, as shown in Table 1.

[0055] Table 1 Validation set evaluation indicators of different band datasets

[0056]

[0057] (2) After training, the code evaluates the model performance on the validation set and prints out the accuracy, precision, recall, and F1 score, which can comprehensively evaluate the model's predictive performance. In the performance comparison of the three bands, it can be seen that the dual-band (400-2000nm) is significantly better than the single-band in all key indicators. Specifically, the accuracy of the dual-band reaches 95.33%, which is approximately 3% and 5% higher than the visible band (92.24%) and the invisible band (90.33%), respectively. In terms of precision, the dual-band even reaches an excellent level of 95.74%, indicating that its false alarm rate is extremely low.

[0058] (3) The superiority of dual-band data in classifying defective flaxseed kernels was determined through the above steps. Then, the dual-band datasets after different preprocessing methods were put into the 1D-CNN model. The accuracy, precision, recall, specificity, and F1 score were used as evaluation indicators for different preprocessing methods.

[0059] Table 2 Evaluation indicators of the dual-band dataset after different preprocessing methods

[0060]

[0061] As shown in Table 2, among the five preprocessing methods (first-order derivative, SNV, MSC, SG smoothing, and autoscaling), the dual-band data after SG smoothing achieved better results, achieving a classification accuracy of 97.50% on the validation set. This is primarily due to the unique convolution-weighted averaging properties of the SG smoothing algorithm. By fitting a polynomial within a local window to smooth the spectral curve, it effectively suppresses high-frequency noise (such as instrument random noise and sample surface scattering interference) while effectively preserving valuable chemical characteristic peaks in the original spectrum (such as the characteristic peaks of carotenoids at 400-500nm and the OH bonding vibration peaks at 1900-2000nm). Especially for samples with complex surface structures such as flaxseed in this study, SG smoothing demonstrates significant advantages in eliminating minor spectral fluctuations caused by particle heterogeneity. Furthermore, its adjustable window size and polynomial order parameters (a second-order polynomial with an 11-point window was used in this study) enable it to adaptively balance noise suppression and feature preservation. Ultimately, the full-band data after SG smoothing achieved the highest classification accuracy (97.50%) in the 1D-CNN model, an improvement of approximately 2.17% over the original data without SG smoothing. The improvement was particularly significant in the sensitivity of identifying subtle defects such as early-stage mold and mild heat damage.

[0062] The superior performance of dual-band technology stems from the complementary and integrated nature of multi-band information. The visible band primarily reflects the surface characteristics of the sample (such as color and morphology), while the invisible band contains information about molecular vibrations (such as CH / OH bonds). The combination of the two enables the model to capture both surface changes and changes in chemical composition. For example, in flaxseed testing, dual-band technology can simultaneously identify color changes caused by mold (visible band) and the chemical characteristics of oil oxidation (invisible band). This multi-dimensional information integration significantly improves classification accuracy.

[0063] Single bands are susceptible to specific interference factors, such as visible bands being sensitive to changes in ambient light, and invisible bands being affected by temperature fluctuations. The dual-band system effectively reduces the impact of a single interference factor through cross-validation of multi-dimensional data. When noise is detected in one band, other bands can provide additional support, significantly improving the model's stability and reliability.

[0064] By comparing the processing effects of dual-band fusion spectral data, the present invention found that the full-band data after SG smoothing performed best in the performance of the constructed 1D-CNN model.

[0065] This paper discloses a 1D-CNN-based dual-band fusion hyperspectral method for identifying imperfect flaxseed kernels. Traditional detection methods typically treat flaxseed as a single homogeneous medium. However, flaxseed is actually a complex, non-uniform, double-layer system composed of a surface structure and an internal structure. As light penetrates the seed surface and reaches the interior, it is inevitably affected by both the surface optical properties and the internal molecular structure, which can interfere with the accuracy of the detection model. In theory, it is more scientific to organically combine molecular vibrational information, which represents the internal quality characteristics of flaxseed, with surface morphological features to establish a predictive model. Therefore, the present invention uses a 1D-CNN network to extract characteristic information of the 400-1000nm visible near-infrared band and the 1000-2000nm short-wave infrared band, analyzes the physicochemical significance of each characteristic band, studies the overlapping and different parts of the dual-band characteristics, and uniformly refines the characteristic information through multi-scale convolution fusion technology, retains key spectral features and eliminates redundant band information irrelevant to quality indicators, clearly defines the characteristic wavelengths of optical properties that respond to defects such as flax seed mold, breakage, germination and heat damage, weakens the limitations of single-band detection, and realizes accurate identification of various types of imperfect kernels.

[0066] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for a person skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to replace some of the technical features therein with equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions claimed to be protected by the present invention.

Claims

1. A dual-band fusion hyperspectral flaxseed imperfect grain recognition method based on 1D-CNN, characterized in that: The following steps are involved: Step 1: manually selecting normal flax seeds, heat-damaged kernel samples, broken kernel samples, sprouted kernel samples, and moldy kernel samples from unprocessed primary raw materials, and manually supplementing to prepare defective kernels; Step 2: Using a hyperspectral imaging system, the hyperspectral data of the five flaxseed particles are collected simultaneously in the 400-1000 nm and 1000-2000 nm bands. Step 3, correcting and extracting the five types of flaxseed hyperspectral data collected in step 2; Step 4: Calculate the mean of the overlapping area to splice the data of the two bands into a new data set, and then preprocess the data; Step 5: Based on the spliced ​​and fused dual-band original spectral data, a 1D-CNN binary classification model is constructed; Step 6: Collect the hyperspectral data of the flax seeds to be predicted by referring to step 2, process the data by referring to steps 3 and 4, and input the preprocessed and fused dual-band data obtained in step 4 into the 1D-CNN model established in step 5 for classification and discrimination.

2. The method for identifying imperfect flaxseed kernels based on dual-band fusion hyperspectral 1D-CNN according to claim 1 is characterized by: In the step 1, moldy and damaged flaxseed grains and plump normal grains are selected, and then 200 moldy grains, 200 germinated grains, 200 damaged grains and 200 heat-damaged grains are artificially prepared in a laboratory environment.

3. The 1D-CNN-based dual-band fusion hyperspectral flaxseed imperfect kernel identification method according to claim 1, characterized in that: in step 2, the Vis-NIR system comprises an 804×440 pixel ICLB1620 CCD camera, an Inspector V10E imaging spectrometer with a spectral resolution of 382.67-1010.64 nm, a halogen light source, a mobile platform, and a Dell computer; the mobile platform speed is set to 7 mm / s, the travel distance is set to 80-340 mm, and the exposure time is 3 ms; The SWIR system consists of a 320×256 pixel EM285CL camera, an inspector N25E imaging spectrometer with a wavelength range from 982.38 nm to 2562.36 nm and a spectral resolution of 6.5 nm, a halogen light source, a mobile platform, and a Dell computer. The mobile platform's speed is set to 17 mm / s, the travel distance is set to 80 to 340 mm, the exposure time is set to 1.5 ms, and the intensity is set to 250. To avoid the influence of light, both systems were placed in a dark box. Before data acquisition, both hyperspectral imaging systems were preheated for 30 minutes to avoid interference from the light source. Flax seeds were displayed in a 10×10 array on a mobile platform.

4. The method for identifying imperfect flaxseed kernels based on dual-band fusion hyperspectral 1D-CNN according to claim 1 is characterized by: In the step three, the mask image is constructed using grayscale images at 879.61 nm and 1007.32 nm respectively; the spectral data of each flax seed is obtained by calculating the average value of all pixels in the ROI; and the black and white plate correction method is used to eliminate redundant information.

5. The method for identifying imperfect flaxseed kernels based on dual-band fusion hyperspectral 1D-CNN according to claim 1 is characterized by: In the step 4, after unifying the two bands to the same wavelength coordinate by linear interpolation, the average is taken in the overlapping area, and the respective data are retained in the non-overlapping area to achieve seamless splicing of the dual-band spectral data, and the spliced ​​data is preprocessed for standby use.

6. The method for identifying imperfect flaxseed kernels based on dual-band fusion hyperspectral 1D-CNN according to claim 1, characterized in that: In the step 5, a 1D-CNN model is constructed based on the spliced ​​and fused dual-band original spectral data, using a three-layer convolutional structure: 16-32-64 channels, and finally classification is achieved through a fully connected layer.

7. The method for identifying imperfect flaxseed kernels based on dual-band fusion hyperspectral 1D-CNN according to claim 1, characterized in that: In step six, the dual-band data processed in step four is input into the binary classification model established in step five, and effect evaluation and analysis are performed to determine the final model.

Citation Information

Cited By

  • Spectrometer for expanding OCT (optical coherence tomography) imaging depth and fusion imaging method

    CN122016044A