# Neural Network-Based Analysis and Its Application to Spectroscopy for Mango
## 2 Equipment and Method
### Results and Discussion  
#### 2.3.1 Data Processing  
* Statistics of mango brix data  
The effects of different point sites on mango brix levels were investigated by plotting the curves of brix levels for each point site of various mango varieties as a function of time, as depicted in Figure 4a-c. The mango varieties included in the study, such as Tainong, Golden, Gaole, and Toffee, are known for their similar size and sugar content, containing high levels of sugar and vitamin C ranging from approximately 14 to 20 percent. These mango varieties predominantly originate from provinces such as Hainan, Guangxi, Yunnan, and Sichuan in China. Specifically, the mango point location in Figure 4a corresponds to the abdomen of the mango, which is exposed to sunlight for the majority of the day and plays a significant role in photosynthesis [22]. The activity of the encoded convertase exhibits a continuous increase, resulting in the elevated cleavage of sucrose into glucose and fructose, consequently leading to a rise in soluble solid content and the highest brix content in mango. In Figure 4c, the mango roots are exposed to greater sunlight, serving as the primary site for soluble solid production and subsequent accumulation, resulting in a slightly higher brix content compared to the top in Figure 4b. However, with prolonged storage, the mango surface undergoes damage due to the diminished activity of antioxidant enzymes and reduced brix content, potentially impacting the experimental outcomes. Hence, inthe current study, efforts are made to minimize brix measurements following prolonged preservation periods [23]. Figure 3: Flowchart of SA algorithm. * Spectral data preprocessing  
The NIR spectral curves from various locations on the mango are captured and are depicted in Figure 5. Notably, the spectral data from points 5-1, 5-2, and 5-3 exhibit relative stability, showing minimal interference from noise factors and displaying distinct characteristic peaks, rendering them more conducive for subsequent research endeavors [24]. Accordingly, the aforementioned three points are selected for analysis. Figure 4: (**a**) Brix bar graph of brix content of different mangoes at top points over time; (**b**) brix bar graph of brix content of different mangoes at equator points over time; and (**c**) brix bar graph of brix content of different mangoes at the root point over time. Figure 5: A 3D plot of different points of mango. Data were collected from all 95 samples at points 5-1, 5-2, and 5-3, with spectral readings obtained over a span of 11 days, ensuring optimal mango freshness. Given the performance attenuation of the NIR spectrometer at the extremities of the wavelength range, significant noise is observed at these points in the spectral data. Consequently, only spectral information within the wavelength range of 1300-2300 nm was preserved for the experiment, as illustrated in Figure 6a. The spectral data underwent additional preprocessing following noise removal. Missing values were addressed using cubic spline interpolation implemented in MATLAB R2022a software. To mitigate instrument noise effects on the spectral curve and enhance the signal-to-noise ratio, Savitzky-Golay convolution smoothing was applied in the research methodology [25]. The findings demonstrate the effective filtering of external noise,  
Figure 6: (**a**) The 2D spectral profiles of points 5-1, 5-2, 5-3 without data preprocessing; (**b**) 2D spectral profiles of points 5-1, 5-2, 5-3 after data preprocessing. revealing characteristic peaks at 1400 nm and 1985 nm. Additionally, the original spectrum underwent Standard Normal Variate (SNV) transformation to rectify spectral errors arising from sample scattering, resulting in enhanced clarity of the two characteristic peaks while retaining the original spectral information. Ultimately, a second derivative treatment was applied to the spectral curve to eliminate baseline drift and enhance spectral resolution [26; 27].