Bagged fruit and vegetable sugar degree detection method based on spectrum correction

By constructing a bagged spectral correction model and sugar-degree detection model, using near-infrared transmission spectroscopy technology, the problem of sugar-degree detection accuracy of bagged fruits and vegetables is solved, and lossless and fast sugar-degree detection is achieved.

CN120275342APending Publication Date: 2025-07-08ZHEJIANG UNIV
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202510587466.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-08
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

The occlusion effect of bagged fruits and vegetables affects the spectral characteristics, resulting in a decrease in the accuracy of the sugar-prediction model. The prior art affects production efficiency when removing fruit bags and may damage fruits and vegetables.

Method used

The near-infrared transmission spectroscopy technology is used to construct a bagged spectral correction model and a sugar-degree detection model, and non-destructive detection is achieved through relevant band processing and weight coefficient correction.

Benefits of technology

The rapid non-destructive testing of the sugar content of fruits and vegetables in bags is achieved, which improves the detection efficiency, reduces costs, and avoids the removal and mounting steps of the fruit bags.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120275342A_ABST
    Figure CN120275342A_ABST
Patent Text Reader

Abstract

The invention discloses a method for detecting the sugar degree of bagged fruits and vegetables based on spectrum correction. The method comprises the following steps: respectively acquiring an original sample set of a correction model and an original sample set of a detection model by using a transmitted spectrum acquisition device and a sugar degree detector, then processing transmitted spectrums during fruit and vegetable bagging, and training a constructed bagging spectrum correction model according to the processed transmitted spectrums, constructing a sugar degree sample data set according to the bagging spectrum correction model and the original sample set of the detection model, training the constructed bagged fruit and vegetable sugar degree detection model according to the sugar degree sample data set, and sequentially inputting the transmission spectrum of the bagged fruit and vegetable to be detected into the trained bagging spectrum correction model and the bagged fruit and vegetable sugar degree detection model for processing. The sugar degree of the bagged fruits and vegetables to be detected is obtained. According to the method, the transmission spectrum of the bagged fruits and vegetables is directly collected for detection, the steps of taking down and sleeving fruit bags before and after detection are avoided, the detection efficiency is improved, the detection cost is reduced, and rapid nondestructive detection of the sugar degree of the bagged fruits and vegetables is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of rapid detection of fruit and vegetable quality, and particularly relates to a method for detecting the sugar content of bagged fruits and vegetables based on spectral correction. Background Art

[0002] The fruit and vegetable bagging technology is an important means to improve the quality of pollution-free fruits and vegetables. By wrapping the fruits in fruit bags during a specific growth stage until they are ripe and picked, the fruit bags can provide an excellent growth environment for fruits and vegetables, promoting quality improvement. The fruit bags effectively protect fruits and vegetables from wind, rain, environmental pollution, pests and diseases, and bird attacks, thus reducing the use of pesticides. At the same time, the fruit bags help the generation of peel color, reduce surface defects and sunburns by improving the microenvironment around the fruits, and increase the content of aromatic substances and sugars through the local greenhouse effect, delaying the softening, withering and water loss of the fruits, and improving the overall quality of fruits and vegetables.

[0003] In addition to the growth stage, the bagging technology also plays an important role in the storage and transportation of fruits and vegetables. When fruits and vegetables are picked and enter the storage and transportation links, the fruit bags can not only continue their excellent effects during the growth stage, but also further play a fresh-keeping role. During storage and transportation, the fruit bags can effectively slow down water loss, avoid surface cracking and loss of luster, thus prolonging the freshness of fruits and vegetables. Especially in the transportation environment with large temperature and humidity fluctuations, the fruit bags provide a stable microenvironment, reducing the chance of fruits being affected by external changes. The fruit bags can regulate the temperature and humidity inside the bags to maintain a relatively constant state, avoiding the softening of fruits due to excessive temperature difference and delaying the aging process. In addition, some fruits and vegetables will release ethylene gas during transportation, accelerating ripening and aging. The fruit bags slow down the effect of ethylene by regulating gas exchange, maintaining the freshness of fruits and vegetables and extending the shelf life.

