Method, system and storage medium for detecting apple core rot

By correcting the original spectrum of apple core rot detection across the entire spectrum and using a dual-output classification model for detection and prediction, the problem of low detection accuracy in existing technologies is solved, achieving efficient detection of apple core rot and prediction of soluble solids content.

CN121453699BActive Publication Date: 2026-04-10EAST CHINA JIAOTONG UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-05
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing methods for detecting apple core rot have low accuracy, especially as fruit size increases and the light absorption effect becomes more pronounced, leading to inaccurate test results.

Method used

By performing full-band correction on the original spectrum of the apple to be tested, and inputting the corrected spectrum into a pre-trained dual-output classification model, the detection of moldy core and prediction of soluble solids content are performed. The dual-output classification model is used for feature extraction and classification, and the influence of light absorption effect is reduced by combining the full-band correction formula.

Benefits of technology

It improved the accuracy of apple core rot detection and simultaneously predicted the soluble solids content, achieving efficient detection and prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121453699B_ABST
    Figure CN121453699B_ABST
Patent Text Reader

Abstract

The application provides a method and system for detecting apple mildew heart disease and a storage medium, the method comprising: collecting a spectrum of an apple to be detected to obtain an original spectrum, and correcting the original spectrum in a full wave band to obtain a corrected spectrum; inputting the corrected spectrum into a pre-trained double-output classification model to respectively detect the apple mildew heart disease and predict the soluble solid content, to obtain a detection result of the apple mildew heart disease and a prediction result of the soluble solid content; and determining a detection value of the soluble solid content according to the detection result of the apple mildew heart disease and the prediction result of the soluble solid content. According to the embodiment of the application, the original spectrum is corrected in a full wave band, the influence of light absorption effect on the original spectrum is effectively reduced, the accuracy of the original spectrum is improved, and the accuracy of the apple mildew heart disease detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of non-destructive testing technology for agricultural products, and in particular to a method, system, and storage medium for detecting apple core rot. Background Technology

[0002] Core rot is one of the major fruit diseases of apples, caused by a combination of pathogens. The disease is characterized by pathogens causing rot from the center of the fruit outwards, gradually rotting the flesh. In the early stages, the apple's exterior remains intact, showing no symptoms. To ensure apple quality, the detection of core rot is receiving increasing attention.

[0003] Current methods for detecting apple core rot generally rely on direct analysis of the near-infrared spectral characteristics of apples. However, when near-infrared light propagates within the apple, it undergoes scattering and absorption. Furthermore, the light absorption effect becomes more pronounced as the fruit size increases, resulting in low accuracy for apple core rot detection based on direct near-infrared spectral analysis. Summary of the Invention

[0004] The purpose of this invention is to provide a method, system, and storage medium for detecting apple core rot, in order to solve the problem of low accuracy in the detection of apple core rot in the prior art.

[0005] The present invention is implemented as follows: a method for detecting apple core rot, the method comprising:

[0006] The spectrum of the apple to be tested is acquired to obtain the original spectrum, and the original spectrum is corrected in all bands to obtain the corrected spectrum;

[0007] The modified spectrum was input into the pre-trained dual-output classification model to detect moldy core disease and predict soluble solids content, respectively, to obtain the detection results and content prediction results of moldy core disease.

[0008] The soluble solids content is determined based on the results of the moldy core detection and the content prediction results.

[0009] The formulas used to perform full-band correction on the original spectrum include:

[0010]

[0011] in, This indicates the apple to be detected. i The corrected spectrum, Represents the unit step function. This represents the first proportionality coefficient. This represents the second proportionality coefficient. represents the original spectrum, represents the waveband range, represents the exponential attenuation coefficient when the waveband range is greater than 710 nm, represents the exponential attenuation coefficient when the waveband range is less than 710 nm, represents the difference between the reference fruit diameter and the fruit diameter of the apple to be detected, represents the extinction coefficient of the apple to be detected at the waveband after 710 nm, represents the extinction coefficient of the apple to be detected at the waveband before 710 nm, represents the fruit diameter of the apple to be detected.

[0012] Preferably, the formula used for full-waveband correction of the original spectrum also includes:

[0013]

[0014] wherein, represents the input value of the unit step function;

[0015]

[0016]

[0017] wherein, represents the size of the extinction coefficient value at 710 nm, represents the size of the extinction coefficient value at 710 nm.

