Method for detecting microplastics in farmland soil based on hyperspectral imaging technology

Through the combination of hyperspectral imaging technology and multiple algorithms, microplastics in farmland soil can be quickly and accurately identified, solving the high cost and inefficiency problems of traditional detection methods and realizing non-destructive testing of microplastics.

CN115931741BActive Publication Date: 2025-07-25SICHUAN AGRI UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310059681.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-18
Publication Date
2025-07-25
Estimated Expiration
2043-01-18

AI Technical Summary

Technical Problem

The existing microplastic detection methods are cumbersome, costly and inefficient, making it difficult to quickly and accurately identify microplastics in farmland soil.

Method used

Using hyperspectral imaging technology, by obtaining the spectral images of the soil, pre-processing, feature variables are extracted using multiple algorithms, and supporting vector machines, backpropagation neural networks or one-dimensional convolutional neural network models are constructed for detection.

Benefits of technology

It realizes the rapid and efficient identification and classification of microplastics, provides theoretical support for non-destructive testing, and reduces the testing cost and time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115931741B_ABST
    Figure CN115931741B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of soil detection, and discloses a method for detecting microplastics in farmland soil based on hyperspectral imaging technology. The method includes: obtaining a spectral image of the target soil; extracting characteristic variables of the spectral image; constructing a detection model; and inputting the characteristic variables into the detection model to obtain a detection result. The detection method of the present invention can quickly and efficiently identify and classify microplastics, and has good application potential in the detection of microplastics in farmland soil, providing a theoretical support and technical means for the rapid and non-destructive detection of microplastics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of soil detection, and particularly to a method for detecting microplastics in farmland soil based on hyperspectral imaging technology. Background Art

[0002] Plastic particles smaller than 5 millimeters in the environment are defined as microplastics. Due to the influence of human activities and industrial production, microplastic pollution is becoming increasingly serious. Microplastics are widespread in aquatic ecosystems such as the ocean, lakes, and rivers, as well as in terrestrial ecosystems such as soil.

[0003] Soil is the basis for the growth of plants and crops. Once the soil is polluted, human survival will be greatly threatened, and food production will also be in a passive situation. The main sources of microplastics in soil include irrigation water, sludge used in agriculture, application of organic fertilizers, plastic film mulching, and atmospheric deposition. Therefore, realizing the rapid and efficient detection of microplastics in soil has important theoretical and practical significance for the prevention and control of farmland soil pollution.

[0004] For microplastics, common detection methods mainly include visual recognition, scanning electron microscopy (SEM), Fourier transform infrared spectroscopy (FTIR), Raman spectroscopy, and pyrolysis gas chromatography-mass spectrometry (Pyro-GC-MS), etc. However, these methods are relatively cumbersome to operate. Visual recognition cannot accurately identify smaller microplastic particles; microscopes need to measure the physical properties of microplastic particles one by one; Fourier transform infrared spectroscopy (FTIR), Raman spectroscopy, and pyrolysis gas chromatography-mass spectrometry (Pyro-GC-MS) are time-consuming and require operators to have rich experience.

[0005] Therefore, traditional detection methods have defects such as high detection cost and low detection efficiency. Summary of the Invention

[0006] The purpose of the present invention is to provide a method for detecting microplastics in farmland soil based on hyperspectral imaging technology, so as to solve the problems of high detection cost and low detection efficiency existing in traditional detection methods.

[0007] To achieve the above-mentioned invention purpose, the technical solution adopted by the present invention is: a method for detecting microplastics in farmland soil based on hyperspectral imaging technology, the method comprising:

[0008] Obtaining a spectral image of the target soil;

[0009] Extracting characteristic variables of the spectral image;

[0010] Constructing a detection model;

[0011] Inputting the characteristic variables into the detection model to obtain a detection result.

[0012] Preferably, it further includes: before extracting the characteristic variables of the spectral image according to a preset algorithm, preprocessing the spectral image, and the preprocessing includes SG convolutional smoothing processing and mean-variance normalization processing.

[0013] Preferably, extracting the characteristic variables of the spectral image includes:

[0014] Performing a first feature extraction on the spectral image based on a first preset algorithm to obtain preliminary features;