[0004] However, although the bagging technology provides multiple fresh-keeping advantages for fruits and vegetables, it also brings some challenges in the later grading process. Especially in spectral detection, the fruit bags will affect the accurate acquisition of key quality parameters such as sugar content. Although the fruit bags can reduce mechanical damage caused by collisions, their shielding effect will affect the spectral characteristics of fruits and vegetables, causing deformation of visible / near-infrared spectral signals, resulting in a decrease in the accuracy of the sugar content prediction model and affecting the accuracy of non-destructive detection technology. At present, the common practice is to remove the fruit bags before commercial processing, but this method not only affects production efficiency, but may also cause damage to vulnerable fruits and vegetables. Therefore, how to solve the influence of fruit bags on spectra, improve grading efficiency and reduce damage has become the key problem in the development of non-destructive detection technology for bagged fruits and vegetables. Summary of the Invention

[0005] In order to solve the defects and deficiencies in the background art, the present invention provides a method for detecting the sugar content of bagged fruits and vegetables based on spectral correction.

[0006] The technical solution adopted by the method for detecting the sugar content of bagged fruits and vegetables of the present invention is as follows:

[0007] S1. Use a near-infrared transmission spectrum acquisition device and a sugar content detector to respectively acquire and obtain the original calibration model sample set and the original detection model sample set.

[0008] S2. According to the original calibration model sample set, obtain the transmission spectrum when each fruit and vegetable is bagged and the relevant bands of the transmission spectrum when each fruit and vegetable is bagged, and process the transmission spectrum when each fruit and vegetable is bagged according to the relevant bands to obtain the corresponding processed transmission spectrum when each fruit and vegetable is bagged.

[0009] S3. Construct a bagged spectrum calibration data set according to the corresponding processed transmission spectrum when each fruit and vegetable is bagged, and train the constructed bagged spectrum calibration model according to the obtained bagged spectrum calibration data set to obtain the trained bagged spectrum calibration model.

[0010] S4. Construct a sugar content sample data set according to the original detection model sample set and the bagged spectrum calibration model, and train the constructed bagged fruit and vegetable sugar content detection model according to the obtained sugar content sample data set to obtain the trained bagged fruit and vegetable sugar content detection model.

[0011] S5. Acquire the transmission spectrum of the bagged fruit and vegetable to be measured, and input the transmission spectrum of the bagged fruit and vegetable to be measured into the trained bagged spectrum calibration model and the trained bagged fruit and vegetable sugar content detection model in sequence for processing to obtain the sugar content of the bagged fruit and vegetable to be measured.

[0012] The specific steps of step S1 are as follows:

[0013] S11. Use a transmission spectrum acquisition device to acquire the transmission spectrum when several fruits and vegetables are bagged and the transmission spectrum when each fruit and vegetable is not bagged, and use a sugar content detector to detect the sugar content of each fruit and vegetable; combine the transmission spectrum when each fruit and vegetable is bagged, the transmission spectrum when not bagged, and the corresponding sugar content as an original calibration model sample, and summarize the samples of all fruits and vegetables to obtain the original calibration model sample set.

[0014] S12. Use a transmission spectrum acquisition device to acquire the transmission spectrum when several fruits and vegetables are bagged again, and use a sugar content detector to detect the sugar content of each corresponding fruit and vegetable. Combine the transmission spectrum when each fruit and vegetable is bagged again and the corresponding sugar content as an original detection model sample, and summarize the samples of all fruits and vegetables acquired again to obtain the original detection model sample set.

[0015] The specific steps of step S2 are as follows:

[0016] S21. In the original calibration model sample set, perform correlation processing on the transmission spectrum when all fruits and vegetables are bagged and the sugar content corresponding to each fruit and vegetable to obtain a correlation curve.

[0017] The transmission spectrum is a spectral curve regarding wavelength and light intensity values; the correlation curve is a curve regarding wavelength and correlation values.

[0018] S32. Select the peak value of the sub-peak from the obtained correlation curve as the correlation threshold. The peak value of the sub-peak is the peak value of the second peak in the correlation curve.

[0019] S23. Select the bands higher than the correlation threshold from the correlation curve and use the selected bands as the relevant bands of the transmission spectrum when each fruit and vegetable is bagged in the original calibration model sample set. The band is an interval between two wavelength points.

