Red date variety classification and identification method based on one-dimensional data of near infrared spectrum

Through a classification and identification method based on one-dimensional data of near-infrared spectroscopy, multiple neural network algorithms are used to directly extract characteristic values ​​from the spectral data of red dates, which solves the problem of inconsistency between destructive testing and preprocessing in the identification of red date varieties, and achieves highly accurate non-destructive classification and identification and suitability testing.

CN120651781APending Publication Date: 2025-09-16TARIM UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311738615.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-18
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

The existing technology for the classification and identification of red date varieties has problems with inconsistent destructive testing methods and pretreatment operations, resulting in inconsistent test results and difficulty in applying them to other crops.

Method used

A classification and identification method based on one-dimensional data of near-infrared spectroscopy was adopted. The BP neural network, radial basis function neural network, convolutional neural network CNN algorithm, long short-term memory neural network algorithm, support vector machine algorithm and random forest algorithm were used to construct a traceability identification model. The characteristic values ​​were directly extracted from the collected near-infrared spectral data to avoid sample preparation and preprocessing. The classification research was carried out using six algorithms.

Benefits of technology

It achieves non-destructive classification and identification of red date varieties, improves detection accuracy and applicability, reduces data processing complexity, and is suitable for other traceability studies with an accuracy rate of 93.50%-94.25%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120651781A_ABST
    Figure CN120651781A_ABST
Patent Text Reader

Abstract

The invention discloses a red jujube variety classification and identification method based on one-dimensional data of a near infrared spectrum. The method comprises the following steps: collecting jujube samples at four places, namely Alaer, Hetian, Yiqiang and Zhonghai; performing data collection and data processing by using a near infrared spectrometer to obtain a one-dimensional jujube data set; constructing a traceability identification model by using a BP neural network, a radial basis function neural network, a convolutional neural network CNN algorithm, a long and short term memory neural network algorithm, a support vector machine algorithm and a random forest algorithm; and evaluating the traceability identification model. Six algorithms are used for carrying out classification research on 4000 groups of obtained one-dimensional data, related parameters are adjusted and optimized, finally, the RBF and the CNN are good in performance, and the accuracy rates are 93.50% and 94.25% respectively. The accuracy of 92.42% is achieved through the random forest algorithm, and good detection efficiency is shown. The research has positive significance on the traceability of jujube fruits and related crops.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of red date identification and traceability, and more particularly to a red date variety classification and identification method based on one-dimensional data of near-infrared spectroscopy. Background Art

[0002] Jujube (Ziziphus jujuba Mill.), also known as the Rhamnaceae jujube, is a key pillar industry in the region, providing numerous local jobs and contributing significantly to the local economy (Liu et al., 2020). Jujube is a small deciduous tree with drupe-shaped fruit measuring 2–3.5 cm in length and 1.5–2 cm in diameter. When ripe, the fruit changes from red to reddish-purple. The flesh is thick, sweet, and plump, while the seeds are flat and oval, about 1 cm long and 8 mm wide. Jujube trees typically bloom from May to July and thrive in mountainous, hilly, or plain areas at altitudes up to 1,700 meters. Jujube trees typically begin to bear fruit after three years of growth, with an economic lifespan of approximately 60–80 years.

[0003] Traceability refers to the process of tracking the origin, production process, and distribution path of a product or item. Its goal is to obtain and verify relevant information to ensure product quality, safety, and traceability. Traceability is often associated with food safety, product quality, and supply chain management. Jujubes are rich in nutrients and possess medicinal properties. They contain various vitamins and trace elements and, compared to other fruits, have higher levels of sugar, protein, and fat. In addition to their medicinal uses, jujubes have become a staple food in daily life, highlighting their importance to consumer health. Therefore, providing traceability information for jujubes can enhance consumer trust in the product, promote food safety regulations, promote environmentally friendly and sustainable agricultural practices, and enhance agricultural efficiency and sustainability. However, the frequent occurrence of food-related issues in recent years has led to a loss of consumer trust in related products due to fraudulent and profit-seeking practices. Therefore, implementing traceability using appropriate technologies can enhance consumer trust, strengthen food safety management, and promote sustainable agricultural development.

[0004] In recent years, many scholars have conducted extensive traceability research. Liang Ning summarized the research progress of food identification and traceability using infrared spectroscopy technology combined with artificial neural networks. Yan Yijun (detected phenolic compounds in peeled barley malt by using near-infrared hyperspectral imaging and machine learning methods, achieving a classification accuracy of up to 99.5% and a square correlation coefficient of up to 98.57%. Li Shuo developed a portable short-wave infrared hyperspectral imager, combined with a machine learning algorithm, to classify the geographical origin and root type of the plant purple currant, achieving an accuracy of 98.98%. Sajjad Kiyani used a portable hyperspectral imaging system to identify the geographical origin and quality of saffron, achieving an accuracy of up to 100%. Hao Wu used chemical and stable isotope fingerprinting technology to trace the origin of imported Chinese bottled mineral water with an accuracy of 96%.

[0005] Previous studies have conducted extensive research on traceability methods, focusing mainly on different types of food and relying mainly on chemical methods that can be destructive to the objects being tested. Related studies using different spectral and machine learning algorithms have mainly focused on traditional machine learning methods, mainly using image-based methods, which lack good adaptability to different origins of the same species. In addition, in most traceability studies, researchers need to pre-process the collected data before conducting further research, and the choice of various pre-processing methods varies among researchers, resulting in inconsistent results. In addition, in order to improve detection accuracy, researchers usually extract sensitive bands and other relevant information from the research objects, which significantly improves the experimental accuracy. However, the sensitive bands of different crops vary, making these methods less effective for traceability studies of other crops. Summary of the Invention

[0006] Therefore, the technical problem to be solved by the present invention is to provide a red date variety classification and identification method based on one-dimensional data of near-infrared spectroscopy that avoids destructive testing methods, uses all features extracted from the collected data to study relevant algorithms, and avoids preprocessing operations as much as possible, providing the possibility of applying these methods to other traceability work.

[0007] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0008] The method for classifying and identifying red date varieties based on one-dimensional data of near-infrared spectroscopy comprises the following steps:

[0009] (1) Jujube samples were collected from four locations: Alar, Hotan, Ruoqiang, and Zhangye;

[0010] (2) Data collection and data processing using near-infrared spectrometer to obtain a one-dimensional jujube dataset;

[0011] (3) Using BP neural network, radial basis function neural network, convolutional neural network (CNN) algorithm, long short-term memory neural network algorithm, support vector machine algorithm and random forest algorithm to build a traceability identification model;

[0012] (4) Evaluate the traceability identification model.

[0013] In the above-mentioned method for classifying and identifying red date varieties based on one-dimensional data of near-infrared spectroscopy, in step (1), dates were collected from the fields of local farmers in four locations: Aral, Hotan, Ruoqiang and Zhangye; a total of 4,000 samples were collected, with 1,000 samples collected from each location, of which 2,800 samples were used as a training set and 1,200 samples were used as a test set.

[0014] The above-mentioned method for classifying and identifying red date varieties based on one-dimensional data of near-infrared spectroscopy, in step (2), comprises:

[0015] (2-1) After washing and drying the dates, 250 small, average, large, unique, and undamaged dates were selected from each region for data collection;

[0016] (2-2) Data acquisition using infrared spectrometer: Open the Thermo Fisher Antaris II near-infrared spectrometer, wait for initialization to complete, open the RESULT-Integration software, check the instrument status, instrument accuracy, and instrument performance, and ensure that all test data are normal for subsequent experiments; place the sample cup in the test area, and place the test sample in the sample cup for diffuse reflectance infrared spectrum data acquisition; during the data acquisition process, the optimal gain was used, and the operation included 32 scan repetitions and 16 cm -1 The measurement mode is absorbance, and the scanning wavenumber range is 10000-4000cm -1 The beam mode was set to internal, the properties to best match, the gain to 1, and the mode to energy scan. The background noise was removed, and the selected jujube sample was placed in the integrated spherical solid sampling module for spectrum acquisition.

