Next Article in Journal
The Effects of Biostimulant Application on Growth Parameters of Lettuce Plants Grown under Deficit Irrigation Conditions
Previous Article in Journal
Preliminary Assessment of Foraging Behavior of Bombus haemorrhoidalis Smith in Doon Valley, Uttarakhand, India
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Proceeding Paper

Distinguishing Pickled and Fresh Cucumber Slices Using Digital Image Processing and Machine Learning †

1
Fruit and Vegetable Storage and Processing Department, The National Institute of Horticultural Research, Konstytucji 3 Maja 1/3, 96-100 Skierniewice, Poland
2
Department of Electrical and Electronics Engineering, Karamanoglu Mehmetbey University, Karaman 70100, Turkey
*
Author to whom correspondence should be addressed.
Presented at the 1st International Electronic Conference on Horticulturae, 16–30 April 2022; Available online: https://sciforum.net/event/IECHo2022.
Biol. Life Sci. Forum 2022, 16(1), 1; https://doi.org/10.3390/IECHo2022-12477
Published: 15 April 2022
(This article belongs to the Proceedings of The 1st International Electronic Conference on Horticulturae)

Abstract

:
In the case of cucumber, postharvest challenges may focus on preserving the high quality and extending the shelf-life of the fruit. Digital image analysis provides objective information about the quality of food products and the changes in their properties as a result of postharvest processing. This study aimed to develop discriminative models for distinguishing the pickled and fresh cucumbers based on the texture parameters of slice images. The textures were extracted from slice images that were converted to individual color channels, L, a, b, R, G, B, X, Y, and Z. The obtained results prove the effects of the preservation on the image features of the cucumber flesh. Including selected textures in the discriminative models allowed for the complete differentiation of the preserved and fresh samples. The application of digital image processing enabled the evaluation of changes in the flesh of cucumber subjected to postharvest preservation.

1. Introduction

Cucumber (Cucumis sativus L.) belongs to the Cucurbitaceae family. It is a warm season crop with a geographical distribution and growing season restricted to ambient temperature [1]. Cucumber is an important fresh consumption crop worldwide and is often grown in greenhouses and open fields. It is characterized by rapid growth and early maturity. Cucumber is a rich source of protein, carbohydrates, riboflavin, thiamin, niacin, vitamins, and minerals. Cucumber is high in water content (90–95%) and low in calories (12–15 kcal per 100 g fresh weight). It has a favorable flavor and texture, as well as medicinal values, including antioxidant ability, antimicrobial activity, and the ability to lower glycemic levels. Eating cucumber may be beneficial in improving immunity, boosting the metabolism, and reducing the risks of cancers [2,3,4]. Therefore, it is often eaten both fresh, e.g., in salads, and processed or preserved, e.g., as pickles. Cucumber may be also consumed cooked [2,4]. The purpose of cucumber processing is to preserve the fruit with minimal damage. In the case of pickled cucumbers, the sensory acceptability depends on the firmness and crunchiness, which are important to consumer preferences [5]. The cucumber processing can vary according to the type of vinegar, salt content, pH value, stabilizing additives, heat treatment optimization during pasteurization, or storage temperature implemented [5]. Pickled cucumbers may be produced by direct acidification, involving the brining of fresh cucumbers in water with acetic acid and salt, followed by their pasteurization. In contrast, the use of a mildly acidic salt solution for brining fresh cucumbers results in fermentation by naturally occurring lactic acid bacteria [6]. Pickling can improve the quality, affect the organoleptic properties, and generally enhance the palatability of cucumber [7]. It also preserves the fruit against microbial spoilage and prolongs the shelf life of the preserved food [7]. The pickled products can be considered as dietary sources of health-promoting components that are characterized by their potential for improving both physical and mental wellness [8].
Image processing may be very useful in the evaluation of the quality of fruit and vegetables. Machine learning algorithms can be helpful for grading and sorting fruit and vegetables based on quality-related features, such as texture, color, shape, size, or the presence of defects and diseases. These characteristics can have an impact on the market value of the foods and on consumer choices. Image processing can ensure objective, cost-effective, fast, and authentic examination. By contrast, such research, when performed by a human, may be subjective, time-consuming, and influenced by the researcher’s surroundings [9,10]. It was found that image analysis can be used for monitoring the processing and preservation of food samples, including fermentation [11,12,13,14].
The objective of this study was to distinguish the pickled and fresh cucumbers based on the texture parameters of slice images. The discriminative models were built using different algorithms. Thus, the effects of the preservation on the properties of the cucumber flesh were evaluated using image processing and machine learning.

2. Materials and Methods

