An apple internal quality detection method based on spectral data and physicochemical indexes

CN122961918APending Publication Date: 2026-10-23REEMOON TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510515878.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-23
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0004]总体来说,现有技术会面临用于内部品质无损检测的光谱波段优化和光谱数据筛选等问题

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122961918A_ABST
    Figure CN122961918A_ABST
Patent Text Reader

Abstract

The application discloses an apple internal quality detection method based on spectral data and physical and chemical indexes, and establishes a target function of a weighted minimum of a square sum of spectral distance proportions of multiple hyperspectral bands and a square sum of physical and chemical property characteristic distance proportions of several internal quality types, so that the selected hyperspectral bands are more optimized and the screening of the data set is more reasonable, so that the screened data set is used to realize the grading detection on the apple internal quality in the hyperspectral preferred band.
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, and in particular to a method for internal quality testing of apples based on spectral data and physicochemical indicators. Background Technology

[0002] Quality testing of apples is an effective means to promote the healthy development of the apple planting industry, increase fruit prices, and boost production and efficiency. Non-destructive internal quality testing technology can obtain various internal quality indicators of apples while ensuring the integrity of the fruit, and it is easy to implement mechanized and automated testing. Hyperspectral imaging combines spectral detection technology with imaging technology, enabling the simultaneous acquisition of spectral characteristics and image information. It has advantages such as speed, non-destructive testing, high detection accuracy, and wide application range, thus enabling the detection of physicochemical indicators and damage / disease in fruits.

[0003] When collecting spectral data of apples during the sorting process, instrument instability and external interference can cause deviations between the collected physicochemical or spectral data and the true values, resulting in outlier samples and impacting model accuracy. To ensure the accuracy of quality inspection data, outliers must be removed before data analysis. To ensure that the physicochemical properties of the sample data in the training model are relatively dispersed and more distinct, the spectral-physicochemical co-occurrence distance method can be used for sample partitioning. When calculating sample distance, both the spectral data and the measured physicochemical indicators of the samples can be considered, making the filtered dataset more reasonable.

[0004] Overall, existing technologies face challenges such as spectral band optimization and spectral data screening for internal quality non-destructive testing. Summary of the Invention

[0005] To address the aforementioned problems in the prior art, this invention provides a method for detecting the internal quality of apples based on spectral data and physicochemical indicators. This method optimizes the selected hyperspectral bands and makes the selection of the dataset more reasonable by using the spectral distance ratio and physicochemical property characteristic distance ratio of the corresponding hyperspectral bands in the apple sample dataset. Thus, the selected dataset is used to perform graded detection of the internal quality of apples on the preferred hyperspectral bands.

[0006] This invention is achieved through the following measures: a method for detecting the internal quality of apples based on spectral data and physicochemical indicators, comprising the following steps:

[0007] S1: For a sample set of a certain grade of a certain apple variety, the spectral distance and physicochemical property distance between different samples can be obtained by detecting different types of internal quality in different hyperspectral bands. Then, for the sample sets of different grades of this apple variety, an objective function can be established to minimize the weighted sum of the squares of the ratios of spectral distances from multiple hyperspectral bands to several types of internal quality and the ratios of physicochemical property distances. The recommended weights of different hyperspectral bands and the recommended weights of different samples for a certain grade of the sample set can be obtained.

[0008] S2: Construct different levels of sample update sets and hyperspectral band optimization sets for internal quality testing of apple varieties based on the hyperspectral band iterative fluctuation threshold, hyperspectral band weight accumulation threshold, sample weight threshold, and the number of hyperspectral bands selected.

[0009] S3: Construct a membership function for the tested fruit that belongs to a certain grade of the apple variety and is related to a certain internal quality type in a certain preferred hyperspectral band;

[0010] S4: For the overall internal quality testing of the tested apple variety, the determination is made by whether the minimum probability of classifying the fruit into a certain grade when different internal quality types are tested is greater than or equal to the probability threshold of the fruit being a certain grade in terms of overall internal quality. The probability of classifying the fruit into a certain grade for a certain internal quality type can be determined by the weighted sum of the actual usage weight of the hyperspectral preferred band and the membership function of the tested fruit belonging to that grade and in the hyperspectral preferred band for that internal quality type.

[0011] As a further optimization of the apple internal quality testing method based on spectral data and physicochemical indicators provided by the present invention, the specific steps of step S1 are as follows:

[0012] Step S1.1: For a certain apple variety, let... The number of grades that can be divided into for this apple variety. The grade number that can be assigned to this apple variety and , The number of hyperspectral bands that can be used for internal quality testing of this apple variety. The hyperspectral band designation for internal quality testing of this apple variety and , The number of internal quality types that need to be tested for this apple variety. An internal quality number is used to test the fruit of this apple variety. , The grade for this apple variety to be used in internal quality testing is... The sample set was constructed using the fruits as samples. For sample set The number of samples in the sample; assuming that the spectral distance and physicochemical property characteristics between different samples can be detected in different hyperspectral bands for different types of internal quality, then a system can be constructed that makes all samples... Each level of sample set in Regarding the hyperspectral bands The objective function is to minimize the weighted sum of the squares of the spectral distance ratio and the physicochemical property characteristic distance ratio of the internal quality types. ,in The calculation method is as follows:

[0013]

[0014] in, To find the minimum value, This is the sample number for this apple variety. For the hyperspectral band The weighting coefficients, For the sample For fruit grade sample set The weighting coefficients, This apple variety is used to distinguish it from the one described above. Sample number, For level Time-high spectral band Regarding internal quality In the sample With sample spectral distance between them For level Time-high spectral band Regarding internal quality In the sample With sample The distance between the physicochemical properties of the two sides, in the and middle and , A function that takes the maximum value in a combination;

[0015] Step S1.2: Considering the above satisfy And the satisfy The steps described in step S1.1 This can be transformed into an equivalent function that minimizes the weighted sum of the squares of the spectral distance ratio and the physicochemical property characteristic distance ratio. ,in The calculation method is as follows:

[0016]

[0017] in, and All are Lagrange multipliers;

[0018] Step S1.3: For the steps described in step S1.2... To each and To find the first and second derivatives, we can obtain... To each and first derivative and and the second derivative and The calculation method is as follows:

[0019]

[0020]

[0021]

[0022]

[0023] When the above and Set to 0, and at the same time, the... and It is clearly greater than 0, therefore it can be determined that... and For the above and exist;

[0024] Step S1.4: From the aforementioned and The Lagrange multiplier can be determined. The calculation method is as follows:

[0025]

[0026] It can be seen that the above The specific calculation formula is as follows:

[0027]

[0028] Step S1.5: From the aforementioned and The Lagrange multiplier can be determined. The calculation method is as follows:

[0029]

[0030] It can be seen that the above The specific calculation formula is as follows:

[0031]

[0032] As a further optimization of the apple internal quality testing method based on spectral data and physicochemical indicators provided by the present invention, the specific steps of step S2 are as follows:

[0033] Step S2.1: Let For the number of iterations, Number of iterations Time-high spectral band The weighting coefficient values, Number of iterations seasonal fruit samples For fruit grade sample set The weighting coefficient values; setting the iterative fluctuation threshold for the hyperspectral band. Hyperspectral band weight accumulation threshold Sample weight threshold and the number of preferred hyperspectral bands ;set up as well as for ,in Constraint symbols; different inputs Corresponding sample set The spectral distance and physicochemical property distance between different samples will As Substitute the steps described in step S1.5 Obtaining the specific calculation formula ;

[0034] Step S2.2: Calculate the number of iterations. Add 1, by As Substitute the steps described in step S1.4 Obtaining the specific calculation formula Then from the above As Substitute the steps described in step S1.5 Obtaining the specific calculation formula ;

[0035] Step S2.3: For Each hyperspectral band, according to Select from largest to smallest This is to construct an optimal set of hyperspectral bands for internal quality testing of this apple variety. ,like Less than or equal to and Greater than or equal to If yes, proceed to step S2.4; otherwise, proceed to step S2.2.

[0036] Step S2.4: If the above There are samples in corresponding Below the Then the sample From the above Remove from the list until the entire list is traversed. All samples in, and the above The remaining portion is set to a grade for internal quality testing of this apple variety. Sample update set Output; set The labeling of the hyperspectral optimal band for internal quality testing of this apple variety and Preferred bands for hyperspectral imaging The actual usage weight can be known ,and The above Output;

[0037] As a further optimization of the apple internal quality testing method based on spectral data and physicochemical indicators provided by the present invention, the specific method of step S3 is as follows:

[0038] The steps described in step S2.4 medium sample For internal quality Preferred bands in hyperspectral Physicochemical characteristic values Construct a set of physicochemical properties Then it is possible to construct a system for the inspected fruit. Belongs to the level of And in the preferred hyperspectral band The above refers to the types of internal quality. membership function ,in For the inspected fruit For internal quality Preferred bands in hyperspectral The physicochemical characteristic values ​​of the surface are as follows:

[0039] 1) If corresponding to the above corresponding If the numerical range of a property is higher than or equal to the numerical range of other levels of physicochemical property characteristic sets, then the larger-scale first preset formula is used, and the calculation method is as follows:

[0040]

[0041] in, It is the independent variable and can be used in the operation. Substitute, For data point density threshold, To find data points in the dataset with a density greater than the specified value. Functions related to the region, A function to find the value of the lower boundary of a set. To find the exponent of the function, To find the function of the natural logarithm, Regarding the internal quality of fruit products The level is The probability threshold can be used to determine the following. The larger value satisfies the condition when the value is the lower boundary value. The time is described conditions;