[0017] (2-3) After collecting the spectrum of the jujube sample, use RESULT-Integration to view the corresponding result data and corresponding reports to confirm that the corresponding result output is normal. Use the first-order derivative and second-order derivative to determine whether the corresponding noise has a significant impact. If normal, export the corresponding data. If there is a problem, adjust the number of scans and resolution-related parameters and conduct the experiment again. Finally, obtain the appropriate result data and output it for use in subsequent experiments.

[0018] In the above-mentioned method for classifying and identifying red date varieties based on one-dimensional data of near-infrared spectroscopy, in step (3), a BP neural network is used to construct a traceability identification model: the training algorithm is the Levenberg-Marquardt method, which minimizes the error function by continuously adjusting parameters; the number of iterations, target training error, learning rate, activation function and number of neurons are adjusted to obtain the best results;

[0019] The number of neurons was set to 6; the initial learning rate was set to 0.01, and the subsequent learning rates were adjusted adaptively; the target training error was set to 1×10 -6 ; The number of iterations is 1000; the activation functions include purelin, satlin, satlins, softmax, tribas and elliotsig.

[0020] The above-mentioned red date variety classification and identification method based on one-dimensional data of near-infrared spectroscopy, radial basis function neural network algorithm: adjusts the parameters related to the hidden layer radial basis function; adjusts the weight, bias, learning rate, number of training iterations and regularization parameters;

[0021] Four radial basis functions, newrbe, newrb, newgrnn, and newpnn, were used for classification tests, and the results showed that newrbe had the best classification performance.

[0022] The output weights and biases are optimized by the Levenberg-Marquardt optimization algorithm. The weights from the input layer to the hidden layer are matrices, and the output is a 750*4000 matrix. The bias output of the hidden layer is a 1*4000 matrix. The initial learning rate of the radial basis function neural network algorithm is 0.001, and the subsequent learning rate is adaptively adjusted. The adjustment uses the Adam optimizer, the regularization parameter is set to 0.01, the number of training iterations is 1000, and it automatically stops when the best performance is achieved. The automatic stop error is set to 1×10 -4 .

[0023] The above-mentioned red date variety classification and identification method based on one-dimensional data of near-infrared spectroscopy uses the convolutional neural network (CNN) algorithm. To improve training speed, batch normalization is added to ensure that the data distribution does not change significantly. In batch normalization, batchnorm is used, Offset is true, Scale is true, Centered is true, and Epsilon is 1e. -6 , the decay coefficient is 0.9, and the regularization parameter is 0.0001;

[0024] Activation function: The activation functions used are sigmoid, tanh, softmax, relu, elu; finally, using the ReLU activation function helps speed up training;

[0025] Because feature extraction from a single convolutional layer is ineffective, additional convolutional layers are added for feature extraction. Normalization and pooling layers are added after convolution to enhance the robustness of image features and reduce computational complexity. The loss function, number of training iterations, and learning rate parameters are adjusted.

[0026] The final model: the loss function is categorical cross entropy, the number of training iterations is 6300, the learning rate is 0.001, and the learning rate is the experimental setting learning rate * 0.5 after 150 times.

[0027] The above-mentioned red date variety classification and identification method based on one-dimensional data of near-infrared spectroscopy, long short-term memory LSTM neural network algorithm: the network structure was modified; the number of units in the hidden layer, the learning rate and the optimization algorithm parameters were adjusted; the number of iterations was 1000; during the modification process, the size of the LSTM layer and the fully connected layer were adjusted, and the final number of units in the hidden layer was 6, and the best value was obtained when the fully connected layer was modified to 4; the activation layer function was adjusted to ReLU, the loss function used was cross entropy, the learning rate was 0.01, and after 700 training times, it was reduced to learning rate*0.1, and the number of iterations was 28000.

[0028] The above-mentioned red date variety classification and identification method based on one-dimensional data of near-infrared spectroscopy, support vector machine algorithm SVM: includes three variants: single-class SVM, C-support vector classification C-svc and v-support vector classification V-svc; in terms of adjusting the SVM kernel function, linear kernel, polynomial kernel, radial basis function RBF kernel and sigmoid kernel are used.

[0029] The above-mentioned red date variety classification and identification method based on one-dimensional data of near-infrared spectroscopy uses the random forest algorithm: the number of decision trees, the minimum sample size per leaf, the number of features, and the feature importance parameters are adjusted and evaluated, and it is determined that 50 decision trees will be used; the minimum number of leaves is 1, out-of-bag predictions are performed, and feature importance calculations are performed.

[0030] In the above-mentioned method for classifying and identifying red date varieties based on one-dimensional data of near-infrared spectroscopy, in step (4), the algorithm for constructing the model is evaluated by F1 score, accuracy, precision and recall;

[0031] F1 score: F1 = (2*P*R) / (P+R);

[0032] Accuracy: Acc = (TP + TN) / (TP + FP + FN + TN);

[0033] Precision: P = TP / (TP + FP);

[0034] Recall: R = TP / (TP + FN);

[0035] Among them, TP stands for true positive, FN stands for false negative, FP stands for false positive, and TN stands for true negative.

[0036] The technical solution of the present invention achieves the following beneficial technical effects:

[0037] 1. The study used all bands extracted from the near-infrared spectral data as eigenvalues, without extracting and testing the sensitive bands unique to red dates. This was not done because different crops have different sensitive bands. While using these sensitive bands can improve accuracy for specific crops, it also means the corresponding method is not universally applicable to other crops. In this application, excellent results were achieved by classifying all eigenvalues ​​obtained by the near-infrared spectrometer. This research achievement is important for determining whether this method is generally applicable to the traceability of other items.

[0038] 2. When using a near-infrared spectrometer for data collection, there is no need to crush and grind according to traditional sample preparation methods, thereby achieving non-destructive data collection and non-destructive traceability of origin.

[0039] 3. 1,000 samples were selected from each region, and near-infrared spectral data were collected using an Antaris II Fourier transform near-infrared spectrometer. The data was then converted into one-dimensional data for analysis. One-dimensional data is simple and easy to understand. It is easy to visualize, simplify analysis, and reduce computational complexity. It can effectively reduce computation time, is lightweight, and is easy to process through combinations, permutations, and correlation analysis.

[0040] 4. This application uses six algorithms to conduct classification research on 4,000 sets of one-dimensional data obtained, including back propagation neural network (BP neural network), radial basis function neural network (RBF), convolutional neural network (CNN), long short-term memory network (LSTM), support vector machine (SVM) and random forest. After adjusting and optimizing the relevant parameters, RBF and CNN performed better, with accuracy rates of 93.50% and 94.25% respectively. The random forest algorithm achieved an accuracy rate of 92.42% and showed good detection efficiency. However, the BP neural network, long short-term memory network and support vector machine algorithms performed relatively poorly, with accuracy rates of 98.58%, 94.33% and 80.42% respectively.

[0041] 5. Considering the time-consuming nature of data collection during the testing process for large-scale datasets, further experiments randomly selected several sets of one-dimensional data and found that 400 sets of data performed significantly better than 700 sets. The final experimental results show that, in traceability testing on a small dataset containing 400 instances, the convolutional neural network (CNN) performed best, achieving an accuracy of 86.67%. The long short-term memory (LSTM) network performed slightly worse than the CNN, achieving an accuracy of 84.12%. The BP neural network, radial basis function neural network, support vector machine (SVM), and random forest algorithms achieved relatively low accuracies of 82.5%, 82.5%, 74.12%, and 74.18%, respectively. In experiments involving 700 instances, the CNN algorithm significantly outperformed. Compared to the CNN algorithm and the next-best LSTM algorithm on the 400-instance dataset, the accuracy, precision, recall, and F1 score improved by 53.13%, 98.98%, 481.43%, and 140.36%, respectively. The corresponding values ​​are 0.9043, 0.9083, 0.9052 and 0.906.