[0020] S24. In the original calibration model sample set, multiply all the ordinate values of the relevant bands in the transmission spectrum when each fruit and vegetable is bagged by a preset weight coefficient to obtain the corresponding processed transmission spectrum when each fruit and vegetable is bagged.

[0021] The correlation processing in step S21 is set according to the following formula:

[0022]

[0023] where T i represents the ordinate correlation value of the i-th wavelength point in the correlation curve, i represents the index and also represents the i-th wavelength point in the transmission spectrum; k represents the index and also represents the transmission spectrum of the k-th fruit and vegetable; n represents the total number of fruits and vegetables; X k,i represents the light intensity value at the i-th wavelength point in the transmission spectrum of the k-th fruit and vegetable; represents the mean value of the light intensity values corresponding to the transmission spectra of all fruits and vegetables at the i-th wavelength point; Y k represents the sugar content of the k-th fruit and vegetable; represents the mean value of the sugar contents of all fruits and vegetables.

[0024] Step S3 is specifically as follows:

[0025] S31. Combine the processed transmission spectrum when the same fruit and vegetable is bagged and the corresponding transmission spectrum when not bagged to form a spectral calibration sample data, and summarize the spectral calibration sample data of all fruits and vegetables to obtain a bagged spectral calibration data set.

[0026] S32. Build a bagged spectral calibration model in the computer, use the processed transmission spectrum when the fruit and vegetable is bagged as the independent variable, use the transmission spectrum when the same fruit and vegetable is not bagged as the dependent variable, and input the bagged spectral calibration data set into the bagged spectral calibration model for training to obtain a trained bagged spectral calibration model.

[0027] The bagged spectral calibration model in step S32 adopts a partial least squares regression model.

[0028] The step S4 is specifically as follows:

[0029] S41. In the original sample set of the detection model, the transmission spectra of all the fruits and vegetables when they are bagged are input into the trained bagging spectrum correction model for processing to obtain the corresponding corrected transmission spectrum of each fruit and vegetable.

[0030] S42, the corrected transmission spectrum and the corresponding sugar content of the same fruit or vegetable are combined into a sugar content sample data set, and the sugar content sample data of all fruits and vegetables are aggregated to obtain a sugar content sample data set.

[0031] S43. Construct a sugar content detection model for bagged fruits and vegetables in a computer, use the calibrated transmission spectrum of fruits and vegetables as input, use the sugar content of the same fruits and vegetables as a label, input the sugar content sample data set into the bagged fruits and vegetables sugar content detection model for training, and obtain a trained bagged fruits and vegetables sugar content detection model.

[0032] The sugar content detection model of bagged fruits and vegetables in step S43 adopts competitive adaptive weighted sampling combined with partial least squares regression model.

[0033] The step S5 specifically comprises: using a transmission spectrum acquisition device to acquire the transmission spectrum of the bagged fruits and vegetables to be tested, the transmission spectrum of the bagged fruits and vegetables to be tested is first input into a trained bagging spectrum correction model for processing to obtain a corrected transmission spectrum of the bagged fruits and vegetables to be tested, and then the corrected transmission spectrum of the bagged fruits and vegetables to be tested is input into a trained bagged fruit and vegetable sugar content detection model for detection to obtain the sugar content of the bagged fruits and vegetables to be tested.

[0034] The beneficial effects of the present invention are as follows:

[0035] 1. The present invention adopts near-infrared transmission spectroscopy technology to collect the transmission spectrum of bagged fruits and vegetables. Near-infrared light can penetrate the fruit bag and the peel to quickly and accurately reflect the internal information of the fruit.

[0036] 2. The method of the present invention only needs to directly collect the transmission spectrum of bagged fruits and vegetables, without removing the fruit bags of the bagged fruits and vegetables, thus avoiding the steps of removing and putting on the fruit bags before and after detection, improving the detection efficiency, reducing the detection cost, and realizing rapid online detection of the sugar content of bagged fruits and vegetables.

[0037] 3. The present invention only needs to input the transmission spectrum of the bagged fruits and vegetables to be tested into the bagging spectrum correction model and the bagged fruit and vegetable sugar content detection model in sequence for processing, so as to obtain the sugar content of the bagged fruits and vegetables to be tested. There is no need to perform destructive component analysis on the fruit pulp, and non-destructive detection of the sugar content of bagged fruits and vegetables can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 It is a partial structural schematic diagram of a transmission spectrum acquisition device in an embodiment of the present invention;