[0042] 2) If corresponding to the above corresponding If the numerical range of a property is lower than or equal to the numerical range of other levels of physicochemical property characteristic sets, then the smaller second preset formula is used, and the calculation method is as follows:

[0043]

[0044] in, To find the function that determines the values ​​of the upper boundary of the set, it is known that... The smaller value satisfies the condition when the value is the upper boundary value. When is the conditions;

[0045] 3) If corresponding to the above corresponding If the numerical range of a given value lies between the numerical ranges of other levels of physicochemical property characteristic sets, then the intermediate third preset formula is adopted, and the calculation method is as follows:

[0046]

[0047] It can be seen that the above The intermediate type satisfies the condition when the value is the upper boundary value. or lower boundary value The time is described conditions.

[0048] As a further optimization of the apple internal quality testing method based on spectral data and physicochemical indicators provided by the present invention, the specific method of step S4 is as follows:

[0049] For the inspected fruit In other words, when the internal quality type is tested as When determining whether it can be classified into a level probability for If the above Greater than or equal to the description in step S3 Then it can be determined that the above The types of internal quality to be tested are: It can be classified into levels Considering that certain internal quality standards are the same or overlap at some levels, a single internal quality can be classified into multiple levels simultaneously; for testing all... When the internal quality type is specified, the The overall internal quality can be classified into grades. probability for ,in Let be the operator that takes the minimum value; The fruit is graded based on its overall internal quality. The probability threshold, if the Greater than or equal to Then it can be regarded as the above. In terms of overall internal quality, it can be classified as grade 1. . Attached Figure Description

[0050] Figure 1 The diagram shown is a flowchart of an internal quality testing method for apples based on spectral data and physicochemical indicators according to an embodiment of the present invention.

[0051] Figure 2 The figure shown is a graph illustrating the sample update elimination ratio and the standard deviation of SSC, TA, and VC at different levels in an embodiment of the present invention.

[0052] Figure 3 The diagram shows the preferred hyperspectral bands in an embodiment of the present invention. Corresponding weight A situation diagram;

[0053] Figure 4 The diagram shows the membership and probability of each hyperspectral band in which the tested fruit can be classified into grade 5 when its internal vitamin C quality is tested, according to an embodiment of the present invention. Situation diagram. Detailed Implementation

[0054] To make the objectives, technical solutions, and advantages of this invention clearer, the specific embodiments of this invention will be further described in detail below through examples and in conjunction with the accompanying drawings. It should be noted that this disclosure specifically involves the testing of internal quality parameters of the Fuji apple variety, such as soluble solids content (SSC), titratable acid content (TA), and vitamin C content (VC). It should be understood that the specific embodiments described herein are only for explaining the invention and are not intended to limit the invention.

[0055] like Figure 1 The diagram shown is a flowchart illustrating an apple internal quality testing method based on spectral data and physicochemical indicators in one embodiment, specifically including the following steps:

[0056] S1: For a sample set of a certain grade of a certain apple variety, the spectral distance and physicochemical property distance between different samples can be obtained by detecting different types of internal quality in different hyperspectral bands. Then, for the sample sets of different grades of this apple variety, an objective function can be established to minimize the weighted sum of the squares of the ratios of spectral distances from multiple hyperspectral bands to several types of internal quality and the ratios of physicochemical property distances. The recommended weights of different hyperspectral bands and the recommended weights of different samples for a certain grade of the sample set can be obtained.

[0057] Specifically, the steps of step S1 are as follows:

[0058] Step S1.1: For Fuji apples, the internal quality of Fuji apples can be graded into very low (1), low (2), medium (3), high (4), and very high (5). The number of grades that this apple variety can be divided into is as follows. It is 5. The grade number that can be assigned to this apple variety and By spacing the bands within the hyperspectral region of 400nm to 1000nm by 5nm, it can be determined how many hyperspectral bands can be used for internal quality testing of this apple variety. It is 120. The hyperspectral band designation for internal quality testing of this apple variety and The number of internal quality types that need to be tested for this apple variety. It is 3. An internal quality number is used to test the fruit of this apple variety. , The grade for this apple variety to be used in internal quality testing is... The sample set is constructed using the fruits as samples, and those that meet the standards for each grade can be randomly selected. A sample set of Red Fuji apples was used to build this grade. Each level relates to SSC, TA, and VC, etc. The specific details of the internal quality of the species are shown in Table 1.

[0059] Table 1. Overview of Apple's Internal Quality Evaluation (SSC, TA, VC, etc.)