[0015] Performing a second feature extraction on the preliminary features based on a second preset algorithm to obtain characteristic variables.

[0016] Preferably, the characteristic variables extracted from the spectral image are: performing feature extraction on the spectral image based on a first preset algorithm to obtain characteristic variables.

[0017] Preferably, the first preset algorithm is a guided soft threshold method, a model adaptive space reduction method, or a principal component analysis method.

[0018] Preferably, the second preset algorithm is an isometric mapping method.

[0019] Preferably, the detection model is a support vector machine model, a backpropagation neural network model, or a one-dimensional convolutional neural network model.

[0020] The present invention also provides a farmland soil microplastic detection device based on hyperspectral imaging technology. The device is used to implement the above-mentioned farmland soil microplastic detection method based on hyperspectral imaging technology. The device includes:

[0021] An acquisition module for acquiring the spectral image of the target soil;

[0022] An extraction module for extracting the characteristic variables of the spectral image;

[0023] A construction module for constructing a detection model;

[0024] A detection module for inputting the characteristic variables into the detection model to obtain a detection result.

[0025] The present invention also provides an electronic device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor, and the processor can execute the machine-executable instructions to implement the above-mentioned farmland soil microplastic detection method based on hyperspectral imaging technology.

[0026] The present invention also provides a computer-readable storage medium, on which instructions are stored. When the instructions are executed by a processor, the processor is configured to execute the above-mentioned farmland soil microplastic detection method based on hyperspectral imaging technology.

[0027] The beneficial effects of the present invention are mainly reflected in:

[0028] The method for detecting soil microplastics based on hyperspectral imaging technology can quickly and efficiently identify and classify microplastics, which has good application potential in the detection of farmland soil microplastics, providing theoretical support and technical means for the rapid and non-destructive detection of microplastics. Description of the Drawings

[0029] Figure 1 is a flowchart of the method for detecting farmland soil microplastics based on hyperspectral imaging technology provided by an embodiment of the present invention;

[0030] Figure 2 is a flowchart of the method for detecting farmland soil microplastics based on hyperspectral imaging technology provided by an alternative embodiment of the present invention;

[0031] Figure 3 is a curve of the spectral image provided by an alternative embodiment of the present invention. Detailed Embodiments

[0032] In order to enable those skilled in the art to better understand the technical solutions of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0033] Embodiment 1

[0034] Figure 1 is a flowchart of the method for detecting farmland soil microplastics based on hyperspectral imaging technology provided by an embodiment of the present invention. As Figure 1 shown, a method for detecting farmland soil microplastics based on hyperspectral imaging technology, the method comprising:

[0035] Step S101: Obtain a spectral image of the target soil;

[0036] Step S102: Extract the characteristic variables of the spectral image;

[0037] Step S103: Construct a detection model;

[0038] Step S104: Input the characteristic variables into the detection model to obtain a detection result.

[0039] The method for detecting soil microplastics based on hyperspectral imaging technology can quickly and efficiently identify and classify microplastics, which has good application potential in the detection of farmland soil microplastics, providing theoretical support and technical means for the rapid and non-destructive detection of microplastics.

[0040] As a further optimization of this embodiment, the method further includes: before extracting the characteristic variables of the spectral image according to a preset algorithm, preprocessing the spectral image, and the preprocessing includes SG convolutional smoothing processing and mean-variance normalization processing.

[0041] In this embodiment, SG convolutional smoothing processing can improve the smoothness of the spectrum and reduce the interference of noise; mean-variance normalization processes the data after removing noise, limits the values of the spectral image of the target soil within a small range, avoids the complexity of high-value operations, and improves the operation efficiency at the same time.

[0042] In this embodiment, the characteristic variables of the spectral image can be processed using a single algorithm or a combination of multiple algorithms.

[0043] Specifically, the characteristic variables of the spectral image are extracted as follows: based on a first preset algorithm, feature extraction is performed on the spectral image to obtain characteristic variables, and the first preset algorithm is the Bootstrap Soft Thresholding (BOSS) method, the Model Adaptive Space Shrinkage (MASS) method, or the Principal Component Analysis (PCA) method.

[0044] Specifically, in step S102, extracting the characteristic variables of the spectral image includes:

[0045] Step a01: perform a first feature extraction on the spectral image based on a first preset algorithm to obtain preliminary features; in this embodiment, the first preset algorithm is the Bootstrap Soft Thresholding (BOSS) method, the Model Adaptive Space Shrinkage (MASS) method, or the Principal Component Analysis (PCA) method.

[0046] Among them, the Bootstrap Soft Thresholding method is derived from Weighted Bootstrap Sampling (WBS) and Model Population Analysis (MPA), and the weights of variables are determined according to the absolute values of regression coefficients. Sub-models are generated using WBS according to the weights, and the sub-models are analyzed using MPA to update the weights of variables. The optimization process follows the soft shrinkage rule, and unimportant variables are not directly eliminated but are given smaller weights. The algorithm runs iteratively until the number of variables reaches 1, and the optimal variable set with the smallest root mean square error in cross-validation (RMSECV) is selected.

[0047] Among them, the Model Adaptive Space Shrinkage (MASS) method is based on Model Population Analysis (MPA). By performing Weighted Binary Matrix Sampling (WBMS) on the model space, a large number of Partial Least Squares (PLS) regression models are established, and the elite part of the models is selected to statistically reassign the weights of each variable and sample. Then, the whole process is repeated until the weights of variables and samples converge. Finally, MASS adaptively finds a high-performance model composed of an optimized subset of variables and a subset of samples. This method avoids the problems of variable selection order and outlier detection.

[0048] Among them, the principal component analysis (PCA) uses complex basic mathematical principles to transform many potentially related variables into a smaller number of variables. The principal component analysis originated from multivariate data analysis and is an unsupervised learning algorithm that adopts the idea of matrix decomposition. It maps high-dimensional data into a low-dimensional space through a certain linear projection method, and expects the variance of the data to be the largest in the projected dimension (the maximum variance theory), so as to use fewer data dimensions and retain the characteristics of the original data points.

[0049] In this embodiment, the guided soft threshold method preferably adopts the guided soft threshold method (BOSS).

[0050] Step a02: Perform a second feature extraction on the preliminary features based on a second preset algorithm to obtain feature variables. In this embodiment, the second preset algorithm adopts the isometric mapping method.

[0051] Isometric mapping (ISOMAP) is a type of manifold learning for nonlinear data dimensionality reduction and is an unsupervised algorithm. It is based on geodesic distance globally and Euclidean distance locally, ensuring that the samples come from different classes or categories, so that the loss of data information can be better controlled, and the data in the high-dimensional space can be more comprehensively represented in the low-dimensional space.

[0052] In this embodiment, the spectral image is subjected to two feature extractions. The first feature extraction can reduce some redundant variables and collinear variables in the original variables, and the second feature extraction can further reduce the number of feature variables, further improving the performance of the detection model.

[0053] As a further optimization of this embodiment, the detection model is a support vector machine model, a backpropagation neural network model, or a one-dimensional convolutional neural network model.

[0054] Among them, support vector machines (SVM) are machine learning methods proposed on the basis of statistical learning theory. SVM performs classification by transforming the original training data into a multi-dimensional space and constructing a hyperplane in a higher dimension. For non-linear cases, it can be transformed into a linear classification through the kernel function mapping method. SVM is based on the VC dimension theory and the principle of structural risk minimization, and seeks the best compromise between model complexity and learning ability according to the effective sample information to achieve the minimum actual risk.

[0055] Among them, the Back Propagation Neural Network (BPNN) is a multi-layer feedforward network trained according to the error backpropagation algorithm. The main feature of this network is the forward transmission of signals and the backpropagation of errors. In the forward transmission, the input signal is processed layer by layer from the input layer through the hidden layer until the output layer. The state of each neuron only affects the state of the next layer of neurons. If the expected output is not obtained at the output layer, it will turn to backpropagation, and the network weights and thresholds are adjusted according to the prediction error, so that the predicted output of the backpropagation neural network continuously approaches the expected output.

[0056] Among them, the one-dimensional convolutional neural network model includes an input layer, a convolutional layer, a pooling layer, a fully connected layer, etc. The structure of the convolutional neural network has six convolutional layers, and a max pooling layer follows every two convolutional layers.