[0039] Figure 2 It is the relevance curve graph obtained in the embodiment of the present invention;

[0040] Figure 3 It is the average spectrum comparison graph of the original bagged, unbagged and corrected bagged Cuiguan pears in the embodiment of the present invention;

[0041] Figure 4 It is the result graph of the training set divided from the sugar degree sample data set in the bagged fruit and vegetable sugar degree detection model in the embodiment of the present invention;

[0042] Figure 5 It is the result graph of the test set divided from the sugar degree sample data set in the bagged fruit and vegetable sugar degree detection model in the embodiment of the present invention.

[0043] Among them, there are light source 1, fruit holder 2, sensor 3, conveyor belt 4, spectrometer 5, dark box 6, conveyor wheel 7, and host computer 8. Specific implementation manners

[0044] The method proposed by the present invention will be further described below with reference to the specification drawings and embodiments.

[0045] The specific embodiments of the present invention are as follows:

[0046] In this embodiment, Cuiguan pears from a local orchard are taken as an example and placed for one day in an environment with a temperature of about 23°C and a relative humidity of about 76%.

[0047] Such as Figure 1The following is a partial structural schematic diagram of the transmission spectrum acquisition device used in this embodiment. The transmission spectrum acquisition device used in this embodiment includes two light sources 1, a fruit tray 2, a sensor 3, a conveyor belt 4, a conveyor frame, a spectrometer 5, a dark box 6, a conveyor wheel 7, and a motor; the conveyor frame is arranged on the detection site, the dark box 6 is installed on the conveyor frame, and the two surfaces of the dark box 6 along the transmission direction are respectively provided with an inlet and an outlet for fruit and vegetable transmission. The two light sources 1 are symmetrically installed on the surfaces on both sides of the interior of the dark box 6 along the transmission direction. The sensor 3 is installed on the conveyor frame and is arranged behind the light source 1 along the transmission direction. The two conveyor wheels 7 are respectively installed at both ends of the conveyor frame in the transmission direction. The conveyor belt 4 is respectively in rolling connection with the two conveyor wheels 7. The motor is installed on the conveyor frame, and the motor 2 is in transmission connection with one of the conveyor wheels 7; the fruit tray 2 is placed on the conveyor belt 4, and the Cuiguan pear is placed on the fruit tray 2; the light source 1 is electrically connected to the spectrometer 5, the sensor 3 is in communication connection with the spectrometer 5, and the spectrometer 5 is in communication connection with the host computer 8. The motor drives the transmission of the conveyor belt 4 through the conveyor wheel 7. When the Cuiguan pear in the fruit tray 2 passes through the sensor 3, the sensor 3 collects the arrival signal of the Cuiguan pear and transmits it to the spectrometer 5 through communication. After receiving the arrival signal of the Cuiguan pear, the spectrometer 5 collects the transmission spectrum of the Cuiguan pear through the light source 1, and the spectrometer 5 transmits the collected transmission spectrum to the host computer 8 for processing. The two light sources 1 are two tungsten halogen lamps with a power of 150 W, the transmission spectrum acquisition range is 200 - 1100 nm, and the integration time is 100 ms. The spectrum is collected with the pose of the Cuiguan pear fruit stalk perpendicular to the movement direction.

[0048] This embodiment is implemented according to the following steps:

[0049] S1. Use the near-infrared transmission spectrum acquisition device and the sugar content detector to respectively collect and obtain the original calibration model sample set and the original detection model sample set.

[0050] S11. Use the transmission spectrum acquisition device to collect the transmission spectra of several fruits and vegetables when they are bagged and the near-infrared transmission spectra of each fruit and vegetable when they are not bagged, and use the sugar content detector to detect the sugar content of each fruit and vegetable. Combine the transmission spectrum of each fruit and vegetable when it is bagged, the transmission spectrum when it is not bagged, and the corresponding sugar content as a calibration model original sample, and summarize the samples of all fruits and vegetables to obtain the original calibration model sample set.