[0060] Rank number SSC(%) TA(%) Vitamin C (mg / kg) evaluate 1 SSC<10.0 TA<0.10 VC<10.0 Extremely low 2 10.0≤SSC<12.0 0.10≤TA<0.30 10≤VC<30 Low 3 12.0≤SSC<14.0 0.30≤TA<0.50 30≤VC<60 middle 4 14.0≤SSC<18.0 0.50≤TA<0.70 60≤VC<100 high 5 SSC≥18.0 TA≥0.70 VC≥100 Extremely high

[0061] If, under different labels, the spectral distance and physicochemical property characteristic distance between different samples can be detected for different types of internal quality in hyperspectral bands, then a system can be constructed that allows all samples to be analyzed. Each level of sample set in Regarding the hyperspectral bands The objective function is to minimize the weighted sum of the squares of the spectral distance ratio and the physicochemical property characteristic distance ratio of each internal quality type. ,in The calculation method is as follows:

[0062]

[0063] in, To find the minimum value, This is the sample number for this apple variety. For the hyperspectral band The weighting coefficients, For the sample For fruit grade sample set The weighting coefficients, This apple variety is used to distinguish it from the one described above. Sample number, For level Time-high spectral band Regarding internal quality In the sample With sample spectral distance between them For level Time-high spectral band Regarding internal quality In the sample With sample The distance between the physicochemical characteristics of the two, in the and middle and , A function that takes the maximum value in a combination;

[0064] Step S1.2: Considering the above satisfy And the satisfy The steps described in step S1.1 This can be transformed into an equivalent function that minimizes the weighted sum of the squares of the spectral distance ratio and the physicochemical property characteristic distance ratio. ,in The calculation method is as follows:

[0065]

[0066] in, and All are Lagrange multipliers;

[0067] Step S1.3: As described in step S1.2 To each and To find the first and second derivatives, we can obtain... To each and first derivative and and the second derivative and The calculation method is as follows:

[0068]

[0069]

[0070]

[0071]

[0072] When the above and Set to 0, and at the same time, the... and It is clearly greater than 0, therefore it can be determined that... and For the above and exist;

[0073] Step S1.4: From the aforementioned and The Lagrange multiplier can be determined. The calculation method is as follows:

[0074]

[0075] It can be seen that the above The specific calculation formula is as follows:

[0076]

[0077] Step S1.5: From the aforementioned and The Lagrange multiplier can be determined. The calculation method is as follows:

[0078]

[0079] It can be seen that the above The specific calculation formula is as follows:

[0080]

[0081] S2: Construct different levels of sample update sets and hyperspectral band optimization sets for internal quality testing of apple varieties based on the hyperspectral band iterative fluctuation threshold, hyperspectral band weight accumulation threshold, sample weight threshold, and the number of hyperspectral bands selected.

[0082] Specifically, the steps of step S2 are as follows:

[0083] Step S2.1: Let For the number of iterations, Number of iterations Time-high spectral band The weighting coefficient values, Number of iterations seasonal fruit samples For fruit grade sample set The weighting coefficient values; setting the iterative fluctuation threshold for the hyperspectral band. Hyperspectral band weight accumulation threshold Sample weight threshold and the number of preferred hyperspectral bands ;set up as well as for ,in Constraint symbols; different inputs Corresponding sample set The spectral distance and physicochemical property distance between different samples can be used to... As Substitute the steps described in step S1.5 Obtaining the specific calculation formula ;

[0084] Step S2.2: Calculate the number of iterations. Add 1, by As Substitute the steps described in step S1.4 Obtaining the specific calculation formula Then from the above As Substitute the steps described in step S1.5 Obtaining the specific calculation formula ;

[0085] Step S2.3: For Each hyperspectral band, according to Select from largest to smallest This is to construct an optimal set of hyperspectral bands for internal quality testing of this apple variety. ,like Less than or equal to and Greater than or equal to If yes, proceed to step S2.4; otherwise, proceed to step S2.2.

[0086] Step S2.4: If the above There are samples in corresponding Below the Then the sample From the above Remove from the list until the entire list is traversed. All samples in, and the above The remaining portion is set to a grade for internal quality testing of this apple variety. Sample update set Output; set The labeling of the hyperspectral optimal band for internal quality testing of this apple variety and Preferred bands for hyperspectral imaging The actual usage weight can be known ,and The above Output;

[0087] Step S2.4 yields a sample update set of 5 grades for the apple variety, based on the number of grades that can be divided into. The relevant elimination ratios and the standard deviations of SSC, TA, and VC are as follows: Figure 2As shown, by removing a portion of abnormal samples, ranging from 6% to 14%, greater differences in physicochemical properties are achieved between samples of different grades. Furthermore, the updated sample set of the same grade exhibits lower standard deviations in SSC, TA, and VC compared to the original sample set, thus improving detection accuracy. Simultaneously, 11 hyperspectral preferred bands—460 nm, 465 nm, 470 nm, 510 nm, 585 nm, 610 nm, 665 nm, 720 nm, 730 nm, 910 nm, 960 nm, and 970 nm—were selected to construct the [specific hyperspectral band]. The actual usage weight of the above hyperspectral preferred bands Adjustments can be made as follows Figure 3 As shown;