[0018] Preferably, before inputting the corrected spectrum into the pre-trained double-output classification model for mold core disease detection and soluble solid content prediction respectively, the method further includes:

[0019] Collecting the spectrum of the apple sample to obtain a spectrum sample, and correcting the spectrum sample in full waveband to obtain a corrected sample;

[0020] Inputting the corrected sample into the double-output classification model for spectrum feature extraction and soluble solid feature extraction respectively to obtain a spectrum feature sample and a soluble solid feature sample, and classifying the spectrum feature sample to obtain a sample classification result;

[0021] Predicting the content of the soluble solid feature sample to obtain a sample content prediction value, and determining the soluble solid content prediction value according to the sample classification result and the sample content prediction value;

[0022] Determine a model loss according to the sample classification result, the sample content prediction value and the soluble solid content prediction value, and perform parameter updating on the double-output classification model according to the model loss until the double-output classification model converges, to obtain the pre-trained double-output classification model.

[0023] Preferably, the model loss is determined according to the sample classification result, the sample content prediction value and the soluble solid content prediction value, and includes:

[0024] Obtain a standard classification result, a standard content prediction value and a standard soluble solid content prediction value, and calculate a first loss according to the sample classification result and the standard classification result;

[0025] Calculate a second loss according to the sample content prediction value and the standard content prediction value, and calculate a third loss according to the soluble solid content prediction value and the standard soluble solid content prediction value;

[0026] The first loss, the second loss and the third loss are weighted to obtain the model loss.

[0027] Preferably, the original spectrum is obtained by performing spectrum collection on the apple to be detected, and includes:

[0028] The spectrum collection on the apple to be detected is performed by using a near-infrared spectrum collection device, a light source of the near-infrared spectrum collection device includes two rows of halogen lamps, parameters of the halogen lamps are 12V and 100W, the halogen lamps are preheated for 30 minutes before spectrum collection, a detection speed of the near-infrared spectrum collection device is set to 0.5 m / s, and an exposure time is 100 ms.

[0029] Another purpose of the embodiment of the present application is to provide an apple mildew heart disease detection system, the system includes:

[0030] A full-waveband correction module is configured to perform spectrum collection on the apple to be detected to obtain an original spectrum, and perform full-waveband correction on the original spectrum to obtain a corrected spectrum;

[0031] A mildew heart disease detection module is configured to input the corrected spectrum into the pre-trained double-output classification model to perform mildew heart disease detection and soluble solid content prediction respectively, to obtain a mildew heart disease detection result and a content prediction result;

[0032] A content prediction module is configured to determine a soluble solid content detection value according to the mildew heart disease detection result and the content prediction result.

[0033] The formula used for the full-waveband correction on the original spectrum includes:

[0034]

[0035] wherein, represents the corrected spectrum of the apple to be detected, i represents the original spectrum of the apple to be detected, represents a unit step function, represents a first proportional coefficient, represents a second proportional coefficient, represents the original spectrum of the apple to be detected, represents a waveband range, represents an exponential decay coefficient when the waveband range is greater than 710 nm, represents an exponential decay coefficient when the waveband range is less than 710 nm, represents a difference between a reference fruit diameter and a fruit diameter of the apple to be detected, represents an extinction coefficient of the apple to be detected at a waveband after 710 nm, represents an extinction coefficient of the apple to be detected at a waveband before 710 nm, represents a fruit diameter of the apple to be detected.

[0036] Preferably, the mold heart disease detection module is further configured to:

[0037] perform spectrum acquisition on the apple sample to obtain a spectrum sample, and perform full-waveband correction on the spectrum sample to obtain a corrected sample;

[0038] input the corrected sample into the dual-output classification model to respectively perform spectrum feature extraction and soluble solid feature extraction, to obtain a spectrum feature sample and a soluble solid feature sample, and perform classification on the spectrum feature sample to obtain a sample classification result;

[0039] perform content prediction on the soluble solid feature sample to obtain a sample content prediction value, and determine a soluble solid content prediction value according to the sample classification result and the sample content prediction value;

[0040] determine a model loss according to the sample classification result, the sample content prediction value, and the soluble solid content prediction value, and perform parameter updating on the dual-output classification model according to the model loss until the dual-output classification model converges, to obtain the pre-trained dual-output classification model.

[0041] Preferably, the mold heart disease detection module is further configured to:

[0042] obtain a standard classification result, a standard content prediction value, and a standard soluble solid content prediction value, and calculate a first loss according to the sample classification result and the standard classification result;

[0043] A second loss is calculated according to the sample content prediction value and the standard content prediction value, and a third loss is calculated according to the soluble solid content prediction value and the standard soluble solid content prediction value;

[0044] The first loss, the second loss and the third loss are weighted to obtain the model loss.

[0045] The embodiment of the present application effectively reduces the influence of light absorption effect on the original spectrum by full-waveband correction of the original spectrum, improves the accuracy of the original spectrum, and further improves the accuracy of apple mildew heart disease detection. By inputting the corrected spectrum into the pre-trained double-output classification model for mildew heart disease detection and soluble solid content prediction, it can effectively identify whether the apple to be detected has mildew, and can simultaneously predict the soluble solid content of the apple to be detected. BRIEF DESCRIPTION OF DRAWINGS

[0046] Figure 1 is a flowchart of the apple mildew heart disease detection method provided by the first embodiment of the present application;

[0047] Figure 2 is a schematic diagram of the relationship curve between the feature waveband light intensity and the fruit diameter provided by the first embodiment of the present application;

[0048] Figure 3 is a structural schematic diagram of the double-output classification model provided by the first embodiment of the present application;

[0049] Figure 4 is a structural schematic diagram of the apple mildew heart disease detection system provided by the second embodiment of the present application;

[0050] Figure 5 is a specific implementation schematic diagram of the apple mildew heart disease detection system provided by the second embodiment of the present application;

[0051] Figure 6 is a structural schematic diagram of the terminal device provided by the third embodiment of the present application. DETAILED DESCRIPTION

[0052] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.

[0053] In order to illustrate the technical solutions of the present application, the following specific embodiments are used to illustrate the technical solutions of the present application.

[0054] Embodiment one

[0055] Please refer to Figure 1, is a flow chart of the apple core rot detection method provided by the first embodiment of the present application. The apple core rot detection method can be applied to any device or system. The apple core rot detection method comprises the following steps:

[0056] In step S10, the spectrum of the apple to be detected is collected to obtain an original spectrum, and the original spectrum is corrected in the full wave band to obtain a corrected spectrum.

[0057] In the step of collecting the spectrum of the apple to be detected to obtain an original spectrum, a near-infrared spectrum collection device is used to collect the spectrum of the apple to be detected. The near-infrared spectrum collection device is a dynamic online diffuse transmission detection device. The light source is two rows of halogen lamps, one row of which has 5 halogen lamps, and the total number of halogen lamps is 10. The parameters of the halogen lamps are 12 V and 100 W, respectively. The halogen lamps provide a light source for collecting spectral information in the diffuse transmission mode. The halogen lamps are preheated for 30 minutes before spectrum collection. The detection speed is set to 0.5 m / s, and the exposure time is 100 ms. In this step, the original spectrum is corrected in the full wave band, which effectively reduces the influence of light absorption effect on the original spectrum and improves the accuracy of apple core rot detection.

[0058] In this embodiment, the extinction rate of light entering the apple interior at a given wavelength is approximately an exponential decay function, which can be expressed as:

[0059]

[0060] is the average extinction coefficient of the full wave band, d is the diameter of the apple, represents the intensity of the transmitted light, is the intensity of the transmitted light.

[0061] For example, the spectral intensities at two depths and in the apple interior are and , respectively. and The corresponding exponential decay functions are subtracted after taking the natural logarithm:

[0062]

[0063]

[0064] The reference, the spectrum of each sample and the diameter are brought into the above formula and the average extinction coefficient is obtained by inverse transformation, and the formula is:

[0065]

[0066] The original spectrum of the apple, The reference fruit diameter, i The original spectrum of the apple, The reference fruit diameter, The fruit diameter of the apple, i n is the total number of samples;

[0067] Optionally, the formula for full-band correction of the original spectrum includes:

[0068]