[0042] 6. This application demonstrates the non-destructive traceability of jujube fruit using near-infrared spectroscopy data combined with a neural network algorithm, while reducing the need for additional pre-processing steps in data processing and achieving promising results. This research has positive implications for the traceability of jujube fruit and related crops. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 : Flow chart of tracing the source of near infrared spectroscopy data of the present invention;

[0044] Figure 2 :Antaris II Fourier transform near-infrared spectrometer;

[0045] Figure 3 : RBF network basic structure diagram;

[0046] Figure 4 :Basic structure diagram of recurrent neural network (RNN);

[0047] Figure 5a : Near infrared spectral data image of Alaer red dates; Figure 5b : Hotan near infrared spectroscopy data image; Figure 5c : Ruoqiang red dates near infrared spectrum data image; Figure 5d : Zhangye red dates near infrared spectrum data image; Figure 5e :Summary of near-infrared spectral data of jujube trees from different origins;

[0048] Figure 6a : Low-precision BP neural network test set example; Figure 6b : Low-precision example of BP neural network training set; Figure 6c:BP neural network low precision correlation R value example

[0049] Figure 7a : High-precision examples of BP neural network test set; Figure 7b :BP neural network high precision correlation R value example;

[0050] Figure 8 : Radial basis neural network classification results of confusion matrix;

[0051] Figure 9a : CNN model diagram (4000 data); Figure 9b : Confusion matrix of convolutional neural network;

[0052] Figure 10 : Confusion matrix of long short-term memory neural network classification results;

[0053] Figure 11 : Confusion matrix of the test set of one-class support vector machine method;

[0054] Figure 12 : V-svc algorithm linear kernel function combination radial basis function kernel confusion matrix;

[0055] Figure 13a : Random forest algorithm fuzzy matrix image; Figure 13b : Random Forest Algorithm Related Images

[0056] Figure 14 : CNN model image (400 data);

[0057] Figure 15a : Confusion matrix of the linear kernel function of the support vector machine (SVM) algorithm; Figure 15b : Confusion matrix of the RBF kernel function of the support vector machine (SVM) algorithm. DETAILED DESCRIPTION

[0058] 1. Method Overview

[0059] This study conducted (a) sample collection: jujube samples were selected from four different regions and integrated. Subsequently, jujubes from different sources were collected; (b) data collection was performed using a near-infrared spectrometer, and the acquired data were preprocessed and converted to extract the corresponding one-dimensional jujube data set. (c) The origin of all collected jujube sample data was traced using relevant algorithms, and the corresponding results were obtained. In addition, a part of the samples was randomly extracted from the entire data set, and a small sample origin tracing study was conducted. Finally, the corresponding results were obtained and summarized for further analysis. The corresponding workflow is as follows: Figure 1 shown.

[0060] 2. Materials and Instruments

[0061] The jujube samples used in this study were collected from four locations: Aral, Hotan, Ruoqiang and Zhangye. To ensure the authenticity of the samples, all jujubes were collected from the fields of local farmers. A total of 4,000 samples were collected, with 1,000 samples collected from each location. Among them, 2,800 samples were used as training sets and 1,200 samples were used as test sets. For each sample, 1,557 features were collected for analysis. The experimental instrument used to collect near-infrared spectral data was an Antaris II Fourier transform near-infrared spectrometer (FT-NIR), such as Figure 2 shown.

[0062] All relevant codes for this study were run on a local server, and the specific configuration is shown in Table 1.

[0063] Table 1 Experimental operating parameters

[0064] Hardware / System Configuration system Microsoft Windows Server 2019Standard CPU Intel(R)Xeon(R)Silver 4210R@2.40GHz GPU NVIDIA GeForce RTX 3060Ti Memory 128GB Accelerated Environment CUDA 11.2

[0065] 3. Experimental Process

[0066] 3.1 Sample preparation

[0067] After washing and drying the dates, 250 small, average, large, and unique morphologically undamaged dates were selected from each region for data collection (i.e., samples of four morphologies were selected).

[0068] 3.2 Instrument calibration and setup

[0069] Prior to data collection, the performance of the NIR spectrometer was tested to ensure proper operation. During data collection, the optimal gain was used, and the operation included 32 scan repetitions and a 16 cm -1 The measurement mode is absorbance, and the scanning wave number range is 10000-4000cm -1 The beam mode is set to Internal, the properties are set to Best Match, the gain is set to 1, and the mode is set to Energy Scan.

[0070] During the spectrum acquisition process, the instrument was placed indoors and shielded from external factors such as natural light. Background noise was removed, and the selected jujube samples were placed in the integrated spherical solid sampling module for spectrum acquisition.

[0071] 3.3 Data Collection and Classification Identification Methods

[0072] After collecting the spectra of the jujube samples, the data were processed using relevant software, and all spectral data were exported as one-dimensional data for subsequent experimental use.

[0073] Turn on the Thermo Fisher Scientific Antaris II near-infrared spectrometer, wait for initialization to complete, and then open the RESULT-Integration software to check the instrument status, instrument calibration, and instrument performance. Ensure all test data is normal before proceeding with subsequent experiments. Place the sample cup in the test area and place the test sample into the sample cup to collect diffuse reflectance infrared spectrum data.

[0074] Use RESULT-Integration to view the corresponding result data and corresponding reports to confirm that the corresponding result output is normal. Use the first-order derivative and second-order derivative to determine whether the corresponding noise has a significant impact. If normal, export the corresponding data. If there is a problem, adjust the number of scans, resolution and other related parameters to conduct experiments, and finally obtain and output the appropriate result data.

[0075] Since there is no consensus on the best algorithm for classifying near-infrared spectral data, this study compared multiple algorithms. The algorithms used for classification included BP neural network, radial basis function neural network, CNN algorithm, long short-term memory network algorithm, support vector machine algorithm, and random forest algorithm.

[0076] 3.4 Introduction to Research Methods

[0077] 3.4.1 BP Neural Network

[0078] The BP neural network, or back-propagation neural network, is a common artificial neural network model. It was first proposed as a concept by Rumelhart and McClelland in 1986 and has since been widely used to solve classification and regression problems through error back-propagation training. Many researchers have applied and improved this algorithm.

[0079] A BP neural network involves two key processes: forward propagation and error backpropagation. It consists of multiple layers of neurons, typically consisting of an input layer, hidden layers, and an output layer. Each neuron is connected to neurons in the previous and next layers, forming a directed graph. Information propagates from the input layer into the network, through the hidden layers, and ultimately to the output layer, thus fulfilling the universal approximation theorem.

[0080] In a BP neural network, the number of nodes in the input and output layers is fixed, while the number of nodes in the hidden layer is variable. This has a significant impact on the neural network, and the number of hidden nodes is typically selected based on an empirical formula, as shown in Equation 1. Here, h is the number of hidden nodes, m is the number of input nodes, n is the number of output nodes, and a is a tuning constant between 1 and 10.

[0081]

[0082] In this study, it was found that the values ​​obtained from this formula produced relatively poor results. Therefore, the data were adjusted, and a range of node numbers was determined and adjusted on a case-by-case basis, and a value more suitable for the experiment was selected.