[0057] The input layer inputs the original data or the data preprocessed by other algorithms into the convolutional neural network. Its function is to send the input data into the convolutional neural network for feature extraction, and then obtain the results we want. In the present invention, a two-dimensional spectral image matrix of n×1 (n represents the dimension of the extracted feature variables) is used.

[0058] The convolutional layer consists of sliding filters at the input end, which extract features from the input feature variables. The sample data volume of the target soil in the present invention is small, and the scale of the two-dimensional spectral image matrix is also small. Therefore, the size of the convolutional kernel is 3×1 in the first and second layers, 12×1 in the third and fourth layers, and 12×1 in the fifth and sixth layers. In addition, the relu function is applied after each convolutional layer, which increases the sparsity of the network and reduces the amount of computation at the same time. The role of the pooling layer is to compress the input feature map. On the one hand, it simplifies the computational complexity of the network; on the other hand, it extracts the main features by feature compression. There are two commonly used pooling layers: the average pooling layer and the max pooling layer. The average pooling layer is the average value of the feature points in the neighborhood, and the max pooling layer is the maximum value of the feature points in the neighborhood. After testing, the max pooling layer has better feature extraction and model convergence effects. In this embodiment, the neural network model uses the max pooling layer.

[0059] The output layer is responsible for outputting the results. It has multiple neurons equal to the number of target variables and can use different types of activation functions according to the type of output.

[0060] In this embodiment, the detection model preferably adopts a one-dimensional convolutional neural network model; when the guided soft threshold method is used as the first preset algorithm and a one-dimensional convolutional neural network model is used as the detection model, it has good classification and recognition effects; secondly, different combinations of the detection model, the first preset algorithm, and the second preset algorithm can detect different types of microplastic contents in the soil, and have the advantages of fast detection speed and convenient detection.

[0061] The present invention also provides a farmland soil microplastic detection device based on hyperspectral imaging technology. The device is used to implement the above-mentioned farmland soil microplastic detection method based on hyperspectral imaging technology. The device includes:

[0062] An acquisition module for acquiring a spectral image of the target soil;

[0063] An extraction module for extracting characteristic variables of the spectral image;

[0064] A construction module for constructing a detection model;

[0065] A detection module for inputting the characteristic variables into the detection model to obtain a detection result.

[0066] The present invention also provides an electronic device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor, and the processor can execute the machine-executable instructions to implement the above-mentioned farmland soil microplastic detection method based on hyperspectral imaging technology.

[0067] The present invention also provides a computer-readable storage medium. Instructions are stored on the computer-readable storage medium, and when the instructions are executed by a processor, the processor is configured to execute the above-mentioned farmland soil microplastic detection method based on hyperspectral imaging technology.

[0068] The soil microplastic detection method based on hyperspectral imaging technology of the present invention can quickly and efficiently identify and classify microplastics, and has good application potential in the detection of farmland soil microplastics, providing theoretical support and technical means for the rapid and non-destructive detection of microplastics.

[0069] Embodiment 2

[0070] In this embodiment, the following experimental method is used to test the soil microplastic detection method based on hyperspectral imaging technology in Embodiment 1.

[0071] I. Acquisition of target soil

[0072] Soil samples were collected from the farmland (29.989°, 102.982°) of Sichuan Agricultural University in Ya'an City, Sichuan Province. The corn roots and weeds on the soil surface were removed, and 3 kg of soil was collected from the top 5 cm of the soil layer and taken back to the laboratory for processing.

[0073] II. Preparation of target soil

[0074] The soil was dried in an incubator at 60 °C for 12 hours to remove the moisture in the soil and prevent the influence of moisture change on the classification accuracy of microplastics during the experiment. Then, the dried soil was filtered using a 5-mm metal mesh sieve to filter out materials larger than 5 mm (such as crop roots and small stones). Finally, 0.15-mm polyethylene (PE), polypropylene (PP), and polyvinyl chloride (PVC) purchased from Hengfa Plasticization were added to the filtered soil in proportion. To simulate the real soil environment as much as possible, it was divided into 8 categories: soil+PE, soil+PP, soil+PVC, soil+PP+PE, soil+PVC+PE, soil+PVC+PP, soil+PVC+PP+PE, and soil. Each category had two different concentrations of 5% and 10%, with 9 parallel samples set for each category, and each sample weighed 10 g, for a total of 144 samples. To detect the influence of microplastic concentration on the detection efficiency, samples with concentrations of 5%, 4%, 3%, 2%, 1%, and 0.5% of polyethylene (PE), polypropylene (PP), and polyvinyl chloride (PVC) were made, with 9 parallel samples set for each concentration, for a total of 162 samples.

