# Automatic System for the Detection of Defects on Olive Fruits in an Oil Mill
## 4 Conclusions  
This paper was concerned with the automated detection of defects on olive fruits for the production of VOO. The early detection of fruits affected by plagues or hail is of great interest, since even a small amount of them may significantly impact the final quality of the produced VOO. As most of these defects are not perceptible in the visible band, this work has proposed a non-invasive industrial monitorization system based on an infrared camera. The image acquisition system was placed over the conveyor belt after the cleaning process and without interfering the regular productive process of the mill. Although images were acquired under controlled conditions, they were not free from glows or shadows due to fruits overlap. To extract information from these type of images, a two stages image processing algorithm was designed. First, olives were segmented from the conveyor belt by an iterative application of the active contour technique assisted with mathematical morphology operations. Second, the detection of defect was performed individually evaluating each of the segmented regions extracted from the previous stage. The proposal was validated by comparison between the automated and manual inspections, considered as ground-truth. In the course of more than a fortnight of January 2021, a total of 5 images per day were manually inspected and then compared with the automated inspections. Two rates were computed for this comparison: the detection rate, obtained from the True Positive Rate (TPR), and the olives wrongly classified estimated by the False Positive Rate (FPR). The results underscore the robustness and accuracy of the algorithm as they are in line with what it is demanded in industry. Because of this, the presented solution comprises a promising starting point to inspect most of the incoming fruits without interfering with the normal daily oil mill functioning. It represents a considerable improvement to the current inspection process, which is based on a sampling scheme carried out by the oil mill expert. The image acquisition time of 10 s was chosen to reduce the number of files and allow to have a more representative sample of olives for the same number of images. However, both the camera and the stroboscopic halogen used allow to significantly increase the capture rate, allowing to practically constantly capture images of the olives being processed on the factory. On the other hand, the average image processing time of 100 s per image is currently too high for making decisions in real time. This computation time, however, allows to perform a quality assurance process on the olive batches, enabling the detection of faulty batches and carrying out the subsequent actions regarding the remuneration of the farmer. Further research effort will be devoted to optimizing the implementation of the different steps in order to reduce this computation time, as well as exploring the enhancement of the olive segmentation step with the application of deep learning methods instead of traditional image processing algorithms. In addition, it is expected to increase the number of image acquisitions as the industrial monitorization system will be installed during the whole next season. Conceptualization, P.C.M., S.S.M., J.G.O. and J.G.G. ; formal analysis, P.C.M. and S.S.M. ; funding acquisition, J.G.O. and J.G.G. ; investigation, P.C.M. and S.S.M. ; writing--original draft, P.C.M. and S.S.M. ; writing--review and editing, P.C.M., S.S.M., J.G.O. and J.G.G. All authors have read and agreed to the published version of the manuscript. This research was partially funded by the Spanish Ministry of Science and Innovation under the project PID2019-110291 RB-I00. Not applicable. The data presented in this study are available on request from the corresponding author. The data are not publicly available due to confidenciality agreements with Almazara San Pedro. **Acknowledgments:** The authors would like to thank Almazara San Pedro, S.L. for their collaboration in this work.