665
Views
4
CrossRef citations to date
0
Altmetric
Research Article

Visualized pattern recognition optimization for apple mechanical damage by laser relaxation spectroscopy

ORCID Icon, , , , , , , , , ORCID Icon & show all
Pages 1566-1578 | Received 22 Mar 2023, Accepted 26 May 2023, Published online: 18 Jun 2023

ABSTRACT

This study aims to enhance the efficiency and accuracy of nondestructive testing (NDT) for identifying mechanical damage in apples. Current methods have limitations in detection efficiency and require significant human resources. We conducted a study using laser relaxation spectroscopy and developed a single-wavelength system to collect spectral data from damaged and undamaged Red Fuji apples. The data was pretreated using the Min-Max standardization algorithm and analyzed using pattern recognition models including the depth extreme learning machine (DELM), SSA-DELM (optimized by the sparrow search algorithm), and backpropagation (BP) neural networks. We introduced neural network visualization to improve accuracy during BP neural network analysis. The BP neural networks achieved the highest accuracy of 94.74% among the models tested. To further enhance accuracy, we proposed an optimized multicount measurement classification recognition (MMCR) model, which improved accuracy to 97.5% with ultrahigh detection speed. The proposed method offers advantages such as ease of operation, affordability, and fast detection, providing a novel approach to rapid fruit quality assessment.

Introduction

Apples contain a wide range of vitamins, carbohydrates, and other nutrients, but they are highly susceptible to mechanical damage during picking, sorting, transport, and storage. Suppose mechanically damaged apples are not screened out in time. In that case, the damaged fruit will release ethylene during storage and transport, ripening other apples, which in severe cases can lead to spoilage, resulting in financial damage. Therefore, apples need to be screened for mechanical damage before storage and transport to identify apples that have suffered mechanical damage.

The near-infrared spectrum (NIRS) instrument is the electromagnetic radiation wave between the visible (Vis) and mid-infrared (MIR) and is the first invisible region one finds in the absorption spectrum. The NIRS region coincides with the absorption region of the ensemble and multiples of the levels of vibration of the hydrogen-containing groups (O-H, N-H, C-H) in organic molecules. By scanning the NIRS of a sample, information on the characteristics of the hydrogen-containing groups of organic molecules in the sample can be obtained. Moreover, using NIR spectroscopy to analyze samples is convenient, fast, efficient, accurate, and less expensive. This technique is increasingly popular without destroying the sample, consuming chemical reagents, or polluting the environment, and the method is widely used for the quality testing of vegetables and fruits.

Yang et al.[Citation1] used electronic noses and chemometrics to rapidly and nondestructively detect compression damage in yellow peaches. Wang et al. used a dual laser scanning system for nondestructive testing of cooling damage in kiwifruit.[Citation2] Detection of hawthorn fruit defects using hyperspectral imaging by Liu et al..[Citation3] Li et al. studied the gossypol content in cottonseed by near-infrared spectroscopy and high-performance liquid chromatography (HPLC).[Citation4] Huang et al. used LIBS combined with the CNN model for high-precision identification of milk powder mixed with various exogenous proteins.[Citation5] Tian et al. used Raman spectroscopy and a support vector machine to conduct rapid nondestructive testing in rice-producing areas.[Citation6] Weng et al. used visible/near-infrared (Vis/NIR) hyperspectral imaging to conduct nondestructive testing of strawberry storage time.[Citation7] Ning et al. successfully screened mechanically damaged apples using spectroscopy.[Citation8] Li et al. proposed a method combining NIR spectroscopy with the XGBoost prediction algorithm for the internal quality evaluation of food.[Citation9] Yao et al. realized hyperspectral imaging technology’s nondestructive detection of egg freshness.[Citation10] Wang et al. invented a spectroscopic technique for nondestructive monitoring of the quality, safety, and classification of fresh red meat.[Citation11] Mohammed et al. used portable near-infrared spectroscopy combined with stoichiometry to detect and quantify milk doping.[Citation12] Fu et al. invented the rapid identification of Chinese herbs by near-infrared and mid-infrared spectroscopy combined with stoichiometry.[Citation13] Vasafietal invented an anomaly detection method for milk processing based on an automatic neural network based on near-infrared spectroscopy.[Citation14] Zhu et al. used hyperspectral imaging, near-infrared spectroscopy, and fusion information to identify new grades of mutton.[Citation15] Shi et al. used a near-infrared spectrometer to detect honey adulteration with high accuracy.[Citation16] Liu et al. used near-infrared spectroscopy to detect high-quality rice.[Citation17] Chuang Cai et al.[Citation18] employed deep learning techniques to achieve efficient grape leaf disease identification, while shundong Fang et al.[Citation19] presented an effective approach for identifying Maize leaf diseases.