[0069] wherein, represents the modified spectrum of the apple to be detected, i represents the unit step function, represents the first proportional coefficient, represents the second proportional coefficient, represents the original spectrum, represents the waveband range, represents the exponential decay coefficient when the waveband range is greater than 710 nm, represents the exponential decay coefficient when the waveband range is less than 710 nm, represents the difference between the reference fruit diameter and the fruit diameter of the apple to be detected, represents the extinction coefficient of the apple to be detected in the waveband after 710 nm, represents the extinction coefficient of the apple to be detected in the waveband before 710 nm, represents the fruit diameter of the apple to be detected. Specifically, in the waveband after 710 nm (including 710 nm), the spectral intensity decreases monotonously with the diameter, which is very close to the extinction coefficient method based on the exponential function. According to the propagation characteristics of light in the medium, this change can be described by an exponential decay function, which is:

[0070]

[0071] In the waveband before 710 nm (not including 710 nm), the spectral intensity changes with the diameter in a non-linear growth and decay trend, which shows a symmetrical exponential relationship, and the diameter turning point of this trend is about 80 mm, which is close to

[0072] . In order to accurately describe this trend, a piecewise function needs to be used: When the diameter is less than 80 mm, the light intensity increases exponentially with the diameter, and the formula is:

[0073]

[0074]

[0075] When = 0, the spectrum is not corrected, and the corrected light intensity is equal to the measured light intensity Therefore, when = 0, = 1, Substituting the above into the equation, a equals 1 and b equals 2. Finally, the formula for the diameter less than 80 mm is:

[0076]

[0077] Since any spectrum is continuous, the corrected light intensity of the apple with a diameter less than 80 mm at 710 nm before and after the 710 nm band must be equal at 710 nm. Based on the correction size after 710 nm (including 710 nm), a proportional coefficient is introduced to the correction function before 710 nm (not including 710 nm) to satisfy:

[0078]

[0079] wherein represents the size of the extinction coefficient value at 710 nm, represents the size of the extinction coefficient value at 710 nm, represents the extinction coefficient of the apple to be detected after the 710 nm band.

[0080] Solving the equation, we get:

[0081]

[0082] When the diameter is greater than 80 mm, because the light intensity before the wavelength 710 nm (not including 710 nm) and the diameter are a kind of symmetrical exponential relationship, the function of the diameter greater than 80 mm is symmetrical about 80 mm with the function of the diameter less than 80 mm. In view of this, the formula for the diameter greater than 80 mm is:

[0083]

[0084] Similarly, the proportional coefficient for the diameter greater than 80 mm is , and the formula is:

[0085]

[0086] Substituting the average extinction coefficient into the mapping relationship, further, in order to realize the unified expression of different wave bands and diameter intervals, the unit step function is introduced, which is defined as:

[0087] ​​

[0088] wherein, denotes an input value of the unit step function.

[0089] Step S20, input the corrected spectrum into the pre-trained double-output classification model for mold core disease detection and soluble solids content prediction respectively, to obtain mold core disease detection results and content prediction results;

[0090] Among them, a single-input double-output classification model (CNN double-response model) is designed, aiming to realize the discrimination of apple samples with mold core disease (classification task) and the prediction of soluble solids content (regression task). Considering that only the discrimination of whether the apple has mold core disease is required in actual application, the classification task is set as two types of labels of healthy and moldy. The double-output classification model adopts a double-branch architecture to process classification and regression tasks respectively. In the classification branch, the model extracts classification features of spectral data through a cascade structure of a series of one-dimensional convolution layers (Conv1D) and maximum pooling layers (MaxPooling). The feature dimension reduction process is realized through the Flatten layer, and then the data is transmitted to the fully connected layer (Dense) to further mine high-level feature representation. The classification output layer uses the "sigmoid" activation function to generate classification probability values, and determines the sample category (healthy or mold core disease) through the "argmax(0.5)" threshold. The regression branch adopts deeper convolution and pooling structures on the basis of shared feature extraction layers, focusing on the extraction of features related to mold core disease and soluble solids content (Soluble Solids Concentration, SSC) prediction, and the output layer uses the "linear" activation function to generate continuous SSC prediction values. To prevent overfitting and enhance the generalization ability of the model, a dropout layer Dropout is introduced between the fully connected layers, with a neuron dropout probability of 0.25. Except for the output layer, all hidden layers use the "ReLU" activation function to enhance the non-linear expression ability of the model. The corrected spectrum is input into the CNN double-response model to simultaneously process the discrimination and prediction tasks.

