ICLEMAS 2025 · 11th International Azerbaijan Congress on Life, Engineering, Mathematical, and Applied Sciences

Comparison of the Performance of ResNet-50 and ShuffleNet Deep Learning Algorithms in Classification of Hazelnut Fruit

Fındık Meyvesinin Sınıflandırılmasında ResNet-50 ve ShuffleNet Derin Öğrenme Algoritmalarının Performansının Karşılaştırılması
Özgür Tomak · Mehmet Cem Dikbaş · Sercan Külcü
Computer Engineering and Electrical and Electronics Engineering, Giresun University, Türkiye
Why sort hazelnuts?Related workDatasetResNet-50 ShuffleNetTrainingResultsConfusion matrices
Paper (PDF) · Use ← → or Space to navigate, F for full screen

Summary

At a Glance

A deep, heavy network against a small, mobile one on the same hazelnut photos: ResNet-50 is marginally more accurate, but ShuffleNet is recommended because it is faster and the gap is tiny.

ResNet-50 test accuracy99.97%3 errors of 11,039
ShuffleNet test accuracy99.94%7 errors of 11,039
Images15,7701,577 hazelnuts × 10 views
Classes3good · bad · inner
ResNet-50

177 layers in MATLAB, residual connections, ImageNet-pretrained.

ShuffleNet

Group convolutions and channel shuffle for devices with little computing power.

Recommendation

For real-time sorting, speed matters and the accuracies are close: choose ShuffleNet.

Introduction

Why Sort Hazelnuts Automatically?

  • Before storage, bad nuts and inner nuts must be separated: bad nuts lower the yield, inner nuts can spoil in storage.
  • AI can sort nuts from images by quality, size and colour, faster and more accurately than manual sorting.
  • A CNN pipeline: build a dataset, clean and normalize it, resize the images, split into training and test sets, train, then measure performance on new data.
Research question

Does a large network beat a lightweight one enough to justify its cost on this task?

Introduction · Related Work · Interactive

Earlier Hazelnut Classifiers

Results as reported by each study; tasks and data differ. Click a column header to sort.

StudyTaskFeatures / methodReported result
Bayrakdar et al., 20153 types (Tombul, Sivri, Badem)diameter, radius, area84% accuracy
Koç et al., 20203 cultivars, in shellrandom forest (bagging) / DL4J83% / 71% accuracy
Keleş and Taner, 202111 varietiesphysical, mechanical and optical features; discriminant analysis / ANNup to 92.7% / 92.7%
This studygood, bad, innerResNet-50 and ShuffleNet on photos99.97% / 99.94% test accuracy

Materials and Method · Dataset · Fig. 2

The Hazelnut Dataset

MATLAB view of the dataset: images per class and random sample photos Sample inner hazelnut photos on the capture platform

Fig. 2: class counts and sample images (dataset by Güneş, 2022)

  • Rear phone camera, 12 MP; photos at 3024×3024 on a platform, one nut per image.
  • Expert labels: 519 bad, 535 good, 523 inner hazelnuts.
  • 10 photos per nut from different angles: 15,770 images.
  • Cropped to 1000×1000, then resized to 224×224, the input size of both networks.

Materials and Method · ResNet-50 · Fig. 1

ResNet-50: Learning the Residual

Residual block: two weight layers F(x) plus the identity shortcut x
Fig. 1: residual block, H(x) = F(x) + x (labels in Turkish: weight layer, residual connection)
  • The block's input skips the convolutions and is added to their output: H(x) = F(x) + x.
  • Layers only learn the change F(x); gradients flow through the shortcut, so very deep networks train well.
  • Batch normalization after each convolution; global average pooling before the fully connected layer.
  • Pretrained on over a million ImageNet images in 1,000 categories; won ILSVRC 2015.
  • In MATLAB: 177 layers for the 50-layer network; input 224×224.

Materials and Method · ShuffleNet · Interactive

ShuffleNet: Cheap Convolutions That Still Mix

Groups
Channels / group

  • Pointwise group convolution cuts the cost of 1×1 convolutions.
  • Channel shuffle lets the groups exchange information.
  • Cheaper layers allow wider feature maps, which small networks need.

Diagram of the shuffle operation (Zhang et al., 2018), not the trained network.

Findings and Discussion · Figs. 3–4 · Interactive

Training Runs in MATLAB

MATLAB training progress of ResNet-50

  • MATLAB, data shuffled, split stated as 30% training and 70% test.
  • Two epochs; both networks pass 95% accuracy early in the first epoch and the loss falls close to zero.

Findings and Discussion · Results

Accuracy and Errors

Lighter bars: training accuracy; darker bars: test accuracy. Red dots: misclassified images in each confusion matrix (11,039 images). The axis starts at 99.7%.

ResNet-50 makes 3 errors, ShuffleNet 7: a difference of 0.03 percentage points.

Findings and Discussion · Figs. 5–6 · Interactive

Confusion Matrix Explorer

Counts from the paper's matrices; metrics on this slide are computed from them for the chosen class against the other two.

Conclusions and Recommendations

Which Network on the Sorting Line?

ResNet-50

  • slightly better: 99.97% test accuracy, 3 errors
  • reported specificity 1 and F1 0.9999
  • deep and heavy: more computation per image

ShuffleNet

  • 99.94% test accuracy, 7 errors
  • observed to run faster on this dataset
  • designed for devices with limited computing power
Because real-time sorting needs fast results and the accuracies are almost equal, the paper recommends ShuffleNet.

Conclusions

Check Questions

  1. What does the shortcut in a residual block add, and why does it help deep networks?
  2. What does ShuffleNet's channel shuffle do?
  3. How many images did each network misclassify, and which pair of classes causes most errors?
  4. Why can a slightly less accurate model be the better choice?
  5. What would make the speed argument stronger?
Show answers
  1. It adds the input x to the block output; gradients pass through it, so deep networks train well.
  2. It interleaves channels after a group convolution so that the groups exchange information.
  3. ResNet-50 3, ShuffleNet 7 of 11,039; most errors are between inner and good nuts.
  4. On a real-time line, speed and hardware cost matter, and the accuracy gap here is only 0.03 points.
  5. Measured inference times and model sizes on the target hardware.

References

Selected References

  • He, K., Zhang, X., Ren, S., Sun, J. (2016). Deep residual learning for image recognition. CVPR, 770–778.
  • Zhang, X., Zhou, X., Lin, M., Sun, J. (2018). ShuffleNet: An extremely efficient convolutional neural network for mobile devices. CVPR, 6848–6856.
  • Güneş, E. (2022). Hazelnuts. Mendeley Data, V2. doi:10.17632/dvvx6kst3f.2
  • Bayrakdar, S. et al. (2015). Determination of type and quality of hazelnut using image processing techniques. SIU 2015, 616–619.
  • Keleş, O., Taner, A. (2021). Classification of hazelnut varieties by using artificial neural network and discriminant analysis. Span. J. Agric. Res., 19(4), e0211.

See the full paper for the complete reference list. Figures on these slides are from the paper.

Thank You

Comparison of the Performance of ResNet-50 and ShuffleNet in Classification of Hazelnut Fruit
How to cite: Tomak, Ö., Dikbaş, M. C., & Külcü, S. (2025). Comparison of the Performance of ResNet-50 and ShuffleNet Deep Learning Algorithms in Classification of Hazelnut Fruit. In 11th International Azerbaijan Congress on Life, Engineering, Mathematical, and Applied Sciences, Congress Proceedings Book, Vol. I, pp. 55–63. BZT Turan Publishing House.
Companion study: optimizer selection for ShuffleNet · All publications
1 / 1