[0051] S12. Use the transmission spectrum acquisition device to collect the transmission spectra of several fruits and vegetables when they are bagged again, and use the sugar content detector to detect the sugar content of each corresponding fruit and vegetable. Combine the transmission spectrum of each fruit and vegetable when it is bagged again and the corresponding sugar content as a detection model original sample, and summarize the samples of all fruits and vegetables collected again to obtain the original detection model sample set.

[0052] In the embodiment, a band of the transmission spectrum in the range of 600 - 940 nm with less noise is selected, and all subsequent experiments on the transmission spectrum are carried out within this band.

[0053] S2. Obtain the transmission spectrum when each fruit and vegetable is bagged and the relevant band of the transmission spectrum when each fruit and vegetable is bagged from the original sample set of the calibration model, and process the transmission spectrum when each fruit and vegetable is bagged according to the relevant band to obtain the corresponding processed transmission spectrum when each fruit and vegetable is bagged.

[0054] S21. In the original sample set of the calibration model, perform a correlation processing on the transmission spectrum when all fruits and vegetables are bagged and the sugar content corresponding to each fruit and vegetable to obtain a correlation curve.

[0055] The correlation processing is set according to the following formula:

[0056]

[0057] where T i represents the vertical coordinate correlation value of the i-th wavelength point in the correlation curve, i represents the index and also represents the i-th wavelength point in the transmission spectrum. In this embodiment, the transmission spectrum of each fruit and vegetable uses 451 wavelength points; k represents the index and also represents the transmission spectrum of the k-th fruit and vegetable; n represents the total number of fruits and vegetables; X k,i represents the light intensity value at the i-th wavelength point in the transmission spectrum of the k-th fruit and vegetable; represents the mean value of the light intensity values corresponding to the transmission spectra of all fruits and vegetables in the original sample set of the calibration model at the i-th wavelength point; Y k represents the sugar content of the k-th fruit and vegetable; represents the mean value of the sugar contents of all fruits and vegetables in the original sample set of the calibration model.

[0058] The transmission spectrum is a spectral curve regarding wavelength and light intensity value; since the correlation curve is obtained from the transmission spectrum, the correlation curve is a curve regarding wavelength and correlation value. As Figure 2 shown is the correlation curve obtained in this embodiment.

[0059] S32. Select the peak value of the sub-peak from the obtained correlation curve as the correlation threshold.

[0060] The peak value of the sub-peak is the peak value of the second peak in the correlation curve. In the specific implementation, it is defaulted that there is only one highest peak and only one second highest peak in the correlation curve.

[0061] S23. Select the band higher than the correlation threshold from the correlation curve and use the selected band as the relevant band of the transmission spectrum when each fruit and vegetable in the original sample set of the calibration model is bagged; the band is an interval between two wavelength points.

[0062] In this embodiment, Figure 2 From the obtained correlation curve graph, select the peak value 0.22 of the sub-peak of the curve as the correlation threshold, and determine that the wavelength band higher than the correlation threshold 0.22 is 680 - 698 nm.

[0063] S24. In the original sample set of the calibration model, multiply all the ordinate values of the relevant wavelength bands in the transmission spectrum when each fruit and vegetable is bagged by a preset weight coefficient to obtain the corresponding processed transmission spectrum when each fruit and vegetable is bagged. In this embodiment, the preset weight coefficient is 2.5.

[0064] S3. Construct a bagging spectrum calibration data set according to the corresponding processed transmission spectrum when each fruit and vegetable is bagged, and train the constructed bagging spectrum calibration model according to the obtained bagging spectrum calibration data set to obtain a trained bagging spectrum calibration model.

[0065] S31. Combine the processed transmission spectrum when the same fruit and vegetable is bagged and the transmission spectrum when it is not bagged to form a spectral calibration sample data, and summarize all the spectral calibration sample data of the fruits and vegetables to obtain a bagging spectrum calibration data set.

[0066] S32. Construct a bagging spectrum calibration model in the computer, use the processed transmission spectrum when the fruit and vegetable is bagged as the independent variable, use the transmission spectrum when the same fruit and vegetable is not bagged as the dependent variable, and input the bagging spectrum calibration data set into the bagging spectrum calibration model for training to obtain a trained bagging spectrum calibration model.