[0091] In order to only predict the SSC of healthy apples, a specific label encoding scheme is innovatively adopted in the data processing strategy: the classification label of healthy apples is set to 1, and the SSC value is the actual measured value; the classification label of mold core disease apples is set to 0, and the SSC value is uniformly set to 0. Therefore, the binary classification result (0 or 1) after "argmax(0.5)" processing is output by the classification branch, and the output of the regression branch is the product of the classification result and the predicted SSC value. This mechanism realizes conditional output: when the apple is judged to be healthy, the regression branch outputs the SSC prediction value; if the apple is judged to be mold core disease, the regression branch outputs 0.

[0092] Optionally, before inputting the corrected spectrum into the pre-trained double-output classification model for mold core disease detection and soluble solids content prediction respectively, further comprising:

[0093] Collecting a spectrum of an apple sample to obtain a spectrum sample, and correcting the spectrum sample in a full waveband to obtain a corrected sample;

[0094] Inputting the corrected sample into the double-output classification model to extract spectral features and soluble solids features respectively to obtain spectral feature samples and soluble solids feature samples, and classifying the spectral feature samples to obtain sample classification results;

[0095] Predicting the content of the soluble solids feature samples to obtain sample content prediction values, and determining soluble solids content prediction values according to the sample classification results and the sample content prediction values;

[0096] Determining a model loss according to the sample classification results, the sample content prediction values and the soluble solids content prediction values, and updating parameters of the double-output classification model according to the model loss until the double-output classification model converges to obtain the pre-trained double-output classification model.

[0097] Further, determining a model loss according to the sample classification results, the sample content prediction values and the soluble solids content prediction values comprises:

[0098] Obtaining standard classification results, standard content prediction values and standard soluble solids content prediction values, and calculating a first loss according to the sample classification results and the standard classification results; wherein the first loss is calculated based on a result similarity between the sample classification results and the standard classification results by calculating the result similarity;

[0099] Calculating a second loss according to the sample content prediction values and the standard content prediction values, and calculating a third loss according to the soluble solids content prediction values and the standard soluble solids content prediction values; wherein the second loss is calculated based on a content similarity between the sample content prediction values and the standard content prediction values by calculating the content similarity, and the third loss is calculated based on a prediction similarity between the soluble solids content prediction values and the standard soluble solids content prediction values by calculating the prediction similarity;

[0100] Weighting the first loss, the second loss and the third loss to obtain the model loss; wherein the weighting coefficients of the losses can be set according to requirements in the weighting process.

[0101] Step S30, determining the soluble solids content detection value according to the mold heart disease detection result and the content prediction result;

[0102] In the method, whether the apple to be detected is moldy is determined based on the mold heart disease detection result, and a classification result in the mold heart disease detection result is multiplied by a content value in the content prediction result to obtain a soluble solids content detection value of the apple to be detected.

[0103] Specifically, in the embodiment, 300 apples of 600 apples are artificially infected by injecting pathogenic bacteria, and are stored at room temperature for 7 days. The number of healthy apples and moldy apples is 300 respectively, and the sample apples are numbered respectively.

[0104] The near-infrared spectrum acquisition device is used to collect the spectrum of the sample apples, five characteristic wave bands (650 nm, 673 nm, 710 nm, 755 nm and 810 nm) of all samples are selected, and an intermediate wave band of 692 nm is added, a relationship diagram with the diameter of the apple as the horizontal axis and the spectral intensity as the vertical axis is drawn, and a fitting analysis is carried out based on the extinction coefficient method to obtain a mapping relationship diagram of the spectral interval-size compensation parameter.

[0105] The collected spectrum is corrected, and the corrected spectrum is input into the CNN double-response model to process the discrimination and prediction tasks at the same time, and the model structure is as shown in Figure 3 The processing mechanism of the model is that the classification branch outputs a binary classification result (0 or 1), and the regression branch outputs the product of the classification result and the predicted SSC value. This mechanism realizes conditional output: when the sample is judged to be healthy, the regression branch outputs the SSC prediction value; if the sample is judged to be mold heart disease, the regression branch outputs 0. The evaluation indexes of mold heart disease discrimination are accuracy, recall rate, precision and F1 score. The calculation of the recall rate and the precision rate is based on the mold as the positive class reference. The evaluation indexes of SSC prediction are the determination coefficient (R²), the root mean square error (RMSE) and the residual prediction deviation (RPD).