[0083] In a BP neural network, the forward propagation process is relatively simple. It refers to the forward calculation of the input data through the network, starting from the input layer, passing through the hidden layers, and finally reaching the output layer. This process is described by Equation 2 and Equation 3. In these equations, x j represents the output value of the jth node in the hidden layer, f is the activation function, represents the input of hidden layer node j, where w ij is the weight from the input layer to the hidden layer, x i is the output value of node i in the input layer, b j is the threshold for hidden layer node j. This section is actually a linear combination of the input and weights, plus the threshold. The output value of each node is determined by the output values ​​of all nodes in the previous layer, the weights between the current node and all nodes in the previous layer, the threshold of the current node, and the activation function f.

[0084]

[0085] x j =f(S j ) (3)

[0086] The training process of a BP neural network relies primarily on backpropagation, a complex process based on the Widrow-Hoff learning rule. This algorithm calculates the error between the network's output and the actual output, propagates the error from the output layer back to the hidden layer, and adjusts the connection weights in the network to minimize the error. This process uses a gradient descent optimization algorithm to update the weights, gradually improving the network's predictive ability.

[0087] The training algorithm used in this study is the Levenberg-Marquardt method, an optimization algorithm for solving nonlinear least squares problems. It is commonly used for curve fitting or parameter estimation. It is an iterative method that minimizes an error function by continuously adjusting parameters. Performance is evaluated using the mean squared error (MSE), as shown in Equation 4, where MSE is the mean squared error, n is the number of samples, yi represents the true value of the i-th sample, and y represents the predicted value of the i-th sample.

[0088] MSE=(1 / n)×Σ(y i -y) 2 (4)

[0089] 3.4.2 Radial Basis Function Neural Network (RBF)

[0090] A radial basis function (RBF) neural network is an artificial neural network that uses a radial basis function as an activation function. The output of an RBF network is a linear combination of the input radial basis functions and the neuron parameters. It belongs to the category of feedforward neural networks and can approximate any continuous function with arbitrary accuracy, making it particularly suitable for solving classification problems.

[0091] The structure of the radial basis function (RBF) neural network is similar to a multi-layer feedforward network. It is a three-layer network consisting of input nodes, hidden layers, and output layers. The input layer includes the source nodes, the second layer is the hidden layer, and the number of hidden units depends on the nature of the problem. The transfer function of the hidden unit is the RBF radial basis function, which is a non-negative nonlinear function with radial symmetry and gradually decreases as the center point changes. The third layer is the output layer, which is used to respond to the input pattern. The basic structure of the network is as follows Figure 3 shown.

[0092] Designing an RBF network involves two main aspects: structural design and parameter design. Structural design determines the appropriate number of nodes in the hidden layer, while parameter design involves determining the network parameters. In structural design, unsupervised methods are used to obtain the center and variance of the radial basis functions, and the weights from the hidden layer to the output layer are obtained by minimizing the mean squared error. In parameter design, supervised learning algorithms are used to train the center, variance, and weights of the radial basis functions in the network. Gradient descent is used to minimize the mean squared error, and each parameter is then adjusted accordingly.

[0093] Park and Sandberg demonstrated that radial basis function networks with sufficient hidden units can approximate continuous functions with arbitrary accuracy. However, compared to commonly used algorithms, they are relatively computationally expensive. Compared to other networks with multiple hidden layers, RBF networks have a relative advantage in handling complex pattern recognition tasks. In this study, the final experimental focus was on one-dimensional feature analysis. Therefore, RBF neural networks demonstrated good feasibility for this purpose.

[0094] 3.4.3 Convolutional Neural Network (CNN)

[0095] Convolutional neural networks (CNNs) are deep learning models widely used in image processing and computer vision tasks. They effectively process and analyze image data by simulating the structure and function of the human visual system. The core idea of ​​CNNs is to extract features from images using convolution operations and perform hierarchical feature extraction and classification through layered stacking. They consist of multiple layers, including convolutional layers, pooling layers, fully connected layers, and activation layers.

[0096] The convolutional layer is the foundation of CNNs. It applies a convolution operation between the input image and a set of learnable convolution kernels (filters) to extract local features from the image. The convolution operation's weight sharing and local connectivity enable CNNs to efficiently process large-scale image data. The formula for the convolutional layer is shown in Equation 5, where N is the output data, W is the input data, P is the padding value, F is the selected convolution kernel size, and S is the stride. W and N in the formula are raised to the corresponding power of the data dimension.

[0097] N = (W-F+2P) / S+1 (5);

[0098] Pooling layers are used to reduce the spatial dimensionality of feature maps while retaining important feature information. Common pooling operations include max pooling and average pooling, which effectively reduce the model's sensitivity to positional variations and enhance its robustness. The specific calculation formula for the pooling layer is the same as Equation 5.

[0099] Fully connected layers, typically found in the final few layers of a CNN, map high-level features to specific categories or labels. Each neuron is connected to all neurons in the previous layer, and the weights are learned to achieve classification. The computational complexity of a single fully connected layer is shown in Equation 6, where M is the computational complexity of the previous layer and F is the size of the convolution kernel in the current layer.

[0100] N = M × F (6);

[0101] Generally, CNNs are used for feature extraction, recognition, and detection tasks on two-dimensional data, such as images. However, because the data collected in this study was one-dimensional, a 1D-CNN was chosen for feature analysis. Given the relative simplicity of one-dimensional data compared to two-dimensional data, the initial convolutional model was relatively basic. However, due to unsatisfactory experimental results, the model was adjusted, ultimately resulting in a convolutional neural network architecture that performed well in this study.

[0102] The training speed in the experiment was slow due to the slow feature extraction process. To increase the training speed, batch normalization was added to ensure that the data distribution did not change significantly. Using the ReLU activation function also helped to speed up the training. Since feature extraction from a single convolutional layer was not effective, additional convolutional layers were added. Batch normalization and max pooling layers were also included to enhance the robustness of image features and reduce computational complexity. These adjustments ultimately led to good classification results. The experiment used batchnorm in batch normalization, Offset was true, Scale was true, Centered was true, and Epsilon was 1e -6, the decay coefficient is 0.9, and the regularization parameter is 0.0001. Regarding the activation function, this experiment uses sigmoid, tanh, softmax, relu, and elu. Select the ReLU activation function. ReLU (Rectified Linear Unit) is a commonly used activation function that outputs the original value when the input is positive and outputs zero when the input is negative. ReLU is linear in the positive interval, which means that for positive input, the gradient is always constant and there is no problem of gradient disappearance. In contrast, some activation functions such as Sigmoid and Tanh will saturate when the input is large or small, causing the gradient to approach zero, making it difficult for the network to learn. Compared with some complex activation functions, ReLU is faster to calculate. This is because in the positive interval, the output of the ReLU function is directly equal to the input, and no complex mathematical operations are required.

[0103] Since the final detection effect is not good, we choose to add a convolution layer to further extract features in order to improve the corresponding accuracy. In order to prevent obvious overfitting problems, we add a normalization layer and a pooling layer after the convolution. The reason why the maximum pooling layer is selected as the pooling layer is that the final accuracy of the maximum pooling layer is the best.

[0104] The final model is Figure 14 The loss function is categorical cross entropy, the number of training iterations is 6300, the learning rate is 0.001, and the learning rate is set to the experimental learning rate * 0.5 after 150 iterations.

[0105] 3.4.4 Long Short-Term Memory (LSTM) Neural Network

[0106] Long short-term memory (LSTM) neural networks are a variant of recurrent neural networks (RNNs) for processing sequential data. RNNs are networks with loops that allow information to persist over time, such as Figure 4 shown.