The research material consisted of cucumbers collected from a garden in central Poland. The fruit samples were cleaned and washed. Fresh cucumbers were subjected to imaging immediately after harvest. The second half of the material was pickled with the use of boiling potable water, white vinegar, sugar, salt, mustard seeds, allspice, bay leaves, dill, and garlic, and stored in one-liter glass jars for six months at a temperature of 11 ± 1 °C.
Before the image acquisition, the fresh cucumbers were sliced after harvest and the pickled cucumbers were sliced after storage. The images of 100 slices of pickled and 100 slices of fresh cucumbers were obtained using a digital camera. The sample images are presented in Figure 1. MaZda software (Łódź University of Technology, Institute of Electronics, Poland) was used for the image processing [15]. The slice images were processed in order to convert to them individual color channels, L, a, b, R, G, B, X, Y, and Z, and to compute the image textures.
The discrimination analysis was carried out using the WEKA application (Machine Learning Group, University of Waikato) [16,17,18]. To distinguish the pickled and fresh cucumbers based on their texture parameters, models developed using the selected algorithms from the Bayes, Functions, Lazy, Trees, Meta, and Rules groups were used. The textures with the highest discriminative power were selected using the best-first algorithm. The discrimination was performed using a test mode of 10-fold cross-validations [18]. The results were evaluated based on the accuracies of the classes of the pickled cucumber and fresh cucumber, including the overall accuracy and the values of the F1-score, and the precision and recall scores. A set of selected textures and algorithms providing the highest results were chosen to be presented in this paper.

3. Results and Discussion

The highest discrimination accuracies and other metrics were obtained using the models that were based on a set of textures selected from the color channel L. The Naive Bayes (Bayes), Multilayer Perceptron (Functions), KStar (Lazy), LMT (Trees), Logit Boost (Meta), and PART (Rules) proved to be the best algorithms. This was confirmed by the values of the F1-score, precision score, recall score, and the overall accuracy, as presented in Table 1, and the discrimination accuracies of the pickled and fresh cucumber slice images, as shown in Figure 2. The overall accuracy and the accuracies of discrimination of both the pickled and fresh cucumber samples reached 100% in the case of the model developed using the Multilayer Perceptron algorithm. The values of F1-score, precision score, and recall score were equal to 1.000 for both the pickled and fresh cucumber classes. The images of the pickled and fresh cucumber slices were completely discriminated. Very high results were also observed for the KStar and LMT algorithms. Both algorithms provided an overall accuracy equal to 99.5%. In the case of KStar, only one slice belonging to the pickled cucumber class was classified incorrectly as fresh cucumber, and all one hundred slices of fresh cucumber were correctly classified as fresh cucumber. In contrast, the LMT algorithm incorrectly classified only one slice of fresh cucumber as pickled cucumber, and all slices belonging to the pickled cucumber class were included in the class of pickled cucumber. A slightly lower overall accuracy of 99% was obtained using the Naive Bayes and Logit Boost algorithms. However, in the case of Naive Bayes, all pickled cucumber slices were correctly classified. A very satisfactory overall accuracy of discrimination was also determined for the model built using the PART algorithm, even though neither the fresh nor pickled cucumber slices were classified correctly in 100% of cases. The overall accuracy reached 98.5%. In the available literature, there are reports on the application of image analysis for the quality evaluation of preserved fruit and vegetables, including pickles [19,20] and lacto-fermented beetroot [21,22]. The results of our research confirmed the usefulness of image processing in the evaluation of preserved products.

4. Conclusions

The obtained results proved the usefulness of the models based on the selected texture parameters of slice images, which were built using machine learning algorithms for the successful discrimination of pickled and fresh cucumbers. It also confirmed that the pickling which affects the cucumber flesh is reflected in the differentiation of the image textures. The pickled and fresh cucumber slices were discriminated with an overall accuracy reaching 100% for the model built using a set of image textures selected from color channel L in the case of the Multilayer Perceptron algorithm. The effectiveness of the features obtained using image processing may be tested in future research for the identification of other methods or techniques of cucumber preservation. The procedure can also be used for other fruit and vegetables.

Author Contributions