[0067] The bagging spectrum calibration model adopts a partial least squares regression model.

[0068] When training the bagging spectrum calibration model in this embodiment, relevant data statistics were carried out, such as Figure 3 Show a comparison graph of the average curve of the original bagged transmission spectrum of Cuiguan pears, the average curve of the unbagged transmission spectrum of Cuiguan pears, and the average curve after bagging spectrum calibration of Cuiguan pears.

[0069] S4. Construct a sugar content sample data set according to the original sample set of the detection model and the bagging spectrum calibration model, and train the constructed bagging fruit and vegetable sugar content detection model according to the obtained sugar content sample data set to obtain a trained bagging fruit and vegetable sugar content detection model.

[0070] S41. In the original sample set of the detection model, input the transmission spectra when all fruits and vegetables are bagged into the trained bagging spectrum calibration model for processing to obtain the corresponding calibrated transmission spectra of each fruit and vegetable.

[0071] S42. Combine the calibrated transmission spectrum of the same fruit and vegetable and the corresponding sugar content to form a sugar content sample data, and summarize all the sugar content sample data of the fruits and vegetables to obtain a sugar content sample data set.

[0072] S43. Build a sugar content detection model for bagged fruits and vegetables in a computer. Using the corrected transmission spectrum of the fruits and vegetables as the input and the sugar content of the same fruits and vegetables as the label, input the sugar content sample data set into the sugar content detection model for bagged fruits and vegetables for training to obtain a trained sugar content detection model for bagged fruits and vegetables.

[0073] The sugar content detection model for bagged fruits and vegetables adopts a competitive adaptive weighted sampling combined with partial least squares regression (CARS-PLSR) model.

[0074] S5. Collect the transmission spectrum of the bagged fruits and vegetables to be measured. Input the transmission spectrum of the bagged fruits and vegetables to be measured into the trained bagged spectrum correction model and the trained sugar content detection model for bagged fruits and vegetables in sequence for processing to obtain the sugar content of the bagged fruits and vegetables to be measured.

[0075] Step S5 is specifically as follows: Use a transmission spectrum collection device to collect the transmission spectrum of the bagged fruits and vegetables to be measured. First, input the transmission spectrum of the bagged fruits and vegetables to be measured into the trained bagged spectrum correction model for processing to obtain the corrected transmission spectrum of the bagged fruits and vegetables to be measured, and then input the corrected transmission spectrum of the bagged fruits and vegetables to be measured into the trained sugar content detection model for bagged fruits and vegetables for detection to obtain the sugar content of the bagged fruits and vegetables to be measured.

[0076] To present the beneficial effects of the method of the present invention, the following experiments were also carried out in this embodiment:

[0077] After obtaining the sugar content sample data set in step S42, directly divide the sugar content sample data set into a training set and a test set at a ratio of 4:1 by the concentration gradient method. Input the divided training set into the sugar content detection model for bagged fruits and vegetables (competitive adaptive weighted sampling combined with partial least squares regression model) for training, and use the divided test set for testing.

[0078] In this embodiment, the CARS algorithm adopts a ten-fold cross-validation method, the maximum number of latent variables extracted is 30, and 50 sampling iterations are performed; during the training process of the PLSR model, the number of cross-validation folds is 30, and the number of cross-validation times is 10.

[0079] As Figure 4 shows the result graph of the training set of the sugar content sample data set divided in the sugar content detection model for bagged fruits and vegetables; as Figure 5 shows the result graph of the test set of the sugar content sample data set divided in the sugar content detection model for bagged fruits and vegetables. Finally, the determination coefficient of the training set is 0.822, the root mean square error is 0.273; the determination coefficient of the test set is 0.810, the root mean square error is 0.273; the relative analysis error is 2.32.

[0080] In addition, the following experiments were also carried out in this embodiment for comparison to highlight the advantages of the method of the present invention:

[0081] The original sample set of the detection model is directly divided into a training set and a test set at a ratio of 4:1. The training set is input into the bagged fruit and vegetable sugar content detection model (competitive adaptive weighted sampling combined with partial least squares regression model) for training, and the divided test set is used for testing.

[0082] The final results are as follows: the determination coefficient and root mean square error of the training set are 0.859 and 0.242 respectively, and the determination coefficient and root mean square error of the test set are 0.740 and 0.320 respectively, and the relative analysis error is 1.98;

