Fruit and vegetable spectrum data processing device and method
By installing a spectrometer in the constant-temperature equipment and performing data preprocessing, the problem that the spectroscopic equipment is affected by the external environment when detecting the freshness of fruits and vegetables is solved, the accuracy and reliability of the fruit and vegetable spectral data are improved, and the migration of the fruit and vegetable spectral data is realized. sex and versatility.
Patent Information
- Application Number
- CN202311438632.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-31
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2043-10-31
AI Technical Summary
Existing spectroscopic equipment is affected by external environments such as temperature, light and transmittance when detecting the freshness of fruits and vegetables, and cannot completely solve the problem of internal identification and sorting of fruits and vegetables.
A fruit and vegetable spectral data processing device is designed. By installing a spectrometer in a constant temperature device and adopting spectral data preprocessing methods, including dark noise processing, zero-mean normalization, sliding mean filtering and fitting residual calculation, mobility is used instead of fruits and vegetables. Spectral data, eliminating the influence of spectrometer dark noise.
It significantly improves the accuracy and reliability of fruit and vegetable spectral data, realizes the portability and versatility of fruit and vegetable spectral data, can effectively avoid the influence of external environment and improve detection accuracy.
Smart Images

Figure CN117589696B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of spectrum recognition, and more specifically, to a device and method for processing fruit and vegetable spectrum data. Background Art
[0002] At present, the freshness detection of agricultural products is of great significance for quality control during the circulation process. Due to the vigorous metabolism of fruits and vegetables, it is easy to lose nutrients in a short period of time, leading to wilting and rotting, and then producing residual substances that are harmful to human health. Therefore, it is particularly important to carry out the detection and evaluation of the freshness of fruits and vegetables. However, at present, the production, circulation and sales of fruits and vegetables mostly rely on human visual judgment, and people's actual experience, sensory ability and standards vary greatly, and there is a lack of consistency in the standard level of freshness of fruits and vegetables.
[0003] Existing products in the sorting equipment industry are gradually improving. With the increase in fruit and vegetable products, the challenges faced are greater. The traditional way of distinguishing fruits and vegetables based on their appearance cannot meet the needs of some industries. The emergence of spectral equipment makes it possible to solve this problem. Spectral sorting equipment is an instrument that uses the absorption, reflection and emission characteristics of spectral energy of different wavelengths to identify and analyze. Although in theory spectral equipment can solve the problem of internal identification of fruits and vegetables, it is limited by the influence of temperature, light, penetration rate, etc., and the existing spectral equipment cannot completely solve the problem of internal identification of fruits and vegetables.
[0004] After searching, the Chinese patent application, application number 202110151497.7, published on June 18, 2021, discloses a method, system and readable storage medium for preferential sorting of fruits and vegetables based on near-infrared spectroscopy. This method irradiates the fruits and vegetables to be sorted with a light source, collects the spectral information of the fruits and vegetables to be sorted, and pre-processes the acquired spectral information to introduce a fruit and vegetable identification model; obtains a predicted defect category value according to the fruit and vegetable identification model, compares the predicted defect category value with the preset defect category value, and obtains a deviation rate; determines whether the deviation rate is greater than the preset deviation rate threshold, and determines the fruits and vegetables to be sorted that have physical damage and insect pests according to the judgment result information, so as to achieve preferential sorting. However, this method does not take into account that the light source is limited by temperature, light, penetration rate, etc. when irradiating the fruits and vegetables to be sorted, and cannot completely solve the problems of internal identification and sorting of fruits and vegetables. Summary of the invention
[0005] 1. Technical issues to be solved
[0006] In view of the fact that the spectral equipment in the prior art is limited by the influence of temperature, light, transmittance, etc. and cannot completely solve the problem of internal identification of fruits and vegetables, the present invention provides a fruit and vegetable spectral data processing device and method, which can effectively prevent the fruit and vegetable spectral data obtained by the spectral equipment from being affected by the external environment, and improve the accuracy and sensitivity of fruit and vegetable spectral identification.
[0007] 2. Technical solution
[0008] The purpose of the present invention is achieved through the following technical solutions.
[0009] A fruit and vegetable spectral data processing device comprises a conveyor belt, a spectral acquisition device arranged on the conveyor belt, one end of the spectral acquisition device is connected to an optical path channel, and the optical path channel is fixedly installed on the conveyor belt; an optical fiber is arranged in the optical path channel, one end of the optical fiber is connected to a receiver, and the other end of the receiver is connected to a constant temperature device, and a spectrometer is installed in the constant temperature device.
[0010] Furthermore, a fruit cup is provided in the spectrum collection device, and one end of the fruit cup is connected to the optical path channel.
[0011] Furthermore, a light source is arranged above the fruit cup.
[0012] A method for processing fruit and vegetable spectral data comprises the following steps:
[0013] Construct a device for processing fruit and vegetable spectral data;
[0014] Set the temperature of the thermostatic device to be constant, connect the light source, illuminate the fruits and vegetables in the fruit cup, and obtain the spectral data of the fruits and vegetables through the spectrometer;
[0015] Preprocessing the fruit and vegetable spectral data, and performing spectral noise reduction on the preprocessed fruit and vegetable spectral data to obtain corrected fruit and vegetable spectral data;
[0016] The mobility of the corrected fruit and vegetable spectral data was calculated.
[0017] Furthermore, the calculation formula for calculating the mobility of the corrected fruit and vegetable spectral data is:
[0018]
[0019] Among them, λ 迁 represents the mobility, λ 穿 represents the spectrum after passing through fruits and vegetables, λ 未 represents the spectrum without passing through fruits and vegetables, and λ0 represents the spectrum when the spectrometer receives no light signal.
[0020] Furthermore, the acquired fruit and vegetable spectral data are preprocessed including dark noise processing and zero mean normalization processing.
[0021] Furthermore, the step of performing dark noise processing on the acquired fruit and vegetable spectral data includes: collecting fruit and vegetable spectral data in the absence of light when not connected to the light source; collecting actual fruit and vegetable spectral data after the light source is connected; and performing dark noise processing by subtracting the fruit and vegetable spectral data in the absence of light from the actual fruit and vegetable spectral data.
[0022] Furthermore, the calculation formula for zero-mean normalization of the acquired fruit and vegetable spectral data is:
[0023]
[0024] Among them, X represents different fruit and vegetable spectral data, Mean represents the mean of different fruit and vegetable spectral data, and SD represents the standard deviation of different fruit and vegetable spectral data.
[0025] Furthermore, the preprocessed fruit and vegetable spectral data are subjected to sliding mean filtering to obtain denoised fruit and vegetable spectral data.
[0026] Furthermore, the denoised fruit and vegetable spectral data are calculated by fitting residuals to obtain corrected fruit and vegetable spectral data, and the calculation formula is:
[0027]
[0028] Among them, R(x) represents the difference of fruit and vegetable spectral data, O(x) represents the original fruit and vegetable spectral data, P(x) represents the fitted fruit and vegetable spectral data, DEV represents the residual, R1 represents the difference of fruit and vegetable spectral data obtained for the first time, R2 represents the difference of fruit and vegetable spectral data obtained for the second time, and R n Indicates the difference of the fruit and vegetable spectral data obtained for the nth time, represents the mean of all the differences of the obtained fruit and vegetable spectral data, and n represents a natural number.
[0029] 3. Beneficial effects
[0030] Compared with the prior art, the advantages of the present invention are:
[0031] (1) A fruit and vegetable spectral data processing device of the present invention installs a spectrometer in a constant temperature device, so that the spectrometer is not affected by external temperature, light, transmittance, etc. and can obtain more accurate fruit and vegetable spectral data, thereby significantly improving the detection accuracy of the fruit and vegetable spectral data processing device.
[0032] (2) A method for processing fruit and vegetable spectral data of the present invention preprocesses fruit and vegetable spectral data, performs spectral noise reduction on the preprocessed fruit and vegetable spectral data to obtain corrected fruit and vegetable spectral data, performs mobility calculation on the corrected fruit and vegetable spectral data, and uses the mobility instead of the fruit and vegetable spectral data. This can eliminate the influence of dark noise of the spectrometer, thereby eliminating errors caused by the fruit and vegetable spectral data processing device itself, improving the accuracy and reliability of fruit and vegetable spectral data, and achieving the portability and versatility of fruit and vegetable spectral data. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 This is a schematic diagram of the structure of a device for processing fruit and vegetable spectral data according to an embodiment of the present invention;
[0034] Figure 2 These are the fruit and vegetable spectral data that have not been subjected to dark noise processing in the initial stage of the embodiment of the present invention.
[0035] Explanation of the numbers in the figure: 1. Conveyor belt; 2. Spectrum acquisition equipment; 3. Light source; 4. Fruit cup; 5. Optical path; 6. Optical fiber; 7. Receiver; 8. Spectrometer; 9. Constant temperature equipment. DETAILED DESCRIPTION
[0036] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0037] Example
[0038] like Figure 1 As shown, a fruit and vegetable spectral data processing device provided by this embodiment includes a conveyor belt 1 and a spectral acquisition device 2 arranged on the conveyor belt 1, and a light source 3 and a fruit cup 4 are arranged in the spectral acquisition device 2. An optical path channel 5 is connected to one end of the spectral acquisition device 2, and the optical path channel 5 is fixedly installed on the conveyor belt 1. An optical fiber 6 is arranged in the optical path channel 5, and a receiver 7 is connected to one end of the optical fiber 6, and a constant temperature device 9 is connected to the other end of the receiver 7. A spectrometer 8 is installed in the constant temperature device 9, and the spectrometer 8 is used to obtain fruit and vegetable spectral data. In the spectral acquisition device 2, one end of the fruit cup 4 is connected to the optical path channel 5, and the fruit cup 4 is used to place fruits and vegetables; the light source 3 is arranged above the fruit cup 4, and the light source 3 is used to irradiate fruits and vegetables. Therefore, a fruit and vegetable spectral data processing device provided by this embodiment installs the spectrometer 8 in the constant temperature device 9, and the constant temperature device 9 ensures that the spectrometer 8 is not easily affected by the external temperature, light, and penetration when acquiring fruit and vegetable spectral data, which can effectively improve the accuracy of fruit and vegetable spectral data processing. It should be noted that the constant temperature device 9 used in this embodiment is a container with a stable ambient temperature. The constant temperature device 9 can effectively reduce the influence of thermal noise, so that the spectrometer 8 can obtain more accurate fruit and vegetable spectral data, and significantly improve the detection accuracy of the fruit and vegetable spectral data processing device.
[0039] The present embodiment further provides a method for processing fruit and vegetable spectral data, comprising the following steps: constructing the above-mentioned fruit and vegetable spectral data processing device; setting the temperature of the constant temperature device 9 to be constant, connecting the light source 3, the light source 3 irradiating the fruits and vegetables in the fruit cup 4, and obtaining fruit and vegetable spectral data through the spectrometer 8; preprocessing the fruit and vegetable spectral data, performing spectral noise reduction on the preprocessed fruit and vegetable spectral data to obtain corrected fruit and vegetable spectral data; and performing mobility calculation on the corrected fruit and vegetable spectral data.
[0040] Specifically in this embodiment, firstly, a fruit and vegetable spectral data processing device as described above is constructed, and fruits and vegetables are placed in a fruit cup 4. The temperature of the constant temperature device 9 is set to be constant, so as to ensure that the fruit and vegetable spectral data processing device is not easily affected by the external temperature when acquiring the fruit and vegetable spectral data. The light source 3 is connected, and the light source 3 irradiates the fruits and vegetables. The optical path channel 5 transmits the spectral information of the fruits and vegetables after irradiation to the receiver 7 through the optical fiber 6. The receiver 7 then transmits the acquired spectral information to the spectrometer 8, and then the fruit and vegetable spectral data is acquired through the spectrometer 8. Furthermore, in order to ensure the portability of the fruit and vegetable spectral data, the acquired fruit and vegetable spectral data needs to be preprocessed when the spectrometer 8 is used, so as to obtain the penetration rate. In this embodiment, the preprocessing of the fruit and vegetable spectral data includes dark noise processing and zero mean normalization processing. The steps of performing dark noise processing on the fruit and vegetable spectral data include: collecting the fruit and vegetable spectral data in the absence of light when the light source 3 is not connected; collecting the actual fruit and vegetable spectral data after the light source 3 is connected; and performing dark noise processing by subtracting the fruit and vegetable spectral data in the absence of light from the actual fruit and vegetable spectral data. Figure 2 As shown in the figure, the fruit and vegetable spectral data without dark noise processing in the early stage, the starting value of the fruit and vegetable spectral data is very high, therefore, the dark noise can be eliminated after the dark noise processing of the fruit and vegetable spectral data, avoiding the problem of inaccurate processing of the fruit and vegetable spectral data caused by the superposition of dark noise into the fruit and vegetable spectral data. The acquired fruit and vegetable spectral data is normalized by zero mean, and the calculation formula is:
[0041]
[0042] Among them, X represents different fruit and vegetable spectral data, Mean represents the mean of different fruit and vegetable spectral data, and SD represents the standard deviation of different fruit and vegetable spectral data.
[0043] Furthermore, the pre-processed fruit and vegetable spectral data is subjected to sliding mean filtering to obtain the denoised fruit and vegetable spectral data. Specifically, a sliding window is set, the sliding window is translated along the spectral vector, the mean of the elements in the sliding window is obtained one by one, and the elements at the center of the window in the original fruit and vegetable spectrum are replaced by the mean of the elements in the sliding window, so as to obtain the denoised fruit and vegetable spectral data. It should be noted that in this embodiment, sliding median filtering can also be used, that is, a sliding window is translated along the spectral vector, the median of the elements in the sliding window is obtained one by one, and the elements at the center of the window in the original fruit and vegetable spectrum are replaced by the median of the elements in the sliding window, so as to obtain the denoised fruit and vegetable spectral data. It should be noted that in the actual application process, when obtaining the fruit and vegetable spectral data, it will be affected by the fluorescence background, the black body radiation of the sample and the surrounding environment, etc., resulting in the generation of the baseline of the fruit and vegetable spectral data. The baseline of the fruit and vegetable spectral data is shown as a slowly changing curve, so it is necessary to perform baseline correction. In this embodiment, the polynomial fitting method is used to calculate the denoised fruit and vegetable spectral data through fitting residuals to obtain the corrected fruit and vegetable spectral data. The calculation formula is:
[0044]
[0045] Among them, R(x) represents the difference of fruit and vegetable spectral data, O(x) represents the original fruit and vegetable spectral data, P(x) represents the fitted fruit and vegetable spectral data, DEV represents the residual, R1 represents the difference of fruit and vegetable spectral data obtained for the first time, R2 represents the difference of fruit and vegetable spectral data obtained for the second time, and R n Indicates the difference of the fruit and vegetable spectral data obtained for the nth time, represents the mean of all the differences of the obtained fruit and vegetable spectral data, and n represents a natural number.
[0046] It should be noted that, since there are differences between spectrometers 8 of the same model, under the same experimental environment, when the spectrometer 8 of the same model is used to obtain the spectral data of fruits and vegetables, the collected spectral data of fruits and vegetables will also be different. In addition, the influence of dark noise will also make the spectral data of fruits and vegetables obtained by the spectrometer 8 of the same model different, and the influence of dark noise can be eliminated by mobility calculation. Therefore, in this embodiment, the mobility calculation is performed on the corrected fruit and vegetable spectral data, and the calculation formula is:
[0047]
[0048] Among them, λ 迁 represents the mobility, λ 穿 represents the spectrum after passing through fruits and vegetables, λ 未represents the spectrum that has not passed through the fruits and vegetables, and λ0 represents the spectrum when the spectrometer 8 does not receive the light signal. Therefore, through the mobility calculation, the characteristic quantities of the fruit and vegetable spectral data of the spectrometer 8 of the same model can be made consistent, the influence of dark noise can be eliminated, and the differences between the individual spectrometers 8 can be further eliminated, so that the fruit and vegetable spectral data obtained on a single spectrometer 8 can be applied to the spectrometer 8 of the same model.
[0049] Therefore, the fruit and vegetable spectral data processing method provided in this embodiment uses mobility instead of fruit and vegetable spectral data, which can eliminate the influence of dark noise of spectrometer 8, thereby eliminating errors caused by spectrometer 8 itself, improving the accuracy and reliability of fruit and vegetable spectral data, and realizing the portability and versatility of fruit and vegetable spectral data.
[0050] The above schematically describes the invention and its implementation methods, which is not restrictive. Without departing from the spirit or basic features of the invention, the invention can be implemented in other specific forms. What is shown in the accompanying drawings is only one of the implementation methods of the invention. The actual structure is not limited thereto, and any figure mark in the claims should not limit the claims involved. Therefore, if a person of ordinary skill in the art is inspired by it, without departing from the purpose of the invention, a structural method and an embodiment similar to the technical solution are designed without creativity, which should all belong to the protection scope of the present invention. In addition, the word "including" does not exclude other elements or steps, and the word "one" before the element does not exclude the inclusion of "multiple" elements. The multiple elements stated in the product claim can also be implemented by one element through software or hardware. The words first, second, etc. are used to indicate the name, and do not indicate any specific order.
Claims
1. A method for processing fruit and vegetable spectral data, The following steps are involved: A fruit and vegetable spectral data processing device is constructed, comprising a conveyor belt (1), a spectral acquisition device (2) arranged on the conveyor belt (1), one end of the spectral acquisition device (2) being connected to an optical path channel (5), and the optical path channel (5) being fixedly mounted on the conveyor belt (1); an optical fiber (6) being arranged in the optical path channel (5), one end of the optical fiber (6) being connected to a receiver (7), the other end of the receiver (7) being connected to a constant temperature device (9), and a spectrometer (8) being installed in the constant temperature device (9); The temperature of the constant temperature device (9) is set to be constant, and the light source (3) is connected to the constant temperature device (9), so that the light source (3) illuminates the fruits and vegetables in the fruit cup (4), and the spectral data of the fruits and vegetables is obtained through the spectrometer (8); Preprocessing the fruit and vegetable spectral data; the preprocessing includes dark noise processing and zero mean normalization processing; Specifically, the step of performing dark noise processing on the acquired fruit and vegetable spectrum data comprises: collecting fruit and vegetable spectrum data when no light is connected and the light source (3) is not connected, collecting actual fruit and vegetable spectrum data after the light source (3) is connected, and performing dark noise processing by subtracting the fruit and vegetable spectrum data when no light is connected from the actual fruit and vegetable spectrum data; the calculation formula for performing zero mean normalization processing on the acquired fruit and vegetable spectrum data is: Among them, X represents different fruit and vegetable spectral data, Mean represents the mean of different fruit and vegetable spectral data, and SD represents the standard deviation of different fruit and vegetable spectral data; The pre-processed fruit and vegetable spectral data are subjected to spectral denoising to obtain corrected fruit and vegetable spectral data; specifically, the pre-processed fruit and vegetable spectral data are subjected to sliding mean filtering or sliding median filtering to obtain denoised fruit and vegetable spectral data; the denoised fruit and vegetable spectral data are subjected to fitting residual calculation to obtain corrected fruit and vegetable spectral data, and the calculation formula is: Among them, R(x) represents the difference of fruit and vegetable spectral data, O(x) represents the original fruit and vegetable spectral data, P(x) represents the fitted fruit and vegetable spectral data, DEV represents the residual, R 1 represents the difference of the fruit and vegetable spectral data obtained for the first time, R 2 represents the difference of the fruit and vegetable spectral data obtained for the second time, R n Indicates the difference of the fruit and vegetable spectral data obtained for the nth time, represents the mean of all the differences in the obtained fruit and vegetable spectral data, and n represents a natural number; The mobility calculation is performed on the corrected fruit and vegetable spectral data. The mobility calculation is used to achieve consistency in the characteristic quantities of the fruit and vegetable spectral data of the spectrometer (8), eliminate the differences between individual spectrometers (8), and apply the fruit and vegetable spectral data obtained on a single spectrometer (8) to a spectrometer (8) of the same model. The mobility calculation formula is: Among them, λ 迁 represents the mobility, λ 穿 represents the spectrum after passing through fruits and vegetables, λ 未 represents the spectrum that has not passed through fruits and vegetables, λ 0 represents the spectrum of the spectrometer (8) when no light signal is received.
2. A method for processing fruit and vegetable spectral data according to claim 1, It is characterized in that A fruit cup (4) is provided in the spectrum collection device (2), and one end of the fruit cup (4) is connected to the optical path channel (5).
3. A method for processing fruit and vegetable spectral data according to claim 2, It is characterized in that A light source (3) is also provided above the fruit cup (4).