[0107] The LSTM network is designed to address the problems traditional RNN models encounter when dealing with long-term dependencies. It addresses the vanishing gradient problem by introducing a structure called a "gating mechanism." The gating mechanism includes a forget gate, an input gate, and an output gate, which control the flow and forgetting of information through a series of mathematical operations. With these gating mechanisms, the LSTM network can better capture long-term dependencies in sequential data and effectively solve related problems. The forget gate equation is shown in Equation 7, where W f is the weight matrix of the forget gate, [h t-1 ,x t ] means to connect two vectors into a longer vector, b f is the bias term of the forget gate, σ(sigmoid) is the activation function. If the input dimension is dx , the hidden layer dimension is d h , the cell state dimension is d c , the weight matrix W of the forget gate f The dimension is d cx (d h +d x ).

[0108] f t =σ(W f ×[h t-1 ,x t ]+b f ) (7);

[0109] The input gate equation is shown in Equation 8, where W i is the weight matrix of the input gate, b i is the bias term of the input gate, and the other parameters are similar to Equation 7.

[0110] i t =σ(W i ×[h t-1 ,x t ]+b i ) (8);

[0111] At the same time, it's worth mentioning the LSTM cell state, a crucial component of the LSTM network. It functions like a conveyor belt, transferring information between time steps and storing long-term dependencies. The relevant formula is shown in Equation 9, where the parameters are essentially the same as in Equation 8, with tanh being the function.

[0112]

[0113] Current cell state c t It is the state of the previous unit C t-1 With the forget gate f t Element multiplication of the current input and the input gate i t As shown in formula 10, c t Represents the unit state, o t Represents the output gate data.

[0114] h t =o t ×tanh(c t ) (10)

[0115] Through this gating mechanism, the LSTM network can effectively capture long-term dependencies in sequence data, making it suitable for tasks such as time series prediction and natural language processing.

[0116] 3.4.5 Support Vector Machine (SVM)

[0117] Support vector machines (SVMs) are supervised learning algorithms commonly used for classification and regression problems. They are based on the principle of structural risk minimization in statistical learning theory and aim to find the optimal decision boundary for classification. The decision function of an SVM can be expressed as Equation 11, where x is the feature vector of the input sample, w is the weight vector of the decision function, and b is the bias term or intercept.

[0118] f(x)=sign(w×x+b) (11)

[0119] SVM can also be extended to the case of nonlinear separability by using kernel functions. Through the kernel function, SVM maps the input samples from the original feature space to a high-dimensional feature space, so that the problem that was previously linearly inseparable becomes linearly separable in the new feature space. i Represents the weight corresponding to the support vector, y i represents the class label of the support vector, x i The eigenvectors representing the support vectors, K(x,x i ) is a measure of the difference between the input sample x and the support vector x i The kernel function of the similarity between them.

[0120] f(x)=sign(∑(α i y i K(x,x i ))+b) (12)

[0121] 3.4.6 Random Forest is an ensemble learning algorithm for classification and regression problems. It combines multiple weak learners, namely decision trees, and improves prediction performance through random feature selection and ensemble voting. For classification problems, the decision function of Random Forest can be expressed as a voting process, as shown in Equation 13, where x is the feature vector of the input sample, c1, c2, ..., c n Represents the prediction results of each decision tree.

[0122] f(x)=mode(c1,c2,...,c n ) (13)

[0123] The decision function of random forest can provide the final classification result by voting or averaging. This ensemble method enables random forest to integrate the prediction results of multiple decision trees, thereby obtaining more stable and accurate prediction results.

[0124] 3.5 Evaluation Method

[0125] To evaluate models and facilitate performance comparisons among researchers, it is necessary to establish unified evaluation criteria. In data mining theory, the most commonly used metric for evaluating predictive ability is the two-dimensional confusion matrix. As shown in Equations 14-17, the F1 score, accuracy, precision, and recall are all derived from the corresponding confusion matrix. In these formulas, TP stands for true positive, FN stands for false negative, FP stands for false positive, and TN stands for true negative.

[0126] F1 score: F1 = (2*P*R) / (P+R)

[0127] Accuracy: Acc = (TP + TN) / (TP + FP + FN + TN)

[0128] Precision: P = TP / (TP + FP)

[0129] Recall: R = TP / (TP + FN)

[0130] Efficiency is also an important indicator of classification methods. In this study, the results in this regard are directly expressed as the time consumed, providing a more intuitive measurement standard. In addition, since different methods in the study may have different model parameters, we compared the total training time and overall duration for subsequent comparison.

[0131] 4. Results and Discussion

[0132] In this study, the final results of all algorithms were obtained through repeated experiments, with conclusions drawn after comparing various aspects of different algorithms. The near-infrared spectral data obtained in this study are shown in Figures 5(a)-5(d), representing data from Alar, Hotan, Ruoqiang, and Zhangye, respectively. Figure 5(e) shows a summary of the selected data. The near-infrared spectral data was exported as one-dimensional data, generating 1557 features for classification experiments.

[0133] 4.1 Origin of BP Neural Network

[0134] For the BP neural network, we adjusted parameters such as the number of iterations, target training error, learning rate, activation function, and number of neurons to obtain the best results. During the training process, we found that selecting the number of neurons according to the formula can achieve more satisfactory results. After multiple experiments, the number of neurons was set to 6. The initial learning rate was set to 0.01, and the subsequent learning rate was adjusted adaptively. The target training error was set to 1×10 -6. Since the number of iterations does not exceed 1000 in most cases, and the methods with more than 1000 iterations take too long to train and have no significant improvement in accuracy compared to methods with shorter training times, the number of iterations is chosen to be 1000. As for the selection of activation functions, 15 activation functions were evaluated in the experiment, including compet, hardlim, hardlims, netinv, poslin, purelin, radbas, radbasn, satlin, satlins, softmax, tribas, elliotsig, logsig, and tansig. As shown in Figure 6(a)-(c), after multiple experiments, some functions showed relatively low accuracy and were therefore abandoned. As shown in Figure 7(a)-(b), we selected six functions, purelin, satlin, satlins, softmax, tribas, and elliotsig, for further study.

[0135] After adjusting the relevant functions and parameters of the BP neural network, the final results are shown in Table 2. Summarizing the data in the table, we found that the results associated with the tribas function were relatively superior. Therefore, this function was selected as the representative of the BP neural network algorithm in this experiment.

[0136] Table 2 Modeling results related to BP algorithm

[0137]

[0138] 4.2 Origin of Radial Basis Function Neural Network (RBF)

[0139] In the radial basis function neural network algorithm (RBF), the parameters related to the hidden layer radial basis function were adjusted. In addition, the weights, bias, learning rate, number of training iterations, and regularization parameters were also adjusted. Four radial basis functions, newrbe, newrb, newgrnn, and newpnn, were tested. The results showed that newrbe had the best classification performance, while the other functions had poor classification performance. The corresponding confusion matrix is ​​shown in Figure 1. Figure 8 shown.

[0140] The weights and biases in this experiment are optimized using the Levenberg-Marquardt optimization algorithm. The corresponding weight and bias data are optimized by adjusting the parameters. The output of the weights and biases cannot be displayed. The weights from the input layer to the hidden layer are matrices, and the output is a 750*4000 matrix. The bias output of the hidden layer is a 1*4000 matrix.

[0141] The initial learning rate of the RBF algorithm is 0.001, and the subsequent learning rate is adaptively adjusted. The adjustment uses the Adam optimizer, the regularization parameter is set to 0.01, the number of training iterations is 1000, and it automatically stops when the best performance is achieved. The automatic stopping error is set to 1×10 -4 .

[0142] 4.3 Origin of Convolutional Neural Networks (CNN)