[0083] It can be seen that the accuracy of the sugar content sample data set composed of the corrected transmission spectrum in the bagged fruit and vegetable sugar content detection model in this embodiment is significantly better than the performance of the original sample set of the detection model composed of the directly uncorrected transmission spectrum in the bagged fruit and vegetable sugar content detection model.

[0084] The method of the present invention realizes the detection by directly collecting the transmission spectrum of bagged fruits and vegetables, avoids the steps of removing and putting on the fruit bags before and after detection, improves the detection efficiency, reduces the detection cost, and can realize the rapid non-destructive on-line detection of the sugar content of bagged fruits and vegetables.

[0085] It should be noted that the above content is only used to illustrate a technical solution of the present invention, rather than a limitation on the protection scope of the present invention. Simple modifications or equivalent replacements made by those skilled in the art to the technical solution of the present invention do not exceed the scope of the present invention.

Claims

1. A method for detecting the sugar content of bagged fruits and vegetables based on spectral correction, characterized in that, Including the following steps: S1. Use a transmission spectrum acquisition device and a sugar content detector to respectively acquire and obtain the original calibration model sample set and the original detection model sample set; S2. According to the original calibration model sample set, obtain the transmission spectrum when each fruit and vegetable is bagged and the relevant bands of the transmission spectrum when each fruit and vegetable is bagged. Process the transmission spectrum when each fruit and vegetable is bagged according to the relevant bands to obtain the corresponding processed transmission spectrum when each fruit and vegetable is bagged; S3. Construct a bagged spectrum calibration data set according to the corresponding processed transmission spectrum when each fruit and vegetable is bagged. Train the constructed bagged spectrum calibration model according to the obtained bagged spectrum calibration data set to obtain a trained bagged spectrum calibration model; S4. Construct a sugar content sample data set according to the original detection model sample set and the bagged spectrum calibration model. Train the constructed bagged fruit and vegetable sugar content detection model according to the obtained sugar content sample data set to obtain a trained bagged fruit and vegetable sugar content detection model; S5. Acquire the transmission spectrum of the bagged fruit and vegetable to be measured, and input the transmission spectrum of the bagged fruit and vegetable to be measured into the trained bagged spectrum calibration model and the trained bagged fruit and vegetable sugar content detection model in sequence for processing to obtain the sugar content of the bagged fruit and vegetable to be measured.

2. The method for detecting the sugar content of bagged fruits and vegetables based on spectral correction according to claim 1, characterized in that, The specific content of step S1 is as follows: S11. Use a transmission spectrum acquisition device to acquire the transmission spectrum when several fruits and vegetables are bagged and the transmission spectrum when each fruit and vegetable is not bagged, and use a sugar content detector to detect the sugar content of each fruit and vegetable; Combine the transmission spectrum when each fruit and vegetable is bagged, the transmission spectrum when not bagged, and the corresponding sugar content as an original calibration model sample, and summarize the samples of all fruits and vegetables to obtain the original calibration model sample set; S12. Use a transmission spectrum acquisition device to acquire the transmission spectrum when several fruits and vegetables are bagged again, and use a sugar content detector to detect the sugar content of each corresponding fruit and vegetable. Combine the transmission spectrum when each fruit and vegetable is bagged again and the corresponding sugar content as an original detection model sample, and summarize the samples of all fruits and vegetables acquired again to obtain the original detection model sample set.

3. The method for detecting the sugar content of bagged fruits and vegetables based on spectral correction according to claim 2, wherein, The specific content of step S2 is as follows: S21. In the original calibration model sample set, perform correlation processing on the transmission spectrum when all fruits and vegetables are bagged and the sugar content of each corresponding fruit and vegetable to obtain a correlation curve; S32. Select the peak value of the sub-peak from the obtained correlation curve as the correlation threshold; S23. Select the bands higher than the correlation threshold from the correlation curve and use the selected bands as the relevant bands of the transmission spectrum when each fruit and vegetable is bagged in the original calibration model sample set; S24. In the original calibration model sample set, multiply the ordinate value of the relevant bands in the transmission spectrum when each fruit and vegetable is bagged by a preset weight coefficient to obtain the corresponding processed transmission spectrum when each fruit and vegetable is bagged.