[0075] III. Obtaining spectral images

[0076] The hyperspectral images of soil microplastic samples were collected using the Gaia Sorter hyperspectral sorter. The wavelength sampling range was 387 - 1034 nm. The hardware structure of this sorter mainly included two groups of a total of 4 LSTS-200 tungsten bromide lamps as uniform light sources, an "Image-λ" series CCD camera, an electronically controlled moving platform, and a computer equipped with hyperspectral data acquisition software (SpaceView), powered by AC220V. The pixels and pixel sizes of the spectral camera were 1344×1024 and 6.45×6.45 μm, respectively.

[0077] IV. Pretreatment

[0078] During the acquisition of spectral images, interference from the sample itself and environmental factors will be encountered. To reduce the interference of the above factors, it is necessary to select an appropriate preprocessing method for the collected fluorescence spectral images to reduce or eliminate noise. In this embodiment, SG convolutional smoothing and mean-variance normalization are used to preprocess the spectral data of soil samples. SG convolutional smoothing can improve the smoothness of the spectrum and reduce the interference of noise. Then, mean-variance normalization is used to process the data after noise removal, limiting the spectral values of the samples within a smaller range, avoiding the complexity of high-value operations, and improving the operation efficiency at the same time.

[0079] V. Extracting Feature Variables

[0080] After preprocessing, the spectral image data still has strong correlations. Therefore, it is necessary to find out the feature variables conducive to classification and eliminate the irrelevant variables. In the embodiment of the present invention, Bootstrapping SoftShrinkage (Boss), Model Adaptive Space Shrinkage (MASS), Principal Component Analysis (PCA), and Isometric Feature Mapping (Isomap) are used to extract features from the spectral data after preprocessing.

[0081] VI. Detection Model Construction

[0082] The detection model adopts a support vector machine model, a backpropagation neural network model, or a one-dimensional convolutional neural network model.

[0083] To evaluate the classification results, in this embodiment, accuracy (A), precision (P), recall (R), and F1_score (F1) are used as the evaluation indicators of the detection model, and their definitions are as follows:

[0084]

[0085]

[0086]

[0087]

[0088] Among them, TP represents the true positive class, TN represents the true negative class, FP represents the false positive class, and FN represents the false negative class.

[0089] Accuracy refers to the ratio of the number of correctly predicted samples to the total number of samples. The higher the accuracy, the better the classification effect of the model. Its calculation method is shown in formula (1); Precision, also known as the precision rate, is for the prediction results. Its meaning is the probability that the samples actually positive among all the samples predicted as positive. Its calculation method is shown in formula (2); Recall, also known as the recall rate, is for the original samples. Its meaning is the probability that the samples predicted as positive among the samples actually positive. Its calculation method is shown in formula (3); F1 is the weighted harmonic mean of precision and recall, which takes into account the values of precision and recall. The higher the value of F1, the better the classification model. Its calculation method is shown in formula (4).

[0090] VII. Test Process

[0091] For each parallel sample, 6 regions of interest (ROIs) are selected, and the size of each ROI is 30×30 pixels. The average spectrum of each ROI is used as the original spectral value of the sample. The curves of the spectral images of all samples are as Figure 3 shown.

[0092] There are 864 spectral image data in total for the samples. Each spectral image data has 256 bands, with a high data dimension and a large amount of redundant information. If the entire spectral image data is directly input into the model, it will not only increase the running time of the model, but also the high correlation between spectra will lead to a decrease in classification accuracy. Therefore, in this paper, the BOSS algorithm, MASS algorithm, PCA algorithm, ISOMAP algorithm, and the combined BOSS, MASS and ISOMAP algorithms are used to extract features from the preprocessed 864 spectral data.

