An apple damage volume prediction method and device, a storage medium and a processor
By combining Micro-CT and image processing technologies with the PCA-RSVR model, the problem of accurately measuring the damage volume of apples was solved, achieving high-precision damage volume prediction and reducing measurement costs.
Patent Information
- Application Number
- CN202310937494.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-28
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2043-07-28
AI Technical Summary
Existing technologies struggle to accurately measure the volume of damage to apples, especially for irregularly shaped damage areas and the depth of damage, making it difficult to fully reflect the extent of apple damage.
By employing Micro-CT and image processing technologies, combined with the PCA-RSVR model, and through impact testing, image acquisition, biological characteristic determination, and model optimization, we can accurately predict the volume of damage to apples.
It improves the accuracy of predicting apple lesion volume, reduces measurement costs, and overcomes the shortcomings of Micro-CT, such as high cost and long measurement time.
Smart Images

Figure CN116958234B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of agricultural engineering, specifically relating to a method and device for predicting apple damage volume, a storage medium, and a processor. Background Technology
[0002] Statistics show that in 2021, my country's apple planting area exceeded 30 million mu (approximately 2 million hectares), with a yield of 41 million tons, ranking among the world's top exporters. Apples are susceptible to mechanical damage during harvesting, transportation, storage, and sales, which can lead to decreased quality and shortened shelf life, resulting in greater economic losses for farmers. To help better understand the impact of pressure, collisions, and vibrations on apple quality during harvesting, storage, transportation, and sales, researchers have conducted extensive studies on calculating apple damage. To date, traditional methods such as visual observation, sampling and slicing, and manual measurement are still commonly used to assess apple quality, approximating the damaged area as an ellipsoid to estimate its area or volume. Traditional manual measurement methods suffer from subjectivity and instability, thus failing to comprehensively and accurately reflect the extent of apple damage.
[0003] In recent years, advancements in computer vision and digital image processing technologies have provided new methods for measuring apple damage. However, image processing methods can only perform two-dimensional image processing and analysis of apple surface damage through morphological operations, edge detection, and threshold segmentation. Although these methods can extract information such as apple surface morphology and color, and qualitatively and quantitatively analyze apple surface damage, the results are affected by factors such as lighting and shadows. Measuring apple damage using predictive models presents several challenges. First, the shape of apple damage can be arbitrary, such as dents, cracks, and cuts; these irregularly shaped damage areas require measurement using complex mathematical models or image processing techniques. Second, the depth of apple damage is difficult to determine; based solely on the measured surface area of the damage, predictive models cannot accurately assess the severity of the damage volume. Summary of the Invention
[0004] To address the aforementioned technical problems, one objective of this invention is to provide a method for predicting apple damage volume, thereby improving the accuracy of apple damage volume prediction. Another objective is to provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the steps of the apple damage volume prediction method. A further objective is to provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the apple damage volume prediction method. Finally, a third objective is to provide a processor for running a program, wherein the program, when running, executes the apple damage volume prediction method.
[0005] The present invention achieves the above-mentioned technical objectives through the following technical means.
[0006] A method for predicting apple damage volume includes the following steps:
[0007] Step S1: Perform an impact test on the apple sample;
[0008] Step S2: Place the damaged area of the apple on the image acquisition device to take a picture, obtain an image of the damaged area of the apple, and save it to the PC. The PC measures the minor axis ω1 and major axis ω2 of the damaged area of the apple, and calculates the area S of the damaged area of the apple using an empirical formula. formula ;
[0009] Step S3: Place the apple subjected to the impact test into a Micro-CT scanner for a 360° scan to obtain CT images of the damaged area of the apple. Process the CT images of the damaged area using software to calculate the specific damage volume V of the apple's damaged area. ct ;
[0010] Step S4: Conduct biological characteristic tests on apple samples to determine the elastic modulus of apple peel and pulp, as well as the soluble pectin content of the peel.
[0011] Step S5: Using the empirical formula measurement of apple damage area, the elastic modulus of pulp and peel, and the soluble pectin content of peel as input variables, calculate the CT value V of apple damage volume. ct To model the output, we obtain the SVR model PCA-RSVR using the PCA principal component analysis algorithm;
[0012] Step S6: Optimize the hyperparameters of the PCA-RSVR model obtained in Step S5, determine the optimal hyperparameters of the model, and assign them to the PCA-RSVR model obtained in Step S5 to retrain the final model.
[0013] Step S7: Input the area calculation value of the apple damage area image into the final model obtained in step S6 to obtain the predicted value of the apple damage volume.
[0014] In the above scheme, step S1 involves using an agricultural material collision mechanics testing platform to conduct impact tests on apple samples. The agricultural material collision mechanics testing platform includes a signal processing circuit, an angle encoder, a computer, an energized electromagnet, a wooden pendulum, a force sensor, an impact head, a test sample, and a material base with a vertical baffle.
[0015] In the above scheme, the image acquisition device in step S2 is a CCD digital camera.
[0016] In the above scheme, the area S of the apple damage region in step S2 formula The empirical calculation formula is:
[0017]
[0018] Among them, S formula The result is calculated using an empirical formula for the area of the apple's damaged region, where ω1 and ω2 are the minor and major axes of the impact region, respectively, in meters (m).
[0019] In the above scheme, in step S3, the apple sample is placed flat in the sample tube (103×130mm), and foam cotton is used to fix the apple. The scanning voltage is set to 45KV, 200μA, and the voxel size is set to 51.3×51.3×51.3μm. 3 The integration time is set to 230ms.
[0020] In the above scheme, step S3, which uses Avizo software to process and calculate the CT image of the damaged area of the apple, includes the following steps:
[0021] Step S1) The scanned apple is divided into multiple layers of original slice images and imported into Avizo software. The voxel size is set and the median method is used for noise reduction.
[0022] Step S2) Perform threshold segmentation on each slice image after processing in step S1) to separate the apple tissue from the damaged area, set the pixel value of the apple tissue to 1, and the pixel value of the hole area in the damaged area to 0.
[0023] Step S3) Use the Fill holes tool in Avizo software to fill the hole areas in the apple slice image based on the boundary detection algorithm, display the overall outline of the apple, and set the pixel value of the overall outline to 0.
[0024] Step S4) Use the Arithmetic tool to perform logical operations on the pixel values of the two slice images in Step S2) and Step S3), set the pixel value of the damaged area to 0, the pixel value of the overall outline to 0, and finally calculate the hole area of the damaged area of the apple.
[0025] Step S5) Use the Remove small spots tool to remove the small pixels in step S4), i.e. the pores inside the apple, and finally obtain the complete damaged area of the apple.
[0026] Step S6) Use the Label Analysis tool to calculate the complete apple damage area obtained in Step S5. The calculation formula is: number of voxels × voxel size. A weighted sum is then applied to each slice image containing the damage area to obtain the final volume V of the entire damage area. ct .
[0027] In the above scheme, the elastic modulus of apple peel and pulp is determined by a universal testing machine, and the soluble pectin content of peel is measured by ultraviolet spectrophotometry.
[0028] In the above scheme, step S5 sets the contribution rate of the PCA algorithm, selects the radial basis function (RBF) kernel function for the SVR model, and uses the "grid search method" to further optimize the hyperparameters of the PCA-RSVR model. The mean square error (CVmse) of multiple cross-validations is used as the basis for hyperparameter selection to determine the optimal hyperparameters of the model. The optimal hyperparameters are then assigned to the model to retrain the final model, and its generalization performance is evaluated using a test set. The optimal parameters are calculated to be c and g, where c is the penalty coefficient and g is the coefficient of the RBF kernel function.
[0029] Furthermore, in step S5, the CT calculation value of the apple lesion volume is predicted using an SVR (Support Vector Machine) model based on PCA (Principal Component Analysis) (PCA-RSVR). The contribution rate of the PCA algorithm is set to 95%, and the kernel function of the SVR model is the radial basis function (RBF). The hyperparameters of the PCA-RSVR model are further optimized using the grid search method. The mean squared error (CVmse) of 10 cross-validations is used as the basis for hyperparameter selection to determine the optimal hyperparameters of the model. The optimal hyperparameters are then assigned to the model to retrain the final model, and its generalization performance is evaluated using a test set. The optimal parameters are calculated to be (c, g) = (32, 22.6274).
[0030] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the program to implement the steps of the apple damage volume processing prediction method.
[0031] A computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of the apple damage volume processing prediction method.
[0032] A processor for running a program, wherein the program executes the apple damage volume processing prediction method during runtime.
[0033] Compared with the prior art, the beneficial effects of the present invention are:
[0034] This invention utilizes Micro-CT technology and image processing technology to accurately measure the volume of damage to an apple after a collision, providing a reliable method for determining the volume of mechanical damage to fruit.
[0035] The optimized PCA-RSVR model, a predictive model for CT measurements of apple damage volume, significantly reduces the cost of apple damage measurement, improves the accuracy of predicting the volume of mechanical damage to the fruit, and overcomes the shortcomings of Micro-CT, such as high cost and long measurement time.
[0036] Note that the description of these effects does not preclude the existence of other effects. One aspect of the invention does not necessarily have all the aforementioned effects. Effects other than those described above can be readily observed and extracted from the description, drawings, claims, etc. Attached Figure Description
[0037] Figure 1 This is a schematic diagram of the apple damage volume prediction method of the present invention;
[0038] Figure 2 This is a front view of the test bench for measuring the collision mechanical properties of agricultural materials according to the present invention.
[0039] Figure 3 This is a schematic diagram of image acquisition of the damaged area of an apple according to the present invention;
[0040] Figure 4 This is a schematic diagram of the measurement of the damaged area in this invention;
[0041] Figure 5 Collision force-displacement change curve;
[0042] Figure 6 This is a flowchart illustrating the calculation process for processing CT images of damaged areas of an apple according to the present invention.
[0043] Figure 7 This diagram illustrates the filtering and thresholding processes applied to the original apple image according to the present invention. Figure 7 (a) shows the filtering and noise reduction process. Figure 7 (b) is the background separation image;
[0044] Figure 8 This is a diagram showing the filling process applied to an apple image according to the present invention;
[0045] Figure 9 This invention provides a logic operation diagram between apple images, wherein... Figure 9 (a) is the image after a logical AND operation; Figure 9 (b) To remove small pixels;
[0046] Figure 10This invention provides a weighted summation 3D graph of an apple image.
[0047] Figure 11 The curves showing the compressive and tensile forces on apple pulp and peel according to this invention;
[0048] Figure 12 This describes the process of determining model parameters using the "grid search method" of this invention.
[0049] Figure 13 This is the frequency histogram of the prediction model error in this invention.
[0050] In the diagram, 1. Signal processing circuit; 2. Incremental optical encoder; 3. Computer; 4. Electrified electromagnet; 5. Wooden pendulum; 6. Force sensor; 7. Impact head; 8. Test sample; 9. Material support base with vertical baffle; 10. CCD controller; 11. CCD camera; 12. PC terminal. Detailed Implementation
[0051] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0052] Figure 1 The image shows a preferred embodiment of the apple damage volume prediction method, which includes the following steps:
[0053] Step S1: Perform an impact test on the apple sample;
[0054] Step S2: Place the damaged area of the apple on the image acquisition device to take a picture, obtain an image of the damaged area of the apple, and save it to the PC. The PC measures the minor axis ω1 and major axis ω2 of the damaged area of the apple, and calculates the area S of the damaged area of the apple using an empirical formula. formula ;
[0055] Step S3: Place the apple subjected to the impact test into a Micro-CT scanner for a 360° scan to obtain CT images of the damaged area of the apple. Process the CT images of the damaged area using software to calculate the specific damage volume V of the apple's damaged area. ct ;
[0056] Step S4: Conduct biological characteristic tests on apple samples to determine the elastic modulus of apple peel and pulp, as well as the soluble pectin content of the peel.
[0057] Step S5: Using the empirical formula measurement of apple damage area, the elastic modulus of pulp and peel, and the soluble pectin content of peel as input variables, calculate the CT value V of apple damage volume. ct To model the output, we obtain the SVR model PCA-RSVR using the PCA principal component analysis algorithm;
[0058] Step S6: Optimize the hyperparameters of the PCA-RSVR model obtained in Step S5, determine the optimal hyperparameters of the model, and assign them to the PCA-RSVR model obtained in Step S5 to retrain the final model.
[0059] Step S7: Input the image of the apple damage area into the final model obtained in step S6 to obtain the predicted value of the apple damage volume.
[0060] like Figure 2 As shown, in step S1, an impact test is conducted on the apple sample using an agricultural material impact mechanics testing platform. The agricultural material impact mechanics testing platform includes a signal processing circuit 1, an angle encoder 2, a computer 3, an energized electromagnet 4, a wooden pendulum 5, a mechanical sensor 6, an impact head 7, a test sample 8, and a material base 9 with a vertical baffle.
[0061] Initially, the wooden pendulum 5 is perpendicular to the ground. At this time, the electrical signal collected by the incremental optical encoder 2 is processed by the signal processing circuit 1, and the reading displayed on the computer is 0. The wooden pendulum 5 is manually raised until the angle between the wooden pendulum 9 and the vertical direction is displayed as θ on the computer. The energized electromagnet 4 is then energized, and the wooden pendulum 5 falls freely. The impact head 7 strikes the test sample 8 located on the material base 9 with a vertical baffle.
[0062] like Figure 3 As shown, the image acquisition device in step S2 is a CCD digital camera. The impacted apple is placed below the CCD camera, and the CCD controller saves the image to the PC. After image processing, the minor and major axes ω1 and ω2 of the impact area are measured, as shown below. Figure 4 As shown.
[0063] In the above scheme, the area S of the apple damage region in step S2 formula The empirical calculation formula is:
[0064]
[0065] Among them, S formula The result is calculated using an empirical formula for the area of the apple's damaged region, where ω1 and ω2 are the minor and major axes of the impact region, respectively, in meters (m).
[0066] When the pendulum strikes the apple, it transfers mechanical energy, causing the apple to move and deform. The pendulum device uses a force sensor 6 and an angle encoder 7 to collect data on the impact force and angle change generated by the aluminum impact head at the moment of contact with the apple. After processing with MATLAB 2020 software (MathWorks.Inc, Massachusetts, USA), a curve showing the relationship between force and deformation during the impact can be plotted, such as... Figure 5 As shown. Calculating the impact energy requires integrating the impact force acting on the apple with the corresponding deformation curve; this integral represents the impact energy. Specifically, the impact energy can be calculated using the following formula:
[0067] E=∫Fdx
[0068] Where E is the impact energy, F is the impact force, and dx is the impact depth along the impact direction.
[0069] The apple was placed flat in the sample tube (103×130mm) and fixed with foam. The scanning voltage was set to 45KV, 200μA, and the voxel size was set to 51.3×51.3×51.3μm. 3 The integration time is set to 230ms.
[0070] Figure 6 This is a flowchart illustrating the processing and calculation of CT images of the damaged area of an apple using Avizo software, including the following steps:
[0071] Step S1) Import the scanned apple slices, which are divided into approximately 1000 layers, into Avizo software and set the voxel size to 51.3 × 51.3 × 51.3 μm. 3 Because apples contain numerous pores with air bubbles, CT image data may contain both signal and noise during acquisition. Therefore, denoising is necessary to reduce noise in the image, minimize interference with segmentation results, and make the image data smoother and clearer, thus improving the quality of observation and analysis. This effectively reduces artifacts and sharp edges, resulting in poor imaging. The median denoising algorithm used in this study is as follows: Figure 7 As shown in (a).
[0072] Step S2) Threshold segmentation is performed on each slice image after processing. The upper threshold is set to 50, and the lower threshold is set to 0 to separate the apple tissue from the damaged area, making the damaged area more clearly distinguishable from other areas. The pixel value of the apple tissue is set to 1, and the pixel value of the hollow area in the damaged area is set to 0. Figure 7 As shown in (b).
[0073] Step S3) Use the Fill holes tool in Avizo software to fill the apple slice image. This tool uses a boundary detection algorithm to fill the empty areas in the apple slice image, displaying the overall outline of the apple, and setting the pixel value of the overall outline to 0. For example... Figure 8 As shown.
[0074] Step S4) Use the Arithmetic tool to perform logical operations on the pixel values of the two slice images from steps S2) and S3), such as... Figure 7 (b) and Figure 8 As shown, the pixel value of the damaged area is 0, and the pixel value of the overall outline is 0. In the logical AND operation, the corresponding pixel value in the output image is 1 only when the corresponding pixel values in both input images are 0; otherwise, it is 0. Therefore, the logical AND operation will only retain the pixel values of the apple's damaged area and the pores inside the apple in the input image, while the pixel values of other areas will be eliminated. Finally, the calculation yields the hollow area of the apple's damaged region. Figure 9 As shown in (a).
[0075] Step S5): Due to the significant difference in physical density between the air inside the apple and other tissues during CT scans, the air in the internal pores may cause some areas to have lower density, and the difference in density between different areas and the air density will be more pronounced. During threshold image segmentation, these areas may be incorrectly classified as "background," ignoring the actual damaged area and affecting the accuracy of segmentation. This can lead to significant errors in the subsequent calculation of the apple's damage volume through layer-by-layer accumulation. Therefore, the Remove small spots tool is used to remove the small pixels (i.e., the apple's internal pores) from S4, ultimately obtaining the complete apple damage area. Figure 9 As shown in (b).
[0076] Step S6) Use the Label Analysis tool to calculate the damaged area obtained after processing. The calculation formula is: number of voxels × voxel size (51.3 × 51.3 × 51.3 μm) 3 The system calculates the volume (V) of the entire damaged area by performing a weighted summation on each slice image containing the damaged area. ct ).like Figure 10 As shown.
[0077] The empirical formula calculation values and CT measurement values obtained under different collision energies are shown in Table 1.
[0078] Table 1. Empirical formula calculation values and CT measurement values for different collision energies.
[0079]
[0080] As can be seen from Table 1, using CT technology to calculate the volume of an apple in three-dimensional space to obtain the volume of apple damage avoids the influence of human selection and setting of parameters, and has higher resolution.
[0081] After scanning, samples were taken and a 10×10×15mm cube of apple pulp, cut 1mm below the peel, was subjected to a compression test using a universal testing machine. The pulp cube was placed vertically on a platform, and a 150mm diameter circular indenter was used to compress the sample at a loading rate of 25mm / min and a preload force of 0.5N. Next, the apple sample was peeled (60×10×1mm), and a tensile test was performed using clamps. The initial distance was 40mm, the tensile rate was set to 50mm / min, and the preload force was 0.05N. Each sample was tested three times, and the average of the three replicates was used as the result. The force-strain curves of the apple pulp and peel after testing with the universal testing machine are shown below. Figure 11 As shown, according to Huco's elasticity formula, the formula for calculating the elastic modulus of apple pulp and peel samples is as follows:
[0082]
[0083] Where E is the elastic modulus, F represents the stress at the elastic limit point and biological yield point of the specimen, L is the initial length of the specimen before testing, and ΔL is the deformation of the specimen.
[0084] The soluble pectin content in fruit peel and pulp was measured using ultraviolet spectrophotometry.
[0085] Correlation analysis:
[0086] The Pearson correlation coefficient (PCC) is a statistical method for measuring the degree of correlation between two variables. This paper uses the Pearson correlation coefficient (PCC) to measure the correlation between CT measurements of apple lesion volume and apple tissue characteristics and empirical formula measurements:
[0087]
[0088] In the formula, y is the CT measurement of the apple lesion volume, and z is the measurement value based on the characteristics of apple tissue and empirical formula.
[0089] The value of ρ ranges from [-1, 1]. Different values of ρ correspond to different degrees of correlation. The correlation between the volume of apple CT measurements and the characteristics of apple tissue, as well as the empirical formula measurements, is shown in Table 2.
[0090] Table 2. Correlation between apple CT measurements, apple tissue characteristics, and empirical formula measurements.
[0091]
[0092] The results showed that all four variables were highly correlated with the CT measurement of apple lesion volume. Therefore, the experimental data obtained from the pendulum impact experiment and the characteristics of apple biological tissue can be used to predict the CT measurement of apple lesion volume through an optimized model.
[0093] The following model uses empirically calculated values of apple damage area, elastic modulus of pulp and peel, and soluble pectin content in pulp and peel as input variables, and CT calculation value of apple damage volume as output variable, to predict the CT calculation value of apple damage volume. The specific steps are as follows:
[0094] (1) Data preprocessing
[0095] The 160 sets of data were divided into groups, with 85% used as the training set and 15% as the test set. The data were then normalized and scaled to the range [0,1] to effectively eliminate the influence of different units and value ranges among the data.
[0096] (2) Parameter selection and optimization
[0097] Based on the above dataset partitioning method, three sets of support vector machine prediction models were established: Poly-SVR (polynomial kernel function), Radial Basis Function-SVR (Rbf-SVR), and PCA-based RBF kernel function-SVR (PCA-RSVR). The PCA algorithm was set to a contribution rate of 95%. All models used 10-fold cross-validation. The hyperparameters of the nonlinear kernel functions were set to default values (the linear kernel function had no hyperparameters). The better model was initially evaluated based on the performance indicators of the test set (as shown in Table 4).
[0098] Table 3 Comparison of Training Set Errors
[0099]
[0100] Table 4. Test Set Error Comparison Results
[0101]
[0102] As shown in Table 4 above, the PCA-RSVR model in the test set has smaller MAE, MSE, RMSE, and MAPE than the Poly-SVR and Rbf-SVR models, while the goodness of fit R... 2 Larger values were observed. Specifically, the PCA-RSVR model showed a 20.865% and 2.866% reduction in MAE value compared to the other two models, a 30.445% and 4.935% reduction in RMSE value, and a 10.197% and 3.077% reduction in MAPE value compared to the other two models. The R-values of the three models were also significantly higher. 2The values are 0.613, 0.823, and 0.914, respectively. It can be concluded that when processing the sample data of this experiment, the SVR model using a nonlinear kernel function outperforms the linear kernel function in both training set fitting accuracy and generalization performance on the test set. Furthermore, the PCA-RSVR model further improves upon the Rbf-SVR model in various aspects. Therefore, after evaluation and comparison, the PCA-RSVR model is the preferred choice.
[0103] To further optimize the model's hyperparameters, the kernel function parameters c and g (c being the penalty coefficient and g being the RBF kernel function coefficients) with optimal performance on the validation set were determined. A grid search method was used to further optimize the hyperparameters of the PCA-RSVR model. The mean squared error (CVmse) of 10 cross-validations was used as the selection criterion to determine the optimal hyperparameters. These optimal hyperparameters were then applied to the model, which was retrained to generate the final model. Its generalization performance was then evaluated using a test set. Figure 12 This involves dividing the training set into ten-fold cross-validation to optimize the parameters c and g in the RBF kernel function, setting the range of parameters c and g to [2]. -5 -2 5 The step size was 0.01, and the optimal parameters were calculated to be (c, g) = (32, 22.6274). The performance parameters of the PCA-RSVR model on the test set after parameter optimization are shown in Table 5 below.
[0104] Table 5. Comparison of test set errors of the optimized PCA-RSVR model.
[0105]
[0106] The optimized PCA-RSVR model shows further improved performance compared to the initial model with default parameters, with improvements in various evaluation metrics, including MAE, MSE, RMSE, MAPE, and R-value. 2 The percentages were 5.3357, 50.1179, 7.0794, 4.49%, and 0.9782, respectively. Figure 13 The analysis shows that after PCA dimensionality reduction, the errors of the training and test sets are more bell-shaped, indicating that the model's errors are concentrated near zero error and have good prediction accuracy for most samples.
[0107] This invention utilizes an agricultural material collision characteristic test bench to conduct impact tests on apples. A CCD digital camera is used to photograph the surface, and the area of the damaged region is calculated. Then, computed tomography (Micro-CT) technology is used to accurately calculate the damaged area of the apple. Furthermore, by measuring the elastic modulus (MPa) of the apple peel and pulp, as well as the soluble pectin content (%) of the peel, the CT-calculated value of the apple's damage volume is predicted using a PCA-RSVR (PCA-PSVR) model based on PCA (Principal Component Analysis), thus achieving precise characterization of the apple's damage volume.
[0108] This invention belongs to the field of designing methods for determining the area of apple damage and predicting the volume of damage to apple crops. The method includes the following steps: conducting an impact test on an apple sample using an agricultural material impact mechanics testing platform; placing the damaged area of the apple under a CCD digital camera for photographing, automatically saving the image to a PC; automatically measuring the minor and major axes (ω1, ω2) of the impact area; and calculating the area S of the damaged region of the apple using an empirical formula. formula The apple subjected to the impact test was placed in a Micro-CT scanner for a 360° scan. The CT images of the damaged area of the apple were processed using Avizo software to calculate the specific damage volume (V) of the affected area. ct The apple samples from the previous step were subjected to biological characteristic tests, and the elastic modulus (MPa) of the apple peel and pulp and the soluble pectin content (%) of the peel were measured. Using the empirical formula measurement of apple damage volume, the elastic modulus of the pulp and peel and the soluble pectin content of the peel as input variables, the CT calculation value of apple damage volume was predicted using the SVR (Support Vector Machine) model in order to obtain an accurate damage volume value.
[0109] It should be understood that although this specification is described according to various embodiments, not every embodiment contains only one independent technical solution. This way of describing the specification is only for clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment can also be appropriately combined to form other implementation methods that can be understood by those skilled in the art.
[0110] The detailed descriptions listed above are merely specific illustrations of feasible embodiments of the present invention and are not intended to limit the scope of protection of the present invention. All equivalent embodiments or modifications made without departing from the spirit of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for predicting apple damage volume, characterized in that, Includes the following steps: Step S1: Perform an impact test on the apple sample; Step S2: Place the damaged area of the apple on the image acquisition device to take a picture, obtain an image of the damaged area of the apple, and save it to [location]. On the PC, the short axis of the damaged area of the apple is measured. and long axis The area of the damaged region on the apple was calculated using an empirical formula. ; Step S3: Place the apple subjected to the impact test into a Micro-CT machine for a 360° scan to obtain the damage to the apple. Regional CT images were used to process and calculate the specific volume of damage in the apple's damaged area using software. ; Step S3 involves processing and calculating the CT image of the damaged area of the apple using Avizo software, including the following steps: Step S31) The scanned apple is divided into multiple layers of original slice images and imported into Avizo software. The voxel size is set and the median method is used for noise reduction. Step S32) Perform threshold segmentation on each slice image after processing in step S31) to separate the apple tissue from the damaged area, set the pixel value of the apple tissue to 1, and the pixel value of the hole area in the damaged area to 0. Step S33) Use the Fill holes tool in Avizo software to fill the hole areas in the apple slice image based on the boundary detection algorithm, display the overall outline of the apple, and set the pixel value of the overall outline to 0; Step S34) Use the Arithmetic tool to perform logical operations on the pixel values of the two slice images in steps S32) and S33), set the pixel value of the damaged area to 0, the pixel value of the overall outline to 0, and finally calculate the hole area of the damaged area of the apple. Step S35) Use the Remove small spots tool to remove the small pixels in step S34), i.e. the pores inside the apple, and finally obtain the complete damaged area of the apple; Step S36) Use the Label Analysis tool to calculate the complete apple damage area obtained in Step S35. The calculation formula is: number of voxels × voxel size. A weighted sum is then applied to each slice image containing the damage area to obtain the final volume of the entire damage area. ; Step S4: Conduct biological characteristic tests on apple samples to determine the elastic modulus of apple peel and pulp, as well as the soluble pectin content of the peel. Step S5: Using the empirical formula measurement of apple damage area, the elastic modulus of pulp and peel, and the soluble pectin content of peel as input variables, calculate the CT value of apple damage volume. To model the output, we obtain the SVR model PCA-RSVR based on the PCA principal component analysis algorithm; Step S6: Optimize the hyperparameters of the PCA-RSVR model obtained in Step S5 to determine the optimal hyperparameters. Then, it is applied to the PCA-RSVR model obtained in step S5 to retrain the final model; Step S7: Input the image of the apple damage area into the final model obtained in step S6 to obtain the predicted value of the apple damage volume.
2. The apple damage volume prediction method according to claim 1, characterized in that, In step S1, the apple sample is subjected to an impact test using an agricultural material collision mechanics testing platform.
3. The apple damage volume prediction method according to claim 1, characterized in that, The image acquisition device in step S2 is a CCD digital camera.
4. The apple damage volume prediction method according to claim 1, characterized in that, The area of the apple damage in step S2 The empirical calculation formula is:
5. The apple damage volume prediction method according to claim 1, characterized in that, The elastic modulus of apple peel and pulp was determined using a universal testing machine, and the soluble pectin content of the peel was measured using ultraviolet spectrophotometry.
6. The apple damage volume prediction method according to claim 1, characterized in that, The steps In S5, the contribution rate of the PCA algorithm is set, and the radial basis function (RBF) is selected as the kernel function for the PCA-RSVR model.
7. The apple damage volume prediction method according to claim 1, characterized in that, In step S6, the "grid search method" is used to further optimize the hyperparameters of the PCA-RSVR model. The mean square error (CVmse) of multiple cross-validations is used as the basis for hyperparameter selection to determine the optimal hyperparameters of the model, and then the model is retrained to obtain the final model.
8. A computer device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor. Computer program, characterized in that, When the processor executes the program, it implements the steps of the apple damage volume processing prediction method according to any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor. The steps of the apple damage volume processing prediction method according to any one of claims 1 to 7 are implemented during the process.
10. A processor, characterized in that, The processor is used to run a program, wherein the program executes the apple damage volume processing prediction method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Modeling method of detection model for internal quality of fruit
CN103278514A
Hyperspectral nondestructive prediction method for apple impact damage area
CN111289463A