[0106] The average spectrum of the corrected different fruit diameters is significantly reduced in the longitudinal light intensity difference compared with that before correction, and is effectively corrected in the full wave band range. The double-response discrimination and prediction results are as follows: Table 1 is the performance of the model in the two aspects of mold heart disease discrimination and healthy sample SSC prediction. In the mold heart disease discrimination task, the discrimination accuracy, recall rate, precision and F1 score of the model for the mold heart disease sample reach 0.98, 0.97, 1.00 and 0.98 respectively in the validation data. In the SSC prediction, the predicted R² reaches 0.96, the RMSE is only 0.97, and the RPD is 1.84. Further, it is shown that the model has good mold sample detection ability and SSC prediction ability, which is crucial to reduce the harm of missed detection.

[0107] Table 1:

[0108]

[0109] In the embodiment, by full-waveband correction on the original spectrum, the influence of light absorption effect on the original spectrum is effectively reduced, the accuracy of the original spectrum is improved, and the accuracy of the apple mildew heart disease detection is improved. By inputting the corrected spectrum into the pre-trained double-output classification model for mildew heart disease detection and soluble solid content prediction, it can effectively identify whether the apple to be detected is mildewed, and can simultaneously predict the soluble solid content of the apple to be detected. The embodiment only needs to collect the sample spectrum, and can complete the full-waveband correction of the spectrum, and realize the simultaneous detection of apple mildew heart disease and healthy apple SSC. The effect can meet the requirements of online detection.

[0110] Embodiment Two

[0111] Please refer to Figure 4 is a structural schematic diagram of an apple mildew heart disease detection system 100 provided by the second embodiment of the present application, comprising:

[0112] The full-waveband correction module 10 is configured to collect the spectrum of the apple to be detected to obtain an original spectrum, and correct the full waveband of the original spectrum to obtain a corrected spectrum.

[0113] Optionally, the full-waveband correction module 10 is further configured to use a near-infrared spectrum acquisition device to collect the spectrum of the apple to be detected, wherein the light source of the near-infrared spectrum acquisition device includes two rows of halogen lamps, the parameters of the halogen lamps are 12V and 100W, the near-infrared spectrum acquisition device is preheated for 30 minutes before spectrum acquisition, and the detection speed of the near-infrared spectrum acquisition device is set to 0.5 m / s and the exposure time is 100 ms.

[0114] The mildew heart disease detection module 11 is configured to input the corrected spectrum into a pre-trained double-output classification model for mildew heart disease detection and soluble solid content prediction, to obtain a mildew heart disease detection result and a content prediction result.

[0115] Optionally, the mildew heart disease detection module 11 is further configured to collect the spectrum of the apple sample to obtain a spectrum sample, and correct the full waveband of the spectrum sample to obtain a corrected sample.

[0116] The corrected sample is input into the double-output classification model for spectrum feature extraction and soluble solid feature extraction to obtain a spectrum feature sample and a soluble solid feature sample, and the spectrum feature sample is classified to obtain a sample classification result.

[0117] The soluble solid content characteristic sample is subjected to content prediction to obtain a sample content prediction value, and a soluble solid content prediction value is determined according to the sample classification result and the sample content prediction value;

[0118] A model loss is determined according to the sample classification result, the sample content prediction value and the soluble solid content prediction value, and the dual-output classification model is subjected to parameter updating according to the model loss until the dual-output classification model converges, so as to obtain the pre-trained dual-output classification model.

[0119] Further, the mold heart disease detection module 11 is further used for: obtaining a standard classification result, a standard content prediction value and a standard soluble solid content prediction value, and calculating a first loss according to the sample classification result and the standard classification result;

[0120] A second loss is calculated according to the sample content prediction value and the standard content prediction value, and a third loss is calculated according to the soluble solid content prediction value and the standard soluble solid content prediction value;

[0121] The first loss, the second loss and the third loss are subjected to weighted processing to obtain the model loss.

[0122] The content prediction module 12 is used for determining a soluble solid content detection value according to the mold heart disease detection result and the content prediction result.

[0123] Please refer to Figure 5 Different diameter sizes of apples are placed into a near-infrared spectrum acquisition device to obtain original spectra, the original spectra are subjected to full-waveband correction through a segmented extinction correction method, the corrected spectra are input into a CNN dual-response model, and a discrimination and prediction task is simultaneously processed to obtain a mold heart disease detection result and a content prediction result, it is determined whether moldiness occurs based on the mold heart disease detection result, SSC prediction values of all sample apples are determined based on the content prediction result, the SSC prediction values are multiplied by the mold heart disease detection result to obtain healthy apple SSC prediction values.