Existing spectral inspection systems mainly collect static spectra for inspection. The broad analytical band requires a high level of light source and analytical instrumentation, which is expensive and has complex analysis models, complicated operation, large size, and extra time. Experimental studies have found that the chemical functional groups within the apple do not instantaneously absorb light energy and reach a steady state when apples are irradiated with visible or near-infrared light. The chemical functional groups within the apple produce a gradual absorption of light, producing a dynamic relaxation spectrum. In this study, red Fuji apples were used as the subject. Combining relaxation phenomena with single-wavelength spectroscopic detection, a single-wavelength relaxation spectroscopy-based detection technique is used to excite the relaxation properties of the internal chemical functional groups of apples using a laser of controlled variable light intensity. The dynamic relaxation spectra generated during relaxation are collected for subsequent pattern recognition model optimization experiments. The principle of relaxation spectroscopy is based on the gradual absorption of spectra by different molecular functional groups within the apple, which are sensitive to their specific characteristics. The absorption spectral data are collected as characteristic values for the identification of mechanical damage to the apple.[Citation9] Current mainstream techniques for detecting fruit damage include X-ray imaging,[Citation20] magnetic resonance imaging (MRI),[Citation21] infrared imaging,[Citation21] acoustic imaging,[Citation22] and electrical imaging.[Citation23] These methods, however, suffer from long detection times and high costs,[Citation24–26] hindering their widespread adoption. Near-infrared (NIR) spectroscopy represents an alternative approach.[Citation27,Citation28] Positioned between visible and middle infrared light on the electromagnetic spectrum, the NIR region corresponds with the vibrational combination frequency and absorption region of hydrogen groups (O-H, N-H, C-H) found in organic molecules. NIR spectroscopy is faster, cheaper and easier to use than a range of existing image-based methods such as Yolo-based and SSD-based detection[Citation29–34] of fruit damage.

In this paper, the feasibility of single-wavelength laser relaxation spectroscopy was verified, and the comparison of multiple identification models was optimized to improve the detection efficiency of the system. A single wavelength light was used as the light source, and a laser controller was utilized to control the current level of the laser, which generated the relaxation procedure. The relaxation spectra of the measured samples were collected. The relaxation spectra were first pretreated using the Min-Max normalization algorithm and combined with different recognition models. The DELM and BP model were developed and optimized by the Sparrow search algorithm. For the BP neural network model, this paper uses the idea of neural network visualization to find the most suitable parameter values by observing the intrinsic relationships of the neural network. A classification model for apple damage detection with different algorithms was conducted to compare the efficiency and accuracy of the different algorithms.

Materials and methods

Experimental materials

Red Fuji apples in the same batch (125 g ±10 g in weight) with a diameter distribution in the 75–85 mm range were utilized in this research. The apples were fresh in bright color with intact skin. They were free from mechanical damage, moths, and decay.

Main instruments and equipment

The experimental equipment includes an MTO-LASER semiconductor laser transmitter (wavelength is 650 nm, and the power is 100 mW). S3000 spectrometer with a USB port, and the slit width is 50 μm). MTAD Fiber-optics probe (operating temperature is −150°C~130°C). A MicroStep MA1–106 constant current laser driver (programmatic or manual adjustment) is utilized. A relaxation spectrum acquisition system is used. In , the apple is placed on the detecting platform, and the laser intensity is varied by adjusting the current to the laser driver. Different intensities of laser light stimulate the relaxation performance of the apples’ inner chemical functional groups, generating an apple’s complete relaxation spectrum. The photosensitive fiber probe is used to collect the diffuse light spectrum, and the spectrum is processed by the spectrometer and collected by the computer.

Figure 1. Single wavelength laser relaxation spectroscopy detection system.

Figure 1. Single wavelength laser relaxation spectroscopy detection system.

Apple damage spectroscopy collection experiments

From physical aspects, the process from the original equilibrium state to the new equilibrium is called relaxation. Mechanistically, amorphous matter always relaxes to lower energy states when in nonequilibrium, so relaxation behavior is the key to understanding various physical phenomena in amorphous matter. The intensity of the laser is related to the current. The higher the input current is, the stronger the laser intensity. The intensity of the laser is controlled by controlling the current to simulate laser irradiation on the apple’s surface.

This experiment used a self-developed spectral detecting system as the experimental environment. Damaged or undamaged apples were set as a variable during the experiment. A 650 nm laser was always used to irradiate the surface of the apple, and the laser intensity was controlled by tuning the current level to collect the spectral data of the apple in different diffuse reflection states. The collected data were used as the source data for further data processing, classification model development, and testing. The experiment was carried out as follows ():

The skin of the apples was washed carefully with distilled water and cleaned with blotting paper. This operation was repeated twice to ensure that the apple surface was thoroughly cleaned of dust, paraffin, and other substances to reduce interference with the experiment. Then, a random circular area with a 1.2 cm radius was selected on the apple surface and marked. The apple was placed on the iron ring of the stand, ensuring that the selected area faced upward and that the center of the selected area was used as the sampling point. The light-sensitive fiber probe was set and faced the sampling point, ensuring that it fitted snugly and had no damage to apple skin. The laser current was first set to 0 A using the laser driver. Then, the laser driver was switched on and adjusted to the required current level, and the laser incidence position was manually adjusted. The spot could be chosen on the circumference of one 1.0 cm circle from the sampling point. Once the position was adjusted, a light shield was placed over the iron stand to create a dark environment and prevent interference with the experimental environment from external light sources.