[0093] Feature variable extraction based on the BOSS algorithm: The BOSS algorithm is used to extract feature variables from the preprocessed spectral data. During the extraction process of the spectral data, the maximum number of latent variables is set to 10 through cross-validation, the number of cross-validation layers is 5, and the number of sampling times is 1000. 105 feature variables are extracted from them, accounting for 41.02% of the total number of spectral variables.

[0094] Feature variable extraction based on the MASS algorithm: The MASS algorithm is used to extract feature variables from the preprocessed spectral data. During the extraction process of the spectral data, the maximum number of latent variables is set to 10 through cross-validation optimization, the number of cross-validation is 5, and the number of sampling times of the binary matrix is 1000. When extracting spectral feature variables, MASS iterates 28 times in total, and 134 feature variables are extracted from them, accounting for 52.34% of the total number of spectral variables.

[0095] Feature variable extraction based on the PCA algorithm: The PCA algorithm is used to extract feature variables from the preprocessed spectral data. When the first 10 principal components are retained, the corresponding principal component contribution rates and cumulative contribution rates are shown in Table 1. When the first 3 principal components are retained, their contribution rate is 99.1483%, which contains most of the information in the original spectral data, and the contribution rates of the first 3 principal components are all greater than 1%. Therefore, the first 3 principal components are selected as the result of the PCA algorithm processing and input into the subsequent classification model.

[0096] Table 1 Principal component contribution rates

[0097]

[0098]

[0099] The first feature extraction can reduce some redundant variables and collinear variables in the original variables, but the proportion of the extracted feature variables is still relatively high, and there are still a few redundant variables. In order to further improve the performance of the model, the obtained feature variables are subjected to a second extraction. The aforementioned ISOMAP algorithm can minimize the number of feature variables compared with the other 3 algorithms. Therefore, the BOSS and MASS algorithms are combined with the ISOMAP algorithm for the second feature extraction, which can not only combine the advantages of different feature extraction algorithms but also further reduce the number of feature variables.

[0100] The 6 types of spectral image data after feature extraction are divided into a training set and a test set according to a ratio of 7:3. In order to prevent overfitting of the data results, cross-validation is used to evaluate the performance of the model.

[0101] In the SVM model, the Gaussian kernel function is selected to establish the classifier. The 6 types of spectral image data after feature extraction are respectively input into the SVM model, and the classification performance of the established SVM model is shown in Table 2.

[0102] Table 2

[0103]

[0104] As can be seen from Table 2, the F1_score value of the SVM model established using 6 types of spectral feature variables ranges from 0.8552 to 0.9388, and its accuracy and precision are both greater than 0.85, and the classification effect is overall stable. Among them, the classification effect of BOSS-SVM is the worst, with its A, P, R, and F1 being 0.8538, 0.8694, 0.8538, and 0.8552 respectively. The reason is that there are many redundant variables in the feature variables extracted by the BOSS algorithm, which will interfere with the classification accuracy. The classification effect of the SVM model after the second feature variable extraction is improved, and its accuracy is increased by about 4%. Since some important variables in the data are removed during the second feature extraction, its classification effect is not the best. The classification effect of ISOMAP-SVM is the best, with its A, P, R, and F1 being 0.9385, 0.9433, 0.9385, and 0.9388 respectively. The SVM model has the most ideal classification and recognition effect on soil+PP and soil+PP+PE, and its accuracy reaches 100%.

[0105] When the BPNN model is selected, the spectral image data serves as the nodes of the input layer of the BPNN model. There are two hidden layers, with the number of nodes being 1000 and 600 respectively, and the output layer is 8 different types of soils. The relu function is selected as the activation function, the cross-entropy loss function is selected as the loss function, the learning rate is adaptively adjusted to 0.0001, and the Adam optimizer is used for gradient descent to realize the update of parameters. The 6 types of spectral data after feature extraction are respectively input into the BPNN model, and the classification performance of the established BPNN model is shown in Table 3.

[0106] Table 3

[0107]