[0124] In this embodiment, the original spectra are subjected to full-waveband correction, the influence of light absorption effect on the original spectra is effectively reduced, the accuracy of the original spectra is improved, and the accuracy of apple mold heart disease detection is improved. The corrected spectra are input into the pre-trained dual-output classification model to perform mold heart disease detection and soluble solid content prediction, respectively, so as to effectively identify whether moldiness occurs in the to-be-detected apple, and to simultaneously predict the soluble solid content of the to-be-detected apple.

[0125] Embodiment three

[0126] Figure 6is a structural block diagram of a terminal device 2 provided by a third embodiment of the present application. As shown in Figure 6 The terminal device 2 of this embodiment includes a processor 20, a memory 21, and a computer program 22 stored in the memory 21 and executable on the processor 20, such as a program of the apple heart rot detection method. The processor 20 implements the steps in each of the embodiments of the apple heart rot detection method when executing the computer program 22.

[0127] For example, the computer program 22 can be divided into one or more modules, which are stored in the memory 21 and executed by the processor 20 to complete the present application. The one or more modules can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program 22 in the terminal device 2. The terminal device can include, but is not limited to, the processor 20 and the memory 21.

[0128] The processor 20 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0129] The memory 21 can be an internal storage unit of the terminal device 2, such as a hard disk or a memory of the terminal device 2. The memory 21 can also be an external storage device of the terminal device 2, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory 21 can include both the internal storage unit and the external storage device of the terminal device 2. The memory 21 is used to store the computer program and other programs and data required by the terminal device. The memory 21 can also be used to temporarily store data that has been output or will be output.

[0130] In addition, each functional module in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0131] If the integrated module is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. The computer readable storage medium can be non-volatile or volatile. Based on this understanding, all or part of the processes in the above-mentioned embodiment methods can also be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. When the processor executes the computer program, the steps of each method embodiment described above can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable files or some intermediate forms, etc. The computer readable storage medium can include any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc.

[0132] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. A method for detecting apple brown fruit rot, characterized by, The method comprises: Collecting the spectrum of the apple to be detected to obtain an original spectrum, and performing full-band correction on the original spectrum to obtain a corrected spectrum; Inputting the corrected spectrum into a pre-trained double-output classification model to perform mold core disease detection and soluble solid content prediction respectively, to obtain mold core disease detection results and content prediction results; Determining the soluble solid content detection value according to the mold core disease detection results and the content prediction results; The formula used for full-band correction of the original spectrum comprises: wherein, represents the modified spectrum of the apple to be detected, i represents a unit step function, represents a first proportional coefficient, represents a second proportional coefficient, represents the original spectrum, represents a waveband range, represents an exponential decay coefficient when the waveband range is greater than 710 nm, represents an exponential decay coefficient when the waveband range is less than 710 nm, represents a difference between a reference fruit diameter and a fruit diameter of the apple to be detected, represents an extinction coefficient of the apple to be detected at a waveband after the 710 nm waveband, represents an extinction coefficient of the apple to be detected at a waveband before the 710 nm waveband, represents a fruit diameter of the apple to be detected;​ The formula used for full-band correction of the original spectrum further comprises: wherein denotes the input value of the unit step function; wherein represents the magnitude of the extinction coefficient value at 710 nm, represents the magnitude of the extinction coefficient value at 710 nm.

2. The method for detecting apple malus disease according to claim 1, wherein, Before inputting the corrected spectrum into the pre-trained double-output classification model to perform mold core disease detection and soluble solid content prediction respectively, the method further comprises: Collecting the spectrum of the apple sample to obtain a spectrum sample, and performing full-band correction on the spectrum sample to obtain a corrected sample; Inputting the corrected sample into the double-output classification model to perform spectrum feature extraction and soluble solid feature extraction respectively, to obtain a spectrum feature sample and a soluble solid feature sample, and classifying the spectrum feature sample to obtain a sample classification result; Performing content prediction on the soluble solid feature sample to obtain a sample content prediction value, and determining the soluble solid content prediction value according to the sample classification result and the sample content prediction value; Determining the model loss according to the sample classification result, the sample content prediction value and the soluble solid content prediction value, and updating the parameters of the double-output classification model according to the model loss until the double-output classification model converges, to obtain the pre-trained double-output classification model.