Under the control of the laser driver, the initial current intensity was set at 0.95 A, and the current increment step was 0.05. The spectral data of each sampling point in the current interval of 0.95–2.05 A were recorded. Finally, the laser driver was switched off to measure the spectral data in the background light state to obtain 24 sets. To reduce the experimental error, a parallel experiment was adopted to repeat the measurement 15 times for each nondestructive sampling point. After removing the data with significant errors, 643 sets of spectral data of apples in the entire state were obtained.

After measurement, the apples were removed, and the selected area was pressed with a mortar stick to form a damaged apple by causing damage to the flesh of the area to a depth of approximately 0.8 cm while ensuring that the apple’s skin was entire. After this step, the apples were immediately placed back on the testing platform, and the spectral data of the damaged apples were measured under the same experimental conditions. The measurement was repeated 30 times for each damaged sampling point. A cumulative total of 1180 sets of spectral data of the apples in the damaged state were obtained. The data from the undamaged apples and the data in the damaged state were combined to form a sample with 1823 data items.

Another 20 apples were taken according to the former experimental method, and the measurement was repeated 15 times for each undamaged apple sampling point and 30 times for each damaged sampling point. Twenty sets of apple data were recorded in the entire state and twenty in the damaged state. The data were used to verify the feasibility of the multicount measurement classification recognition method.

Min-max normalization of spectral data

The spectral profiles corresponding to 650 nm wavelengths at currents of 0.9–2.05 A were screened and integrated for the collected relaxation dynamic spectra data. The spectral data in other bands were rounded off before the data analysis. The data were pretreated. The Min-Max normalization algorithm was used for processing.

In a multi-indicator evaluation system, individual evaluation indicators usually have different scales and orders of magnitude due to their nature. When the indicators’ levels differ significantly, a direct analysis using the raw indicator values would highlight the role of the higher-valued indicators in a comprehensive analysis and relatively weaken the role of the lower-valued indicators. Therefore, the raw data need to be standardized to ensure the reliability of the results. Min-Max normalization allows for numerical comparability of features between dimensions and can significantly improve the accuracy of the classifier. The conversion functions are:

(1) x=(xxmin)(xmaxxmin)(1)

where xmax is the maximum value of the original sample data and xmin is the minimum value of the original sample data. When new data are added, this may result in a change in xmax and xmin, which needs to be redefined.

Algorithmic model

Two classification model algorithms (BP and DELM) were utilized in this work.

BP neural networks: The BP neural network is a multilayer feed-forward network trained by error back-propagation. Its basic idea is the gradient descent method, using the gradient search technique, to minimize the actual output value of the network and the expected output value of the error mean square difference. In this paper, a classification model is constructed using a BP neural network, and a multi-input single-output visualization model is built after inputting spectral information under different currents (). The main idea of the BP algorithm is as follows: (i) Forward process: The input information is used to calculate the output value of each cell, layer by layer, from the input layer through the hidden layer. (ii) Backpropagation process: the output error is calculated layer by layer forward for each cell in the hidden layer, and this error is used to correct the weights of the previous layer. The model is shown in .

Figure 2. Algorithm flow diagram: (a) BP algorithm structure diagram; (b) DELM algorithm flow chart.

Figure 2. Algorithm flow diagram: (a) BP algorithm structure diagram; (b) DELM algorithm flow chart.

Table 1. Comparison of the advantages and disadvantages of different models.

DELM Model: Using a layer-by-layer greedy training approach, Auto Encoder for Extreme Learning Machines (ELM-AE) initialization is applied to the input weights of each hidden layer of DELM, and hierarchical unsupervised training is performed. The model is shown in .

The input data sample X is taken as the target output of the 1st ELM-AE X1=Xand the output weight β1of the ELM-AE output expression is:

xj=i=1LβiG(ai,bi,xj),βiRm,j=1,2,,N;aTa=I,bTb=1),

then the output matrix of the first hidden layer of DELM is taken as the input and the target output X2=X, of the next ELM-AE, and so on, layer by layer, with the last one layer trained with ELM, using β=(IC+HTH)1HTX to solve for the output weight βi+1 of the last one hidden layer of DELM, In , Hi+1 is the output matrix of the last one hidden layer and T is the sample label. The input weight matrix of each hidden layer in Hi+1 is Wi+1=βI+1T.

Model optimization algorithms

The algorithms are optimized to improve the model’s accuracy, namely, the deep extreme learning vector machine, the deep extreme learning vector machine algorithm optimized by the Sparrow search algorithm, and BP neural networks optimized for visualization processing.