[0088] S3: Construct a membership function for the tested fruit that belongs to a certain grade of the apple variety and is related to a certain internal quality type in a certain preferred hyperspectral band;

[0089] Specifically, the method for step S3 is as follows:

[0090] The steps described in step S2.4 medium sample For internal quality Preferred bands in hyperspectral Physicochemical characteristic values Construct a set of physicochemical properties Then it is possible to construct a system for the inspected fruit. Belongs to the level of And in the preferred hyperspectral band The above refers to the types of internal quality. membership function ,in For the inspected fruit For internal quality Preferred bands in hyperspectral The physicochemical characteristic values ​​of the surface are as follows:

[0091] 1) If corresponding to the above corresponding If the numerical range of a property is higher than or equal to the numerical range of other levels of physicochemical property characteristic sets, then the larger-scale first preset formula is used, and the calculation method is as follows:

[0092]

[0093] in, It is the independent variable and can be used in the operation. Substitute, For data point density threshold, To find data points in the dataset with a density greater than the specified value. Functions related to the region, A function to find the value of the lower boundary of a set. To find the exponent of the function, To find the function of the natural logarithm, Regarding the internal quality of fruit products The level is The probability threshold can be used to determine the following. The larger value satisfies the condition when the value is the lower boundary value. When is the conditions;

[0094] 2) If corresponding to the above corresponding If the numerical range of a property is lower than or equal to the numerical range of other levels of physicochemical property characteristic sets, then the smaller second preset formula is used, and the calculation method is as follows:

[0095]

[0096] in, To find the function that determines the values ​​of the upper boundary of the set, it is known that... The smaller value satisfies the condition when the value is the upper boundary value. The time is described conditions;

[0097] 3) If corresponding to the above corresponding If the numerical range of a given value lies between the numerical ranges of other levels of physicochemical property characteristic sets, then the intermediate third preset formula is adopted, and the calculation method is as follows:

[0098]

[0099] It can be seen that the above The intermediate type satisfies the condition when the value is the upper boundary value. or lower boundary value The time is described conditions.

[0100] It is evident that for internal qualities such as SSC, TA, and VC, Level 1 should be selected as described above. The smaller-sized second preset formula, level 5, is selected. The first preset formula is larger than the second, and the remaining levels 2, 3 and 4 are selected from the above. The intermediate third preset formula, the This can be achieved through efficient algorithms for finding dense regions within a data cube, wherein... Set to 0.8, the All were set to 0.9;

[0101] S4: For the overall internal quality testing of the tested apple variety, the determination is made by whether the minimum probability of classifying the fruit into a certain grade when different internal quality types are tested is greater than or equal to the probability threshold of the fruit being a certain grade in terms of overall internal quality. The probability of classifying the fruit into a certain grade for a certain internal quality type can be determined by the weighted sum of the actual usage weight of the hyperspectral preferred band and the membership function of the tested fruit belonging to that grade and in the hyperspectral preferred band for that internal quality type.

[0102] Specifically, the method for step S4 is as follows:

[0103] For the tested fruit of this apple variety In other words, when the internal quality type is tested as When determining whether it can be classified into a level probability for If the above Greater than or equal to the description in step S3 Then it can be determined that the above The types of internal quality to be tested are: It can be classified into levels Considering that certain internal quality standards are the same or overlap at some levels, a single internal quality can be classified into multiple levels simultaneously; for testing all... When the internal quality type is specified, the The overall internal quality can be classified into grades. probability for ,in Let be the operator that takes the minimum value; The fruit is graded based on its overall internal quality. The probability threshold, if the Greater than or equal to Then it can be regarded as the above. In terms of overall internal quality, it can be classified as grade 1. .

[0104] Suppose that when detecting the internal quality of VC, the affiliation of the 11 hyperspectral bands that can be classified into level 5 is as follows: Figure 4 As shown in the 11 columns on the left, and as... Figure 4 The rightmost column shows what is being said at this time. Corresponding probability It is possible The calculated value is 0.927, which is greater than or equal to the stated value. Then it can be determined that the above When testing the internal quality of VC, it can be classified as level 5; for testing the three types of overall internal quality, if the internal quality of SSC and TA is tested, the aforementioned The probabilities of being classified into level 5 were calculated to be 0.904 and 0.913 respectively. corresponding It can be seen that when the above At that time, the In terms of overall internal quality, it can be classified as grade 5, which is considered to be an extremely high grade among the Fuji apple varieties.