[0108] As can be seen from Table 3, the F1_score value of the BPNN model established using 6 types of spectral feature variables ranges from 0.8756 to 0.9414, and its highest accuracy is 0.9414. The classification effect of the BPNN model is good. Compared with the BPNN after the first feature extraction, the classification accuracy of the BPNN after the second feature extraction has not been improved much, indicating that the second feature variable extraction in the present invention is not applicable to the BPNN model. Among them, the classification effect of ISOMAP-BPNN is the best, with its A, P, R, and F1 being 0.9414, 0.9427, 0.9414, and 0.9414 respectively. The BPNN model has the most ideal classification and recognition effect on soil+PE and soil+PVC, and its accuracy reaches 100%.

[0109] When a one-dimensional convolutional neural network model is selected, since there are many hyperparameters in the convolutional neural network, the present invention selects two hyperparameters, namely the learning rate and the batch size, adjusts different values and trains them with the model, so as to optimize the neural network selected by the present invention, and reflects the performance of the model through the above parameters.

[0110] Batch size: The purpose of setting batch_size is to let the model select a batch of data for processing each time during the training process. As the batch size increases, faster, smaller amplitudes, larger storage capacities, and easier convergence are achieved. Too small a batch size may lead to difficult convergence. In order to analyze the relationship between the batch size and the model performance, 1000 iterations were set in the experiment, and the model was trained and tested with different batch sizes. The test results show that when the batch size is 80, the model is in the optimal state, the loss curve remains stable, and a fast training rate is maintained. Therefore, the batch size was set to 80 in the subsequent research.

[0111] Learning rate: As the value of the learning rate decreases, the classification accuracy of the model will increase accordingly. In order to optimize the neural network model and analyze the influence of the learning rate on the model performance, the model was trained and predicted with different learning rates. As shown in Table 4, when the learning rates are 0.01 and 0.001, the classification performance of the model is optimal and the evaluation index values are comparable. However, when the learning rate is 0.01, the loss of the model is smaller, which is 0.8281. Therefore, when the learning rate is 0.01, the performance of the model is the best.

[0112] Table 4

[0113]

[0114] The six types of spectral data after feature extraction are respectively input into the 1D-CNN model, and the classification performance of the established 1D-CNN model is shown in Table 5.

[0115] Table 5

[0116]

[0117] It can be seen from Table 5 that the F1_score value of the 1D-CNN model established by using six types of spectral feature variables ranges from 0.0185 to 0.9417, and its highest accuracy is 0.9423. Generally, the classification effect of the 1D-CNN model is good.

[0118] Among them, the classification effect of MASS-1D-CNN shows an abnormal situation. The main reason is that the parameters of the 1D-CNN of the present invention are not applicable to the feature variables extracted by the MASS algorithm.

[0119] Compared with BOSS-1D-CNN, the classification accuracy of the second feature extraction BOSS-ISOMAP1D-CNN decreases. The reason may be that the ISOMAP algorithm eliminates important variables extracted by the BOSS algorithm during the feature extraction process. The classification accuracy of MASS-ISOMAP-1D-CNN is relatively normal, indicating that the second feature variable extraction in the present invention is applicable to MASS.

[0120] BOSS-1D-CNN has the best classification effect, with its A, P, R, and F1 being 0.9423, 0.9471, 0.9423, and 0.9417 respectively. The 1D-CNN model has the most ideal classification and recognition effects on soil+PVC, soil+PVC+PE, and soil+PVC+PP, with an accuracy rate reaching 100%. The classification and recognition accuracy of the 1D-CNN model for soil+PE is only 72%. 1D-CNN misclassifies 25% of soil+PE as soil+PP and 3% of soil+PE as soil+PVC. The main reason may be that there are many gravels, crop roots, etc. in the soil samples that cannot be removed, affecting the final classification effect.

[0121] Therefore, in the present invention, the SVM model has the most ideal classification and recognition effects on soil+PP and soil+PP+PE, with an accuracy rate reaching 100%. The BPNN model has the most ideal classification and recognition effects on soil+PE and soil+PVC, with an accuracy rate reaching 100%. The 1D-CNN model has the most ideal classification and recognition effects on soil+PVC, soil+PVC+PE, and soil+PVC+PP, with an accuracy rate reaching 100%. The classification accuracy of the three classification models in the present invention is all above 93%. By comparing the above three models, the overall classification accuracy of 1D-CNN is better than that of the other two classification models, with a classification accuracy of 94.23%. Different combinations of the present invention can detect different types of microplastic contents in the soil, and have the advantages of fast detection speed and convenient detection.