[0143] When applying a convolutional neural network (CNN), after certain adjustments to the model and using a large amount of experimental data, good classification performance was achieved. The model structure is shown in Figure 9(a). Parameters such as the loss function, number of training iterations, and learning rate were adjusted. Based on the accuracy and loss curves during training, the model stabilized after 200 iterations. This number of iterations was selected to avoid overfitting, and the final results were obtained. The corresponding confusion matrix and accuracy-loss curve are shown in Figure 9(b).

[0144] The experiment uses batchnorm in batch normalization, Offset is true, Scale is true, Centered is true, and Epsilon is 1e -6 , the decay coefficient is 0.9, and the regularization parameter is 0.0001.

[0145] Regarding activation functions, the activation functions used in this experiment are sigmoid, tanh, softmax, relu, and elu. Choosing the ReLU activation function helps speed up training.

[0146] Since the final detection effect is not good, we choose to add a convolution layer to further extract features in order to improve the corresponding accuracy. To prevent obvious overfitting problems, we add a normalization layer and a maximum pooling layer after the convolution. The maximum pooling layer has the best final accuracy.

[0147] The theoretical basis is that due to underfitting in the results, we chose to increase the content of the feature extraction part. Since overfitting appeared in the comparison of the results of the training set, test set and validation set, normalization work and pooling layers were added.

[0148] The final model is Figure 14 The loss function is categorical cross entropy, the number of training iterations is 6300, the learning rate is 0.001, and the learning rate is set to the experimental learning rate * 0.5 after 150 iterations.

[0149] 4.4 Origin of Long Short-Term Memory (LSTM) Neural Network

[0150] In the experiments with the Long Short-Term Memory (LSTM) neural network, the network structure was modified. Parameters such as the number of units in the hidden layer, the learning rate, and the optimization algorithm were adjusted. The best results were obtained after training the model for 1,000 iterations, at which point both the loss and accuracy stabilized. Therefore, this result is considered the best, and the corresponding confusion matrix, accuracy, and loss are shown in Figure 2. Figure 10 As shown in the figure, during the modification process, the LSTM and fully connected layers were resized, ultimately achieving an optimal number of hidden units of 6 and 4 for the fully connected layer. The activation layer function was adjusted, remaining generally the same as the CNN, with RELU as the optimal choice. The loss function used was cross entropy, the learning rate was 0.01, and after 700 training cycles, it was reduced to learning rate * 0.1. The number of iterations was 28,000.

[0151] 4.5 Origin of Support Vector Machine (SVM)

[0152] In the study of the support vector machine (SVM) algorithm, three different variants were explored, namely single-class SVM, C-svc (C-support vector classification), and v-svc (v-support vector classification). Since the e-SVR and v-SVR methods mainly solve regression problems, they were not used in this study. The best results were obtained by adjusting the type of SVM kernel function. It was found that the single-class SVM method, which is mainly used for anomaly detection, is not suitable for classification. Figure 11 This is confirmed by the corresponding confusion matrix of the test set shown. Therefore, the C-SVC and V-SVC methods are further compared.

[0153] In multiple experiments using the C-SVC and v-SVC methods, by adjusting various parameters, C-SVC achieved a best test set accuracy of 64.25%, while v-SVC achieved a best test set accuracy of 83.75%. In comparison, v-SVC outperformed C-SVC in classification performance. The SVM kernels used included linear, polynomial, radial basis function (RBF), and sigmoid kernels.

