Fruit putrefaction degree detection method based on hyperspectrum reconstructed by RGB (red, green and blue) image
Through the detection method based on RGB image reconstruction, the problems of complex detection of fruit corruption degree and high equipment cost in the prior art are solved, and automated and efficient detection results are achieved, which are suitable for actual production applications.
Patent Information
- Application Number
- CN202510017260.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2025-05-09
AI Technical Summary
In the existing non-destructive testing technology, the operation requirements for fruit corruption are high, and the equipment production costs are high, which is not conducive to promotion and use.
The detection method based on RGB image reconstruction hyperspectral was adopted. By collecting the original RGB images of the fruit to be tested, the pre-trained reconstruction spectral target domain model and fruit corruption detection model were input to obtain the fruit corruption detection results.
It realizes the automation and efficiency of fruit corruption detection, reduces the cost and complexity of testing equipment, adapts to actual production links, and is easy to promote.
Smart Images

Figure CN119964147A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of agricultural intelligent technology, and in particular to a method for detecting fruit corruption based on RGB image reconstruction of a hyperspectral spectrum. Background Art
[0002] With the continuous development of the fruit industry and the overall progress of the logistics and transportation industry, the fruit industry has put forward higher requirements for post-harvest storage, preservation, loss reduction, etc., among which the problem of fruit corruption caused by decay fungi is particularly prominent. The loss of fruit caused by decay fungi infection has seriously hindered the sustainable development of the fruit industry. Usually, after infection with decay fungi pathogens, the main manifestation is a significant decrease in fruit quality (sugar, hardness, vitamins, acidity), accompanied by large-scale fruit rot and cross-infection. Traditional methods for detecting decay fungi infection in stored fruits mainly rely on manual detection (visual, olfactory, auditory) and biochemical analysis (polymerase chain reaction, immunoassay and mold culture), which is overly dependent on manual experience, time-consuming, inefficient, and difficult to assess the overall disease extent of the fruit.
[0003] In recent years, with the development of non-destructive testing technology, machine vision, near-infrared spectroscopy and hyperspectroscopy have been widely used to evaluate the quality and safety of fruits. Among them, hyperspectroscopy combines spectroscopy and imaging vision technology to achieve spectrum integration, which has great development potential in the detection of fungal infection in agricultural products and has gradually replaced traditional manual detection methods.
[0004] However, the acquisition of hyperspectral images requires the use of a near-infrared (NIR) hyperspectral camera, which has complex equipment, high manufacturing costs, and high operational requirements for detection personnel. Therefore, it is difficult to adapt to actual production links during promotion and use.
[0005] Therefore, the prior art still needs to be improved and developed. Summary of the invention
[0006] In view of the above-mentioned deficiencies in the prior art, the purpose of the present invention is to provide a method for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectral, aiming to solve the problems in the existing non-destructive testing technology of high requirements for the operation of fruit corruption detection, high equipment production cost, and being unfavorable for promotion and use.
[0007] The technical solution of the present invention is as follows:
[0008] A method for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectral, comprising:
[0009] Collect the original RGB image of the fruit to be tested;
[0010] Inputting the original RGB image into a pre-trained reconstructed spectral target domain model to obtain an original reconstructed hyperspectral image;
[0011] The original reconstructed hyperspectral image is input into a pre-trained fruit corruption degree detection model to obtain a fruit corruption degree detection result.
[0012] The method for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectral, wherein the pre-trained reconstructed spectrum target domain model is jointly determined by the first training set and the reconstructed spectrum source domain model;
[0013] The first training set includes a plurality of initial RGB images and a plurality of initial hyperspectral images; the initial hyperspectral images are collected by a visible near-infrared hyperspectrometer; the initial RGB images are collected by an industrial camera;
[0014] The reconstructed spectral source domain model comprises:
[0015] The shallow feature extraction module is used to perform initial feature extraction on the RGB image, obtain local features in the RGB image and map them to a high-dimensional space to obtain an initial feature map with multi-channel features;
[0016] A deep feature extraction module, connected to the output end of the shallow feature extraction module, used to extract the deep features in the initial feature map to obtain a deep feature map;
[0017] The deep feature fitting module is connected to the output end of the deep feature extraction module, and is used to extract high-level features in the deep feature map to establish a mapping relationship between high-level features and output labels, and fit the data to obtain a reconstructed hyperspectral image.
[0018] The method for detecting the degree of fruit corruption based on RGB image reconstruction of hyperspectral, wherein the pre-trained reconstructed spectral target domain model is determined by the first training set and the reconstructed spectral source domain model, specifically comprises the following steps:
[0019] Prepare multiple fruit samples with different degrees of spoilage;
[0020] Collecting a plurality of initial RGB images and initial hyperspectral images of the fruit samples;
[0021] Based on the initial hyperspectral image, a characteristic wavelength selection algorithm is used to extract characteristic wavelengths related to the fruit sample to obtain a target hyperspectral image; the characteristic wavelength selection algorithm includes any one of a two-dimensional correlation spectral analysis method, a continuous projection method, and a competitive adaptive weighting method;
[0022] Extract three specific bands from the target hyperspectral image and synthesize a spectrum RGB image;
[0023] Inputting the spectral RGB image into a pre-built reconstructed spectral source domain model to obtain a spectral reconstructed hyperspectral image;
[0024] Comparing the plurality of spectrally reconstructed hyperspectral images with their corresponding target hyperspectral images until the spectrally reconstructed hyperspectral images meet a first preset condition, thereby obtaining a migration model;
[0025] The initial RGB image is input into the migration model to obtain a reconstructed spectral target domain model.
[0026] The method for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectral, wherein the step of preparing a plurality of fruit samples with different degrees of corruption specifically comprises:
[0027] Purifying spoilage bacteria and preparing a spore suspension; wherein the spoilage bacteria are isolated from Hami melon fruits that have been left to mold naturally;
[0028] Providing 600 Hami melon fruit samples, using a sterile needle to select two inoculation points at an interval of 180° at the equator of each Hami melon fruit sample, and inoculating 20 μL of a spore suspension at each inoculation point;
[0029] All the inoculated Hami melon fruit samples were placed in an environment with a temperature of 23-27° C. and a relative humidity of 55%-60% and stored for 10 days to obtain a plurality of fruit samples with different degrees of corruption.
[0030] The fruit corruption degree detection method based on RGB image reconstruction hyperspectral, wherein the pre-trained fruit corruption degree detection model is determined by the second training set and the convolutional neural network;
[0031] The second training set includes a plurality of the spectral reconstructed hyperspectral images and their corresponding target hyperspectral images; the convolutional neural network includes an input module, an attention module and an output module connected in series in sequence;
[0032] The input module includes a first convolutional layer and a second convolutional layer, wherein the convolution kernel size of the first convolutional layer is 3×3×3, the number of channels is 8, the sliding step size is (2, 2, 2), and it includes a first activation layer; the convolution kernel size of the second convolutional layer is 3×3×3, the number of channels is 16, the sliding step size is (2, 2, 2), and it includes a second activation layer;
[0033] The attention module includes a channel attention module and a spatial attention module; the channel attention module is used for data dimension reduction and adjustment of the weight of each channel; the spatial attention module is used for dynamically allocating spatial feature weights and reducing feature dimensions;
[0034] The output module includes two fully connected layers and a Softmax layer, the fully connected layer is used for linear fitting of features, and the Softmax layer is used to map features to target labels.
[0035] The method for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectral, wherein the pre-trained fruit corruption degree detection model is determined by the second training set and the convolutional neural network, specifically comprising the following steps:
[0036] labeling a plurality of the fruit samples to obtain a plurality of corruption degree labels of target fruit images;
[0037] Inputting the plurality of spectral reconstructed hyperspectral images and the corresponding target hyperspectral images into a pre-built initial fruit corruption degree detection model to obtain a training fruit spectral corruption degree grade label;
[0038] The training fruit spectrum corruption level label is compared with the target fruit image corruption level label until the training fruit spectrum corruption level label meets the second preset condition, thereby obtaining a trained fruit corruption level detection model.
[0039] The method for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectral, wherein the pre-trained fruit corruption degree detection model is determined by the second training set and the convolutional neural network, further comprising:
[0040] Comparing the evaluation indicators of the reconstructed spectral target domain model and the fruit corruption degree detection model to verify the feasibility of the model; wherein the evaluation indicators of the reconstructed spectral target domain model include any one or more of mean absolute error, mean square error, peak signal-to-noise ratio, and structural similarity; the evaluation indicators of the fruit corruption degree detection model include any one or more of accuracy, sensitivity, and specificity;
[0041] If the model effect meets the requirements, the reconstructed spectral target domain model and the fruit corruption degree detection model are encapsulated;
[0042] If the model effect does not meet the requirements, expand the sample set and repeat the training steps until the requirements are met.
[0043] The fruit corruption degree detection method based on RGB image reconstruction hyperspectral, wherein the corruption degree grade label of the target fruit image includes a healthy period label, a contact period label, an invasion period label, a latent period label and a corruption period label.
[0044] The method for detecting the degree of fruit corruption based on RGB image reconstruction of hyperspectral spectrum, wherein the pre-trained reconstructed spectral target domain model and the pre-trained fruit corruption degree detection model are both constructed based on the mapping relationship between the RGB image and the hyperspectral image; the mapping relationship between the RGB image and the hyperspectral image satisfies:
[0045]
[0046] Among them, I C represents the three channels of the RGB image (c = R, G, B); x represents the horizontal coordinate of the detection point in the RGB image; y represents the vertical coordinate of the detection point in the RGB image; λ n represents the sampling frequency band; n represents the number of bands, and the corresponding wavelength range is 400-1000 nanometers; H(λ n ) represents the hyperspectral image; E C (λ n ) represents the spectral response function.
[0047] The method for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectrum, wherein the method for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectrum is applied to a device for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectrum, and the device for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectrum comprises:
[0048] A dark box, the inner wall of which is coated with a black matte coating;
[0049] A material table is escalably arranged at the bottom of the dark box and is used to place the fruits to be tested;
[0050] A light source, disposed in the dark box, for emitting light toward the material platform;
[0051] A camera is disposed in the dark box and above the material table, and is used to collect an RGB image of the fruit to be tested; and
[0052] A control module is arranged in the dark box and is electrically connected to the camera and the light source; the control module is used to receive data collected by the camera and execute a method for detecting the degree of fruit corruption based on RGB image reconstruction of a hyperspectral spectrum;
[0053] Wherein, the step of collecting the original RGB image of the fruit to be tested specifically includes:
[0054] Turn on the light source and preheat for 5-10 minutes;
[0055] The position of the camera is adjusted to be just above the material table, and the camera is calibrated based on a white reference image and a black reference image; the white reference image is acquired by placing a white Teflon plate on the material table as a white standard sample through the camera; the black reference image is acquired by completely covering the lens of the camera;
[0056] The angle of the light source is adjusted so that the light is irradiated at 45° to the surface of the fruit to be tested; and the original RGB image of the fruit to be tested is collected by the camera.
[0057] Compared with the prior art, the embodiments of the present invention have the following advantages:
[0058] The present application can detect the degree of fruit corruption by acquiring the RGB image of the fruit to be tested. The RGB image can be directly obtained using an industrial camera. Therefore, the detection device has a simple structure, low manufacturing cost, high degree of automation in the detection process, and is integrated into the detection device, which is convenient to operate and has a fast detection speed. In short, the detection method disclosed in the present application can solve the problems of high cost, complex operation, and data redundancy of hyperspectral equipment, and provide an efficient and low-cost detection solution that is suitable for actual production scenarios and easy to promote. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0060] Figure 1 The figure is a flow chart of the method for detecting the degree of fruit corruption based on reconstructing a hyperspectral spectrum from an RGB image in the present invention.
[0061] Figure 2 The flowchart of the training method for reconstructing the spectral target domain model in the present invention.
[0062] Figure 3 It is the initial hyperspectral image of the fruit sample collected in the present invention; wherein A: RGB represents the visualized initial RGB image; A: Red represents the red channel image in the initial RGB image; A: Yellow represents the yellow channel image in the initial RGB image; A: Green represents the green channel image in the initial RGB image; A: Blue represents the blue channel image in the initial RGB image.
[0063] Figure 4 These are RGB images of fruit samples collected at different storage times after the fruit samples were infected by spoilage fungi in the present invention.
[0064] Figure 5 These are hyperspectral visualization images of fruit samples collected at different storage times after the fruit samples are infected by spoilage fungi in the present invention.
[0065] Figure 6 It is the initial high spectral reflectance spectrum curve diagram of all fruit samples in the present invention.
[0066] Figure 7 It is the initial RBG curve diagram of all fruit samples in the present invention.
[0067] Figure 8 This is a slice diagram of characteristic variables extracted by the two-dimensional correlation spectroscopy analysis method in the present invention.
[0068] Fig. 9 The figure is a flow chart of the training method of the fruit corruption degree detection model in the present invention.
[0069] Fig.10 It is a structural schematic diagram of a device for detecting the degree of fruit corruption based on RGB image hyperspectral reconstruction in the present invention.
[0070] Fig.11 This is a flow chart of collecting the original RGB image of the fruit to be tested in the present invention.
[0071] Among them, 10, dark box; 20, material table; 30, light source; 40, camera; 50, control module; 51, control board; 52, relay; 60, halogen lamp bracket; 70, lifting bracket; 80, motor; 90, reducer; 100, touch screen; 110, power supply; 120, terminal block; 130, heat dissipation device. DETAILED DESCRIPTION
[0072] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0073] Variations in the shapes shown in the drawings may occur due to manufacturing techniques and / or tolerances. Therefore, the examples described herein are not limited to the specific shapes shown in the drawings but include variations in shapes that occur during manufacturing.
[0074] As used herein, the term "and / or" includes any one of the associated listed items and any combination of any two or more items.
[0075] Although terms such as "first," "second," and "third" may be used herein to describe various members, components, regions, layers, or portions, these members, components, regions, layers, or portions are not limited by these terms. Rather, these terms are only used to distinguish one member, component, region, layer, or portion from another member, component, region, layer, or portion. Therefore, without departing from the teachings of the examples described herein, the first member, component, region, layer, or portion referred to may also be referred to as the second member, component, region, layer, or portion.
[0076] For ease of description, spatial relational terms such as "above", "upper", "below", and "lower" may be used herein to describe the relationship of one element to another element as shown in the accompanying drawings. Such spatial relational terms are intended to encompass different orientations of the device in use or operation in addition to the orientation depicted in the accompanying drawings. For example, if the device in the accompanying drawings is turned over, an element described as being "above" or "upper" relative to another element will subsequently be "below" or "lower" relative to the other element. Thus, the term "above" includes both "above" and "below" orientations depending on the spatial orientation of the device. The device may also be positioned in other ways, and the spatial relational terms used herein will be interpreted accordingly.
[0077] The terms used herein are only used to describe various examples and are not used to limit the present disclosure. Unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. The terms "include", "comprise" and "have" list the stated features, quantities, operations, components, elements and / or their combinations that exist, but do not exclude the existence or addition of one or more other features, quantities, operations, components, elements and / or their combinations.
[0078] In recent years, with the rapid development of convolutional neural networks, machine learning has set off a booming wave in all walks of life. Hyperspectral images have been widely used in computer vision tasks such as target detection and image processing due to their rich spectral information. However, they are also accompanied by the defects of high acquisition costs and large environmental restrictions. Compared with expensive hyperspectral cameras, RGB images taken by ordinary cameras are cheaper and less restricted by environmental factors. The pixel values of three-channel RGB images are highly correlated with the pixel radiation values of hyperspectral images. Therefore, high-quality hyperspectral images can be reconstructed from RGB images. Although the reconstructed low-cost hyperspectral images will lose some data, they can still show more spectral information than RGB images.
[0079] See also Figure 1In one embodiment of the present invention, a method for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectral is disclosed, which includes:
[0080] S10, collecting the original RGB image of the fruit to be tested;
[0081] S20, inputting the original RGB image into a pre-trained reconstructed spectral target domain model to obtain an original reconstructed hyperspectral image;
[0082] S30, inputting the original reconstructed hyperspectral image into a pre-trained fruit corruption degree detection model to obtain a fruit corruption degree detection result.
[0083] The pre-trained reconstructed spectral target domain model and the pre-trained fruit corruption degree detection model disclosed in this embodiment are both implemented on an open source deep learning framework (such as the Pytorch framework) for machine learning and deep learning, and the original RGB image of the fruit to be tested is collected by an industrial camera.
[0084] In this embodiment, the fruit corruption degree detection result is a fruit corruption degree grade label, which is grade information. According to the degree of fruit corruption, the fruit corruption process can be divided into five periods, namely, the healthy period, the contact period, the invasion period, the incubation period and the corruption period, wherein the contact period is the period when the pathogen spores contact with the host and wait for suitable germination conditions; the invasion period is the period when the pathogen invades the host by destroying the physical defense structures such as the host cell wall and establishes a parasitic relationship; the incubation period is the period when the pathogen inside the fruit maintains a dynamic balance with the host and presents a dormant state, and the fruit has no symptoms of disease and is not significantly different from the healthy fruit; the corruption period is the period when the dynamic balance between the pathogen and the host is broken, the growth of the pathogen is not inhibited, and the mycelium begins to grow and propagate in large quantities and spreads continuously, and the fruit enters the onset period and presents symptoms of disease. Therefore, multiple grade labels can be set to calibrate the degree of corruption of the fruit.
[0085] For example, fruits with 0 CFU / mL of mold spores are marked as healthy fruits, and fruits with 1×10 1 ~10 2 Fruits with 1×10 CFU / mL are marked as contact period fruits, and the mold spore count is 1×10 2 ~10 3 Fruits with 1×10 CFU / mL are marked as invasive fruits, and the mold spores are 1×10 3 ~10 4 Fruits with less than 1×10 CFU / mL are marked as incubation period fruits, and the mold spores are greater than 1×10 5 Fruits with a lower CFU / mL are marked as spoiled fruits.
[0086] In this way, the original RGB image is input into the pre-trained fruit corruption degree detection model, and one of the labels among the healthy period label, contact period label, invasion period label, latent period label and corruption period label will be output according to the detected corruption degree.
[0087] Specifically, this embodiment can detect the degree of fruit corruption by acquiring the original RGB image of the fruit to be tested. The detection equipment has a simple structure, low manufacturing cost, a high degree of automation in the detection process, convenient operation, and a fast detection speed. It can solve the problems of high cost, complex operation, and data redundancy of hyperspectral equipment, and provide an efficient and low-cost detection solution that is suitable for actual production scenarios and easy to promote.
[0088] Specifically, as an implementation of this embodiment, it is disclosed that the pre-trained reconstructed spectral target domain model is jointly determined by a first training set and a reconstructed spectral source domain model; the first training set includes multiple initial RGB images and multiple initial hyperspectral images; the initial hyperspectral images are collected by a visible near-infrared hyperspectr; and the initial RGB images are collected by an industrial camera.
[0089] Specifically, according to the Lambertian hypothesis, the formation process of the RGB image is shown in the following formula (1):
[0090]
[0091] Among them, I C represents the three channels of the RGB image (c = R, G, B); x represents the horizontal coordinate of the detection point in the RGB image; y represents the vertical coordinate of the detection point in the RGB image; λ represents the wavelength; L(λ) represents the illumination spectrum; R(x, y, λ) represents the spectral reflectance of the object; E C (λ) represents the spectral response function.
[0092] The hyperspectral image H(x, y, λ) is defined as the product of the spectral reflectance of the material and the illumination spectrum. Therefore, the relationship between the hyperspectral image and the RGB image is shown in formula (2):
[0093]
[0094] The discretization formula (2) can construct the mapping relationship between the RGB image and the hyperspectral image, and obtain formula (3):
[0095]
[0096] Among them, λ n represents the sampling frequency band; n represents the number of bands, and the corresponding wavelength range is 400-1000 nanometers (nm).
[0097] Spectral reconstruction is to invert the above forward image formation model in an optimization framework to find the multi-channel data cube H(λ n ). In other words, constructing a mapping relationship between RGB images and hyperspectral images can establish a corresponding training model to achieve the effect of inputting RGB images and outputting hyperspectral images. Therefore, in actual application, it is only necessary to collect RGB images for detection, and the hyperspectral images can be directly output through the trained model to obtain the detection results. It is only necessary to use an industrial camera to collect RGB images, and there is no need to use a near-infrared hyperspectral camera to collect data. Therefore, the detection equipment is simplified, which is conducive to reducing costs and improving the portability of the equipment. Specifically, the pre-trained reconstructed spectral target domain model and the pre-trained fruit corruption degree detection model disclosed in this embodiment are both constructed based on the mapping relationship between RGB images and hyperspectral images.
[0098] Specifically, the reconstructed spectral source domain model disclosed in this embodiment includes a shallow feature extraction module, a deep feature extraction module and a deep feature fitting module. The shallow feature extraction module is composed of a convolution module, which is used to perform initial feature extraction on the RGB image, obtain local features in the RGB image to establish primary reconstruction correlation, and map the local features to a high-dimensional space to obtain an initial feature map with multi-channel features.
[0099] The deep feature extraction module is connected to the output end of the shallow feature extraction module, and includes an encoder layer, a decoder layer, an upsampling layer and a downsampling layer. The encoder is composed of a self-attention mechanism module, a fully connected feedforward network module, a residual connection and normalization module, and a position encoding module, and is used to extract deep features in the initial feature map and reduce the feature dimension; the decoder layer is composed of a self-attention mechanism module, a fully connected feedforward network module, a residual connection and normalization module, and a position encoding module, and is used to increase the dimension of the deep features extracted by the encoder to obtain a deep feature map.
[0100] The deep feature fitting module is connected to the output end of the deep feature extraction module, and includes a linear fitting layer, a nonlinear activation layer, and a random inactivation layer. The deep feature fitting module is used to automatically extract high-level features from the deep feature map, establish a mapping relationship between high-level features and output labels, and fit the data to obtain a reconstructed hyperspectral image.
[0101] See also Figure 2 As another implementation of this embodiment, the steps disclosed in which the pre-trained reconstructed spectral target domain model is jointly determined by the first training set and the reconstructed spectral source domain model specifically include:
[0102] M10. Prepare multiple fruit samples with different degrees of corruption.
[0103] Specifically, when preparing fruit samples, fruit samples with uniform size and uniform maturity are selected.
[0104] In one implementation of this embodiment, it is disclosed that the step M10 specifically includes:
[0105] M11. Purify spoilage bacteria and prepare a spore suspension; wherein the spoilage bacteria are isolated from Hami melon fruits that have been left to mold naturally;
[0106] M12. Provide 600 Hami melon fruit samples, use a sterile needle to select two inoculation points at an interval of 180° at the equator of each Hami melon fruit sample, and inoculate 20 μL of the spore suspension at each inoculation point;
[0107] M13. All the inoculated Hami melon fruit samples were placed in an environment with a temperature of 23-27° C. and a relative humidity of 55%-60% and stored for 10 days to obtain multiple fruit samples with different degrees of corruption.
[0108] In this embodiment, by preparing fruit samples in the same temperature and humidity environment, the influence of environmental factors or individual fruit factors on the growth of spoilage fungi is reduced, thereby obtaining multiple naturally moldy fruit samples and improving the effectiveness of the detection samples.
[0109] M20. Collect initial RGB images and initial hyperspectral images of a plurality of the fruit samples.
[0110] The fruit sample is illuminated by a halogen lamp, and an industrial camera is used to obtain an RGB image, and a visible near-infrared hyperspectrometer is used to obtain an initial hyperspectral image. For example, taking Hami melon as an example, the collected initial RGB image and initial hyperspectral image are as follows: Figure 3 , Figure 4 and Figure 5 shown.
[0111] M30. Based on the initial hyperspectral image, a characteristic wavelength selection algorithm is used to extract characteristic wavelengths related to the fruit sample to obtain a target hyperspectral image.
[0112] The characteristic wavelength selection algorithm disclosed in this embodiment includes any one of a two-dimensional correlation spectrum analysis method, a continuous projection method, and a competitive adaptive weighting method.
[0113] For example, the specific steps of extracting characteristic wavelengths related to fruit samples using two-dimensional correlation spectroscopy are as follows:
[0114] based on Figure 3 and Figure 4 The initial RGB image shown, and Figure 5The initial hyperspectral image shown in FIG. 1 is firstly subjected to a four-point area sampling method. The inoculation point of the fruit sample is used as the center, and an image of 500×500 (length×width, in pixels) is selected as the extraction area. The average data curve of the extraction area is as follows: Figure 6 and Figure 7 Then, the two-dimensional correlation spectroscopy analysis method was used to extract characteristic variables. The different degrees of mold in Hami melon were used as external disturbance conditions, and 13 autocorrelation peaks of 472, 532, 564, 585, 596, 634, 665, 684, 712, 745, 790, 847 and 900 (in nanometers) in the cut spectrum were selected as characteristic wavelengths to obtain a 13-channel target hyperspectral image, as shown in Figure 1. Figure 8 shown.
[0115] M40, extracting three specific bands from the target hyperspectral image and synthesizing a spectral RGB image.
[0116] M50. Input the spectral RGB image into a pre-built reconstructed spectral source domain model to obtain a spectral reconstructed hyperspectral image.
[0117] M60. Compare the plurality of spectrally reconstructed hyperspectral images with their corresponding target hyperspectral images until the spectrally reconstructed hyperspectral images meet a first preset condition, thereby obtaining a migration model.
[0118] Specifically, the first preset condition is: inputting the plurality of spectrally reconstructed hyperspectral images and their corresponding target hyperspectral images into a pre-built reconstructed spectral source domain model for training until the similarity between the output multi-channel hyperspectral image and the target hyperspectral image is no longer close, obtaining the optimal weight parameters of the reconstructed spectral source domain model, and loading the optimal weight parameters into the reconstructed spectral source domain model to form an optimal migration model.
[0119] based on Figure 8 , three specific bands are extracted from the target hyperspectral image to synthesize spectral RGB images, and then the spectral RGB images are input into multiple reconstructed spectral source domain models for reconstruction, as shown in Table 1 below, which shows the reconstruction results of all models.
[0120] Table 1 Results of evaluation indicators of spectral reconstruction model
[0121]
[0122] As shown in Table 1, the MRAE, RMSE, PSNR and SSIM indicators of the Sim-MST++ reconstruction model among all reconstruction models are 0.0446, 0.0158, 36.270 and 0.9333 respectively, showing the best results, which is related to the fact that the Sim-MST++ model processes the spatial information in the image by introducing position encoding. Therefore, Sim-MST++ is determined to be the best migration model.
[0123] M70. Input the initial RGB image into the migration model to obtain a reconstructed spectral target domain model.
[0124] Finally, the initial RGB image is input into the migration model to form the Sim-MST++ reconstructed spectral target domain model, which is used to determine the multi-channel hyperspectral image reconstructed from the three-channel RGB image.
[0125] Specifically, as another implementation of this embodiment, it is disclosed that the pre-trained fruit corruption degree detection model is jointly determined by a second training set and a convolutional neural network; the second training set includes a plurality of the spectrally reconstructed hyperspectral images and their corresponding target hyperspectral images.
[0126] Specifically, the convolutional neural network disclosed in this embodiment includes an input module, an attention module and an output module connected in series.
[0127] The input module is composed of a convolution layer and an activation layer, which is used to reduce the dimension of the reconstructed multispectral image, reduce the amount of calculation, reduce redundancy, improve the calculation efficiency, and extract preliminary features. Specifically, the input module includes a first convolution layer and a second convolution layer, the convolution kernel size of the first convolution layer is 3×3×3, the number of channels is 8, the sliding step size is (2, 2, 2), and it includes a first activation layer; the convolution kernel size of the second convolution layer is 3×3×3, the number of channels is 16, the sliding step size is (2, 2, 2), and it includes a second activation layer.
[0128] The attention module includes a channel attention module and a spatial attention module; the channel attention module focuses on the importance of each channel in the image features, including an average pooling layer and a weight allocation layer, wherein the average pooling layer is used for data dimension reduction, and the weight allocation layer is used to dynamically adjust the weight of each channel; the spatial attention module focuses on the importance of the spatial dimension, mainly including two pooling layers and a convolution layer, wherein the pooling layer is used to dynamically allocate spatial feature weights, and the convolution layer is used to reduce the feature dimension.
[0129] The output module includes two fully connected layers and a Softmax layer, using ReLU as an activation function; the fully connected layer is used for linear fitting of features, and the Softmax layer is used to map features to target labels.
[0130] The convolutional neural network of this embodiment fuses information at different levels by sequentially connecting the input module, the attention module, and the output module to obtain a richer and higher-quality feature representation.
[0131] See also Fig. 9 In another embodiment of this embodiment, it is disclosed that the pre-trained fruit corruption degree detection model is determined by the second training set and the convolutional neural network, and the steps specifically include:
[0132] Q10. Label a plurality of the fruit samples to obtain a plurality of labels of corruption degree of target fruit images.
[0133] In this embodiment, the corruption level label of the target fruit image is calibrated according to the corruption level of the fruit sample, which can be classified into: healthy period label, contact period label, invasion period label, latent period label and corruption period label.
[0134] Q20. Input the plurality of spectrally reconstructed hyperspectral images and their corresponding target hyperspectral images into a pre-built initial fruit corruption degree detection model to obtain training fruit spectral corruption degree grade labels.
[0135] The corresponding initial hyperspectral image and target hyperspectral image are calculated from the initial RGB images of multiple fruit samples, and the initial hyperspectral image is input into the reconstructed spectral target domain model to obtain the spectral reconstructed hyperspectral image. The spectral reconstructed hyperspectral image and the target hyperspectral image are then input into the pre-built initial fruit corruption degree detection model. Through dimensionality reduction data processing and linear fitting, the target label is finally mapped out, that is, the training fruit spectral corruption degree grade label.
[0136] Q30. Compare the training fruit spectrum corruption level label with the target fruit image corruption level label until the training fruit spectrum corruption level label meets the second preset condition, thereby obtaining a trained fruit corruption level detection model.
[0137] Specifically, the second preset condition is: inputting a plurality of the spectrally reconstructed hyperspectral images and their corresponding target hyperspectral images into a pre-built initial fruit corruption degree detection model for training, until the similarity between the output training fruit spectral corruption degree grade label and the target fruit image corruption degree grade label is no longer close, obtaining the optimal weight parameters of the initial fruit corruption degree detection model, and loading the optimal weight parameters into the initial fruit corruption degree detection model to form a trained fruit corruption degree detection model.
[0138] Specifically, in another implementation of this embodiment, the step of disclosing that the pre-trained fruit corruption degree detection model is determined by the second training set and the convolutional neural network also includes:
[0139] Q40, comparing the evaluation indicators of the reconstructed spectral target domain model and the fruit corruption degree detection model to verify the feasibility of the model; wherein the evaluation indicators of the reconstructed spectral target domain model include any one or more of mean absolute error (MRAE), mean square error (RMSE), peak signal-to-noise ratio (PSNR), and structural similarity (SSIM); the evaluation indicators of the fruit corruption degree detection model include any one or more of accuracy, sensitivity, and specificity;
[0140] Q50. If the model effect meets the requirements, encapsulate the reconstructed spectral target domain model and the fruit corruption degree detection model;
[0141] Q60. If the model effect does not meet the requirements, expand the sample set and repeat the training steps until the requirements are met.
[0142] In this embodiment, the performance of the evaluation model is encapsulated by the available reconstructed spectral target domain model and the fruit corruption degree detection model so as to be mounted on the detection device, so as to integrate the processing program, improve the detection speed and simplify the detection process.
[0143] See also Fig.10 In another implementation of the present embodiment, the fruit corruption degree detection method based on RGB image reconstruction hyperspectrum is applied to a fruit corruption degree detection device based on RGB image reconstruction hyperspectrum, and the fruit corruption degree detection device based on RGB image reconstruction hyperspectrum includes a dark box 10, a material table 20, a light source 30, a camera 40 and a control module 50, wherein the inner wall of the dark box 10 is coated with a black matte coating; the material table 20 is arranged at the bottom of the dark box 10 in a liftable manner, and is used to place the fruit to be tested; the light source 30 is arranged in the dark box 10, and is used to emit light toward the material table 20; the camera 40 is arranged in the dark box 10, located above the material table 20, and is used to collect the RGB image of the fruit to be tested; the control module 50 is arranged in the dark box 10, and is electrically connected to the camera 40 and the light source 30; the control module 50 is used to receive the data collected by the camera 40, and execute the fruit corruption degree detection method based on RGB image reconstruction hyperspectrum.
[0144] In this embodiment, a portable detection device is provided to detect the fruit to be detected in the dark box 10, and the detection label can be directly output, with high detection efficiency and convenient operation; the entire device has a simple structure, low production cost, and good portability, and provides a low-cost and efficient solution for reconstruction technology in the field of complex food system detection; at the same time, it solves the problems of high cost, complex operation and data redundancy of traditional hyperspectral equipment, is convenient for application in actual production links, and is easy to promote.
[0145] Specifically, the inner side of the dark box 10 disclosed in this embodiment is coated with a black matte coating to increase the diffuse reflection inside the dark box 10, eliminate the dispersion of light, make the light on the surface of the fruit to be tested more realistic, and facilitate the acquisition of a real RGB image.
[0146] Specifically, the material table 20 disclosed in this embodiment is arranged horizontally and can be fixed to the bottom of the dark box 10 by a lifting bracket 70. The lifting bracket 70 can be driven by a motor 80, and the lifting height is 0-8 cm. The output end of the motor 80 is connected to a reducer 90, and the reducer 90 is connected to the lifting bracket 70 to adjust the position of the fruit to be tested, so as to facilitate the acquisition of a real and clear RGB image.
[0147] Specifically, the light source 30 disclosed in the present embodiment is a halogen lamp, covering a wavelength range of 400-1000nm and a power of 15-30W. Two halogen lamps can be provided, both located above the material table 20, and preferably the two halogen lamps are symmetrically arranged on the left and right sides of the material table 20 to emit light from two directions at the same time, increase the light receiving area on the surface of the fruit to be tested, reduce shadows, improve the image acquisition effect of the fruit to be tested, and reduce the distortion or blur of the image. In addition, a halogen lamp bracket 60 can be provided in the dark box 10 disclosed in the present embodiment, and the halogen lamp can be rotatably mounted on the halogen lamp bracket 60 to increase the irradiation range of the halogen lamp and improve the flexibility of use, so as to adapt to fruits of different sizes to be tested and fully irradiate the surface of the fruit to be tested.
[0148] Specifically, the camera 40 disclosed in this embodiment includes but is not limited to an industrial camera with high spatial resolution, with a resolution of 20 million pixels, and can collect RGB images. In addition, in order to facilitate movement and avoid the fruit to be tested, the camera 40 can be set on the top of the dark box 10 to reduce collision with the fruit to be tested. In addition, a camera bracket can be set in the dark box 10, and mechanical transmission is performed using structures such as a motor and a transmission rod to drive the camera 40 to move in the dark box 10, so as to facilitate alignment with the fruit to be tested, adjust the collection distance, and collect a complete and clear RGB image.
[0149] Specifically, the control module 50 disclosed in this embodiment includes but is not limited to a microcomputer composed of a control board 51 and a data acquisition module, the main frequency of the microcomputer is 2.5GHz, the memory is 16GB, and the interface supports USB and HDMI connections; the data acquisition module has a 10Gb / s high-speed data transmission interface and a 2Gb high-speed cache space to quickly process the RGB image collected by the camera and quickly output the image data. When in use, the data acquisition module adjusts the RGB image collected by the camera 40, outputs the image data to the control board 51, and the control board 51 is equipped with a trained reconstruction spectral target domain model and a fruit corruption degree detection model. The image data is spectrally reconstructed and analyzed in the control board 51, and after integrated processing, the fruit corruption degree detection result can be directly output.
[0150] Specifically, a touch screen 100 can also be provided on the dark box 10 disclosed in this embodiment to display the test results, so as to facilitate the test personnel to quickly obtain the test information. For example, a touch screen 100 with a resolution of 1080p and a size of 8 inches can be set on the outer wall of the dark box 10 for human-computer interaction operations such as collecting parameter settings, displaying data, and saving test results.
[0151] Specifically, a power source 110 may also be provided in the dark box 10 disclosed in the present embodiment. The power source 110 includes, but is not limited to, dry cells, lithium batteries, etc. For example, a lithium battery with a size of 7×7 cm, a rated output voltage of 12 volts, an output power of 60 watts, and a capacity of 20,000 mAh is used, which is electrically connected to the control module 50 to provide stable power, so that no external circuit is required, which can increase the portability of the detection device and facilitate mobile use. In another implementation of the present embodiment, when the power source 110 is not provided, a terminal block 120 is provided on the dark box 10 to be electrically connected to the control board 51 to connect to the external circuit for power transmission.
[0152] Specifically, the halogen lamp disclosed in this embodiment will generate heat during operation, so a heat dissipation device 130 can be set on the dark box 10, such as a heat dissipation fan, a heat sink, etc. A heat dissipation fan with a silent device can be used, with a size of 50×50 mm, a rotation speed of 1000-5000RPM, and a power of 0.5-5W.
[0153] Specifically, a relay 52 can be set in the control module disclosed in this embodiment, and the cooling fan 130 is electrically connected to the control board 51. The speed of the cooling fan 130 and the irradiation power of the light source 30 are controlled by the relay 52 to adjust the temperature in the darkroom 10 to avoid overheating.
[0154] See also Fig.11 In another implementation of this embodiment, the step of collecting the original RGB image of the fruit to be tested specifically includes:
[0155] N10, turn on the light source and preheat for 5-10 minutes;
[0156] N20, adjust the position of the camera to be just above the material table, and calibrate the camera based on a white reference image and a black reference image; the white reference image is acquired by placing a white Teflon plate on the material table as a white standard sample through the camera; the black reference image is acquired by completely covering the lens of the camera;
[0157] N30, adjusting the angle of the light source so that the light is irradiated at 45° to the surface of the fruit to be tested; and collecting the original RGB image of the fruit to be tested by the camera.
[0158] In this embodiment, preheating is performed first to reduce the influence of uneven light, and then the camera is calibrated and the RGB image of the fruit to be tested is collected to improve the authenticity of the image collected by the camera. Specifically, during the preheating process, the height of the light source, the height of the camera, and the height of the material table can also be adjusted to the optimal collection distance to improve the image collection quality.
[0159] In this embodiment, two halogen lamps are arranged on the upper left and upper right of the material table, and the two halogen lamps emit light at a 45° angle to the upper surface of the material table, thereby increasing the light receiving area of the surface of the fruit to be tested and further improving the image acquisition quality.
[0160] It should be understood that the various parts of the present application can be implemented in hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array, a field programmable gate array, etc.
[0161] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0162] In summary, the present application discloses a method for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectrum, which is implemented by a device for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectrum. The device for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectrum is portable, has a built-in camera to collect RGB images of the fruit to be tested, and then uses the developed fruit corruption degree detection model to perform integrated detection of the degree of fruit corruption, with high detection efficiency and low detection cost.
[0163] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application may be combined with each other.
[0164] It should be noted that the present invention takes the fruit spoilage degree detection method based on RGB image reconstruction hyperspectral as an example to introduce the specific structure and working principle of the present invention, but the application of the present invention is not limited to the fruit spoilage degree detection method based on RGB image reconstruction hyperspectral, and can also be applied to the detection and production of other similar workpieces.
[0165] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
[0166] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectral, characterized in that: include: Collect the original RGB image of the fruit to be tested; Inputting the original RGB image into a pre-trained reconstructed spectral target domain model to obtain an original reconstructed hyperspectral image; The original reconstructed hyperspectral image is input into a pre-trained fruit corruption degree detection model to obtain a fruit corruption degree detection result.
2. The method for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectral according to claim 1, characterized in that: The pre-trained reconstructed spectrum target domain model is determined by the first training set and the reconstructed spectrum source domain model; The first training set includes a plurality of initial RGB images and a plurality of initial hyperspectral images; the initial hyperspectral images are collected by a visible near-infrared hyperspectrometer; the initial RGB images are collected by an industrial camera; The reconstructed spectral source domain model comprises: The shallow feature extraction module is used to perform initial feature extraction on the RGB image, obtain local features in the RGB image and map them to a high-dimensional space to obtain an initial feature map with multi-channel features; A deep feature extraction module, connected to the output end of the shallow feature extraction module, used to extract the deep features in the initial feature map to obtain a deep feature map; The deep feature fitting module is connected to the output end of the deep feature extraction module, and is used to extract high-level features in the deep feature map to establish a mapping relationship between high-level features and output labels, and fit the data to obtain a reconstructed hyperspectral image.
3. The method for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectral according to claim 2, characterized in that: The pre-trained reconstructed spectral target domain model is determined by the first training set and the reconstructed spectral source domain model in a step that specifically includes: Prepare multiple fruit samples with different degrees of spoilage; Collecting a plurality of initial RGB images and initial hyperspectral images of the fruit samples; Based on the initial hyperspectral image, a characteristic wavelength selection algorithm is used to extract characteristic wavelengths related to the fruit sample to obtain a target hyperspectral image; the characteristic wavelength selection algorithm includes any one of a two-dimensional correlation spectral analysis method, a continuous projection method, and a competitive adaptive weighting method; Extract three specific bands from the target hyperspectral image and synthesize a spectrum RGB image; Inputting the spectral RGB image into a pre-built reconstructed spectral source domain model to obtain a spectral reconstructed hyperspectral image; Comparing the plurality of spectrally reconstructed hyperspectral images with their corresponding target hyperspectral images until the spectrally reconstructed hyperspectral images meet a first preset condition, thereby obtaining a migration model; The initial RGB image is input into the migration model to obtain a reconstructed spectral target domain model.
4. The method for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectral according to claim 3, characterized in that: The steps of preparing a plurality of fruit samples with different corruption degrees specifically include: Purifying spoilage bacteria and preparing a spore suspension; wherein the spoilage bacteria are isolated from Hami melon fruits that have been left to mold naturally; Providing 600 Hami melon fruit samples, using a sterile needle to select two inoculation points at an interval of 180° at the equator of each Hami melon fruit sample, and inoculating 20 μL of a spore suspension at each inoculation point; All the inoculated Hami melon fruit samples were placed in an environment with a temperature of 23-27° C. and a relative humidity of 55%-60% and stored for 10 days to obtain a plurality of fruit samples with different degrees of corruption.
5. The method for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectral according to claim 3, characterized in that: The pre-trained fruit corruption degree detection model is determined by the second training set and the convolutional neural network; The second training set includes a plurality of the spectral reconstructed hyperspectral images and their corresponding target hyperspectral images; the convolutional neural network includes an input module, an attention module and an output module connected in series in sequence; The input module includes a first convolutional layer and a second convolutional layer, wherein the convolution kernel size of the first convolutional layer is 3×3×3, the number of channels is 8, the sliding step size is (2, 2, 2), and it includes a first activation layer; the convolution kernel size of the second convolutional layer is 3×3×3, the number of channels is 16, the sliding step size is (2, 2, 2), and it includes a second activation layer; The attention module includes a channel attention module and a spatial attention module; the channel attention module is used for data dimension reduction and adjustment of the weight of each channel; the spatial attention module is used for dynamically allocating spatial feature weights and reducing feature dimensions; The output module includes two fully connected layers and a Softmax layer, the fully connected layer is used for linear fitting of features, and the Softmax layer is used to map features to target labels.
6. The method for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectral according to claim 5, characterized in that: The pre-trained fruit corruption degree detection model is determined by the second training set and the convolutional neural network, and the steps specifically include: labeling a plurality of the fruit samples to obtain a plurality of corruption degree labels of target fruit images; Inputting the plurality of spectral reconstructed hyperspectral images and the corresponding target hyperspectral images into a pre-built initial fruit corruption degree detection model to obtain a training fruit spectral corruption degree grade label; The training fruit spectrum corruption level label is compared with the target fruit image corruption level label until the training fruit spectrum corruption level label meets the second preset condition, thereby obtaining a trained fruit corruption level detection model.
7. The method for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectral according to claim 6, characterized in that: The pre-trained fruit corruption degree detection model is determined by the second training set and the convolutional neural network, and the step further includes: Comparing the evaluation indicators of the reconstructed spectral target domain model and the fruit corruption degree detection model to verify the feasibility of the model; wherein the evaluation indicators of the reconstructed spectral target domain model include any one or more of mean absolute error, mean square error, peak signal-to-noise ratio, and structural similarity; the evaluation indicators of the fruit corruption degree detection model include any one or more of accuracy, sensitivity, and specificity; If the model effect meets the requirements, the reconstructed spectral target domain model and the fruit corruption degree detection model are encapsulated; If the model effect does not meet the requirements, expand the sample set and repeat the training steps until the requirements are met.
8. The method for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectral according to claim 6, characterized in that: The target fruit image corruption level labels include a healthy period label, a contact period label, an invasion period label, a latent period label and a corruption period label.
9. The method for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectral according to claim 1, characterized in that: The pre-trained reconstructed spectral target domain model and the pre-trained fruit corruption degree detection model are both constructed based on the mapping relationship between the RGB image and the hyperspectral image; the mapping relationship between the RGB image and the hyperspectral image satisfies: Among them, I C represents the three channels of the RGB image (c = R, G, B); x represents the horizontal coordinate of the detection point in the RGB image; y represents the vertical coordinate of the detection point in the RGB image; λ n represents the sampling frequency band; n represents the number of bands, and the corresponding wavelength range is 400-1000 nanometers; H(λ n ) represents the hyperspectral image; E C (λ n ) represents the spectral response function.
10. The method for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectral according to claim 1, characterized in that: The method for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectrum is applied to a device for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectrum. The device for detecting the degree of fruit corruption based on RGB image reconstruction hyperspectrum comprises: A dark box, the inner wall of which is coated with a black matte coating; A material table is escalably arranged at the bottom of the dark box and is used to place the fruits to be tested; A light source, disposed in the dark box, for emitting light toward the material platform; A camera is disposed in the dark box and above the material table, and is used to collect an RGB image of the fruit to be tested; and A control module is arranged in the dark box and is electrically connected to the camera and the light source; the control module is used to receive data collected by the camera and execute a method for detecting the degree of fruit corruption based on RGB image reconstruction of a hyperspectral spectrum; Wherein, the step of collecting the original RGB image of the fruit to be tested specifically includes: Turn on the light source and preheat for 5-10 minutes; The position of the camera is adjusted to be just above the material table, and the camera is calibrated based on a white reference image and a black reference image; the white reference image is acquired by placing a white Teflon plate on the material table as a white standard sample through the camera; the black reference image is acquired by completely covering the lens of the camera; The angle of the light source is adjusted so that the light is irradiated at 45° to the surface of the fruit to be tested; and the original RGB image of the fruit to be tested is collected by the camera.
Citation Information
Cited By
Blueberry decay prediction model construction method and blueberry decay prediction method
CN121937994A