[0122] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0123] This application is described with reference to the flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and combinations of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing device produce means for implementing the specified functions in one or more flows and / or blocks. Figure 1 in one or more flows and / or blocks Figure 1 or in one or more blocks.

[0124] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including instruction means for implementing the specified functions in one or more flows and / or blocks. Figure 1 in one or more flows and / or blocks Figure 1 or in one or more blocks.

[0125] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operational steps are performed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the specified functions in one or more flows and / or blocks. Figure 1 in one or more flows and / or blocks Figure 1 or in one or more blocks.

[0126] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.

[0127] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.

[0128] A computer-readable medium includes both permanent and non-permanent, removable and non-removable media and can implement information storage by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transitory medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer-readable medium does not include transitory computer-readable media such as modulated data signals and carrier waves.

[0129] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or apparatus comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or apparatus. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising the element.

[0130] The above are only embodiments of the present application and are not used to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.

Claims

1. A method for detecting microplastics in farmland soil based on hyperspectral imaging technology, characterized in that: The method includes: Obtaining a spectral image of the target soil; Extracting characteristic variables of the spectral image; the extraction of the characteristic variables of the spectral image includes: performing a first feature extraction on the spectral image based on a first preset algorithm to obtain preliminary features; performing a second feature extraction on the preliminary features based on a second preset algorithm to obtain characteristic variables; or performing a feature extraction on the spectral image based on the first preset algorithm to obtain characteristic variables; wherein, the first preset algorithm is the guided soft threshold method, the model adaptive space reduction method, the principal component analysis method or the isometric mapping method, and the second preset algorithm is the isometric mapping method; Constructing a detection model; the detection model is a support vector machine model, a backpropagation neural network model or a one-dimensional convolutional neural network model; Inputting the characteristic variables into the detection model to obtain a detection result; Wherein, when the detection model selects the support vector machine model, the detection model is used to identify soil+PP and soil+PP+PE in the soil; and the model adaptive space reduction method is used to perform a first feature extraction on the spectral image to obtain preliminary features, and then the isometric mapping method is used to perform a second feature extraction on the preliminary features to obtain characteristic variables; When the detection model selects the backpropagation neural network model, the detection model is used to identify soil+PE and soil+PVC in the soil; and the isometric mapping method is directly used to perform a feature extraction on the spectral image to obtain characteristic variables; When the detection model selects the one-dimensional convolutional neural network model, the detection model is used to identify soil+PVC, soil+PVC+PE and soil+PVC+PP in the soil; and the guided soft threshold method is directly used to perform a feature extraction on the spectral image to obtain characteristic variables.

2. The farmland soil microplastic detection method based on hyperspectral imaging technology according to claim 1, wherein: It further includes: Before extracting the characteristic variables of the spectral image according to the preset algorithm, preprocessing the spectral image, and the preprocessing includes SG convolutional smoothing processing and mean-variance normalization processing.

3. A farmland soil microplastic detection device based on hyperspectral imaging technology, which is used to implement the farmland soil microplastic detection method based on hyperspectral imaging technology according to claim 1 or 2, and is characterized in that: The device includes: An acquisition module for acquiring a spectral image of the target soil; An extraction module for extracting characteristic variables of the spectral image; A construction module for constructing a detection model; A detection module for inputting the characteristic variables into the detection model to obtain a detection result.

4. An electronic device, comprising a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, characterized in that: The processor can execute the machine-executable instructions to implement the method for detecting microplastics in farmland soil based on hyperspectral imaging technology according to claim 1 or 2.

5. A computer-readable storage medium having instructions stored thereon, characterized in that: When executed by the processor, the instructions cause the processor to be configured to execute the method for detecting microplastics in farmland soil based on hyperspectral imaging technology according to claim 1 or 2.

Citation Information

Patent Citations

  • Agricultural product quality parameter detection method and equipment based on fluorescence hyperspectral imaging

    CN114720436A