3. The method of detecting apple malus disease according to claim 2, wherein, Determining the model loss according to the sample classification result, the sample content prediction value and the soluble solid content prediction value comprises: Obtaining a standard classification result, a standard content prediction value and a standard soluble solid content prediction value, and calculating a first loss according to the sample classification result and the standard classification result; Calculating a second loss according to the sample content prediction value and the standard content prediction value, and calculating a third loss according to the soluble solid content prediction value and the standard soluble solid content prediction value; Performing weighted processing on the first loss, the second loss and the third loss to obtain the model loss.

4. The method of detecting apple malus disease according to claim 1, wherein, Collecting the spectrum of the apple to be detected to obtain an original spectrum comprises: Using a near-infrared spectrum acquisition device to collect the spectrum of the apple to be detected, wherein the light source of the near-infrared spectrum acquisition device comprises two rows of halogen lamps, the parameters of the halogen lamps are 12V and 100W, the halogen lamps are preheated for 30 minutes before spectrum acquisition, the detection speed of the near-infrared spectrum acquisition device is set to 0.5 m / s, and the exposure time is 100 ms.

5. A system for detecting apple brown fruit rot, characterized by The system comprises: A full-band correction module configured to collect the spectrum of the apple to be detected to obtain an original spectrum, and perform full-band correction on the original spectrum to obtain a corrected spectrum; The moldy heart disease detection module is configured to input the corrected spectrum into a pre-trained double-output classification model to perform moldy heart disease detection and soluble solid content prediction, respectively, to obtain moldy heart disease detection results and content prediction results. The content prediction module is configured to determine a soluble solid content detection value according to the moldy heart disease detection results and the content prediction results. The formula used for full-waveband correction of the original spectrum includes: wherein, denotes the modified spectrum of the apple to be detected, i denotes a unit step function, denotes a first proportional coefficient, denotes a second proportional coefficient, denotes the original spectrum of the apple to be detected, denotes a waveband range, denotes an exponential decay coefficient when the waveband range is greater than 710 nm, denotes an exponential decay coefficient when the waveband range is less than 710 nm, denotes a difference between a reference fruit diameter and a fruit diameter of the apple to be detected, denotes an extinction coefficient of the apple to be detected at a waveband after 710 nm, denotes an extinction coefficient of the apple to be detected at a waveband before 710 nm, denotes a fruit diameter of the apple to be detected,​ The formula used for full-waveband correction of the original spectrum also includes: wherein denotes the input value of the unit step function; wherein represents the magnitude of the extinction coefficient value at 710 nm, represents the magnitude of the extinction coefficient value at 710 nm.

6. The apple malus disease detection system of claim 5, wherein, The moldy heart disease detection module is further configured to: Collect the spectrum of the apple sample to obtain a spectrum sample, and perform full-waveband correction on the spectrum sample to obtain a corrected sample; Input the corrected sample into the double-output classification model to perform spectrum feature extraction and soluble solid feature extraction, respectively, to obtain a spectrum feature sample and a soluble solid feature sample, and classify the spectrum feature sample to obtain a sample classification result; Perform content prediction on the soluble solid feature sample to obtain a sample content prediction value, and determine a soluble solid content prediction value according to the sample classification result and the sample content prediction value; Determine a model loss according to the sample classification result, the sample content prediction value, and the soluble solid content prediction value, and update the parameters of the double-output classification model according to the model loss until the double-output classification model converges to obtain the pre-trained double-output classification model.

7. The apple malus heart disease detection system of claim 6, wherein, The moldy heart disease detection module is further configured to: Obtain a standard classification result, a standard content prediction value, and a standard soluble solid content prediction value, and calculate a first loss according to the sample classification result and the standard classification result; Calculate a second loss according to the sample content prediction value and the standard content prediction value, and calculate a third loss according to the soluble solid content prediction value and the standard soluble solid content prediction value; Perform weighted processing on the first loss, the second loss, and the third loss to obtain the model loss.

8. A computer-readable storage medium storing a computer program, the computer-readable storage medium comprising: The computer program, when executed by a processor, implements the steps of the apple moldy heart disease detection method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Method for establishing apple moldy core detection model

    CN111521583A

  • On-line detection and sorting method and device for moldy core integrating internal and external quality of apples

    CN118169137A