Conceptualization, E.R.; methodology, E.R.; software, E.R.; validation, E.R.; formal analysis, E.R.; investigation, E.R.; resources, E.R.; data curation, E.R.; writing—original draft preparation, E.R., K.S. and M.F.A.; writing—review and editing, E.R., K.S. and M.F.A.; visualization, E.R.; supervision, E.R. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data presented in this study are available on request from the corresponding author.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Ashrostaghi, T.; Aliniaeifard, S.; Shomali, A.; Azizinia, S.; Abbasi Koohpalekani, J.; Moosavi-Nezhad, M.; Gruda, N.S. Light Intensity: The Role Player in Cucumber Response to Cold Stress. Agronomy 2022, 12, 201. [Google Scholar] [CrossRef]
  2. Sallam, B.N.; Lu, T.; Yu, H.; Li, Q.; Sarfraz, Z.; Iqbal, M.S.; Khan, S.; Wang, H.; Liu, P.; Jiang, W. Productivity Enhancement of Cucumber (Cucumis sativus L.) through Optimized Use of Poultry Manure and Mineral Fertilizers under Greenhouse Cultivation. Horticulturae 2021, 7, 256. [Google Scholar] [CrossRef]
  3. Mostafa, Y.S.; Hashem, M.; Alshehri, A.M.; Alamri, S.; Eid, E.M.; Ziedan, E.-S.H.; Alrumman, S.A. Effective Management of Cucumber Powdery Mildew with Essential Oils. Agriculture 2021, 11, 1177. [Google Scholar] [CrossRef]
  4. Obel, H.O.; Cheng, C.; Tian, Z.; Li, J.; Lou, Q.; Yu, X.; Wang, Y.; Ogweno, J.O.; Chen, J. Molecular Research Progress on Xishuangbanna Cucumber (Cucumis sativus L. var. Xishuangbannesis Qi et Yuan): Current Status and Future Prospects. Agronomy 2022, 12, 300. [Google Scholar] [CrossRef]
  5. Kersten, A.-K.; Scharf, S.; Bandte, M.; Martin, P.; Meurer, P.; Lentzsch, P.; Büttner, C. Softening of Processed Plant Virus Infected Cucumis sativus L. Fruits. Agronomy 2021, 11, 1451. [Google Scholar] [CrossRef]
  6. Moore, J.F.; DuVivier, R.; Johanningsmeier, S.D. Changes in the free amino acid profile of pickling cucumber during lactic acid fermentation. J. Food Sci. 2022, 87, 599–611. [Google Scholar] [CrossRef] [PubMed]
  7. Dupas de Matos, A.; Marangon, M.; Magli, M.; Cianciabella, M.; Predieri, S.; Curioni, A.; Vincenzia, S. Sensory characterization of cucumbers pickled with verjuice as novel acidifying agent. Food Chem. 2019, 286, 78–86. [Google Scholar] [CrossRef] [PubMed]
  8. Moore, J.F.; DuVivier, R.A.; Johanningsmeier, S.D. Formation of γ-aminobutyric acid (GABA) during the natural lactic acid fermentation of cucumber. J. Food Compos. Anal. 2021, 96, 103711. [Google Scholar] [CrossRef]
  9. Bhargava, A.; Bansal, A. Fruits and vegetables quality evaluation using computer vision: A review. J. King Saud Univ.-Comput. Inf. Sci. 2021, 33, 243–257. [Google Scholar] [CrossRef]
  10. Dubey, S.R.; Jalal, A.S. Application of Image Processing in Fruit and Vegetable Analysis: A Review. J. Intell. Syst. 2015, 24, 405–424. [Google Scholar] [CrossRef]
  11. Zenoozian, M.S.; Feng, H.; Razavi, S.M.A.; Shahidi, F.; Pourreza, H.R. Image analysis and dynamic modeling of thin-layer drying of osmotically dehydrated pumpkin. J. Food Process. Preserv. 2008, 32, 88–102. [Google Scholar] [CrossRef]
  12. Hernández-Carrión, M.; Hernando, I.; Sotelo-Díaz, I.; Quintanilla-Carvajal, M.X.; Quiles, A. Use of image analysis to evaluate the effect of high hydrostatic pressure and pasteurization as preservation treatments on the microstructure of red sweet pepper. Innov. Food Sci. Emerg. Technol. 2015, 27, 69–78. [Google Scholar] [CrossRef]
  13. Feng, X.M.; Olsson, J.; Swanberg, M.; Schnürer, J.; Rönnow, D. Image analysis for monitoring the barley tempeh fermentation process. J. Appl. Microbiol. 2007, 103, 1113–1121. [Google Scholar] [CrossRef] [PubMed]
  14. Verdú, S.; Barat, J.M.; Grau, R. Non destructive monitoring of the yoghurt fermentation phase by an image analysis of laser-diffraction patterns: Characterization of cow’s, goat’s and sheep’s milk. Food Chem. 2019, 274, 46–54. [Google Scholar] [CrossRef] [PubMed]
  15. Szczypinski, P.M.; Strzelecki, M.; Materka, A.; Klepaczko, A. MaZda—A software package for image texture analysis. Comput. Meth. Prog. Biomed. 2009, 94, 66–76. [Google Scholar] [CrossRef] [PubMed]
  16. Bouckaert, R.R.; Frank, E.; Hall, M.; Kirkby, R.; Reutemann, P.; Seewald, A.; Scuse, D. WEKA Manual for Version 3-9-1; The University of Waikato: Hamilton, New Zealand, 2016. [Google Scholar]
  17. Frank, E.; Hall, M.A.; Witten, I.H. The WEKA Workbench. Online Appendix for Data Mining: Practical Machine Learning Tools and Techniques, 4th ed.; Morgan Kaufmann: Burlington, MA, USA, 2016. [Google Scholar]
  18. Witten, I.H.; Frank, E. Data mining. In Practical Machine Learning Tools and Techniques, 2nd ed.; Elsevier: San Francisco, CA, USA, 2005. [Google Scholar]
  19. Ariana, D.P.; Lu, R. Hyperspectral waveband selection for internal defect detection of pickling cucumbers and whole pickles. Comput. Electron. Agric. 2010, 74, 137–144. [Google Scholar] [CrossRef]
  20. Ariana, D.P.; Lu, R. Evaluation of internal defect and surface color of whole pickles using hyperspectral imaging. J. Food Eng. 2010, 96, 583–590. [Google Scholar] [CrossRef]
  21. Ropelewska, E.; Wrzodak, A. The Use of Image Analysis and Sensory Analysis for the Evaluation of Cultivar Differentiation of Freeze-Dried and Lacto-Fermented Beetroot (Beta vulgaris L.). Food Anal. Methods 2022, 15, 1026–1041. [Google Scholar] [CrossRef]
  22. Ropelewska, E.; Wrzodak, A.; Sabanci, K.; Aslan, M.F. Effect of lacto-fermentation and freeze-drying on the quality of beetroot evaluated using machine vision and sensory analysis. Eur. Food Res. Technol. 2022, 248, 153–161. [Google Scholar] [CrossRef]
