
In recent years, food safety issues have attracted much attention, and people's requirements for the quality and safety standards of fruits and vegetables have become increasingly higher, which has become a hot topic of social concern. Generally, the quality of fruits and vegetables includes external qualities such as shape, color, size and surface defects, and internal qualities such as sugar content, acidity, hardness, soluble solids content, starch content, moisture and maturity, and the content of other nutrients. The quality is an important factor in its market sales.
Traditional fruit and vegetable quality detection methods such as chemical methods, high-performance liquid chromatography, mass spectrometry, etc. are usually destructive to the objects to be tested and slow. Machine vision and spectral technology have the advantages of fast, non-destructive and reliable, and have been widely used in fruit and vegetable quality detection in recent years. Among them, machine vision technology extracts and analyzes spatial information such as the shape, size, color and surface defects of fruits and vegetables for external quality detection, while near-infrared spectroscopy technology mainly detects the internal quality of fruits and vegetables.
Hyperspectral imaging technology combines images with spectral technology to simultaneously obtain spectral information and spatial information reflecting the internal and external quality of the object to be tested. In recent years, it has been widely studied in non-destructive testing of fruit and vegetable quality at home and abroad. This article will introduce the latest research progress in this field from the basic principles of hyperspectral imaging technology and its research and application in non-destructive testing of fruit and vegetable quality.
1. Principle of hyperspectral imaging technology
Each pixel in the hyperspectral system can obtain dozens to hundreds of continuous narrow band information in the same spectral range, and obtain a smooth and complete spectral curve. At the same time, the entire imaging system can also obtain the spatial information of the object to be measured, realizing the simultaneous detection of the internal components and appearance characteristics of the object to be measured, with the characteristics of spectral continuity and high resolution.

The hyperspectral image acquired by the system can be represented by a stereoscopic three-dimensional image composed of a continuous band of optical images, as shown in Figure 2. The two-dimensional image of the XY plane represents the spatial information of the object, such as shape, size, defects, etc. Since the external changes of the object will affect the reflection spectrum, the shape, color or defect will change at a certain wavelength. The λ coordinate represents the spectral information of the object, which will reflect the internal quality of the object under test, such as the composition and structure.

This study applied a 400-1000nm hyperspectral camera, and the FS13 product of Hangzhou Caipu Technology Co., Ltd. can be used for related research. The spectral range is 400-1000nm, the wavelength resolution is better than 2.5nm, and up to 1200 spectral channels. The acquisition speed can reach 128FPS in the full spectrum, and the highest after band selection is 3300Hz (supporting multi-region band selection).

2. Detection of external quality of fruits and vegetables
People’s direct feeling about fruits and vegetables in the market is the quality of their external quality, that is, the judgment of color, freshness, size, mechanical damage, frostbite and decay. Traditional machine vision technology is difficult to distinguish external characteristics such as mechanical damage, frostbite, decay and freshness in the detection of external quality of fruits and vegetables due to low precision and complex operation. Hyperspectral imaging technology just overcomes this shortcoming and can achieve all-round non-destructive detection. It is also highly accurate and easy to operate. In recent years, it has been gradually used in the detection of external quality of fruits and vegetables.
Freshness is an important indicator reflecting the quality of fruits and vegetables. Freshly picked fruits and vegetables usually need to be stored and transported before they reach consumers. This process will affect their freshness and quality. Generally speaking, people’s subjective judgment of the freshness of fruits and vegetables is inaccurate. The spectral images of four vegetable leaves, including Chinese cabbage, spinach, rapeseed and baby cabbage, were collected and compared using an imaging spectrometer at 0, 10, 24 and 48 hours of dehydration. Among them, the comparative analysis of the hyperspectral image and machine vision image of the pakchoi leaves at different water loss times is shown in Figures 3 and 4. It can be seen that the state of the leaves in the two images has changed significantly with the change of time, but the machine vision image can only show the water loss state, and the hyperspectral image analyzes the changes in spectral information and finds that the appearance and internal chlorophyll of the leaves have changed during the water loss process. The correlation coefficient of the chlorophyll relative content value prediction model is r=0.76, indicating that hyperspectral technology can effectively identify the freshness of vegetable leaves.

The hyperspectral technology and ANN prediction model were used to study the frostbite of apples, as shown in Figure 5. The experiment used the process shown in Figure 6, and selected five principal component bands (717, 751, 875, 960 and 980 nm) from the hyperspectral image of frostbitten apples in the 400-1000 nm band to establish the ANN model. The correlation coefficients of the training set, test set and validation set were 0.93, 0.91 and 0.92, respectively, and finally achieved a recognition accuracy of more than 98%.



3. Conclusion
With the improvement of living standards, people have higher and higher requirements for the quality of healthy food. Traditional machine vision technology and physical and chemical methods are complex and destructive in measuring the quality of fruits and vegetables, and it is difficult to meet the detection needs. Hyperspectral imaging technology integrates machine vision, spectroscopy and image processing technology. The image produced is a three-dimensional data cube of "spectrum combination", which not only contains the spatial information characteristics of the object to be tested, but also contains the spectral information of the object to be tested. It can accurately, quickly and non-destructively detect the quality of agricultural products, and is simple to operate. In recent years, it has been widely used in the detection of fruit and vegetable quality. However, in the process of collecting and processing image data, hyperspectral imaging technology is limited by the performance and processing speed of the instrument. This technology is currently mainly used in basic research and has not been widely used in industrial online real-time detection. In order to achieve commercial online detection of fruit and vegetable quality, the following two points need to be achieved in order to solve these problems: first, improve and upgrade the related equipment of hyperspectral imaging technology, such as imaging spectrometers, to improve their performance and reduce their production costs, which is conducive to the promotion of hyperspectral imaging technology in fruit and vegetable quality detection; second, select characteristic wavelengths for full-band and different varieties of fruit and vegetable hyperspectral images to reduce data redundancy and reduce the acquisition and processing time of hyperspectral images. Nevertheless, with the development of society and scientific progress, hyperspectral imaging technology will continue to improve and improve, and will have broader development space and application prospects in the fields of agricultural products and food safety in the future.