[0154] We used linear kernel function u'v, polynomial kernel function (r*u'v+coef0)^degree, RBF kernel function exp(-r|uv|^2), and sigmoid kernel function tanh(r*u'v+coef0) to obtain the best result. Regarding the parameters such as r(gama), coef0, cost, and nu, we found that the linear kernel function and RBF kernel function achieved good results in the experiment. The confusion matrix of the corresponding results is shown below. Figure 15a , Figure 15bAs shown in the figure, the RBF kernel function performed better in the final comparison and was therefore used in subsequent experiments. Adjusting other parameters had little effect, so the relevant parameters were adjusted back to their original values ​​for the final experiment.

[0155] The corresponding confusion matrix of the v-svc algorithm is as follows Figure 12 shown.

[0156] 4.6 Origin of the Random Forest Algorithm

[0157] In the study of the random forest algorithm, parameters such as the number of decision trees, the minimum sample size per leaf, the number of features, and feature importance were adjusted and evaluated. After multiple experiments, the optimal parameters were selected and the best results were achieved using a total of 50 decision trees. The minimum number of leaves was set to 1, out-of-bag predictions were performed, and feature importance was calculated.

[0158] The best accuracy achieved on the test set is 92.42%. The corresponding result graphs are shown in Figure 13(a)-(b).

[0159] 4.7 Comparative Analysis of the Efficiency of Six Algorithms

[0160] Because efficiency is an important criterion for classification methods, we compared the training time, testing time, and total time of various methods. Since the BP neural network, radial basis function neural network, convolutional neural network, v-SVC, and the tribas function of the random forest algorithm performed relatively well, these six methods were included in the comparison. The results show that these methods have relatively good efficiency, as shown in Table 3.

[0161] Table 3 Classification efficiency of different algorithms (4000 samples)

[0162] Algorithm Length of training(s) Test Duration(s) Total duration(s) BP 280 7 287 RBF 172 7 179 CNN 203 7 210 LSTM 1092 7 1099 Support Vector Machine 43 6 49 Random Forest Algorithm 87 7 94

[0163] 4.8 Small Data Traceability

[0164] This study collected a total of 4,000 data points for comparative analysis. Several algorithms demonstrated promising performance in the experiments. However, after analyzing the experimental process, we found that analyzing such a large amount of data presented challenges in terms of both time and sample consumption. Therefore, we randomly selected data points to reduce the experimental data set, facilitating further research and repeatable experiments.

[0165] 4.8.1. Randomly select 400 data

[0166] When extracting and analyzing the relevant data, we found that extracting 400 instances from each source produced good attribution results. At the same time, there were significant differences between the various algorithms. Therefore, we selected this dataset size to conduct a comprehensive analysis of the relevant results.

[0167] When experimenting with BP neural networks, the accuracy of six functions—purelin, satlin, satlins, softmax, tribas, and elliotsig—dropped significantly. The corresponding accuracies were 78.16%, 82.5%, 74.16%, 55.83%, 65.83%, and 62.5%, respectively. Among these functions, satlin achieved relatively high accuracy and was therefore selected for further comparison.

[0168] In experiments with radial basis function neural networks and long short-term memory neural networks, the relevant parameters were adjusted, resulting in the best possible accuracy of 82.5% and 84.16%, respectively. These accuracies remained stable across multiple experiments. Compared to previous results, the accuracy has decreased significantly.

[0169] In the research of convolutional neural networks, the accuracy of the model used previously was low, with the best accuracy being only 54.75%. Therefore, the model was adjusted again, and the structure comparison before and after the adjustment was as follows: Figure 14 To avoid overfitting during training, we analyzed the accuracy and loss curves and found that the relevant parameters had stabilized after 500 training iterations. Therefore, we selected this number of iterations to achieve the desired results. The accuracy was 86.67%.

[0170] We adjusted various parameters and conducted repeated experiments for both the SVM and random forest algorithms. Comparison revealed that, among the SVM algorithms, C-SVC achieved the best accuracy of 72.165%, while v-SVC achieved a significantly lower accuracy of only 30.6%. The best accuracy for the random forest algorithm was 74.16%, a result that was consistent across repeated experiments.

[0171] We conducted a comprehensive comparison of relevant data. Analysis of the data in the table reveals that the efficiency of various algorithms is relatively similar. The CNN algorithm is slightly less efficient, but the difference is not significant. However, in terms of accuracy, precision, recall, and F1 score, the CNN algorithm outperforms the second-ranked LSTM algorithm by 3.03%, 1.97%, 0.70%, and 1.66%, respectively. See Table 4 for detailed data.

[0172] Table 4 Traceability results of different algorithms (400 samples)

[0173] Algorithm Acc P R F1-Score Total duration(s) BP-400 0.8250 0.8451 0.8413 0.8432 52 RBF-400 0.8250 0.8321 0.8233 0.8277 13 LSTM-400 0.8412 0.8559 0.8531 0.8545 43 C-SVC-400 0.7412 0.7977 0.7535 0.7750 38 Random Forest Algorithm-400 0.7418 0.7460 0.7495 0.7477 27 CNN-400 0.8667 0.8728 0.8591 0.8687 87

[0174] 4.8.2 Randomly select 700 data

[0175] While there were some differences in the accuracy of the algorithms when the dataset size was 400, the differences were not significant. Therefore, we conducted another round of experiments on the relevant data. After multiple iterations, we found that when the traceability data from various sources reached 700 instances, the CNN algorithm achieved an accuracy of 90.43%. While other algorithms showed significant improvements in accuracy and other metrics, there was still a significant gap compared to the CNN results. Specifically, in terms of accuracy, precision, recall, and F1 score, these values ​​exceeded the second-ranked LSTM algorithm by 4.64%, 3.92%, 4.07%, and 3.99%, respectively. Compared to the dataset size of 400, these differences increased by 53.13%, 98.98%, 481.43%, and 140.36%, respectively. Furthermore, there was only a slight difference in detection efficiency. Therefore, in this study, the CNN algorithm demonstrated a relative advantage. Detailed data is shown in Table 5.

[0176] Table 5 Traceability results of different algorithms (700 samples)

[0177]

[0178]

[0179] 4.8.3. Summarizing the analysis of different data points

[0180] After summarizing all the data, the results are shown in Table 6. Analysis of the tabular data shows that when the dataset consists of 4000 data points, the convolutional neural network and radial basis function neural network achieve the best classification performance, followed closely by the random forest algorithm. The v-SVC performs relatively poorly, while the remaining algorithms perform well. Comparing classification performance and efficiency, the radial basis function neural network achieves the best efficiency, followed by the long short-term memory neural network and the backpropagation neural network. The other algorithms perform generally well. When the dataset is reduced to 400 data points, the relevant parameters of some algorithms show a significant decrease, so they are not listed here. Comparing the relevant data reveals that the convolutional neural network achieves the best classification performance, followed closely by the long short-term memory neural network. The C-SVC and random forest algorithms perform relatively poorly, while the other algorithms perform well. When the dataset size reaches 700 instances, the results are largely consistent with those for 400 instances. However, the differences in accuracy, precision, recall, and F1 score are more pronounced compared to the 400-instance dataset. In addition to classification performance, we also conducted a comparative analysis of efficiency. The RBF neural network has the highest efficiency, followed by the LSTM neural network and the BP neural network. The efficiency of other neural networks is relatively average. The corresponding results are shown in Table 6.

[0181] Table 6 Summary of relevant data of different algorithms

[0182]

[0183]

[0184] V. Conclusion

[0185] In this study, we conducted field surveys and visited jujube orchards in Alar, Hotan, Ruoqiang, and Zhangye, obtaining approximately 60 kilograms of dried jujube fruit from local farmers for use in our experiments. We compared the appearance of jujube fruit from different regions and found that they were visually difficult to distinguish. We collected near-infrared spectral data from 1,000 samples from each region using an Antaris II Fourier transform near-infrared spectrometer. The data were then converted to one-dimensional data for analysis.

[0186] Previous studies have combined near-infrared spectrometer data with other data, such as images, and have achieved some positive results. For example, Guangxin Ren et al. used Fourier transform near-infrared spectrometers (FT-NIRS) to quantitatively analyze and geographically trace black tea, achieving a maximum accuracy of 94.3%. Zhang, L., et al. also conducted traceability studies using near-infrared spectroscopy and machine learning algorithms, achieving a maximum accuracy of 97.96%. However, these studies primarily relied on machine learning algorithms for predictive analysis, facing challenges such as insufficient data. In contrast, our research utilized deep learning algorithms, including convolutional neural networks, backpropagation neural networks, and radial basis function neural networks, to analyze and study the data, achieving excellent classification and detection results.

[0187] In addition, in previous studies, various methods such as proton transfer reaction time-of-flight mass spectrometry and inductively coupled plasma optical emission spectrometry have been widely used in traceability and related re-studies. However, these methods have disadvantages such as long detection time and the need to destroy samples, resulting in low detection efficiency and a large consumption of manpower and material resources. In addition, some crops have high economic value, requiring large-scale sample testing for the detection items. In our research, we collected near-infrared spectral data without destroying the items being tested, achieving non-destructive testing. This makes it possible to detect crops with high economic value, and the time required for detection using the corresponding algorithm is relatively short. In addition, as long as it is within the capabilities of the server, multiple tests can be performed simultaneously, thus achieving large-scale sample testing.

[0188] It's worth noting that in this study, we used all bands extracted from near-infrared spectral data as feature values, rather than extracting and testing sensitive bands specific to red dates. This is because different crops have different sensitive bands. While using these sensitive bands can improve accuracy for specific crops, it also means the resulting method may not be universally applicable to other crops. In our study, we achieved excellent results by classifying all feature values ​​obtained by the near-infrared spectrometer. This finding is important for determining the general applicability of this method to trace the provenance of other items.

[0189] Regarding the issue of test data, it's clear that when sufficient test data is available, the accuracy of the relevant algorithms is extremely high, with convolutional neural networks and radial basis function neural networks achieving 100% accuracy. However, when the data volume is small, the accuracy of the algorithms decreases. However, compared to machine learning algorithms such as random forests, neural network algorithms, including convolutional neural networks, have significantly higher accuracy. Among them, convolutional neural networks achieved the highest detection accuracy, reaching 86.67%, significantly outperforming other algorithms. Therefore, convolutional neural networks can theoretically be applied to traceability testing and achieve excellent results.

[0190] This study describes the development of a red date origin traceability system based on data collection and analysis. By combining near-infrared spectroscopy with mainstream machine learning algorithms, this study successfully achieved origin traceability for red dates. Effective origin traceability testing remains a challenge, as destructive testing or long removal times can significantly impact traceability research. This effort requires significant human, material, and time resources, and can result in corresponding economic losses. Based on the above results and discussion, the following conclusions can be drawn:

[0191] During data collection using a near-infrared spectrometer, traditional sample preparation methods such as crushing and grinding are not required, enabling non-destructive data collection and, consequently, non-destructive origin traceability. Furthermore, no further preprocessing or extraction of relevant data is required in sensitive spectral regions. This has important implications for the application of this method in other crop traceability studies. Furthermore, when conducting origin traceability studies on jujube fruits with varying amounts of data, different algorithms yielded varying results. However, when the data volume was sufficiently large, all algorithms demonstrated high accuracy, demonstrating the practical feasibility of origin traceability. Furthermore, in the jujube origin traceability study based on one-dimensional data, the experimental data were intentionally randomized, eliminating the reliance on human expertise and judgment in neural network-based traceability. Instead, the acquired data were automatically learned, gradually improving accuracy and ultimately achieving origin traceability. Furthermore, the 1D-CNN method was observed to outperform other algorithms in terms of effectiveness. Notably, the convolutional neural network model structure was significantly adjusted during the study to improve accuracy. This suggests that while the convolutional neural network model used in this study cannot directly guarantee optimal performance on other crops, theoretical adjustments to the correlation structure may lead to higher accuracy. Notably, compared to other algorithms, the long short-term memory (LSTM) neural network's accuracy for red date origin traceability decreased more slowly when data was significantly reduced. This suggests the feasibility of applying this algorithm in the field of origin traceability.

[0192] In future research, the team will add more red date varieties to the experiment and use corresponding algorithms to conduct further origin traceability research. Furthermore, efforts will be made to differentiate red dates from the same region based on geographical characteristics, exploring the possibility of narrowing the traceability range.

[0193] Obviously, the above embodiments are merely examples for clarity of explanation and are not intended to limit the implementation methods. Those skilled in the art will readily appreciate that other variations or modifications based on the above descriptions are possible. It is not necessary and impossible to enumerate all implementation methods here. Obvious variations or modifications arising therefrom remain within the scope of protection of the claims of this patent application.

Claims

1. A method for classifying and identifying red date varieties based on one-dimensional data of near-infrared spectroscopy, characterized in that: The steps include: (1) Jujube samples were collected from four locations: Alar, Hotan, Ruoqiang, and Zhangye; (2) Data collection and data processing using near-infrared spectrometer to obtain a one-dimensional jujube dataset; (3) Using BP neural network, radial basis function neural network, convolutional neural network (CNN) algorithm, long short-term memory neural network algorithm, support vector machine algorithm and random forest algorithm to build a traceability identification model; (4) Evaluate the traceability identification model.

2. The method for classifying and identifying red date varieties based on one-dimensional data of near infrared spectroscopy according to claim 1, wherein: In step (1), jujubes were collected from the fields of local farmers in four locations: Aral, Hotan, Ruoqiang, and Zhangye; a total of 4,000 samples were collected, with 1,000 samples collected from each location, of which 2,800 samples were used as a training set and 1,200 samples were used as a test set.

3. The method for classifying and identifying red date varieties based on one-dimensional data of near infrared spectroscopy according to claim 1, wherein: In step (2), it includes: (2-1) After washing and drying the dates, 250 small, average, large, unique, and undamaged dates were selected from each region for data collection; (2-2) Data acquisition using infrared spectrometer: Open the Thermo Fisher Antaris II near-infrared spectrometer, wait for initialization to complete, open the RESULT-Integration software, check the instrument status, instrument accuracy, and instrument performance, and ensure that all test data are normal for subsequent experiments; place the sample cup in the test area, place the test sample in the sample cup for diffuse reflectance infrared spectrum data acquisition; during the data acquisition process, use the optimal gain, and the operation includes 32 scan repetitions and 16 cm -1 The measurement mode is absorbance, and the scanning wavenumber range is 10000-4000cm -1 The beam mode was set to internal, the properties to best match, the gain to 1, and the mode to energy scan. The background noise was removed, and the selected jujube sample was placed in the integrated spherical solid sampling module for spectrum acquisition. (2-3) After collecting the spectrum of the jujube sample, use RESULT-Integration to view the corresponding result data and corresponding reports to confirm that the corresponding result output is normal. Use the first-order derivative and second-order derivative to determine whether the corresponding noise has a significant impact. If normal, export the corresponding data. If there is a problem, adjust the number of scans and resolution-related parameters and conduct the experiment again. Finally, obtain the appropriate result data and output it for use in subsequent experiments.

4. The method for classifying and identifying red date varieties based on one-dimensional data of near infrared spectroscopy according to claim 1, wherein: In step (3), the BP neural network constructs the traceability identification model: the training algorithm is the Levenberg-Marquardt method, which minimizes the error function by continuously adjusting the parameters; the number of iterations, target training error, learning rate, activation function and number of neurons are adjusted to obtain the best results; The number of neurons was set to 6; the initial learning rate was set to 0.01, and the subsequent learning rates were adjusted adaptively; the target training error was set to 1×10 -6 ; The number of iterations is 1000; the activation functions include purelin, satlin, satlins, softmax, tribas and elliotsig.

5. The method for classifying and identifying red date varieties based on one-dimensional data of near infrared spectroscopy according to claim 1, wherein: Radial Basis Function Neural Network Algorithm: Adjusted parameters related to the hidden layer radial basis function; adjusted weights, bias, learning rate, number of training iterations, and regularization parameters; Four radial basis functions, newrbe, newrb, newgrnn, and newpnn, were used for classification tests, and the results showed that newrbe had the best classification performance. The Levenberg-Marquardt optimization algorithm is used to optimize the output weights and bias data. The weights from the input layer to the hidden layer are matrices, and the output is a 750*4000 matrix. The bias output of the hidden layer is a 1*4000 matrix. The initial learning rate of the radial basis function neural network algorithm is 0.001, and the subsequent learning rate is adaptively adjusted. The adjustment uses the Adam optimizer, the regularization parameter is set to 0.01, the number of training iterations is 1000, and it automatically stops when the best performance is achieved. The automatic stop error is set to 1×10 -4 .

6. The method for classifying and identifying red date varieties based on one-dimensional data of near infrared spectroscopy according to claim 1, characterized in that: Convolutional Neural Network (CNN) algorithm: To improve training speed, batch normalization was added to ensure that the data distribution did not change significantly. In batch normalization, batchnorm was used, Offset was true, Scale was true, Centered was true, and Epsilon was 1e. -6 , the decay coefficient is 0.9, and the regularization parameter is 0.0001; Activation function: The activation functions used are sigmoid, tanh, softmax, relu, elu; finally, using the ReLU activation function helps speed up training; Because feature extraction from a single convolutional layer is ineffective, additional convolutional layers are added for feature extraction. Normalization and pooling layers are added after convolution to enhance the robustness of image features and reduce computational complexity. The loss function, number of training iterations, and learning rate parameters are adjusted. The final model: the loss function is categorical cross entropy, the number of training iterations is 6300, the learning rate is 0.001, and the learning rate is the experimental setting learning rate * 0.5 after 150 times.

7. The method for classifying and identifying red date varieties based on one-dimensional data of near infrared spectroscopy according to claim 1, characterized in that: Long Short-Term Memory (LSTM) neural network algorithm: The network structure was modified; the number of hidden layer units, learning rate, and optimization algorithm parameters were adjusted; the number of iterations was 1,000; the size of the LSTM layer and the fully connected layer were adjusted during the modification process, ultimately achieving an optimal number of hidden layer units of 6 and a fully connected layer of 4; the activation layer function was adjusted to ReLU, the loss function used was cross entropy, the learning rate was 0.01, and after 700 training cycles, it was reduced to learning rate * 0.1, and the number of iterations was 28,000.

8. The method for classifying and identifying red date varieties based on one-dimensional data of near infrared spectroscopy according to claim 1, characterized in that: Support vector machine algorithm SVM: includes three variants: single-class SVM, C-support vector classification C-svc and v-support vector classification v-svc; in terms of adjusting the SVM kernel function, linear kernel, polynomial kernel, radial basis function RBF kernel and sigmoid kernel are used.

9. The method for classifying and identifying red date varieties based on one-dimensional data of near infrared spectroscopy according to claim 1, characterized in that: Random Forest Algorithm: The number of decision trees, minimum sample size per leaf, number of features, and feature importance parameters were adjusted and evaluated, and 50 decision trees were used; the minimum number of leaves was 1, out-of-bag predictions were performed, and feature importance calculations were performed.

10. The method for classifying and identifying red date varieties based on one-dimensional data of near infrared spectroscopy according to claim 1, characterized in that: In step (4), the algorithm for building the model is evaluated by F1 score, accuracy, precision, and recall; F1 score: F1 = (2*P*R) / (P+R); Accuracy: Acc = (TP + TN) / (TP + FP + FN + TN); Precision: P = TP / (TP + FP); Recall: R = TP / (TP + FN); Among them, TP stands for true positive, FN stands for false negative, FP stands for false positive, and TN stands for true negative.

Citation Information

Cited By

  • Online sampling and laboratory testing linkage intelligent quality control method for litchi sorting

    CN122583263A