Sparrow search algorithm: The sparrow search algorithm is a new group intelligence optimization algorithm based on the behavior of sparrows foraging for food and escaping predators [36]. The foraging process of the sparrow can be seen as a simple model of a finder-joiner, to which a detection warning mechanism is added. Suppose there are N sparrows in a D-dimensional space, and the position of the ithsparrow in the D-dimensional search space is Xi=xi1,,xid,xiD,i=1,2,,N,xid denotes the ith position of the sparrow in the dthdimension. The number of discoverers is between 10% and 20% of the population, and the position will be continuously updated according to Equationequation (2).

(2) xidi+1=xidiexp(iαT)R2<STxidi+QLR2ST(2)

where t is the current iteration number and T is the maximum iteration number.α is a uniform random number between(0,1], Q is a random number obeying standard normal distribution, L is a matrix of size 1×d,with all elements 1,R2[0,1] and ST=[0.5,1] are the warning value and safety value, respectively. When R2<ST, which means that there are no predators around, the producer enters the wide search mode. If R2ST, it means that some sparrows have discovered the predator, and all sparrows need quickly fly to other safe areas [36]. The sparrows, except the finders, as the entrants, update their positions according to Formula (3):

(3) xid(i+1)=Qexp(xwdtxidti2)i>n2xbdt+|xidtxbd(t+1)|A+Lin2(3)

where A is a 1×D dimensional matrix. xwdt is the worst position of the sparrow in the d-dimension at the tthiteration of the population, and xbdt+1 is the optimal position of the sparrow in the d-dimension at the (t+1)th iteration of the population. When i>n2, it indicates that the tthjoiner has not found food, is in a hungry state, has low adaptation and flies to other places to forage for food to obtain enough energy, when in2 the ith joiner forages at a random position near the current optimal position xb. Scouts typically make up 10–20% of the population, with positions updated according to Equationequation (4) below.

(4) xidi+1=xbdt+β(xidtxbdt)fifgxidt+K(xidtxwdt|(fifw)|+efi=fg)(4)

where β is the step control parameter, a normally distributed random number obeying a mean of zero and a variance of one, K is a random number between [−1,1] indicating the direction of movement of the sparrow, also a step control parameter; e is a very small constant, to avoid the occurrence of denominator 0, fi is the adaptation value of the ith sparrow, and fg and fw are the current optimal adaptation and the worst adaptation of the sparrow race, respectively. When fifg, this sparrow is currently at the edge of the race. When fi=fg, the sparrow is at the center of the race, is aware of the threat from the predator and adjusts its strategy by moving closer to other sparrows in time to avoid being attacked by the predator.

The general steps of the sparrow search algorithm are as follows.

Step 1: Initialize populations, number of iterations, initialize predator and joiner ratios.

Step 2: Calculation and ranking of fitness values.

Step 3: Updating predator positions according to Equationequation (2).

Step 4: Update the joiner positions according to Equationequation (3).

Step 5: Update the position of the vigilantes according to Equationequation (4).

Step 6: Calculating fitness values and updating sparrow positions.

Step 7: If the stop condition is met, exit, and output the result. Otherwise, repeat Steps 2–6.

Multicount measurement classification recognition (MMCR) method

To further improve the accuracy rate, the MMCR optimization model was adopted to avoid measuring relaxation spectra due to improper personal operation or machine-causing data errors, which could lead to classification errors in the pattern recognition model. The optimization method for classifying and recognizing multiple measurements is as follows:

An apple’s damaged or entire region is measured N times continuously according to the method from 2.3. Then, the data obtained are substituted into the above pattern recognition model. If the amount of damaged data in the model classification result is higher than N/2, the apple region is considered damaged. Otherwise, it is considered entire. Twenty apples were taken for the above experiment, and the data were recorded and analyzed. In this experiment, the value of N was taken as 5 for undamaged apples and 15 for damaged apples.

Visualization technology

To facilitate intelligent parameter tuning of AI models, a GUI platform was developed, utilizing the visualized pattern recognition method. This platform enables targeted adjustments by leveraging visualizations of model structure, accuracy variations, and other relevant factors. The advantages of incorporating visualizations into the tuning process can be summarized as follows:

Enhanced understanding: The visualizations provide an intuitive representation of the model’s behavior, aiding researchers in better comprehending the relationships between different parameters and their impact on model performance.

Efficient parameter optimization: The GUI platform simplifies the parameter tuning process through its visual interface. Researchers can interactively explore various settings and observe real-time changes in model performance, leading to faster and more effective parameter optimization.

Improved model performance: Visualizations facilitate the identification of patterns or trends in the data that may not be easily captured through numerical analysis alone. This allows for more accurate fine-tuning of the model, resulting in improved performance and accuracy.

User-friendly interface: The GUI platform offers a user-friendly interface that simplifies the parameter tuning process. Researchers with varying levels of machine learning expertise can easily interpret the visual representations and make informed decisions.

The inclusion of the GUI platform and the visualized pattern recognition method in this research contributes to a more intelligent and effective approach to parameter tuning, promoting advancements in AI model optimization.