[0105] 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 scope of the principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for detecting the internal quality of apples based on spectral data and physicochemical indicators, characterized in that, Includes the following steps: S1: For a sample set of a certain grade of a certain apple variety, the spectral distance and physicochemical property distance between different samples can be obtained by detecting different types of internal quality in different hyperspectral bands. Then, for the sample sets of different grades of this apple variety, an objective function can be established to minimize the weighted sum of the squares of the ratios of spectral distances from multiple hyperspectral bands to several types of internal quality and the ratios of physicochemical property distances. The recommended weights of different hyperspectral bands and the recommended weights of different samples for a certain grade of the sample set can be obtained. S2: Construct different levels of sample update sets and hyperspectral band optimization sets for internal quality testing of apple varieties based on the hyperspectral band iterative fluctuation threshold, hyperspectral band weight accumulation threshold, sample weight threshold, and the number of hyperspectral bands selected. S3: Construct a membership function for the tested fruit that belongs to a certain grade of the apple variety and is related to a certain internal quality type in a certain preferred hyperspectral band; S4: For the overall internal quality testing of the tested apple variety, the determination is made by whether the minimum probability of classifying the fruit into a certain grade when different internal quality types are tested is greater than or equal to the probability threshold of the fruit being a certain grade in terms of overall internal quality. The probability of classifying the fruit into a certain grade for a certain internal quality type can be determined by the weighted sum of the actual usage weight of the hyperspectral preferred band and the membership function of the tested fruit belonging to that grade and in the hyperspectral preferred band for that internal quality type.