Figure 1. The slice images of the pickled and fresh cucumbers.
Figure 1. The slice images of the pickled and fresh cucumbers.
Blsf 16 00001 g001
Figure 2. Accuracies of discrimination of pickled and fresh cucumber slice images using the models developed based on textures from the color channel L with different machine learning algorithms: Naive Bayes (a), Multilayer Perceptron (b), KStar (c), LMT (d), Logit Boost (e), and PART (f).
Figure 2. Accuracies of discrimination of pickled and fresh cucumber slice images using the models developed based on textures from the color channel L with different machine learning algorithms: Naive Bayes (a), Multilayer Perceptron (b), KStar (c), LMT (d), Logit Boost (e), and PART (f).
Blsf 16 00001 g002
Table 1. The evaluation metrics of the discrimination of pickled and fresh cucumber slice images based on textures from the color channel L.
Table 1. The evaluation metrics of the discrimination of pickled and fresh cucumber slice images based on textures from the color channel L.
AlgorithmClassF1-ScorePrecisionRecallOverall Accuracy (%)
Naive Bayespickled cucumber0.9900.9801.00099
fresh cucumber0.9901.0000.980
Multilayer Perceptronpickled cucumber1.0001.0001.000100
fresh cucumber1.0001.0001.000
KStarpickled cucumber0.9951.0000.99099.5
fresh cucumber0.9950.9901.000
LMTpickled cucumber0.9950.9901.00099.5
fresh cucumber0.9951.0000.990
Logit Boostpickled cucumber0.9900.9900.99099
fresh cucumber0.9900.9900.990
PARTpickled cucumber0.9850.9900.98098.5
fresh cucumber0.9850.9800.990
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Ropelewska, E.; Sabanci, K.; Aslan, M.F. Distinguishing Pickled and Fresh Cucumber Slices Using Digital Image Processing and Machine Learning. Biol. Life Sci. Forum 2022, 16, 1. https://doi.org/10.3390/IECHo2022-12477

AMA Style

Ropelewska E, Sabanci K, Aslan MF. Distinguishing Pickled and Fresh Cucumber Slices Using Digital Image Processing and Machine Learning. Biology and Life Sciences Forum. 2022; 16(1):1. https://doi.org/10.3390/IECHo2022-12477

Chicago/Turabian Style

Ropelewska, Ewa, Kadir Sabanci, and Muhammet Fatih Aslan. 2022. "Distinguishing Pickled and Fresh Cucumber Slices Using Digital Image Processing and Machine Learning" Biology and Life Sciences Forum 16, no. 1: 1. https://doi.org/10.3390/IECHo2022-12477

Article Metrics

Back to TopTop