Results and analysis

Parameter design

Model comparison: The data were pre-processed using the Min-Max algorithm and then randomly shuffled and divided into two parts: a training set of 1500 items and a prediction set of 323 items with a ratio of approximately 0.82. The accuracy of the model results is closely related to the model parameters, and different parameters significantly affect the model’s accuracy, which is also used as one of the criteria for evaluating the strengths and weaknesses of the algorithm.

Some of the essential parameters of the DELM, SSA-DELM and BP neural network and the classification effect on the data are shown in . The results show that the visualized BP neural network has the best classification results, with an accuracy of 94.74% in the test set. Most likely due to the small number of data samples, the classification results of DELM could have been better, with only 84.3% accuracy in the training set and 85.6% in the test set. Even when the DELM model was optimized using the SSA algorithm, the accuracy mainly stayed the same, with 86.1% accuracy in the training set and only 84.6% in the test set.

Table 2. Parameters and results of different model runs.

Model optimization: The main optimization methods in this paper are SSA optimization and neural network visualization optimization. In this paper, the DELM model is optimized using the SSA algorithm, and the BP neural network is optimized using neural network visualization. The results of the two optimized models are run as follows.

In , the results of both the DELM and SSA-DELM models are plotted. As the DELM model has low accuracy and there is room for optimization, the SSA algorithm is used to optimize it. shows the convergence curve of the SSA to optimize the DELM. The DELM model was optimized using the SSA, and the model’s accuracy was improved. However, the test set accuracy of the DELM model optimized using the SSA mainly stayed the same, which shows that the SSA-DELM model could be better. The main reason for the poor classification ability of the DELM model for these experimental data is the small amount of experimental data, which is not suitable for deep learning.

Figure 3. Results of different models: (a) DELM and SSA-DELM model test set classification results; (b) SSA-DELM algorithm convergence curve; (c) BP neural network structure visualization model diagram; (d) BP neural network training set and validation set accuracy graph; (e) BP neural network training set and validation set loss value graph.

Figure 3. Results of different models: (a) DELM and SSA-DELM model test set classification results; (b) SSA-DELM algorithm convergence curve; (c) BP neural network structure visualization model diagram; (d) BP neural network training set and validation set accuracy graph; (e) BP neural network training set and validation set loss value graph.

The visualization model of the BP neural network is shown in . This model achieves model optimization by plotting the accuracy and variation with the number of iterations of the training and validation sets, finding the optimal number of iterations, and substituting them into the test set. The BP neural network has an accuracy of 94.74% with the visualization idea, which is much higher than the other two models. The accuracy rate is higher than before visualization. It is easy to find that the BP neural network model is well suited to solve nonlinear data sets such as spectral data. As the number of iterations increases, the accuracy of the training set and validation sets fluctuates. In addition, the loss value of the training set continues to decrease as the number of iterations increases. The loss value of the validation set first decreases with the increase in the number of iterations and then gradually increases when the number of iterations reaches 841. The number of iterations, 841, is used as the optimal parameter of the BP neural network to ensure its high accuracy while avoiding data overfitting.

Optimized model for multicount classification recognition

After compiling and comparing the inspection data, all the damaged apples were accurately detected. The incorrectly predicted samples were generally undamaged apples. The multimachine learning classification model using three algorithms could accurately predict and classify damaged apples with an accuracy of 100% for all 20 damaged apples. However, the prediction accuracy of undamaged apples was low. The classification model incorrectly predicted undamaged apples as damaged apples. To more intuitively derive the most appropriate algorithm, the accuracy of each different algorithm for the 20 undamaged apples was integrated and predicted. Each undamaged apple was tested five times, and the data are listed in a row. Each damaged apple was tested 15 times, and the data are listed in a row. Each data set was recorded, and all were substituted into the model, resulting in .

Table 3. Comparison of accuracy of different models optimized by MMCR.

The results are shown in the data in . In the left column, the classification accuracy is shown before optimizing the MMCR method, while the right column displays the classification accuracy after the optimization of the MMCR method. The results indicate a significant improvement in model accuracy through the implementation of MMCR. By comparing the classification predictions of different models for apple damage, it was found that the best classification was the BP model, and the worst was the DELM model. The TPR values of the DELM model were low and extremely unstable, making it difficult to exclude chance. After optimization of the DELM model using the SSA algorithm, the prediction accuracy (TPR values) of the SSA-DELM model for undamaged apples was slightly improved. However, the accuracy was still very different compared to the BP neural network model. Relaxed spectral data are nonlinear data. As a nonlinear system, the BP neural network can approximate a nonlinear mapping relationship and an incredibly complex functional relationship, which is an excellent method to interpret and analyze the data of this experiment. The MMCR method was introduced in this paper to further improve the accuracy based on the BP neural network. The MMCR method helps the BP model to make an accurate diagnosis by consuming a slightly longer time than the original model in exchange for higher accuracy. The MMCR method helps the BP model make an accurate diagnosis by measuring the apple spectral data several times to avoid detection and classification errors as much as possible. The experiments show that the BP neural network with three hidden layers and 841 iterations is optimized using the MMCR method. The classification accuracy of damaged apples is 100% (NPR values) and that of undamaged apples is 95% (TPR values). The average accuracy is improved to 97.5%. In addition, the classification prediction time of the optimized BP algorithm model for a single apple sample is less than 0.3 s, which achieves the expectation of fast and accurate detection. Compared with the MSC-RSWL-CNN classification model proposed by Ning’s team for detecting mechanical damage of apples, the method in this paper newly proposes the neural network visualization idea and the MMCR method, which improves the detection accuracy by 4.5% while ensuring fast detection.[Citation8] This shows that the classification effect of using the BP-MMCR model is the best for apple mechanical damage identification. The BP model with ultrahigh detection efficiency can help related industries. In addition, the idea of neural network visualization proposed in this paper is an innovative idea in the field of spectral detection, which provides a new idea in the field of spectral detection, and this idea also helps the popularity of AI in society.

