Apple damage volume prediction method, and device, storage medium and processor
By combining Micro-CT technology and image processing technology, the PCA-RSVR model was established, and the accuracy and cost of Apple's damage volume prediction were solved, achieving high-precision damage volume prediction.
Patent Information
- Application Number
- PCT/CN2024/074196
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-07-28
- Filing Date
- 2024-01-26
- Publication Date
- 2025-02-06
AI Technical Summary
The prior art is difficult to accurately predict Apple damage volume, traditional manual measurements have subjectivity and instability, image processing methods are affected by light and shadows, and cannot effectively evaluate irregular damage and damage depth.
Using a combination of Micro-CT technology and image processing technology, a prediction method based on PCA-RSVR model is established through impact testing, image acquisition, CT scanning and biological characteristics testing, and the model hyperparameters are optimized to improve prediction accuracy.
Accurate prediction of Apple's damage volume is achieved, the measurement cost is reduced, the prediction accuracy is improved, and the disadvantages of the high cost and long-term measurement of Micro-CT technology are overcome.
Smart Images

Figure CN2024074196_06022025_PF_FP_ABST
Abstract
Description
Apple damage volume prediction method, device, storage medium and processor Technical Field
[0001] The present invention belongs to the field of agricultural engineering, and in particular relates to a method and device for predicting apple damage volume, a storage medium and a processor. Background Art
[0002] According to statistics, in 2021, my country's apple planting area exceeded 30 million mu, with a production of 41 million tons, and its export volume ranked among the top in the world. Apples are prone to mechanical damage during picking, transportation, storage and sales, which may lead to a decline in apple quality and a shortened shelf life, resulting in greater economic losses for farmers. In order to help people better understand the impact of pressure, collision and vibration on apple quality during picking, storage, transportation and sales, researchers have conducted extensive research on the calculation of apple damage. To date, traditional methods such as human visual observation, sampling and slicing, and manual measurement are still commonly used to detect apple quality, and the damaged area is approximated as an ellipsoid to estimate the area or volume. Traditional manual measurement methods have problems of subjectivity and instability, and therefore cannot fully and accurately reflect the damage to apples.
[0003] In recent years, advances in computer vision and digital image processing technologies have provided new methods for measuring apple damage. However, image processing methods are limited to two-dimensional image processing and analysis of apple surface damage through morphological operations, edge detection, and threshold segmentation. Although these image processing methods can extract information such as apple surface morphology and color, allowing for qualitative and quantitative analysis of apple surface damage, the results are affected by factors such as lighting and shadows. Measuring apple damage using predictive models presents several difficulties. First, apple damage can have arbitrary shapes, such as dents, cracks, and cuts. These irregularly shaped damaged areas require complex mathematical models or image processing techniques to measure. Second, the depth of apple damage is difficult to determine, and predictive models cannot accurately assess the volumetric severity of damage based solely on the measured surface area.
[0004] Summary of the Invention
[0005] In response to the above technical problems, one of the objects of the present invention is to provide a method for predicting apple damage volume, so as to realize the prediction of apple damage volume and improve the prediction accuracy of apple damage volume; one of the objects of the present invention is to provide a computer device, comprising a memory, a processor and a computer program stored in the memory and runnable on the processor, wherein the steps of the method for predicting apple damage volume processing are realized when the processor executes the program; one of the objects of the present invention is to provide a computer-readable storage medium having a computer program stored thereon, wherein the steps of the method for predicting apple damage volume processing are realized when the program is executed by the processor; one of the objects of the present invention is to provide a processor, wherein the processor is used to run the program, wherein the method for predicting apple damage volume processing is executed when the program is run.
[0006] The present invention achieves the above technical objectives through the following technical means.
[0007] A method for predicting apple damage volume processing comprises the following steps:
[0008] Step S1: performing an impact test on the apple sample;
[0009] Step S2: Place the damaged area of the apple on an image acquisition device and take a photo. The image of the damaged area of the apple is obtained and saved to the PC. The PC measures the short axis ω1 and the long 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 ;
[0010] Step S3: Place the apple that has been impacted into a Micro-CT machine for 360° scanning to obtain a CT image of the damaged area of the apple. The CT image of the damaged area of the apple is processed and calculated by software to obtain the specific damage volume V of the damaged area of the apple. ct ;
[0011] Step S4: performing biological property testing on the apple sample to determine the elastic modulus of the apple peel and pulp as well as the soluble pectin content of the peel;
[0012] Step S5: Using the empirical formula measurement value of the apple damage area, the elastic modulus of the flesh and peel, and the soluble pectin content of the peel as input variables, the CT calculation value V of the apple damage volume ct As the output, modeling is performed to obtain the SVR model PCA-RSVR based on PCA principal component analysis algorithm;
[0013] Step S6: Optimize the hyperparameters of the PCA-RSVR model obtained in step S5 to determine the optimal hyperparameters of the model, and assign them to the PCA-RSVR model obtained in step S5 to retrain the final model;
[0014] Step S7: Input the calculated area value of the apple damaged region image into the final model obtained in step S6 to obtain the predicted value of the apple damaged volume.
[0015] In the above scheme, in step S1, the apple sample is subjected to an impact test using an agricultural material collision mechanics test bench. The agricultural material collision mechanics test bench 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.
[0016] In the above solution, the image acquisition device in step S2 is a CCD digital camera.
[0017] In the above solution, the area of the damaged apple in step S2 is formula The empirical calculation formula is:
[0018] Among them, S formula is the calculation result of the empirical formula for the area of apple damage, ω1 and ω2 are the minor axis and major axis of the impact area, m.
[0019] In the above scheme, in step S3, the apple sample was placed flat in a sample tube (103×130 mm), and the apple was fixed with foam cotton. The scanning voltage was set to 45 kV, 200 μA, and the voxel size was set to 51.3×51.3×51.3 μm. 3 , the integration time is set to 230ms.
[0020] In the above solution, the step S3 uses Avizo software to process and calculate the CT image of the damaged area of the apple, including 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) performing threshold segmentation on each slice image processed in step S1) to separate the apple tissue from the damaged area, setting the pixel value of the apple tissue to 1 and the pixel value of the hollow area of the damaged area to 0;
[0023] Step S3), using the Fill holes tool in the Avizo software based on the boundary detection algorithm to fill the hole areas in the apple slice image, display the overall outline of the apple, and set the pixel value of the overall outline to 0;
[0024] Step S4), using the Arithmetic tool to perform a logical operation on the pixel values of the two slice images in step S2) and step S3), setting the pixel value of the damaged area to 0 and the pixel value of the overall outline to 0, and finally calculating the hollow area of the damaged area of the apple;
[0025] Step S5), using the Remove small spots tool to remove the small pixels in step S4), i.e., the pores inside the apple, and finally obtaining a complete apple damaged area;
[0026] Step S6) Use the Label Analysis tool to calculate the complete apple damage area obtained in step S5) using the following formula: number of voxels × voxel size. Perform a weighted summation on each slice with a damage area, and finally obtain the volume V of the entire damage area. ct .
[0027] In the above scheme, the elastic modulus of the peel and pulp of the apple is measured using a universal testing machine, and the soluble pectin content of the peel is measured using ultraviolet spectrophotometry.
[0028] In the above scheme, the contribution rate of the PCA algorithm is set in step S5, the radial basis kernel function RBF is selected as the kernel function of the SVR model, and the "grid search method" is used to further optimize the hyperparameters of the PCA-RSVR model. The average 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 the model is assigned to retrain the final model. The generalization performance is evaluated with the test set, and the optimal parameters are obtained after calculation as c and g, where c is the penalty coefficient and g is the RBF kernel function coefficient.
[0029] Furthermore, in step S5, the CT calculated value of the apple damage volume is predicted using the SVR (support vector machine) model (PCA-RSVR) based on PCA (principal component analysis algorithm), wherein the contribution rate of the PCA algorithm is set to 95%, and the kernel function of the SVR model is the radial basis kernel function RBF. The "grid search method" is used to further optimize the hyperparameters of the PCA-RSVR model, and the mean square error (CVmse) of 10 cross-validations is used as the basis for hyperparameter selection to determine the optimal hyperparameters of the model, and the hyperparameters are assigned to the model to retrain the final model, and the generalization performance is evaluated using the test set. After calculation, the optimal parameters are (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, wherein the processor implements the steps of the apple damage volume processing prediction method when executing the program.
[0031] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the apple damage volume processing prediction method.
[0032] A processor is used to run a program, wherein the apple damage volume processing prediction method is executed when the program is running.
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] The present invention utilizes Micro-CT technology and image processing technology to more accurately measure the volume of damage to apples after collision, providing a reliable method for measuring the volume of mechanical damage to fruits.
[0035] The optimized PCA-RSVR model, a CT measurement value prediction model for apple damage volume, greatly 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, which is relatively high in cost and long in measurement time.
[0036] Note that the description of these effects does not preclude the existence of other effects. One embodiment of the present invention does not necessarily have all of the above effects. Effects other than the above can be clearly seen and extracted from the description of the specification, drawings, claims, etc. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] FIG1 is a schematic flow chart of a method for predicting apple damage volume processing according to the present invention;
[0038] FIG2 is a front view of the test bench for measuring the collision mechanical properties of agricultural materials according to the present invention;
[0039] FIG3 is a schematic diagram of image acquisition of an apple damaged area image according to the present invention;
[0040] FIG4 is a schematic diagram of measuring the damaged area according to the present invention;
[0041] Figure 5 Collision force-displacement change curve;
[0042] FIG6 is a flowchart of the present invention for processing a CT image of a damaged area of an apple;
[0043] FIG7 shows the filtering and threshold segmentation processing of the original apple image according to the present invention, wherein FIG7(a) shows the filtering and noise reduction processing, and FIG7(b) shows the background separation processing;
[0044] FIG8 is a diagram showing the filling process of an apple image according to the present invention;
[0045] FIG9 is a diagram of the logical operation performed on apple images according to the present invention, wherein FIG9(a) is an image after the logical AND operation; FIG9(b) is an image after the small pixels are removed;
[0046] FIG10 is a weighted sum 3D graph of an apple image according to the present invention;
[0047] FIG11 is a compression-tensile force curve of apple pulp and peel according to the present invention;
[0048] FIG12 is a diagram illustrating the process of determining model parameters using the grid search method of the present invention;
[0049] FIG13 is a frequency histogram of the prediction model error of the present invention.
[0050] In the figure, 1. signal processing circuit; 2. incremental optical encoder; 3. computer; 4. energized electromagnet; 5. wooden pendulum; 6. mechanical sensor; 7. impact head; 8. test sample; 9. material carrying base with vertical baffle; 10. CCD controller; 11. CCD camera; 12. PC terminal. DETAILED DESCRIPTION
[0051] The following describes embodiments of the present invention in detail, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and are not to be construed as limiting the present invention.
[0052] FIG1 shows a preferred embodiment of the method for predicting the volume of apple damage, which includes the following steps:
[0053] Step S1: performing an impact test on the apple sample;
[0054] Step S2: Place the damaged area of the apple on an image acquisition device and take a photo. The image of the damaged area of the apple is obtained and saved to the PC. The PC measures the short axis ω1 and the long 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 that has been impacted into a Micro-CT machine for 360° scanning to obtain a CT image of the damaged area of the apple. The CT image of the damaged area of the apple is processed and calculated by software to obtain the specific damage volume V of the damaged area of the apple. ct ;
[0056] Step S4: performing biological property testing on the apple sample to determine the elastic modulus of the apple peel and pulp as well as the soluble pectin content of the peel;
[0057] Step S5: Using the empirical formula measurement value of the apple damage area, the elastic modulus of the flesh and peel, and the soluble pectin content of the peel as input variables, the CT calculation value V of the apple damage volume ct As the output, modeling is performed to obtain the SVR model PCA-RSVR based on PCA principal component analysis algorithm;
[0058] Step S6: Optimize the hyperparameters of the PCA-RSVR model obtained in step S5 to 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 damaged area into the final model obtained in step S6 to obtain the predicted value of the apple damaged volume.
[0060] As shown in Figure 2, in step S1, an impact test is performed on an apple sample using an agricultural material collision mechanics test bench. The agricultural material collision mechanics test bench includes a signal processing circuit 1, an angle encoder 2, a computer 3, an energized electromagnet 4, a wooden pendulum 5, a force 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. The electrical signal collected by the incremental optical encoder 2 is processed by the signal processing circuit 1, resulting in a reading of 0 on the computer. The wooden pendulum arm 5 is manually raised until the angle between the wooden pendulum arm 9 and the vertical direction is displayed as θ on the computer. This activates the electromagnet 4, causing the wooden pendulum 5 to fall freely. The impact head 7 strikes the test sample 8, which is located on the material base 9 with a vertical baffle.
[0062] As shown in Figure 3, the image acquisition device in step S2 is a CCD digital camera. The impacted apple is placed under the CCD camera, and the CCD controller saves the image to the PC. After image processing, the short axis and long axis ω1 and ω2 of the impact area are measured, as shown in Figure 4.
[0063] In the above solution, the area of the damaged apple in step S2 is formula The empirical calculation formula is:
[0064] Among them, S formula is the calculation result of the empirical formula for the area of apple damage, ω1 and ω2 are the minor axis and major axis of the impact area, m.
[0065] When the pendulum hits the apple, it transmits mechanical energy, causing the apple to move and deform. The pendulum device collects data on the impact force and angle change generated by the aluminum impact head at the moment of contact with the apple, using the mechanical sensor 6 and the angle encoder 7. After processing with MATLAB 2020 software (MathWorks. Inc, Massachusetts, USA), a curve showing the relationship between the force and deformation of the apple during the impact can be drawn, as shown in Figure 5. To calculate the impact energy, it is necessary to integrate the impact force acting on the apple and the corresponding deformation curve. This integral corresponds to the impact energy. Specifically, the impact energy can be calculated using the following formula:
[0066] E=∫Fdx
[0067] Where E is the impact energy, F is the impact force, and dx is the impact depth along the impact direction.
[0068] The apple was placed flat in a sample tube (103×130 mm) and fixed with foam cotton. The scanning voltage was set to 45 kV, 200 μA, and the voxel size was set to 51.3×51.3×51.3 μm. 3 , the integration time is set to 230ms.
[0069] FIG6 is a flowchart of processing a CT image of an apple's damaged area using Avizo software, which includes the following steps:
[0070] Step S1) The scanned apple is divided into about 1000 layers of raw slices and imported into Avizo software, with the voxel size set to 51.3×51.3×51.3μm. 3 Because apples contain a large number of pores and air bubbles, CT image data may contain both signal and noise during the acquisition process. Therefore, noise reduction processing is required to reduce the noise in the image and reduce the interference with the segmentation results. This makes the image data smoother and clearer, improves the quality of observation and analysis data, and effectively reduces artifacts, sharp corners, and other undesirable imaging effects in the data. The median method is selected as the noise reduction algorithm for this study, as shown in Figure 7(a).
[0071] Step S2) Threshold segmentation is performed on each processed slice image, with the upper threshold set to 50 and the lower threshold set to 0. This separates the apple tissue from the damaged area, making the damaged area more clearly distinguishable from the other areas. The pixel value of the apple tissue is set to 1, and the pixel value of the cavity area within the damaged area is set to 0. This is shown in Figure 7(b).
[0072] Step S3) Use the Fill holes tool in the Avizo software to fill the apple slice image. This tool fills the holes in the apple slice image based on a boundary detection algorithm, displays the overall outline of the apple, and sets the pixel value of the overall outline to 0, as shown in Figure 8.
[0073] In step S4, the Arithmetic tool is used to perform a logical operation on the pixel values of the two slice images from steps S2) and S3). As shown in Figures 7(b) and 8, the pixel values of the damaged area and the overall outline are both 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 only retains the pixel values of the damaged apple area and the pores inside the apple in the input image, eliminating the pixel values in other areas. The final calculation results in the cavity area of the damaged apple, as shown in Figure 9(a).
[0074] Step S5) Since the physical density of air inside the apple differs significantly from that of other tissues in a CT scan, the air in the internal pores may cause some areas to have lower density, making the density values of different areas more significantly different from those of air. When performing threshold image segmentation, these areas may be mistakenly classified as "background," while the actual damaged areas may be ignored, thus affecting the accuracy of the segmentation. This can lead to significant errors in the subsequent calculation of the apple's damaged volume through layer-by-layer accumulation. Therefore, the Remove Small Spots tool is used to remove the small pixels in S4 (i.e., the pores inside the apple), ultimately obtaining the complete damaged area of the apple. This is shown in Figure 9(b).
[0075] Step S6) Use the Label Analysis tool to calculate the damaged area obtained by processing. The calculation formula is: number of voxels × voxel size (51.3 × 51.3 × 51.3 μm 3 ), and perform weighted sum calculation on each slice with damaged area, and finally get the volume of the entire damaged area (V ct ). As shown in Figure 10.
[0076] The calculated values obtained by the empirical formula and the CT measured values at different collision energies are shown in Table 1.
[0077] Table 1 Calculated values based on empirical formula and CT measured values at different collision energies
[0078] As can be seen from Table 1, the apple damage volume is obtained by calculating the volume of the apple in three-dimensional space using CT technology, which avoids the influence of human selection and setting parameters and has higher resolution.
[0079] The scanned samples were sampled and a compression test was performed on a 10×10×15mm pulp cube sample cut 1mm below the apple peel using a universal testing machine. The pulp cube was placed vertically on the platform and compressed with a circular indenter with a diameter of 150mm. The loading rate was 25mm / min and the preload force was 0.5N. Next, the apple sample was peeled (60×10×1mm) and the peel sample was clamped up and down with a clamp for tensile testing. The initial distance was 40mm, the tensile rate was set to 50mm / min, and the preload force was 0.05N. The experiment was repeated 3 times for each sample, and the average value of the 3 repetitions was used as the measurement result. The force-varying curves of apple pulp and peel tested by the universal testing machine are shown in Figure 11. According to Hu Ke's elastic formula, the elastic modulus of apple pulp and peel samples is calculated as follows:
[0080] Where E is the elastic modulus, F represents the stress at the elastic limit point and the biological yield point of the specimen, L is the initial length of the specimen before testing, and ΔL is the deformation of the specimen.
[0081] The soluble pectin content in peel and pulp was measured by UV spectrophotometry.
[0082] Correlation analysis:
[0083] 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, apple tissue characteristics, and empirical formula measurements:
[0084] Where y is the CT measurement value of the apple injury volume, and z is the measurement value of the apple tissue characteristics and empirical formula.
[0085] The value range of ρ is [-1, 1]. Different values of ρ correspond to different correlation levels. The correlation between the volume of apple CT measurements and apple tissue characteristics and the empirical formula measurements is measured using PCC, as shown in Table 2.
[0086] Table 2 Correlation between apple CT volume measurements, apple tissue characteristics, and empirical formula measurements
[0087] The results show that these four variables are highly correlated with the CT measurement values of apple damage volume. Therefore, the experimental data obtained from the pendulum impact experiment and the biological tissue characteristics of apples can be used to predict the CT measurement values of apple damage volume through the optimization model.
[0088] The following model is used to predict the CT value of apple damage volume using the empirical formula measurement value of apple damage area, the elastic modulus of the flesh and peel, and the soluble pectin content in the flesh and peel as input variables, and the CT value of apple damage volume as output. The specific steps are as follows:
[0089] (1) Data preprocessing
[0090] The 160 sets of data were grouped, 85% were divided into training sets and 15% were used as test sets. The data were normalized and scaled to [0, 1] to effectively eliminate the impact of the dimensions and value ranges between the data.
[0091] (2) Parameter selection and optimization
[0092] Based on the above data set division method, three groups of support vector machine prediction models were established, namely the polynomial kernel function (Poly-SVR), the radial basis kernel function (Rbf-SVR), and the PCA-based RBF kernel function SVR (PCA-RSVR). The PCA algorithm was set with a contribution rate of 95%. Each model adopted 10-fold cross-validation, and the hyperparameters of the nonlinear kernel function were all set to the default values (the linear kernel function had no hyperparameters). The performance indicators of the test set (as shown in Table 4) were used to preliminarily evaluate the better model.
[0093] Table 3. Comparison results of training set errors
[0094] Table 4. Comparison results of test set errors
[0095] As shown in Table 4 above, the MAE, MSE, RMSE, and MAPE of the PCA-RSVR model in the test set are smaller than those of the Poly-SVR model and the Rbf-SVR model, and the fit R 2 The MAE values of the PCA-RSVR model were lower by 20.865 and 2.866 respectively compared with the other two models, the RMSE values were lowered by 30.445 and 4.935 respectively, and the MAPE values were lowered by 10.197% and 3.077% respectively. The fitting values R 2 The values of 0.613, 0.823, and 0.914 are respectively. It can be concluded that when processing the sample data of this experiment, the SVR model using the nonlinear kernel function outperforms the linear kernel function in terms of both the training set fitting accuracy and the generalization performance of the test set. At the same time, the PCA-RSVR model has further improved the performance of the Rbf-SVR model. Therefore, after evaluation and comparison, the PCA-RSVR model was selected as the optimal model.
[0096] In order to further optimize the hyperparameters of the model, the kernel function parameters c and g (c is the penalty coefficient, g is the RBF kernel function coefficient) with the best performance on the validation set were determined. The “grid search method” was used to further optimize the hyperparameters of the PCA-RSVR model. The mean square error of 10 cross-validations (CVmse) was used as the basis for hyperparameter selection to determine the optimal hyperparameters of the model. The model was then assigned to retrain the final model, and its generalization performance was evaluated using the test set. As shown in Figure 12, the training set was divided into ten-fold cross-validation to select the parameters c and g in the RBF kernel function. The range of parameters c and g was set to [2 -5 -2 5 ], with a step size of 0.01. Finally, the optimal parameters obtained after calculation are (c, g) = (32, 22.6274). The performance parameters of the PCA-RSVR model test set after the optimization are shown in Table 5 below.
[0097] Table 5 Comparison results of test set error of optimized PCA-RSVR model
[0098] The performance of the PCA-RSVR model after optimizing the parameters is further improved compared with the initial model with default parameters. The evaluation indicators are further improved, including MAE, MSE, RMSE, MAPE and R 2 The values are 5.3357, 50.1179, 7.0794, 4.49%, and 0.9782, respectively. Figure 13 shows the frequency distribution histogram of the training set and test set errors in each interval. Analysis shows that after PCA dimensionality reduction, the errors of the model's training set and test set have a more "bell-shaped" distribution, indicating that the model's errors are concentrated near zero error and have good prediction accuracy for most samples.
[0099] The present invention uses an agricultural material collision characteristics test bench to perform impact tests on apples, photographs the surface with a CCD digital camera, and calculates the area of the damaged area. Computed tomography (Micro-CT) is then used to accurately calculate the damaged area of the apples. The elastic modulus (MPa) of the apple peel and flesh, as well as the soluble pectin content (%) of the peel, are measured. A PCA-RSVR (Support Vector Machine) model based on principal component analysis (PCA) is used to predict the CT-calculated value of the apple damage volume, achieving accurate characterization of the apple damage volume.
[0100] The present invention belongs to the field of designing methods for measuring the area of apple damage and predicting the volume of apple crop damage. The method comprises the following steps: performing an impact test on an apple sample using an agricultural material collision mechanics test bench; placing the damaged apple area under a CCD digital camera to take a photo, which is automatically saved to a PC; automatically measuring the minor axis and major axis (ω1, ω2) of the impact area; and calculating the area S of the damaged apple area using an empirical formula. formula The apples subjected to the impact test were placed in a Micro-CT machine for 360° scanning. The CT images of the damaged area of the apples were processed and calculated using Avizo software to obtain the specific damage volume (V ct ); the apple samples from the previous step were subjected to biological property tests to determine the elastic modulus (Mpa) of the apple peel and flesh, as well as the soluble pectin content (%) of the peel; using the empirical formula measurement value of the apple damage volume, the elastic modulus of the flesh and peel, and the soluble pectin content of the peel as input variables, the SVR (support vector machine) model was used to predict the CT calculated value of the apple damage volume in order to obtain an accurate damage volume value.
[0101] It should be understood that although this specification is described according to various embodiments, not every embodiment contains only one independent technical solution. This narrative method of the specification is only for the sake of 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.
[0102] The series of detailed descriptions listed above are only specific descriptions of feasible embodiments of the present invention. They are not intended to limit the scope of protection of the present invention. Any equivalent embodiments or changes that do not deviate from the technical spirit of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for predicting apple damage volume processing, characterized in that: The following steps are involved: Step S1: performing an impact test on the apple sample; Step S2: Place the damaged area of the apple on an image acquisition device to take a photo, obtain the image of the damaged area of the apple and save it to the PC. The PC measures the short axis ω1 and the long axis ω2 of the damaged area of the apple, and calculates the area S of the damaged area of the apple by an empirical formula. formula ; Step S3: Place the apple subjected to the impact test into a Micro-CT machine for 360° scanning to obtain a CT image of the damaged area of the apple. The CT image of the damaged area of the apple is processed and calculated by software to obtain the specific damage volume V of the damaged area of the apple. ct ; Step S4: performing biological property testing on the apple sample to determine the elastic modulus of the apple peel and pulp and the soluble pectin content of the peel; Step S5: Using the empirical formula measurement value of the apple damage area, the elastic modulus of the flesh and peel, and the soluble pectin content of the peel as input variables, the CT calculation value V of the apple damage volume ct As the output, modeling is performed to 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, determine the optimal hyperparameters of the model, and assign them to the PCA-RSVR model obtained in step S5 to retrain the final model; Step S7: Input the apple damaged area image into the final model obtained in step S6 to obtain the predicted value of the apple damaged volume.
2. The method for predicting apple damage volume processing according to claim 1, characterized in that: In the step S1, an impact test is performed on the apple sample using an agricultural material collision mechanics test bench.
3. The method for predicting apple damage volume processing according to claim 1, characterized in that: The image acquisition device in step S2 is a CCD digital camera.
4. The method for predicting apple damage volume processing according to claim 1, characterized in that: The apple damaged area S in step S2 formula The empirical calculation formula is:
5. The apple damage volume processing prediction method according to claim 1, characterized in that: In step S3, the CT image of the damaged area of the apple is processed and calculated using the Avizo software, including the following steps: Step S1), the scanned apple is divided into multiple layers of original slices and imported into Avizo software, the voxel size is set, and the median method is used for noise reduction; Step S2), performing threshold segmentation on each slice image processed in step S1), separating the apple tissue from the damaged area, setting the pixel value of the apple tissue to 1, and the pixel value of the hollow area of the damaged area to 0; Step S3), using the Fill holes tool in the Avizo software to fill the hole areas in the apple slice image based on the boundary detection algorithm, displaying the overall outline of the apple, and setting the pixel value of the overall outline to 0; Step S4), using the Arithmetic tool to perform a logical operation on the pixel values of the two slice images in step S2) and step S3), setting the pixel value of the damaged area to 0 and the pixel value of the overall contour to 0, and finally calculating the hollow area of the damaged area of the apple; Step S5), using the Remove small spots tool to remove the small pixels in step S4), i.e., the pores inside the apple, and finally obtaining a complete apple damaged area; Step S6), use the Label Analysis tool to count the complete apple damage area obtained in step S5). The calculation formula is: number of voxels × voxel size, and weighted sum calculation is performed on each slice with the damaged area, and finally the volume size V of the entire damaged area can be obtained. ct .
6. The apple damage volume processing prediction method according to claim 1, characterized in that: The elastic modulus of apple peel and pulp was determined by universal testing machine, and the soluble pectin content of peel was measured by ultraviolet spectrophotometry.
7. The apple damage volume processing prediction method according to claim 1, characterized in that: In the step S5, the contribution rate of the PCA algorithm is set, the radial basis kernel function RBF is selected as the kernel function of the SVR model, and the "grid search method" is used to further optimize the hyperparameters of the PCA-RSVR model. The average mean square error CVmse of multiple cross-validation is used as the basis for hyperparameter selection to determine the optimal hyperparameters of the model, and the model is assigned to retrain the final model, and its generalization performance is evaluated with a test set. After calculation, the optimal parameters are c and g, where c is the penalty coefficient and g is the RBF kernel function coefficient.
8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the apple damage volume processing prediction method described in any one of claims 1 to 7 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the apple damage volume processing prediction method described in any one of claims 1 to 7 are implemented.
10. A processor, characterized in that: The processor is used to run a program, wherein the program, when running, executes the apple damage volume processing prediction method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Online nondestructive testing method for internal and external quality of apples
CN111076670A
Hyperspectral nondestructive prediction method for apple impact damage area
CN111289463A
Fruit defect nondestructive testing method based on neural network and fruit grading method
CN112697984A
Navel orange damage detection method
CN114565574A
Apple damage volume prediction method and device, storage medium and processor
CN116958234A
Cited By
High-throughput measurement method for transverse diameter and longitudinal diameter of pineapple fruit based on image processing
CN120538385A