2. The method for detecting the internal quality of apples based on spectral data and physicochemical indicators according to claim 1, characterized in that, The specific steps of step S1 are as follows: Step S1.1: For a certain apple variety, let... The number of grades that can be divided into for this apple variety. The grade number that can be assigned to this apple variety and , The number of hyperspectral bands that can be used for internal quality testing of this apple variety. The hyperspectral band designation for internal quality testing of this apple variety and , The number of internal quality types that need to be tested for this apple variety. An internal quality number is used to test the fruit of this apple variety. , The grade for this apple variety to be used in internal quality testing is... The sample set was constructed using the fruits as samples. For sample set The number of samples in the sample; assuming that the spectral distance and physicochemical property characteristics between different samples can be detected in different hyperspectral bands for different types of internal quality, then a system can be constructed that makes all samples... Each level of sample set in Regarding the hyperspectral bands The objective function is to minimize the weighted sum of the squares of the spectral distance ratio and the physicochemical property characteristic distance ratio of the internal quality types. ,in The calculation method is as follows: G ( a h , b k , i ) = ∑ k = 1 K ∑ h = 1 H a h 2 ∑ e = 1 E ∑ i ∈ Γ k b k , i 2 { [ α k , h , e ( i , j ) max i , j ∈ Γ k [ α k , h , e ( i , j )] ] 2 + [ β k , h , e ( i , j ) max i , j ∈ Γ k [ β k , h , e ( i , j )] ] 2 } in, To find the minimum value, This is the sample number for this apple variety. For the hyperspectral band The weighting coefficients, For the sample For fruit grade sample set The weighting coefficients, This apple variety is used to distinguish it from the one described above. Sample number, For level Time-high spectral band Regarding internal quality In the sample With sample spectral distance between them For level Time-high spectral band Regarding internal quality In the sample With sample The distance between the physicochemical properties of the two sides, in the and middle and , A function that takes the maximum value in a combination; Step S1.2: Considering the above satisfy And the satisfy The steps described in step S1.1 This can be transformed into an equivalent function that minimizes the weighted sum of the squares of the spectral distance ratio and the physicochemical property characteristic distance ratio. ,in The calculation method is as follows: F ( a h , b k , i , λ , μ ) = ∑ k = 1 K ∑ h = 1 H a h 2 ∑ e = 1 E ∑ i ∈ Γ k b k , i 2 { [ α k , h , e ( i , j ) max i , j ∈ Γ k [ α k , h , e ( i , j )] ] 2 + [ β k , h , e ( i , j ) max i , j ∈ Γ k [ β k , h , e ( i , j )] ] 2 } − λ ( ∑ h = 1 H a h − 1 ) − μ ( ∑ i ∈ Γ k b k , i − 1 ) in, and All are Lagrange multipliers; Step S1.3: For the steps described in step S1.2... To each and To find the first and second derivatives, we can obtain... To each and first derivative and and the second derivative and The calculation method is as follows: ∂ F ∂ a h = 2 a h ∑ k = 1 K ∑ e = 1 E ∑ i ∈ Γ k b k , i 2 { [ α k , h , e ( i , j ) max i , j ∈ Γ k [ α k , h , e ( i , j )] ] 2 + [ β k , h , e ( i , j ) max i , j ∈ Γ k [ β k , h , e ( i , j )] ] 2 } − λ ∂ F ∂ b k , i = 2 b k , i ∑ h = 1 H ∑ e = 1 E a h 2 { [ α k , h , e ( i , j ) max i , j ∈ Γ k [ α k , h , e ( i , j )] ] 2 + [ β k , h , e ( i , j ) max i , j ∈ Γ k [ β k , h , e ( i , j )] ] 2 } − μ ∂ 2 F ∂ a h 2 = 2 ∑ k = 1 K ∑ e = 1 E ∑ i ∈ Γ k b k , i 2 { [ α k , h , e ( i , j ) max i , j ∈ Γ k [ α k , h , e ( i , j )] ] 2 + [ β k , h , e ( i , j ) max i , j ∈ Γ k [ β k , h , e ( i , j )] ] 2 } ∂ 2 F ∂ b k , i 2 = 2 ∑ h = 1 H ∑ e = 1 E a h 2 { [ α k , h , e ( i , j ) max i , j ∈ Γ k [ α k , h , e ( i , j )] ] 2 + [ β k , h , e ( i , j ) max i , j ∈ Γ k [ β k , h , e ( i , j )] ] 2 } When the above and Set to 0, and at the same time, the... and It is clearly greater than 0, therefore it can be determined that... and For the above and exist; Step S1.4: From the aforementioned and The Lagrange multiplier can be determined. The calculation method is as follows: λ = 2 { ∑ h = 1 H { ∑ k = 1 K ∑ e = 1 E ∑ i ∈ Γ k b k , i 2 { [ α k , h , e ( i , j ) max i , j ∈ Γ k [ α k , h , e ( i , j )] ] 2 + [ β k , h , e ( i , j ) max i , j ∈ Γ k [ β k , h , e ( i , j )] ] 2 } } − 1 } − 1 It can be seen that the above The specific calculation formula is as follows: a h = { ∑ k = 1 K ∑ e = 1 E ∑ i ∈ Γ k b k , i 2 { [ α k , h , e ( i , j ) max i , j ∈ Γ k [ α k , h , e ( i , j )] ] 2 + [ β k , h , e ( i , j ) max i , j ∈ Γ k [ β k , h , e ( i , j )] ] 2 } } − 1 ∑ h = 1 H { ∑ k = 1 K ∑ e = 1 E ∑ i ∈ Γ k b k , i 2 { [ α k , h , e ( i , j ) max i , j ∈ Γ k [ α k , h , e ( i , j )] ] 2 + [ β k , h , e ( i , j ) max i , j ∈ Γ k [ β k , h , e ( i , j )] ] 2 } } − 1 Step S1.5: From the aforementioned and The Lagrange multiplier can be determined. The calculation method is as follows: μ = 2 { ∑ i ∈ Γ k { ∑ h = 1 H ∑ e = 1 E a h 2 { [ α k , h , e ( i , j ) max i , j ∈ Γ k [ α k , h , e ( i , j )] ] 2 + [ β k , h , e ( i , j ) max i , j ∈ Γ k [ β k , h , e ( i , j )] ] 2 } } − 1 } − 1 It can be seen that the above The specific calculation formula is as follows: b k , i = { ∑ h = 1 H ∑ e = 1 E a h 2 { [ α k , h , e ( i , j ) max i , j ∈ Γ k [ α k , h , e ( i , j )] ] 2 + [ β k , h , e ( i , j ) max i , j ∈ Γ k [ β k , h , e ( i , j )] ] 2 } } − 1 ∑ i ∈ Γ k { ∑ h = 1 H ∑ e = 1 E a h 2 { [ α k , h , e ( i , j ) max i , j ∈ Γ k [ α k , h , e ( i , j )] ] 2 + [ β k , h , e ( i , j ) max i , j ∈ Γ k [ β k , h , e ( i , j )] ] 2 } } − 1 。 3. The method for detecting the internal quality of apples based on spectral data and physicochemical indicators according to claim 1, characterized in that, The specific steps of step S2 are as follows: Step S2.1: Let For the number of iterations, Number of iterations Time-high spectral band The weighting coefficient values, Number of iterations seasonal fruit samples For fruit grade sample set The weighting coefficient values; Set the iterative fluctuation threshold in the hyperspectral band. Hyperspectral band weight accumulation threshold Sample weight threshold and the number of preferred hyperspectral bands ;set up as well as for ,in Constraint symbols; different inputs Corresponding sample set The spectral distance and physicochemical property distance between different samples will As Substitute the steps described in step S1.5 Obtaining the specific calculation formula ; Step S2.2: Calculate the number of iterations. Add 1, by As Substitute the steps described in step S1.4 Obtaining the specific calculation formula Then from the above As Substitute the steps described in step S1.5 Obtaining the specific calculation formula ; Step S2.3: For Each hyperspectral band, according to Select from largest to smallest This is to construct an optimal set of hyperspectral bands for internal quality testing of this apple variety. ,like Less than or equal to and Greater than or equal to If yes, proceed to step S2.4; otherwise, proceed to step S2.