Conclusion

This paper developed a single-wavelength laser light relaxation spectroscopy system to control the light intensity by adjusting the laser current to excite the relaxation properties of apple internal chemical functional groups. The relaxation spectra of the samples were collected, and the raw spectral data were screened. The Min-Max normalization algorithm was used to optimize the screened spectral data, and three pattern recognition classification models were substituted into the DELM algorithm, visualized BP, and SSA-DELM algorithm. Finally, the MMCR method was used to find the best model among the three. The results indicated that the DELM model and SSA-DELM model were unsuitable for apple spectral data classification, and the accuracy was only 57.5% and 60%, respectively. In contrast, the Min-Max normalized visualized BP algorithm combined with MMCR presented better classification results (97.5% in accuracy). Furthermore, the detection time for a single apple was less than 0.3 s, which presented high detection efficiency. The single-wavelength laser relaxation spectroscopy data were nonlinear, and the visualized BP neural network provided a nonlinear mapping relationship and an incredibly complex functional relationship, which increased the detection accuracy to a great level. This paper has visualized that the BP method effectively broadens the usage of artificial intelligence to more nonprofessional and technical personnel. It provides a new method for rapid and accurate fruit quality analysis.

Ethical approval

This article does not contain any studies with human participants or animals performed by any of the authors.

Acknowledgments

The authors acknowledge programmers who contribute to the instrumentation and devices. Also, thanks to the people who fabricated the experimental materials.

Disclosure statement

No potential conflict of interest was reported by the author(s).

Data availability statement

Data sharing does not apply to this article as no datasets were generated or analyzed during the current study.

Additional information

Funding

This research is financially supported by the Scientific Research Project of Zhejiang Province (Grant No. 2019C02075, LGG19F010012), National College Student Research Programme (Grant No. 202110341027), College Student Research Programme of Zhejiang Province (Grant No. 2022R412A028, 2022R412A034) and Zhejiang A&F University.