4. According to the method for detecting the sugar content of bagged fruits and vegetables based on spectral calibration described in claim 3, it is characterized in that: The correlation processing in step S21 is set according to the following formula: Among them, T i represents the vertical coordinate correlation value of the i-th wavelength point in the correlation curve, where i represents the index and also the i-th wavelength point in the transmission spectrum; k represents the index and also the transmission spectrum of the k-th fruit and vegetable; n represents the total number of fruits and vegetables; X k,i represents the light intensity value at the i-th wavelength point in the transmission spectrum of the k-th fruit and vegetable; represents the mean value of the light intensity values corresponding to the transmission spectra of all fruits and vegetables at the i-th wavelength point; Y k represents the sugar content of the k-th fruit and vegetable; represents the mean value of the sugar contents of all fruits and vegetables.

5. A method for detecting the sugar content of bagged fruits and vegetables based on spectral correction according to claim 3, wherein, The specific content of step S3 is as follows: S31. Compose the processed transmission spectrum when the same fruit and vegetable is bagged and the corresponding transmission spectrum when it is not bagged into a spectral calibration sample data. The spectral calibration sample data of all fruits and vegetables are aggregated to obtain a bagged spectral calibration dataset. S32. Construct a bagged spectral calibration model. Use the processed transmission spectrum when the fruit and vegetable is bagged as the independent variable and the transmission spectrum when the same fruit and vegetable is not bagged as the dependent variable. Input the bagged spectral calibration dataset into the bagged spectral calibration model for training to obtain a trained bagged spectral calibration model.

6. A method for detecting the sugar content of bagged fruits and vegetables based on spectral calibration according to claim 5, characterized in that: The bagged spectral calibration model in step S32 adopts a partial least squares regression model.

7. A method for detecting the sugar content of bagged fruits and vegetables based on spectral correction according to claim 2, characterized in that, The specific steps of step S4 are as follows: S41. In the original sample set of the detection model, input the transmission spectra of all fruits and vegetables when they are bagged into the trained bagged spectral calibration model for processing to obtain the corrected transmission spectra corresponding to each fruit and vegetable. S42. Compose the corrected transmission spectrum of the same fruit and vegetable and the corresponding sugar content into a sugar content sample data. The sugar content sample data of all fruits and vegetables are aggregated to obtain a sugar content sample dataset. S43. Construct a bagged fruit and vegetable sugar content detection model. Use the corrected transmission spectrum of the fruit and vegetable as the input and the sugar content of the same fruit and vegetable as the label. Input the sugar content sample dataset into the bagged fruit and vegetable sugar content detection model for training to obtain a trained bagged fruit and vegetable sugar content detection model.

8. A method for detecting the sugar content of bagged fruits and vegetables based on spectral calibration according to claim 7, characterized in that: The bagged fruit and vegetable sugar content detection model in step S43 adopts a competitive adaptive weighted sampling combined with a partial least squares regression model.

9. A method for detecting the sugar content of bagged fruits and vegetables based on spectral calibration according to claim 1, characterized in that: The specific steps of step S5 are as follows: Use a transmission spectrum acquisition device to acquire the transmission spectrum of the bagged fruit and vegetable to be measured. The transmission spectrum of the bagged fruit and vegetable to be measured is first input into the trained bagged spectral calibration model for processing to obtain the corrected transmission spectrum of the bagged fruit and vegetable to be measured, and then the corrected transmission spectrum of the bagged fruit and vegetable to be measured is input into the trained bagged fruit and vegetable sugar content detection model for detection to obtain the sugar content of the bagged fruit and vegetable to be measured.

Citation Information

Patent Citations

  • Bottle-contained yellow wine quality index on-line detection method and device

    CN101216418A

  • Near-infrared-spectrum-based method for rapidly detecting components of bagged rice

    CN103487384A

  • Fruit cup device and method for detecting sugar degree of vulnerable fruits with packaging based on near infrared spectrum diffused transmission technology

    CN107462550A

  • Rice smut extraction method and system based on hyperspectral data waveband selection

    CN115830444A

  • Method for detecting quality of packaged food based on near infrared spectrum

    CN116754514A