3.2.1. Prediction Accuracies of CNN models
The test accuracies (TA) on the classification of fruits into ‘unripe’ and ‘ideally ripe’ levels are presented in Table 2. Fine-tuned VGG-16 model trained on banana (Model-1), papaya (Model-1), mango (Mango-3) and lemon (Mango-4) datasets showed test accuracies of 66.7, 70.7, 72.3 and 79.6 respectively.
When the datasets of two fruits were combined and fine-tuned VGG-16 network was trained on the combined fruits dataset, the test accuracies increased as compared to fine-tuned VGG-16 network trained on the individual fruit dataset. When fine-tuned VGG-16 network was trained on a combined dataset of banana & papaya (Model-5); mango and banana (Model-6); and mango and papaya (Model-7), the test accuracies were 78.1, 80.1 and 83.3 respectively. Thus, in case of Model-5, TA is 78.1 which greater than 66.7 and 70.7 implying that TA is improved when fine-tuned VGG-16 is trained on a combined dataset of banana and papaya in comparison to individual datasets of banana and papaya. Similarly, in case of Model-6, TA is 80.1 which is greater than 72.3 and 66.7 implying that TA is improved when fine-tuned VGG-16 is trained on a combined dataset of mango and banana in comparison to individual datasets of mango and banana. Also, in case of Model-7, TA is 83.3 which is greater than 72.3 and 70.7 implying that TA is improved when fine-tuned VGG-16 is trained on a combined dataset of mango and papaya in comparison to individual datasets of mango and papaya.
Further, when fine-tuned VGG-16 network was first fine-tuned on the ‘Fruit-360’ dataset (‘Fruits’) and then trained on the individual or combined fruits dataset, the test accuracies improved significantly as compared to the above models. ‘Fruit-360’ dataset consists of 120 classes of fruits including banana, papaya and mango. Fine-tuned VGG-16 network first fine-tuned on ‘Fruits’ network and further fine-tuned on banana (Model-8), papaya (Model-9), mango (Model-10) and lemon (Model-11) datasets showed TAs of 83.3, 87.6, 84.6 and 86.4 respectively. As shown in Table 2, Model-8 showed TA of 83.3 which is greater than TA of 66.7 showed by Model-1. Similarly, Model-9, Model 10 and Model-11 showed PA of 87.6, 84.6 and 86.4; which is greater than TA of 70.7, 72.3 and 79.6 showed by Model-2, Model-3 and Model 4 respectively.
Table 2
Test accuracy of climacteric fruits using distinct models
Base Model
|
Trained on
|
Tested on
|
Model Name
|
Test Accuracy (TA)
|
Fine-tuned VGG-16
|
Banana
|
Banana
|
Model-1
|
66.7
|
Fine-tuned VGG-16
|
Papaya
|
Papaya
|
Model-2
|
70.7
|
Fine-tuned VGG-16
|
Mango
|
Mango
|
Model-3
|
72.3
|
Fine-tuned VGG-16
|
Lemon
|
Lemon
|
Model-4
|
79.6
|
Fine-tuned VGG-16
|
Banana & Papaya
|
Banana & Papaya
|
Model-5
|
78.1
|
Fine-tuned VGG-16
|
Mango & Banana
|
Mango & Banana
|
Model-6
|
80.2
|
Fine-tuned VGG-16
|
Mango & Papaya
|
Mango & Papaya
|
Model-7
|
83.3
|
Fine-tuned VGG-16 further fine-tune on ‘Fruits 360’ dataset
|
Banana
|
Banana
|
Model-8
|
83.3
|
Fine-tuned VGG-16 further fine-tune on ‘Fruits 360’ dataset
|
Papaya
|
Papaya
|
Model-9
|
87.6
|
Fine-tuned VGG-16 further fine-tune on ‘Fruits 360’ dataset
|
Mango
|
Mango
|
Model-10
|
84.6
|
Fine-tuned VGG-16 further fine-tune on ‘Fruits 360’ dataset
|
Lemon
|
Lemon
|
Model-11
|
86.4
|
Fine-tuned VGG-16 further fine-tune on ‘Fruits 360’ dataset
|
Banana & Papaya
|
Banana & Papaya
|
Model-12
|
87.5
|
Fine-tuned VGG-16 further fine-tune on ‘Fruits 360’ dataset
|
Mango & Banana
|
Mango & Banana
|
Model-13
|
88.2
|
Fine-tuned VGG-16 further fine-tune on ‘Fruits 360’ dataset
|
Mango & Papaya
|
Mango & Papaya
|
Model-14
|
89.9
|
When fine-tuned VGG-16 network was first fine-tuned on ‘Fruits’ network and further fine-tuned on the combined fruits dataset, there were significant improvements on the TAs in comparison to all the other models. Fine-tuned VGG-16 network first fine-tuned on ‘Fruits’ network and further fine-tuned on combined datasets of banana & papaya (Model-12); mango and banana (Model-13); and mango and papaya (Model-14), the test accuracies were 87.5, 88.2 and 89.9 respectively. As shown in Table 2, Model-12 showed TA of 87.5 which is greater than TA of 66.7, 70.7 and 78.1 showed by Model-1, Model-2 and Model-5 respectively. Similarly, Model-13, showed TA of 88.2 which is greater than TA of 72.3, 66.7 and 80.2 showed by Model-3, Model-1 and Model-6 respectively. Also, Model-14 showed TA of 89.9 which is greater than 72.3, 70.7 and 83.3 showed by Model-3, Model-2 and Model-7 respectively. Thereby, it can be concluded that fine-tuning of the VGG-16 network on the ‘Fruit-360’ dataset was significantly beneficial in improving the test accuracies on test dataset of fruits.
3.2.2. Transfer Learned Accuracies
Fine-tuned VGG-16 network trained on banana dataset (Model-1) to classify ripeness levels into ‘unripe’ and ‘ideally ripe’, was used for zero-shot transfer learning (TL) on papaya, mango and lemon without any of their data being present on the training set. Similarly, fine-tuned VGG-16 network trained on papaya (Model-2); mango (Model-3); and lemon (Model-4); datasets were used for TL on banana, mango and lemon; banana, papaya and lemon; and banana, papaya and mango respectively and the same is shown in Table 3. Model-2 and Model-3 without any image of banana showed zero-shot transfer learned accuracies of 56.9 and 63.4 on banana respectively which are comparable to the test accuracy (TA) of 66.7 obtained by training VGG-16 network on banana data (Model-1). Model-1 and Model-3 without any image of papaya showed zero-shot transfer learned accuracies of 62.6 and 65.3 on papaya respectively which are comparable to the TA of 70.7 obtained by training VGG-16 network on papaya data (Model-2). Model-1 and Model-2 without any image of mango showed zero-shot transfer learned accuracies of 66.7 and 64.8 on mango respectively which are comparable to the TA of 72.3 obtained by training VGG-16 network on mango data (Model-3). The zero-sot transfer learning was successful in case of banana, mango and papaya and this might be because of their similarity in ripening characteristics and changes of physical attributes like colour change from green to yellow and firmness change from hard to soft. This implies a successful transfer of knowledge from one climacteric fruit to another which is per the similarity of physico-chemical degradation phenomenon of climacteric fruits.
However, Model-1, Model-2 and Model-3 without any image of lemon showed zero-shot transfer learned accuracies of 10, 9.6 and 15 on lemon respectively which are very less as compared to the TA of 79.6 obtained by training VGG-16 network on lemon data (Model-4). This implies that transfer learning was not successful for the transfer of knowledge from climacteric fruits namely banana, mango and papaya to non-climacteric fruit lemon. Also, Model-4 without any image of banana, papaya and mango showed zero-shot transfer learned accuracies of 7.6, 20.6 and 14.7 on banana, papaya and mango respectively which are not comparable to the TA of 66.7, 70.7 and 72.3 obtained by training VGG-16 network on banana (Model-1), papaya (Model-2) and mango datasets (Model-3) respectively. Further, all the other models listed in Table 3 trained on ‘Fruits’ network and further fine-tuned on individual or combined dataset of climacteric fruits namely banana, mango and papaya when used for zero-shot TL on non-climacteric fruit lemon, or vice-versa, the TAs were not exemplary. This further proves that due to the dissimilarity in post-harvest degradation mechanism of climacteric and non-climacteric fruits transfer of knowledge was not successful from climacteric to non-climacteric fruits and vice-versa.
Fine-tuned VGG-16 network trained on a combined dataset of banana and papaya (Model-5) showed zero-shot transfer learned accuracy of 73.3 on mango without any data of mango being present on the training set. Similarly, Model-6 and Model-7 showed zero-shot transfer learned accuracy of 71.4 on papaya and 70.3 on banana respectively. TA of 73.3 on mango obtained from Model-5 is greater than zero-shot transfer learned accuracies of 66.7 and 64.8 on mango obtained from Model-1 and Model-2 respectively implying improvement in transfer learned test accuracy on combining the training dataset of banana and papaya. Zero-shot TL accuracy of 71.4 on papaya obtained from Model-6 is greater than zero-shot transfer learned accuracy of 62.6 and 65.3 on papaya obtained from Model-1 and Model-3 respectively. Zero-shot TL accuracy of 70.3 on banana obtained from Model-7 is greater than zero-shot transfer learned accuracy of 56.9 and 63.4 on banana obtained from Model-2 and Model-3 respectively. From these observations, it is thus implied that there is improvement in transfer learned accuracy on combining the training dataset of two climacteric fruits.
Also, Model-5 showed TL accuracies of 68.6 and 71.2 on banana and papaya test set which was greater than the TA of 66.7 and 70.7 obtained by training VGG-16 network on banana data (Model-1) and papaya data (Model-2) respectively. Similarly, Model-6 showed TL accuracies of 68.9 and 73.2 on banana and mango test set which was greater than the TA of 66.7 and 72.3 obtained by training VGG-16 network on banana data (Model-1) and mango data (Model-3) respectively. Further, Model-7 showed TL accuracies of 72.6 and 71.7 on mango and papaya test set which was greater than the TA of 72.3 and 70.7 obtained by training VGG-16 network on mango data (Model-3) and papaya data (Model-2) respectively. This further implies that combining the datasets of two climacteric fruits namely banana and papaya or mango and banana or mango and papaya helped in improving the test accuracies of individual fruits.
Fine-tuned VGG-16 network when first fine-tuned on ‘Fruits’ network and further fine-tuned on banana (Model-8) showed zero-shot transfer learned accuracies of 72.6 and 73.9 on papaya and mango respectively. Zero-shot TL accuracies of 72.6 and 73.9 obtained from Model-8 are greater than zero-shot transfer learned accuracies of 62.6 and 66.7 on papaya and mango respectively obtained from Model-1. Similarly, Model-9 showed zero-shot transfer learned accuracies of 73.7 and 76.4 on banana and mango respectively. Zero-shot TL accuracies of 73.7 and 76.4 obtained from Model-9 are greater than zero-shot transfer learned accuracies of 56.9 and 64.8 on banana and mango respectively obtained from Model-2. Further, Model-10 showed zero-shot transfer learned accuracies of 76.7 and 78.7 on banana and papaya respectively. Zero-shot TL accuracies of 76.7 and 78.7 obtained from Model-10 are greater than zero-shot transfer learned accuracies of 63.4 and 65.3 on banana and papaya respectively obtained from Model-3. All these results implied that an intermediate ‘Fruits’ network helped in the improvement of zero-shot transfer learned accuracies of climacteric fruits.
Fine-tuned VGG-16 network when first fine-tuned on ‘Fruits’ network and further fine-tuned on a combined dataset of banana and papaya (Model-12); mango and banana (Model-13); mango and papaya (Model-14) showed zero-shot transfer learned accuracies of 84.3 on mango; 81.2 on papaya and 79 on banana respectively. Zero-shot TL accuracy of 84.3 on mango obtained from Model-12 is greater than zero-shot transfer learned accuracies of 66.7, 64.8, 73.3, 73.9 and 76.4 on mango obtained from Model-1, Model-2, Model-5, Model-8 and Model-9 respectively. This implied that there is a significant improvement in transfer learned accuracy on first fine-tuning the VGG-16 model on a ‘Fruits’ network followed by fine-tuning on a combined dataset of banana and papaya. Similarly, zero-shot TL accuracy of 81.2 on papaya obtained from Model-13 is greater than zero-shot transfer learned accuracies of 62.6, 65.3, 71.4, 72.6 and 78.7 on papaya obtained from Model-1, Model-3, Model-6, Model-8 and Model-10 respectively. Further, zero-shot TL accuracy of 79 on banana obtained from Model-14 is greater than zero-shot transfer learned accuracies of 56.9, 63.4, 70.3, 73.7 and 76.7 on banana obtained from Model-2, Model-3, Model-7, Model-9 and Model-10 respectively. These results implied that there is a significant improvement in transfer learned prediction accuracy than all the above-mentioned scenarios on first fine tuning the VGG-16 model on a ‘Fruits’ network followed by fine-tuning on a combined dataset of two climacteric fruits.
Model-12 and Model-13 resulted in zero-shot TL accuracy of 85.6 and 85.2 respectively on banana test dataset which was greater than TA of 66.7 and 83.3 obtained by using Model-1 and Model-8 respectively and zero-shot TL accuracies of 56.9, 63.4, 68.6, 68.9, 70.3, 73.7 and 76.7 by using Model-2, Model-3, Model-5, Model-6, Model-7, Model-9 and Model-10 respectively on test dataset of banana, implying a significant improvement in the prediction of ripeness level of banana by fine-tuning VGG-16 network on ‘Fruits’ dataset followed by a combined dataset of two climacteric fruits namely banana and papaya; and mango and banana.
Similarly, Model-12 and Model-14 resulted in zero-shot TL accuracies of 86.1 and 86.7 respectively on papaya test dataset which were greater than TA of 70.7 and 87.6 obtained by using Model-2 and Model-9 respectively and zero-shot TL accuracies of 62.6, 65.3, 71.2, 71.4, 71.7, 72.6 and 78.7 by using Model-1, Model-3, Model-5, Model-6, Model-7, Model-8 and Model-10 respectively on test dataset of papaya implying a significant improvement in the prediction of ripeness level of papaya by fine-tuning VGG-16 network on ‘Fruits’ dataset followed by a combined dataset of two climacteric fruits namely banana and papaya; and mango and papaya.
Further, Model-13 and Model-14 resulted in zero-shot TL accuracies of 85.5 and 86.3 respectively on mango test dataset which were greater than TAs of 72.3 and 84.6 obtained by using Model-3 and Model-10 respectively and zero-shot TL accuracies of 66.7, 64.8, 73.3, 73.2, 72.6, 73.9 and 76.4 by using Model-1, Model-2, Model-5, Model-6, Model-7, Model-8 and Model-9 respectively on test dataset of mango, implying a significant improvement in the prediction of ripeness level of mango by fine-tuning VGG-16 network on ‘Fruits’ dataset followed by a combined dataset of two climacteric fruits namely mango and banana; and mango and papaya.
Table 3: Transfer Learned accuracies for different CNN networks. *The test accuracy (TA) indicates accuracies on test dataset of fruits by using the corresponding model as shown in Table 3 which is trained on the same fruits. For more details on TA Table 2 can be referred.
Model Name
|
Test Accuracy (TA)*
|
TL on Banana
|
TL on Papaya
|
TL on Mango
|
TL on Lemon
|
Model-1
|
66.7
|
-
|
62.6
|
66.7
|
10
|
Model-2
|
70.7
|
56.9
|
-
|
64.8
|
9.6
|
Model-3
|
72.3
|
63.4
|
65.3
|
-
|
15
|
Model-4
|
79.6
|
7.6
|
20.6
|
14.7
|
-
|
Model-5
|
78.1
|
68.6
|
71.2
|
73.3
|
15
|
Model-6
|
80.2
|
68.9
|
71.4
|
73.2
|
12.8
|
Model-7
|
83.3
|
70.3
|
71.7
|
72.6
|
22
|
Model-8
|
83.3
|
-
|
72.6
|
73.9
|
18
|
Model-9
|
87.6
|
73.7
|
-
|
76.4
|
16.7
|
Model-10
|
84.6
|
76.7
|
78.7
|
-
|
28.6
|
Model-11
|
86.4
|
16.8
|
31.7
|
26.5
|
-
|
Model-12
|
87.5
|
85.6
|
86.1
|
84.3
|
23.6
|
Model-13
|
88.2
|
85.2
|
81.2
|
85.5
|
20.8
|
Model-14
|
89.9
|
79
|
86.7
|
86.3
|
32.3
|
Thus, Model-12, Model-13 and Model-14 resulted in the best test accuracies for the prediction of ripeness level of climacteric fruits banana, papaya and mango. These models were further used for the prediction of ripeness levels of unknown samples of climacteric fruits namely apple, peach, pear and avocado and non-climacteric fruits namely Orange, Cherry, Litchi and Strawberry by zero-shot transfer learning technique. The Transfer Learned accuracies on these unknown samples of climacteric and non-climacteric fruits were not present in the training dataset of Model-12, Model-13 and Moel-14 and the same is presented in Table 4.
Table 4
Transfer Learned accuracies on unknown samples of climacteric and non-climacteric fruits for different CNN networks
Model Name
|
Test Accuracy (TA)
|
TL on Apple
|
TL on Peach
|
TL on Pear
|
TL on Avocado
|
TL on Orange
|
TL on Cherry
|
TL on Litchi
|
TL on Strawberry
|
Model-12
|
87.5
|
71.9
|
72.6
|
79.6
|
65.8
|
35.4
|
26.8
|
35.7
|
24.8
|
Model-13
|
88.2
|
74.6
|
70.9
|
82.4
|
56.9
|
45.9
|
35.6
|
28.6
|
27.6
|
Model-14
|
89.9
|
80.9
|
76.9
|
80.3
|
68.1
|
38.7
|
47.6
|
39.3
|
36.5
|
Model-12 resulted in zero-shot transfer learned accuracies of 71.9, 72.6, 79.6, 65.8, 35.4, 26.8, 35.7 and 24.8 on apple, peach, pear, avocado, orange, cherry, litchi and strawberry respectively. Model-13 resulted in zero-shot transfer learned accuracies of 74.6, 70.9, 82.4, 56.9, 45.9, 35.6, 28.6 and 27.6 on apple, peach, pear, avocado, orange, cherry, litchi and strawberry respectively. Model-14 resulted in zero-shot transfer learned accuracies of 80.9, 76.9, 80.3, 68.1, 38.7, 47.6, 39.3 and 36.5 on apple, peach, pear, avocado, orange, cherry, litchi and strawberry respectively. Thus, Model-12, Model-13 and Model-14 trained on climacteric fruits namely banana, papaya and mango resulted in satisfactory zero-shot transfer learned accuracies in the range of 70 to 82 for climacteric fruits.
Further, it was observed that the zero-shot transfer learned accuracy was less for avocado as compared to other climacteric fruits namely, apple, peach and pear. The reason for the same can be attributed to the fact that avocado has a complex ripening process with very less sugar content of about 0.7 g in 100 grams by weight. Model-12, Model-13 and Model-14 are trained on climacteric fruits banana, mango and papaya with high sugar content in the range of 8 gm to 14gm in 100 grams by weight [28–30]. These models when used for zero-shot transfer learning on climacteric fruits, the prediction of ripeness level was satisfactory for fruits with higher sugar content namely apple, peach and pear in the range of 10 to 13 grams in 100 grams by weight unlike avocado [28–30]. Thus, we can further conclude that these models result in better predictions for fruits with higher sugar content in comparison to fruits with lower sugar content.
However, these models trained on climacteric fruits when were used for zero-shot transfer learning on non-climacteric fruits, the test accuracies were unsatisfactory and in the range 25 to 48. The reason behind the unsatisfactory result can be attributed to the dissimilarity in the ripening pattern and visual attributes between climacteric and non-climacteric fruits [5]. This further implies that the transfer of knowledge was successful from climacteric to non-climacteric fruits but not from climacteric to non-climacteric fruits.