References

  • Yang, X.; Chen, J.; Jia, L.; Yu, W.; Wang, D.; Wei, W.; Li, S.; Tian, S.; Wu, D. Rapid and Non-Destructive Detection of Compression Damage of Yellow Peach Using an Electronic Nose and Chemometrics. Sensors (Basel). 2020 Mar 27. 20(7), 1866. DOI: 10.3390/s20071866 PMID: 32230958; PMCID: PMC7181052
  • Wang, Z.; Künnemeyer, R.; McGlone, A.; Sun, J.; Burdon, J.; Cree, M. J. Non-Destructive Detection of Chilling Injury in Kiwifruit Using a Dual-Laser Scanning System with a Principal Component Analysis - Back Propagation Neural Network. J. Near Infrared Spectrosc. 2022, 30(2), 67–73. DOI: 10.1177/09670335211061842.
  • Liu, D. H.; Zhang, S. J.; Wang, B. Detection of Hawthorn Fruit Defects Using Hyperspectral Imaging. Guang pu xue yu Guang pu fen xi= Guang pu. 2015, 35(11), 3167–3171.
  • Li, C.; Su, B.; Zhao, T.; Li, C.; Chen, J.; Zhu, S. Feasibility Study on the Use of Near-Infrared Spectroscopy for Rapid and Nondestructive Determination of Gossypol Content in Intact Cottonseeds. J. Cotton Res. 2021, 4(1), 138–146. DOI: 10.1186/s42397-021-00088-2.
  • Huang, W. H. (Huang, Weihua). Identification of Adulterated Milk Powder Based on Convolutional Neural Network and Laser-Induced Breakdown Spectroscopy [J]. Journal, May: Microchemical, 2022, p. 176.
  • Tian, F.; Tan, F.; Li, H. An Rapid Nondestructive Testing Method for Distinguishing Rice Producing Areas Based on Raman Spectroscopy and Support Vector Machine. Vib. Spectrosc : An International Journal Devoted To Applications Of Infrared And Raman Spectroscopy. 2020, 107(1), 103017. DOI: 10.1016/j.vibspec.2019.103017.
  • Weng, S.; Shuan, Y.; Dong, R.; Pan, F.; Liang, D. Fangfang Pan,dong Liang.Nondestructive Detection of Storage Time of Strawberries Using Visible/near-Infrared Hyperspectral Imaging. Int. J. Food Prop. 2020, 23(1), 269–281. DOI: 10.1080/10942912.2020.1716793.
  • Ning, J.; Ye, H.; Sun, Y.; Zhang, J.; Mei, Z.; Xiong, S.; Zhang, S.; Li, Y.; Hui, G.; Yi, X., et al. Study on Apple Damage Detecting Method Based on Relaxation Single-Wavelength Laser and Convolutional Neural Network. Food Meas. 2022, 16(5), 3321–3330.
  • Li, L.; Li, C.; Wu, Y.; Yang, Y.; Zhang, Y.; Zhang, H.; Wu, B.; Liu, L.; Xie, R.Spectroscopy-Based Food Internal Quality Evaluation with XGBoost Algorithm.APWeb/WAIM Workshops.2018. DOI: 10.1007/978-3-030-01298-4_6
  • Yao, K.; Sun, J.; Zhou, X.; Nirere, A.; Tian, Y.; Wu, X. Nondestructive Detection for Egg Freshness Grade Based on Hyperspectral Imaging Technology. J. Food Process Eng. 2020, 43(7), e13422.1–e13422.9. DOI: 10.1111/jfpe.13422.
  • Wang, W.; Peng, Y.; Sun, H.; Zheng, X.; Wei, W. Spectral Detection Techniques for Non-Destructively Monitoring the Quality, Safety, and Classification of Fresh Red Meat. Food Anal. Methods. 2018, 11(10), 2707–2730. DOI: 10.1007/s12161-018-1256-4.
  • Mohammed, A. M.; Shuming, Y. Detection and Quantification of Cow Milk Adulteration Using Portable Near-Infrared Spectroscopy Combined with Chemometrics. Afr. J. Agric. Res. 2021, 17(2), 198–207. DOI: 10.5897/AJAR2020.15321.
  • Fu, H.; Shi, Q.; Wei, L.; Xu, L.; Guo, X.; Hu, O.; Lan, W.; Xie, S.; Yang, T. Rapid Recognition of Geoherbalism and Authenticity of a Chinese Herb by Data Fusion of Near-Infrared Spectroscopy (NIR) and Mid-Infrared (MIR) Spectroscopy Combined with Chemometrics. J. Spectrosc. 2019, 2019(20), 1–9. DOI: 10.1155/2019/2467185.
  • Vasafi, P. S.; Paquet-Durand, O.; Brettschneider, K.; Hinrichs, J.; Hitzmann, B. Anomaly Detection During Milk Processing by Autoencoder Neural Network Based on Near-Infrared Spectroscopy. J. Food Eng. 2021, 299(Juna), .110510.1–.110510.10. DOI: 10.1016/j.jfoodeng.2021.110510.
  • Zhu, R.; Bai, Z.; Qiu, Y.; Zheng, M.; Jianfeng, G.; Yao, X. Comparison of Mutton Freshness Grade Discrimination Based on Hyperspectral Imaging, Near Infrared Spectroscopy and Their Fusion Information. J. Food Process. Eng. 2021, 44(4), e13642.1–e13642.12. DOI: 10.1111/jfpe.13642.
  • Tan, S. H.; Pui, L. P.; Solihin, M. I.; Keat, K. S.; Lim, W. H.; Ang, C. K. Physicochemical Analysis and Adulteration Detection in Malaysia Stingless Bee Honey Using a Handheld Near-Infrared Spectrometer. J. Food Process Preserv. 2021, 45(7), e15576.1–e15576.17. DOI: 10.1111/jfpp.15576.
  • Liu, Y.; Yongyu, L.; Peng, Y.; Yang, Y.; Wang, Q. Detection of Fraud in High-Quality Rice by Near-Infrared Spectroscopy. J. Food Sci. 2020, 85(9), 2773–2782. DOI: 10.1111/1750-3841.15314.
  • Cai, C.; Wang, Q.; Cai, W.; Yang, Y.; Hu, Y.; Li, L.; Wang, Y.; Zhou, G. Identification of Grape Leaf Diseases Based on VN-BWT and Siamese DWOAM-DRNet. Eng. Appl. Artif. Intell. 2023, 123, 106341. DOI: 10.1016/j.engappai.2023.106341.
  • Fang, S.; Wang, Y.; Zhou, G.; Chen, A.; Cai, W.; Wang, Q.; Hu, Y.; Li, L. Multi-Channel Feature Fusion Networks with Hard Coordinate Attention Mechanism for Maize Disease Identification Under Complex Backgrounds. Comput. Electron. Agric. 2022, 203, 107486. DOI: 10.1016/j.compag.2022.107486.
  • van Dael, M.; Verboven, P.; Zanella, A.; Nicolai, B. Combination of Shape and X-Ray Inspection for Apple Internal Quality Control: In silico Analysis of the Methodology Based on X-Ray Computed Tomography; Postharvest Biology and Technology: 2018. DOI: 10.1016/j.postharvbio.2018.05.020.
  • Defraeye, T.; Lehmann, V.; Gross, D.; Holat, C.; Nicolai, B. M.; Verboven, P.; Verlinden, B. E.; Nicolai, B. M. Application of Mri for Tissue Characterisation of ‘Braeburn’ Apple. Postharvest Biol. Technol. 2013, 75, 95–105. DOI: 10.1016/j.postharvbio.2012.08.009.
  • Wei, L.; Zhang, H.; Liu, X. Hyperspectral/Multispectral Reflectance Imaging Combining with Watershed Segmentation Algorithm for Detection of Early Bruises on Apples with Different Peel Colors. Food Anal. Methods. 2019, 12(5), 1218–1228. DOI: 10.1007/s12161-019-01456-0.
  • Mahmoud Soltani, F.; Farahmandi, A.; Hosseinpour, S. Early Detection of Freeze Damage in Navel Orange Fruit Using Nondestructive Low Intensity Ultrasound Coupled with Machine Learning. Food Anal. Methods. 2021, 14(6), 1140–1149. DOI: 10.1007/S12161-020-01942-W.
  • Yu, S.; Liu, Y.; Tang, Y.; Li, X.; Li, W.; Li, C.; Lan, H.; Lan, H. Non-Destructive Quality Assessment Method for Korla Fragrant Pears Based on Electrical Properties and Adaptive Neural-Fuzzy Inference System. Comput. Electron. Agric. 2022, 203, 107492. DOI: 10.1016/J.COMPAG.2022.107492.
  • Lin, M.; Fawole, O. A.; Saeys, W.; Wu, D.*, Wang, J.; Opara, U. L.; Nicolai, B.; Chen, K. Mechanical Damages and Packaging Methods Along the Fresh Fruit Supply Chain: A Review. Crit. Rev. Food Sci. Nutr. 2022. 1–20. *, DOI: 10.1080/10408398.2022.2078783.
  • He, Y.; Xiao, Q.; Bai, X.; Zhou, L.; Liu, F.; Zhang, C. Recent Progress of Nondestructive Techniques for Fruits Damage Inspection: A Review. Crit. Rev. Food Sci. Nutr. 2022, 62(20), 5476–5494.
  • Mahanti, N. K.; Pandiselvam, R.; Kothakota, A.; Chakraborty, S. K. Emerging Non-Destructive Imaging Techniques for Fruit Damage Detection: Image Processing and Analysis - Sciencedirect. Trends Food Sci. Technol. 2022, 120, 418–438
  • Sa, I.; Ge, Z.; Dayoub, F.; Upcroft, B.; Perez, T.; McCool, C. DeepFruits: A Fruit Detection System Using Deep Neural Networks. Sensors (Basel, Switzerland). 2016, 16(8), 1222. DOI: 10.3390/s16081222.
  • Zhang, M.; Jiang, Y.; Li, C.; Yang, F.; Li, C. Fully Convolutional Networks for Blueberry Bruising and Calyx Segmentation Using Hyperspectral Transmittance Imaging. Biosyst. Eng. 2020, 192, 159. DOI: 10.1016/j.biosystemseng.2020.01.018.
  • Wang, Z.; Hu, M.; Zhai, G. Application of Deep Learning Architectures for Accurate and Rapid Detection of Internal Mechanical Damage of Blueberry Using Hyperspectral Transmittance Data. Sensors (Basel). 2018 Apr 7 18 (4), 1126. DOI: 10.3390/s18041126
  • Gao, F.; Fu, L.; Zhang, X.; Majeed, Y.; Li, R.; Karkee, M.; Zhang, Q. Multi-Class Fruit-On-Plant Detection for Apple in Snap System Using Faster R-Cnn. Comput. Electron. Agric. 2020, 176, 105634. DOI: 10.1016/j.compag.2020.105634.
  • Khan, A. I.; Quadri, S. M. K.; Saba, B.; Shah Junaid, L. Deep Diagnosis: A Real-Time Apple Leaf Disease Detection System Based on Deep Learning. Comput. Electron. Agric. 2022, 198, 107093. DOI: 10.1016/J.COMPAG.2022.107093.
  • Bin, Y.; Pan, F.; Xiaoyan, L.; Zhijie, L.; Fuzeng, Y. A Real-Time Apple Targets Detection Method for Picking Robot Based on Improved YOLOv5. Remote Sensing(9). 2021, 13(9), 1619. DOI: 10.3390/RS13091619.
  • Xue, J.; Shen, B. A Novel Swarm Intelligence Optimization Approach: Sparrow Search Algorithm. Syst. Sci. Control Eng. 2020, 8(1), 22–34. DOI: 10.1080/21642583.2019.1708830.