2. Step S2.4: If the above There are samples in corresponding Below the Then the sample From the above Remove from the list until the entire list is traversed. All samples in, and the above The remaining portion is set to a grade for internal quality testing of this apple variety. Sample update set Output; set The designation of the hyperspectral optimal band for internal quality testing of this apple variety and Preferred bands for hyperspectral imaging The actual usage weight can be known ,and The above Output the results.

4. The method for detecting the internal quality of apples based on spectral data and physicochemical indicators according to claim 1, characterized in that, The specific steps of step S3 are as follows: The steps described in step S2.4 medium sample For internal quality Preferred bands in hyperspectral Physicochemical characteristic values Construct a set of physicochemical properties Then it is possible to construct a system for the inspected fruit. Belongs to the level of And in the preferred hyperspectral band The above refers to the types of internal quality. membership function A k , e , w [ γ w , h ( v )] ,in For the inspected fruit For internal quality Preferred bands in hyperspectral The physicochemical characteristic values ​​of the surface are as follows: 1) If corresponding to the above corresponding If the numerical range of a property is higher than or equal to the numerical range of other levels of physicochemical property characteristic sets, then the larger-scale first preset formula is used, and the calculation method is as follows: A k , e , w ( x ) = { 1 , x ≥ down[Scan ρ ( Ω k , e , w )] 1 − exp{ ln( 1 − η k , e )[ down[Scan ρ ( Ω k , e , w )] − down( Ω k , e , w )] [ down[Scan ρ ( Ω k , e , w )] − x ] } , x < down[Scan ρ ( Ω k , e , w )] in, It is the independent variable and can be used in the operation. Substitute, For data point density threshold, To find data points in the dataset with a density greater than the specified value. Functions related to the region, A function to find the value of the lower boundary of a set. To find the exponent of the function, To find the function of the natural logarithm, Regarding the internal quality of fruit products The level is The probability threshold can be used to determine the following. The larger value satisfies the condition when the value is the lower boundary value. The time is described conditions; 2) If corresponding to the above corresponding If the numerical range of a property is lower than or equal to the numerical range of other levels of physicochemical property characteristic sets, then the smaller second preset formula is used, and the calculation method is as follows: A k , e , w ( x ) = { 1 , x ≤ up[Scan ρ ( Ω k , e , w )] exp{ ln( η k , e )[ up( Ω k , e , w ) − up[Scan ρ ( Ω k , e , w )]] [ x − up[Scan ρ ( Ω k , e , w )]] }, x > up[Scan ρ ( Ω k , e , w )] in, To find the function that determines the values ​​of the upper boundary of the set, it is known that... The smaller value satisfies the condition when the value is the upper boundary value. The time is described conditions; 3) If corresponding to the above corresponding If the numerical range of a given value lies between the numerical ranges of other levels of physicochemical property characteristic sets, then the intermediate third preset formula is adopted, and the calculation method is as follows: A k , e , w ( x ) = { 1 , down[Scan ρ ( Ω k , e , w )] ≤ x ≤ up[Scan ρ ( Ω k , e , w )] exp{ ln( η k , e )[ up( Ω k , e , w ) − up[Scan ρ ( Ω k , e , w )]] [ x − up[Scan ρ ( Ω k , e , w )]] }, x > up[Scan ρ ( Ω k , e , w )] 1 − exp{ ln( 1 − η k , e )[ down[Scan ρ ( Ω k , e , w )] − down( Ω k , e , w )] [ down[Scan ρ ( Ω k , e , w )] − x ] } , x < down[Scan ρ ( Ω k , e , w )] It can be seen that the above The intermediate type satisfies the condition when the value is the upper boundary value. or lower boundary value The time is described conditions.

5. The method for detecting the internal quality of apples based on spectral data and physicochemical indicators according to claim 1, characterized in that, The specific steps of step S4 are as follows: For the inspected fruit In other words, when testing its internal quality types as When determining whether it can be classified into a level probability for ∑ w ∈ R a a w ⋅ A k , e , w [ γ w , h ( v )] If the above Greater than or equal to the description in step S3 Then it can be determined that the above The types of internal quality to be tested are: It can be classified into levels Considering that certain internal quality standards are the same or overlap at some levels, a single internal quality can be classified into multiple levels simultaneously; for testing all... When the internal quality type is specified, the The overall internal quality can be classified into grades. probability for ∧ 1 ≤ e ≤ E ϒ k , e = ∧ 1 ≤ e ≤ E { ∑ w ∈ R a a w ⋅ A k , e , w [ γ w , h ( v )] } ,in Let be the operator that takes the minimum value; The fruit is graded based on its overall internal quality. The probability threshold, if the Greater than or equal to Then it can be regarded as the above. In terms of overall internal quality, it can be classified as grade 1. .