In view of the problem of low accuracy in walnut mass detection caused by relatively inconstant density, this study suggested the integration of X‐ray imaging technology and image processing technology with machine learning for walnut mass detection. Using image processing technology to remove the background of walnut X‐ray image and to segment the kernels, the mass prediction models could be constructed after extracting the shape and texture of walnut characteristic parameters and the kernel shape characteristic parameters. The results revealed that when mass prediction models were built based on walnut shape characteristic parameters or constructed with the application of texture characteristic parameters, the determination coefficient (R2) were rather low, even the residual predictive deviation (RPD) less than 1.4, proving that these models were not reliable. However, when mass prediction models were built based on walnut and kernel shape characteristic parameters, the R2 for both partial least squares (PLS) and radial basis function (RBF) models were higher than 0.84. And the RPD values were 1.8133 and 1.7474, respectively. On this basis, when competitive adaptive reweighed sampling (CARS) optimized parameters were adopted, the R2 for both PLS and RBF models were higher than 0.86 and the RPD were 1.8759 and 1.8850, respectively. The result proved that the application of walnut and kernel shape characteristics can improve the accuracy of model prediction. Therefore, using X‐ray imaging technology to detect walnut mass was feasible, which could realized the prompt, accurate and nondestructive detection of walnut mass. This technology provided a novel thought for the accurate grading of walnuts.
Practical Applications
At present, there is a problem of similar size but large mass difference after walnut size classification, which directly affects the commodity value of walnuts. It is necessary to combine multiple characteristics to select and classify walnuts. Mass is an important grading index. With the development of machine vision technology, online detection of fruit mass has been realized. However, due to the relatively inconstant density of walnuts and the limitation of the technology, the machine vision technique cannot obtain internal information. This study used X‐ray transmission to obtain the internal information of walnuts without destroying the walnuts. At the same time, the mass detection models were established by combining the internal and external characteristics of the walnuts to achieve fast, accurate, and nondestructive testing of walnut mass. Automatic mass detection provides technical support for intelligent grading, which has important production significance and economic value for the development of the walnut industry.