Enhancing Arecanut Quality Grading: A Comparison of Custom CNNs and Transfer Learning Models | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article Enhancing Arecanut Quality Grading: A Comparison of Custom CNNs and Transfer Learning Models Dhanush Ghate D, Pramukh S Hegde, Saishma H, Pallavi K N, Sudeep D Ghate This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-5841671/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract Effective grading of arecanut is essential for ensuring product quality, maximizing market competitiveness, and satisfying consumer preferences. However, traditional methods of arecanut grading are challenging due to variations in arecanut size, shape, and appearance, resulting in subjective and inconsistent evaluations. Deep learning can enhance this process by automating grading and using sophisticated algorithms to assess both visual and non-visual attributes, thereby increasing efficiency, accuracy, and consistency. This study presents two standalone CNN-based methodologies for automated arecanut quality grading, leveraging DenseNet121 and InceptionV3 with custom layers tailored for arecanut classification. A dataset of 2,000 high-resolution images, manually curated from farms and augmented for diversity, was used for training and validation. Eight CNN architectures - DenseNet121, EfficientNetB4, InceptionResNetV2, InceptionV3, MobileNetV2, ResNet50, VGG16, and VGG19 were evaluated. Experimental findings showed DenseNet121 and InceptionV3 achieved the highest accuracy (95.67%) and strong precision/recall scores (96%), making them the most promising models. Meanwhile, MobileNetV2 was identified as the fastest model in terms of classification speed; however, its relatively low accuracy limits its practical application in grading tasks. DenseNet121 and InceptionV3, while marginally slower at 0.015 and 0.011 seconds per image, respectively, offered a good balance between computational cost and elevated accuracy. DenseNet121 excels in feature reuse through its dense connectivity, reducing redundancy and improving performance on smaller datasets, while InceptionV3 utilizes multi-scale feature extraction to capture intricate patterns effectively. Both models demonstrate robustness under varying conditions, ensuring reliability in practical deployment scenarios. This study highlights the potential of CNNs to provide a reliable, and scalable solution for arecanut grading, benefiting farmers by expanding market opportunities. Artificial Intelligence and Machine Learning Arecanut Grading CNN Agriculture Deep learning Image classification Figures Figure 1 Figure 2 Figure 3 Figure 4 Figure 5 Figure 6 Figure 7 1. Introduction Arecanut ( Areca catechu L .) is a prominent palm species known for their economic significance and is predominantly cultivated in the southern parts of India (Ansari et al., 2021 ). The plant yields a fruit known as arecanut, supari, or betelnut with diverse applications, such as chewing material, medicinal purposes, and other commercial products. India, as the largest consumer and producer globally, accounts for 50% of the world's arecanut output. In 2020-21, India produced 15.59 lakh tonnes of arecanut from an area of 7.93 lakh hectares, valued approximately at 656.03 million USD with Karnataka contributing 79% of this output (Indian Council of Agricultural Research, ICAR report 2023). Grading arecanuts by quality is essential for determining market value and ensuring farmer profitability, but the process remains labor-intensive and inconsistent due to size, shape, and texture variations (Sujatha et al., 2016 ). Manual grading challenges are exacerbated by labor shortages, underscoring the need for efficient, automated solutions to enhance accuracy and reduce processing time. Recent advancements in artificial intelligence (AI) and machine learning (ML) have revolutionized agricultural operations, enabling precision crop monitoring, quality assessment, and efficient resource management. Convolutional Neural Networks (CNNs), a class of deep learning algorithms, have shown exceptional performance in agricultural classification tasks, including citrus fruit grading, seed type identification, and pest detection, achieving accuracies exceeding 90% (Huang, 2012 ; Xiao et al., 2023 ;). Despite their potential, CNNs often require large, annotated datasets for optimal performance, posing a challenge in data-scarce domains. To address this limitation, transfer learning - a technique that employs pre-trained deep learning models to perform specific tasks with limited data has emerged as a promising approach. In our earlier study, we developed a hardware device that classifies arecanuts into grades using the InceptionV3 model. The device analyzes attributes such as color, texture, and density, achieving a classification accuracy of 98.23% (Ghate et al., 2024 ). Building on this foundation, the current study focuses on improving arecanut classification accuracy by integrating advanced CNN architectures and transfer learning to address challenges such as scarcity of annotated data in agricultural settings. This study explores CNN-based models integrated with transfer learning to develop a reliable and automated arecanut grading system aimed to reduce manual effort and enhance grading accuracy in a cost-effective manner. This study aims to develop a powerful machine learning model capable of classifying arecanut into four distinct quality categories using advanced deep learning techniques. By training and evaluating eight state-of-the-art CNN architectures, including ResNet, VGG, Inception, and EfficientNet, augmented with custom dense layers for transfer learning and fine-tuned hyperparameters, the research seeks to minimize manual effort and processing time while enhancing classification accuracy. A curated dataset of 2000 labeled arecanut images ensures replicability and scalability for broader applications. This study advances prior work by leveraging CNN architectures and transfer learning to improve accuracy and scalability in multi-grade arecanut classification. The findings aim to benefit farmers by automating a traditionally labor-intensive process, improving grading consistency, and enabling equitable market opportunities. Additionally, the methodology and dataset presented here are expected to inspire further innovations in agricultural product classification, contributing to the wider adoption of machine learning in precision agriculture. 2. Related works 2.1 Traditional classification The traditional classification of arecanuts is based on manual inspection, which is a labour-intensive and error-prone technique. Farmers and traders often grade nuts based on visual features such as color, size, shape, and texture, which frequently results in errors owing to subjective interpretation (Danti and M., 2012; Huang, 2012 ). Factors like lighting, fatigue, and individual bias exacerbate the risk of misclassification, especially when nuts exhibit subtle visual differences after processing. Additionally, manual grading depends heavily on skilled personnel, making it impractical for small-scale farmers or large-scale operations (Bhat et al., 2023 ). Labor shortages and a high demand for efficiency highlight the critical need for scalable, objective solutions that provide consistent, accurate grading while lowering costs and reliance on manual labor. 2.2 Machine learning-based classification Advancements in machine learning (ML) have significantly enhanced the automation of arecanut classification, overcoming many limitations of traditional methods. Studies employing techniques such as texture extraction, feature-based analysis, and deep learning have shown promising results. Recent ML studies and deep learning approaches have relied on extracting features like color, texture, and geometry to improve the accuracy and efficiency of arecanut grading. For instance, Shedthi et al. ( 2023 ) used Grey Level Co-occurrence Matrix (GLCM) for texture extraction, combined with classifiers like logistic regression, k-NN, Naïve Bayes, SVM, and ANN, achieving an accuracy of 98.8%. Similarly, Chandrashekar and Suresha (2019) employed structural matrix decomposition (SMD) and GLCM-based features with a feed-forward neural network to classify four arecanut types, attaining 88.13% accuracy. Naik and Rudra ( 2023 ) introduced a non-destructive approach for quality assessment through X-ray imaging and deep learning, utilizing YOLOv5 alongside an adaptive genetic algorithm to attain a mean average precision (mAP) of 97.84%. Mallikarjuna et al. ( 2021 ) employed deep CNNs, including AlexNet, alongside multi-gradient imaging techniques to classify disease-affected nuts, showing improved performance in terms of recall, precision, and F1 scores. Balipa et al. ( 2022 ) created a dataset of 180 healthy and diseased arecanut images to train CNN and SVM models using Wavelet and Gabor filters for feature extraction, achieving promising classification rates. Recent advancements also underscore integration of deep learning with image processing techniques. Huang ( 2012 ) combined image processing with back-propagation neural networks (BPNNs), grading nuts into three quality categories with 90.9% accuracy. Patil et al. ( 2023 ) developed a customized CNN that surpassed AlexNet for classifying de-husked arecanuts, achieving a mAP of 98.34% and an F1 score of 98.45% on a small dataset of 300 samples using 10-fold cross-validation. These advancements demonstrate the increasing effectiveness of CNNs in agricultural tasks, especially in improving grading consistency and scalability. Despite the contributions of aforementioned studies to the advancement in automated classification of arecanuts, several limitations remain within these investigations. Table 1 summarises the comparison of previously published machine learning studies used for the classification of areca. Several existing studies face significant limitations, such as small, non-standard datasets (e.g., Shedthi et al., 180 images; Patil et al., 300 images), limiting model scalability and generalizability. To address this, the current study introduces a standardised dataset of 2000 arecanut images, considerably larger and more diversified than prior datasets, enabling vigorous training and better real-world applicability. Additionally, most prior works focus on binary classification (e.g., healthy vs. diseased nuts), which falls short of the multi-grade quality assessment needed for commercial applications. Our study addresses this gap by employing a four-grade classification framework for comprehensive evaluation. Furthermore, while advanced techniques like X-ray imaging and YOLOv5 achieve high accuracy, their cost and complexity make them impractical for small-scale farmers. Our approach focuses on affordable solutions validated under real-world conditions (e.g., varying lighting and nut appearances), ensuring both reliability and accessibility . Table 1 Summary of published studies using machine learning for arecanut classification Study Dataset Size Technique/Algorithms Performance Limitations Chandrashekhara and Suresha, 2019 300 images SMD + GLCM + FFNN Accuracy: 88.13% Binary Classification Naik and Rudra, 2023 X-ray imaging YOLOv5 + Genetic Algorithm mAP: 97.84% High computational cost, requires specialized hardware Patil et al., 2023 300 images Customized CNN F1 Score: 98.45% Insufficient dataset for multi-grade classification Shedthi et al., 2023 180 images GLCM + ANN Accuracy: 98.8% Small dataset, lacks scalability Ghate et al., 2024 2000 + images InceptionV3 Accuracy: 98.23% Hardware constraints to try multiple models. Overlap between testing and training images. Current study 2000 images CNNs + Transfer Learning Achieves > 95% accuracy across multiple grades. Overcomes scalability issues and supports multi-grade classification in resource-constrained environments. 3. Methodology 3.1 Dataset Collection and Annotation The original dataset consists of 2,000 arecanut images categorized into four distinct grades, each containing 500 images. Arecanut plantations in the Puttur region of Dakshina Kannada district, Karnataka, India (12.40°N, 75.10°E), served as the source for the images. The images were captured in diverse conditions, including varying lighting, angles, and backgrounds, to ensure well-constructed representation of real-world scenarios. Experts at the Central Plantation Crops Research Institute (CPCRI) Regional Station, Vittal, Karnataka provided annotations based on visual parameters such as color, texture, and size, which are standard criteria in commercial grading practices. The images were captured using a Vivo Y200e 5G mobile camera with a resolution of 50 MP (6120x6120), resulting in file sizes ranging between 7.5 MB and 9.0 MB. For processing, the images were resized to 224x224 pixels across three RGB channels, a standard resolution for deep learning models like CNNs (Russakovsky et al., 2015 ). This resizing ensured compatibility with the chosen architectures while preserving key visual features that are essential for classification. An 80:20 distribution divided the dataset into training and validation sets. In Karnataka, classification of the de-husked arecanuts into four distinct categories based on their quality: Grade 1 (Best) exhibits a light brown color and lack of peel, Grade 2 (Phatora) displays surface cuts, Grade 3 (Cheppugotu) maintains its skin and appears white, and Grade 4 (Karigotu) displays a dark brown color and signs of rot. The training set was further subdivided into four distinct sub-classes: Grade 1, Grade 2, Grade 3, and Grade 4. 3.2 Data Augmentation Pixel values of the images were normalized by rescaling them by a factor of 1/255. To enhance model adaptability and performance in complex environments, eight distinct data augmentation techniques were applied to the images. These techniques included rotation, width shift, height shift, and fill, as illustrated in Fig. 2 . Random horizontal flips, shearing (up to 0.2 degrees), and zooming (by a factor of 0.2) were also incorporated. These techniques were specifically chosen to tackle common challenges in arecanut classification, such as variability in shape, size, and orientation of the nuts. For instance, rotation and zooming help account for irregularities in nut appearance during real-world grading processes. The augmentation process increased the training dataset by generating an additional 8,000 images, ensuring equal representation across all four grades (Shorten et al., 2019). Pixels introduced during transformations were managed using a fill mode set to 'constant' with a constant value of 125. Augmented datasets were generated using the ‘train_data_gen’ and ‘val_data_gen’ objects. This augmentation strategy not only introduced variability into the training data but also ensured that the model was better equipped to handle the diverse appearances of arecanuts in real-world settings. 3.3 Hyperparameter Tuning Bayesian optimization with Keras Tuner facilitated hyperparameter tuning by efficiently predicting the most promising hyperparameter combinations (Snoek et al., 2012 ). A custom HyperModel class encapsulated the model architecture and hyperparameters, enabling flexible adjustments and experimentation. The tuning process involved running 25 trials for each of the eight models, balancing computational efficiency with a thorough exploration of the search space. The primary hyperparameters included the number of convolutional layers which ranged from 3 to 7, each containing 512 neurons, influencing the model's ability to extract features at different abstraction levels. The schematic architecture of custom Convolutional Neural Network (CNN) model for arecanut classification is shown in Fig. S1. The learning rate, adjusted within the range of 0.0001 to 0.01, and dropout rates, ranging from 0.1 to 0.6, decided by a combination of prior research and preliminary experiments. These choices reflect the importance of layer count for model capacity; while learning and dropout rates ensure effective training and prevent overfitting. This tuning approach maximized validation accuracy and optimized model performance while remaining computationally efficient. 3.4 Transfer Learning for Arecanut Classification K-fold cross-validation with eight folds was employed to ensure a thorough evaluation of the model’s performance. This technique helps in evaluating how the model will generalize to an independent dataset by training and validating it on different subsets of the data. Eight pre-trained deep learning models - ResNet50, VGG16, VGG19, InceptionV3, InceptionResNetV2, EfficientNetB4, DenseNet121, and MobileNetV2 - were adapted for the arecanut classification task. These models were chosen based on their proven performance in various classification tasks, making them suitable for our application. The base layers of these pre-trained models were frozen to retain their learned features, while global average pooling was applied to reduce feature maps efficiently without introducing additional parameters (Donahue et al., 2014 ). Custom dense layers with ReLU activation were added to capture non-linear relationships in the arecanut features, ensuring effective classification performance. Dropout layers were incorporated after dense layers to mitigate overfitting by randomly deactivating neurons during training. The choice of ReLU stems from its simplicity, computational efficiency, and ability to mitigate the vanishing gradient problem, while dropout improves generalization - key for handling the variability in arecanut images. The final output layer used softmax activation to classify the images into four quality grades. 3.5 Model Compilation and Training The models were compiled using the categorical cross-entropy loss function, which is appropriate for multi-class classification (Ho and Wookey, 2019 ). A dropout rate of 0.5 was applied after the global average pooling layer and between the fully connected layers to prevent overfitting. Early stopping was implemented with a patience of eight epochs, monitoring validation loss (Prechelt, 2002 ). A learning rate reduction strategy further refined the model by reducing the learning rate by a factor of 0.2 if the validation loss did not improve for five epochs, with a minimum learning rate set to 0.000001. To address potential class imbalance, the dataset was carefully analyzed to ensure equal representation of all four grades. After initial training for 50 epochs, the best-performing model from hyperparameter tuning was selected for further evaluation. 3.6 Initial Model Evaluation and Fine-Tuning The best-performing model from each architecture was selected based on validation accuracy and F1-score for further evaluation (Goutte and Gaussier, 2005 ). The model was evaluated on the validation dataset to assess its performance on unseen data. Key metrics, including a confusion matrix, precision, recall, and F1-scores were recorded. Observations from the confusion matrix were analyzed to identify misclassifications, particularly among adjacent grades. This further led to the refinement of the model architecture and hyperparameters to improve performance. For fine-tuning, all layers of the selected model were initially frozen to retain pre-trained features. The total number of layers in the base model was determined, and the last 50 layers (or the last 10 layers in the case of VGG) were unfrozen to allow for adaptation to the specific task while retaining learned features from earlier layers. Early stopping and learning rate reduction were implemented to prevent overfitting and optimize training efficiency. TensorBoard was used to monitor the training process. Post-fine-tuning, the model was re-evaluated, and a new confusion matrix was generated to assess improvements in classification performance, particularly for challenging grades. The comparisons between initial and fine-tuned evaluations presented significant gain in overall accuracy and class-wise precision, validating the effectiveness of the fine-tuning strategy. 3.7 Experimental Setup The experiments were conducted on a system with an 11th-generation Intel Core i7 processor, 32GB of RAM, and an NVIDIA RTX 3060 GPU with 12GB of memory. The computational setup also enabled the use of advanced techniques like Bayesian optimization for hyperparameter tuning and K-fold cross-validation without compromising on speed or performance. Both the initial and fine-tuned models were saved as .h5 (hierarchical data format) files - one reflecting the state after initial training and another after fine-tuning, to ensure reproducibility and enable further experimentation. 4. Results and discussion The arecanut industry faces significant challenges in maintaining uniform and accurate grading of arecanuts due to variability in its size, shape, and texture, coupled with the subjectivity of manual evaluation. This study aims to address these limitations by using convolutional neural networks (CNNs) for automated arecanut classification. Using a balanced dataset of 2,000 arecanut images across four quality grades, we explored various CNN architectures, including DenseNet121, EfficientNetB4, and MobileNetV2, to identify the optimal model for this task. Preliminary studies suggest that the adoption of CNNs not only improves classification accuracy but also significantly reduces the time and effort associated with traditional grading methods. This research highlights the potential of deep learning to transform agricultural quality assessment, particularly for resource-intensive tasks like arecanut grading. Figure 1 is a flowchart illustrating the process of arecanut classification using custom-designed CNN models in this study. 4.1 Augmentation and image datasets The present study used the dataset consisting of 2000 images categorized into four quality grades with 500 images in each category. The images were captured under varying conditions to reflect real-world variability, including differences in lighting, angles, and background textures. Figure 2 illustrates the augmentation methods applied. By incorporating augmented samples during training, the model improved its ability to generalize across diverse scenarios, enhancing accuracy on validation and test sets. Similar nut classification studies, such as those on groundnuts and hazelnuts, utilized datasets with 300 to 4,250 images distributed across multiple classes (Patil et al., 2023 ; Taner et al., 2021 ). The comparable size of our dataset and the use of augmentation align with these approaches, demonstrating their effectiveness in addressing variability and improving classification performance. 4.2 Justification for choosing different CNN models Identifying a suitable Convolutional Neural Network (CNN) model for classifying arecanut images means finding the right balance between task-specific criteria, performance, and computational complexity. This study evaluated eight distinct CNN architectures: DenseNet121, EfficientNetB4, InceptionResNetV2, InceptionV3, MobileNetV2, ResNet50, VGG16, and VGG19. The models were chosen for their ability to address specific challenges in arecanut classification, such as texture variability, resource constraints, and deployment efficiency. Table 2 summarizes the computational requirements, and key strengths of these CNN models, providing a comparative overview. For instance, DenseNet121 and ResNet50 are well-suited for environments requiring high accuracy and texture-sensitive classification, while MobileNetV2 excels in applications with resource constraints, such as mobile or edge devices. In contrast, models such as VGG16 and InceptionResNetV2 deliver superior accuracy in resource-rich environments at the cost of higher computational overhead. Practical deployment considerations, such as inference speed and memory usage are critical in selecting models for different applications. By evaluating these models against several criteria, this study focuses on the trade-offs between performance and computational efficiency, offering insights into how state-of-the-art CNNs can address the challenges of automating arecanut grading in diverse environments. Table 2 Comparative analysis of CNN models used : strengths and practical considerations CNN Model Key strengths Practical considerations DenseNet121 (Huang et al., 2017 ) Efficient feature reuse improves texture and shape detection. Smooth gradient flow enhances performance and reduces redundancy. Moderate computational requirements; well-suited for small datasets with limited redundancy. EfficientNetB4 (Tan and Le, 2020 ) Compound scaling achieves a balance between accuracy and efficiency. Delivers optimal performance with minimal computational resources.. Ideal for resource-constrained environments due to high scalability and efficiency. InceptionV3 (Szegedy et al., 2016 ) Factorized convolutions enhance multi-scale feature detection. Multi-scale feature extraction enhances adaptability. Efficient for real-time classification tasks with a robust architecture for complex patterns. InceptionResNetV2 (Peng et al., 2022 ) Combines Inception and residual blocks for precision and adaptability. Handles complex feature hierarchies effectively with skip connections. Computationally intensive; requires robust hardware for optimal performance. Suitable for tasks requiring fine-grained detail detection. MobileNetV2 (Sandler et al., 2018) Linear bottlenecks enhance efficiency without sacrificing accuracy. Optimized for low-resource environments with lightweight design. Fast inference, making it ideal for edge deployment. ResNet50 (Sachdeva et al., 2024 ) Deep residual learning mitigates vanishing gradients, ensuring stable training. Maintains high accuracy in deep networks through effective gradient propagation. Versatile for processing large datasets but requires significant memory. VGG16/VGG19 (Hindarto, 2023 ) Simple architecture with consistent performance for fine-grained feature tasks. High memory consumption makes it better suited for high-resource systems. 4.3 Hyperparameter tuning Hyperparameter tuning was crucial to enhancing the classification accuracy of CNN models for arecanut grading. We utilized the Bayesian classifier to identify promising hyperparameter ranges before conducting fine-tuning with K-fold cross-validation. Key hyperparameters for each CNN model were optimized to enhance classification accuracy for arecanut grading. The DenseNet121 model, which had three custom dense layers, a learning rate of 0.0001, and a dropout rate of 0.1, did very well, as shown in Table 3 , with the RMSprop optimizer enhancing its training by adaptively adjusting the learning rate for each parameter based on the gradient's magnitude, ensuring stable and efficient convergence. EfficientNetB4 necessitated additional layers and a slightly elevated dropout rate of 0.4, which may stem from its propensity to overfit small datasets due to its depth and parameter richness. The SGD optimizer achieved a fine-tuned learning rate of approximately 0.00021. Even though most CNN models showed RMSprop and Adam optimizers as best hyperparameters, they had different optimal configurations showing the intricacy involved in balancing depth and regularization. Notably, VGG16 and VGG19, known for their depth, required relatively higher learning rates, with VGG19 needing the highest learning rate of 0.001 among the models tested, allowing us to compare the performance of models with similar architectures but varying depths. Table 3 explains optimal hyperparameter settings for selecting the best CNN models in the current study. These results emphasize that both complex and simpler models can achieve competitive performance when optimally tuned, illustrating the importance of tailored hyperparameter configurations. Table 3 Optimal hyperparameter settings for selecting the best CNN models for arecanut classification CNN model No. of custom layers Learning rate Dropout rate Optimizer DenseNet121 3 0.0001 0.1 RMSprop EfficientNetB4 7 0.000209 0.4 SGD InceptionResNetV2 3 0.0001 0.2 RMSprop InceptionV3 4 0.000879 0.2 Adam MobileNetV2 3 0.00012 0.2 Adam ResNet50 4 0.000226 0.1 Adam VGG16 5 0.000193 0.1 RMSprop VGG19 3 0.001087 0.2 RMSprop Recent studies underline the major role of hyperparameter tuning in optimizing deep learning models for agricultural classification tasks. For instance, Patil et al. ( 2023 ) reported that an eight-layer AlexNet underperformed compared to a customized CNN trained with a learning rate of 0.0002 and Adam optimizer for arecanut quality classification. Similarly, Naik and Rudra ( 2023 ) achieved state-of-the-art results using YOLOv5 models for non-invasive X-ray-based arecanut quality assessment, with adaptive genetic algorithms improving the mAP of YOLOv5m to 97.78%. While the approaches used in the above differ methodologically, the focus on adaptive hyperparameter optimization matches with our findings. Shankar et al. ( 2022 ) indicated the importance of automated hyperparameter tuning for fruit classification, achieving remarkable accuracy improvements using the Aquila Optimization Algorithm for RNN models. These studies jointly suggest that precise hyperparameter tuning, whether manual or automated, is necessary for achieving optimal performance in various agricultural classification tasks. Compared to these studies, our CNN model, DenseNet121, demonstrates superior performance in accuracy, model size, and parameters. To further improve the model's performance, experimenting with hybrid optimization strategies could help balance generalization and computational efficiency, while layer-wise freezing during transfer learning might mitigate overfitting in small datasets. 4.4 Model validation performance evaluation: Table 4 summarizes the model validation performance evaluation of the tested CNN models, showing significant differences in accuracy and other metrics. DenseNet121 emerged as the top performer with 98.50% accuracy and a balanced F1-Score, showcasing its ability to capture complex features. MobileNetV2, with slightly lower accuracy (98.42%), offers a lightweight architecture ideal for resource-constrained applications like mobile devices and agricultural machinery. InceptionResNetV2 and InceptionV3 both achieved high accuracy (96.75%) and performed well in precision, recall, and F1-Score, demonstrating their reliability for arecanut classification. VGG16 and VGG19 provided good results with accuracies around 90%, but had lower recall rates, suggesting room for improvement in classifying all relevant classes. In contrast, EfficientNetB4 underperformed with an accuracy of just 24.75%, likely due to a mismatch between its general-purpose design and the texture-specific features of arecanut images. ResNet50 also performed moderately, with an accuracy of 65.25%, indicating the need for further optimization, particularly due its more complex architecture. Table 4 Validation metrics for CNN models in arecanut classification Model Accuracy Precision Recall F1-Score DenseNet121 0.985 ± 0.001 0.986 ± 0.009 0.995 ± 0.0099 0.985 ± 0.001 EfficientNetB4 0.2475 ± 0.02 0.63 ± 0.013 0.2475 ± 0.0275 0.099 ± 0.019 InceptionResNetV2 0.9675 ± 0.012 0.969 ± 0.009 0.968 ± 0.0115 0.9673 ± 0.011 InceptionV3 0.9675 ± 0.017 0.969 ± 0.016 0.967 ± 0.0173 0.968 ± 0.017 MobileNetV2 0.984 ± 0.009 0.985 ± 0.008 0.984 ± 0.0094 0.9842 ± 0.009 ResNet50 0.6525 ± 0.03 0.634 ± 0.035 0.6525 ± 0.0299 0.6311 ± 0.03 VGG16 0.9033 ± 0.02 0.912 ± 0.019 0.903 ± 0.0211 0.9039 ± 0.02 VGG19 0.891 ± 0.033 0.913 ± 0.022 0.891 ± 0.0330 0.8926 ± 0.03 Figures 3 and 4 illustrate the variations in accuracy and loss across 25 trials of hyperparameter tuning with 50 epochs in each trial. Most models stabilized after the first few epochs, indicating neither overfitting nor underfitting. Notably, DenseNet121, InceptionV3, and EfficientNetB4 demonstrated enhanced training performance compared to other models. In contrast, the remaining models experienced either overfitting or underfitting at various epochs. The trial with low loss and high accuracy was considered the best model with the best hyperparameters. The results indicate that while DenseNet121 and InceptionV3 are the most suitable models for this task, future work needs to focus on improving underperforming models like EfficientNetB4 and ResNet50, maybe by tailored pretraining or dataset-specific augmentations. The dense connections in DenseNet121's architecture make gradient flow and feature reuse more efficient, which leads to better performance (Nguyen et al., 2024). InceptionV3's factorized convolutional and aggressive regularization ensure high accuracy while maintaining computational efficiency (Hossain et al., 2024 ). According to (Sachdeva et al., 2024 ), EfficientNetB4 and ResNet50's higher level of complexity and sensitivity to hyperparameters often lead to overfitting or poor generalization on certain datasets. 4.5 Model testing Upon further evaluation using the test dataset, DenseNet121 and InceptionV3 models emerged as the top performers, achieving a test accuracy of 95.67% and strong F1-scores, precision, and recall of 96% (Table 5 ). Both models showed consistent performance across validation and test phases, underscoring their reliability for arecanut classification. DenseNet121’s dense connections improve feature reuse and gradient flow, while InceptionV3’s factorized convolutions and regularization capture fine-grained textures. Both models improved after fine-tuning, with significant gains in precision, recall, and F1-scores compared to their initial evaluation. For instance, fine-tuned DenseNet121 demonstrated an accuracy of 95.67%, with a precision, recall, and F1-score of 96%, improving upon the baseline results, which underscores the value of refining the model to better adapt to the specific task at hand. In contrast, models such as EfficientNetB4, InceptionResNetV2, VGG16, VGG19, and ResNet50 exhibited poor test results, with accuracies below 25.45% and failing to maintain performance outside the validation phase (Table 5 ). These models showed low F1-scores and near-zero Cohen's Kappa values, suggesting significant underfitting for this task. The architectural choices in these models might not be well-suited for this dataset, requiring more specialized tuning or adjustments to handle arecanut’s unique features effectively. Table 5 Comparison of test performance metrics for initial and fine-tuned CNN models in arecanut classification Model\Metrics Accuracy Precision Recall F1 -Score Cohen's Kappa Log loss Total time (s) Average time/image (s) Initial models DenseNet121 0.9567 0.96 0.96 0.96 0.94 0.15 6.02 0.015 EfficientNetB4 0.2545 0.06 0.25 0.1 0 1.39 7.25 0.018 InceptionResNetV2 0.2545 0.06 0.25 0.1 0 2.89 6.58 0.017 InceptionV3 0.9567 0.96 0.96 0.96 0.94 0.17 4.27 0.011 MobileNetV2 0.3511 0.32 0.35 0.25 0.13 10.01 3.21 0.008 ResNet50 0.2366 0.06 0.25 0.1 0 12.17 3.84 0.010 VGG16 0.2545 0.06 0.25 0.1 0 1.41 2.28 0.006 VGG19 0.2545 0.06 0.25 0.1 0 1.39 2.72 0.007 Fine-tuned models DenseNet121 0.9567 0.96 0.96 0.96 0.94 0.15 5.88 0.015 EfficientNetB4 0.2545 0.06 0.25 0.1 0 1.39 6.96 0.018 InceptionResNetV2 0.2545 0.06 0.25 0.1 0 2.89 5.88 0.015 InceptionV3 0.9567 0.96 0.96 0.96 0.94 0.17 4.33 0.011 MobileNetV2 0.3511 0.32 0.35 0.25 0.13 10.01 3.20 0.008 ResNet50 0.2366 0.06 0.25 0.1 0 12.17 3.45 0.009 VGG16 0.2545 0.06 0.25 0.1 0 1.41 2.28 0.006 VGG19 0.2545 0.06 0.25 0.1 0 1.39 2.71 0.007 In terms of computational efficiency, MobileNetV2 proved to be the fastest, with an average classification time of 0.008 seconds per image, although its accuracy of 35.11% limits its practical utility (Table 5 ). DenseNet121 and InceptionV3, while slightly slower at 0.015 and 0.011 seconds per image, respectively, offer a good balance between computational cost and high accuracy. In comparison, models like ResNet50 and EfficientNetB4 exhibited notably slower performance, with higher average classification times and lower accuracy, further emphasizing their unsuitability for this task (Table 5 ). In contrast to earlier works (Chandrashekhara et al., 2019) which focused on geometrical features, this study utilizes advanced CNN architectures, achieving a 10% improvement in the precision and recall. DenseNet121’s superior ability to model fine-grained textures is a key factor in this improvement, particularly after fine-tuning steps. Naik and Rudra's (2023) YOLOv5 model, while effective, was limited by a small dataset (900 X-ray images), which may not fully capture the complexity of arecanut quality. Additionally, this study's use of CNN models offers more scalable and robust performance for large, complex datasets. Our proposed fine-tuned DenseNet121 and InceptionV3 models outperform existing models for arecanut classification. DenseNet121’s efficiency and compact model size make it an ideal choice for practical deployment in real-world agricultural settings. 4.6 Complexity of CNN Models for Arecanut Classification Table 6 presents a comprehensive overview of the key metrics- total parameters, trainable and non-trainable parameters, model size, and layer count, highlighting the varying complexities of the CNN models used for arecanut classification. Trainable parameters are those that the model learns during training, while non-trainable parameters are typically fixed weights from pretrained layers. The DenseNet121 model, with 8.09 million total parameters and a 30.86 MB model size, strikes a balance between architectural complexity and efficiency, making it well-suited for fine-grained feature extraction. In contrast, EfficientNetB4, although larger at 76.94 MB, offers a favorable trade-off between performance and computational cost, with 20.17 million parameters. InceptionResNetV2, the most complex of the models, requires substantial computational resources, with 55.65 million parameters and a 212.29 MB size as shown in Fig. 6 . While MobileNetV2 offers a lightweight model size of 13.13 MB and only 3.44 million parameters, it prioritizes efficiency over accuracy, making it suitable for mobile or edge devices where real-time inference is critical. Table 6 Characteristics of selected fine-tuned CNN models for arecanut classification CNN model Total parameters (million) Trainable parameters (million) Non- trainable (million) Size (mb) Total layers No. of weights DenseNet121 8.09 1.05 7.037 30.86 439 612 EfficientNetB4 2.016 2.5 17.67 76.94 492 627 InceptionResNetV2 55.65 1.31 54.36 212.29 789 904 InceptionV3 23.64 1.84 21.8 90.19 322 386 MobileNetV2 3.44 1.18 2.26 13.13 163 268 ResNet50 25.43 1.84 23.59 97 186 328 VGG16 16.03 1.32 14.71 61.15 32 38 VGG19 20.81 0.79 20.02 79.4 31 40 Despite differences in model complexity, the accuracy results as shown in Table 5 reveal that more complex models like InceptionResNetV2 and InceptionV3 did not perform as expected. InceptionV3, with 23.64 million parameters and a 90.19 MB size, pointed to high computational demand but did not surpass DenseNet121, which achieved 95.67% accuracy. This accentuates the importance of model selection beyond complexity—DenseNet121, while less computationally demanding than InceptionResNetV2, outperformed it in accuracy. The trade-off between accuracy and computational efficiency is clear: while InceptionResNetV2 and InceptionV3 offer high computational capacity, they did not exceed DenseNet121 in performance. MobileNetV2, prioritizing speed and efficiency, sacrifices accuracy but is more suitable for real-time applications. For this task, DenseNet121 - a balanced approach of moderate complexity and strong performance - proved more effective for arecanut classification. Previous research on fruit quality inspection, as reviewed by Naranjo-Torres et al. ( 2020 ), often used simpler models like LeNet, AlexNet, and ResNet. While these models were effective, more advanced architectures like DenseNet121 and InceptionV3 have shown superior performance, particularly in handling complex features like texture variation in arecanut images. Our findings indicate that the larger input sizes in DenseNet121 and InceptionV3 may have contributed to improved results, aligning with the growing trend towards deeper, more complex models in image classification. 4.7 Confusion matrix The confusion matrix offers a detailed assessment of classification performance, capturing true positives, false positives, true negatives, and false negatives. This analysis is critical for assessing the accuracy and reliability of the models. Figure 5 displays the confusion matrices for the testing phase of the fine-tuned eight models, Figs. S2 and S3 present the validated confusion matrices for all models, and the testing results for both initial and fine-tuned models. Darker shades in the matrices indicate higher accuracy in predictions for each grade. True Positive (TP): This refers to the number of positive samples that the model correctly classified as positive. True Negative (TN): This specifies the number of negative samples that the model correctly classified as negative. False Positive (FP): This specifies the number of negative samples that the model mistakenly categorized as good samples. False Negative (FN): This specifies the number of positive samples that the model mistook for negative. Accuracy is the percentage of correct outputs among all the outputs produced by the model, as indicated in the equation below. $$\:Accuracy=\frac{(TP+TN)}{(TP+TN+FP+FN)}$$ Precision is the proportion of TP predictions (correctly predicted positive instances) out of predictions made by the model. It measures how accurate the model’s positive predictions are, and is calculated as given in the equation below. $$\:Precision=\:\frac{TP}{(TP+FP)}$$ Recall is the proportion of TP predictions out of all actual positive instances in the data, as shown in the equation below. $$\:Recall=\:\frac{TP}{(TP+FN)}$$ F1 Score represents the harmonic mean of Precision and Recall and it is used to balance the trade-off between precision and recall as given below. $$\:F1\:Score=\frac{2*Precision*Recall}{Precision+Recall}$$ DenseNet121 (Fig. 5 A) and InceptionV3 (Fig. 5 D) exhibited strong predictive accuracy, with high diagonal values in their confusion matrices, indicating consistent performance across grades. DenseNet121 achieved a true positive rate (TPR) of over 90% across all grades, but showed slight difficulty in identifying Grade 2 compared to InceptionV3. In contrast, InceptionV3 also performed well but exhibited slightly lower accuracy in handling grades 1 and 3 compared to DenseNet121. ResNet50 (Fig. 5 E) exhibited significant flaws, primarily over-predicting the class Grade 1 while struggling with other grades. This misclassification is likely caused by insufficient feature extraction, which affects its ability to capture finer grade variations. Similarly, EfficientNetB4 showed limited effectiveness, achieving a TPR of only 25% for Grade 1. Models like VGG16 and VGG19 also suffered from high false positive rates (FPR), frequently misclassifying other grades as Grade 1. Higher grades (Grades 3 and 4) were particularly prone to misclassification across most models, highlighting difficulties in distinguishing finer-grade differences. Overall, the confusion matrix analysis provides critical insights into model performance, revealing areas for improvement, particularly in handling underrepresented grades. DenseNet121 and InceptionV3 emerged as most reliable models, but further refinements in data handling and model architectures are necessary to optimize classification accuracy across all grades. The architecture of DenseNet121 consists of 121 layers, each connected to all previous layers, thereby reducing the number of parameters required and enhancing efficiency. The InceptionV3 model comprises 48 layers, including various convolutional, pooling, and fully connected layers. Its unique Inception module, which captures features at multiple scales, made it effective in handling diverse image characteristics. DenseNet121’s dense connectivity enabled efficient feature extraction, while InceptionV3’s multiscale processing was advantageous for images with distinct feature sizes. 4.8 ROC-AUC curves The Receiver Operating Characteristic (ROC) curves for the fine-tuned CNN models in Fig. 7 compare the true positive rate (TPR) and false positive rate (FPR) at different classification thresholds, providing an extensive evaluation of binary classifiers. The area under the curve (AUC) is a critical metric, with values closer to 1 indicating superior performance. For clarity, we present ROC curves for the top eight models. DenseNet121 (Fig. 7 A) displayed superior performance, achieving AUC values of 1.00 for three grades and 0.99 for one, reflecting excellent class separation and predictive capability. Similarly, InceptionV3 (Fig. 7 D) performed admirably with AUC values near 1.00 across all grades. These results justify their suitability for tasks requiring precise classification across a wide range of grades. In contrast, EfficientNetB4 (Fig. 7 B) exhibits moderate performance with AUC values ranging from 0.45 to 0.73, particularly struggling with Grades 3 and 4. InceptionResNetV2 (Fig. 7 C) reflects random prediction behavior with an AUC of 0.50, indicating an inability to differentiate between classes. VGG16 and VGG19 (Fig. 7 G,H) also exhibit random performance with flat ROC curves, further demonstrating their ineffectiveness for this task. MobileNetV2 (Fig. 7 E) performs well for Grade 3 and Grade 4, with AUC values near 1. It shows limited ability to distinguish Grade 1 and Grade 2, with AUC values of 0.61 and 0.62.7Additionally, inconsistent performance across grades in ResNet50 (Fig. 7 F) with an AUC of 0.66 for Grade 1 but only 0.33 for Grade 3 emphasizes the need for better feature engineering tailored to grade-specific variations. The ROC-AUC curves for initial-tuned CNN models in arecanut classification are provided in Fig. S4 for comparison. 5. Limitations of the Study This study indicates the potential of Convolutional Neural Network (CNN) models for automating arecanut grading, while it also recognizes certain limitations. A key constraint is the relatively small and regionally limited dataset, which may restrict the models' ability to generalize across different arecanut varieties and growing conditions. The dataset majorly consists of frontal images, which may not capture important features such as surface texture, color uniformity, or hidden defects visible from other angles. This single-perspective approach might limit the model’s ability to fully differentiate between quality grades. Additionally, the lack of advanced imaging techniques, such as multi-angle imaging, further limits the representation of key features important for fine-grained classification. These limitations can be addressed by expanding the dataset and employing advanced imaging systems, which will enhance both the reliability and accuracy of the models. 6. Conclusion This study demonstrates the feasibility and efficacy of deep learning, specifically Convolutional Neural Networks (CNNs), for automating arecanut classification. Traditional grading methods are inefficient, time-intensive, and are reliant on expert knowledge, presenting challenges for small-scale farmers. Among the eight transfer learning models fine-tuned in this study, DenseNet121 and InceptionV3 emerged as the top-performing models, achieving overall accuracies of 95.67%. These results highlight the potential of CNNs to handle texture-based image classification tasks with high reliability. DenseNet121’s dense connectivity structure optimized feature reuse and reduced parameter complexity, making it effective for complex feature extraction, while InceptionV3’s multi-scale Inception modules enhanced adaptability to diverse image features. Both models exhibited robust generalization, as reflected in their high Cohen’s Kappa values (0.94) and low log loss scores, ensuring reliability across unseen data. This study also analyzed confusion matrices and AUC-ROC plots, revealing DenseNet121’s and InceptionV3’s ability to achieve near-perfect predictions, with minimal errors across all four grades. The proposed CNN-based system offers a scalable, rapid, and reliable solution for automating arecanut grading, which can benefit small-scale farmers by providing more accurate and consistent grading. This could also lead to fairer pricing and improved market opportunities. Future work should focus on expanding the dataset to include more arecanut varieties, multi-angle imaging, and larger sample sizes. Additionally, exploring hybrid architectures and lightweight models for real-time deployment will enhance robustness and efficiency, paving the way for AI-driven solutions in precision agriculture and sustainable farming practices. Declarations CRediT authorship contribution statement DDG : Data curation, Methodology, Software, Validation, Visualization, Writing - original draft. PSH : Writing - original draft, Visualization, Writing - review & editing. SH : Writing, review & editing. PKN : Writing - review & editing. SDG : Conceptualization, Resources, Software, Validation, Methodology, Supervision, Writing - original draft, Writing - review & editing. Declaration of generative AI and AI-assisted technologies in the writing process During the preparation of this work the author(s) used [QuillBot] in order to [improve clarity, engagement and grammar related]. After using this tool/service, the author(s) reviewed and edited the content as needed and take(s) full responsibility for the content of the publication. Declaration of Competing Interest The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper. Funding This research did not receive any specific grant from funding agencies in the public, commercial, or not-for-profit sectors. Open-access publication funding will be provided by the NITTE Deemed to be University, Deralakatte. Acknowledgments The authors would like to thank Dr. Nagaraj , Plant Pathologist, ICAR-CPCRI, Vitla, Puttur, Karnataka for the assistance provided during field data collection. References Ansari, A., Mahmood, T., Bagga, P., Ahsan, F., Shamim, A., Ahmad, S., Shariq, M., Parveen, S., 2021. Areca catechu : A phytopharmacological legwork. Food Frontiers 2, 163–183. https://doi.org/10.1002/fft2.70 Balipa, M., Shetty, P., Kumar, A. and Puneeth, B.R., 2022. Arecanut Disease Detection Using CNN and SVM Algorithms. In 2022 International Conference on Artificial Intelligence and Data Engineering (AIDE) (pp. 01-04). Bhat, A., Shetty, A.S., Suvarna, D.M., Anchan, R.S., 2023. A Cnn-Based Approach To Classify Areca Nuts Based On Grades. Journal of Emerging Technologies and Innovative Research (JETIR) 10,4 Chandrashekhara, H. and Suresha, M., 2019. Classification of healthy and diseased arecanuts using SVM classifier. International Journal of Computer Sciences and Engineering, 7(2), pp.544-548. https://doi.org/10.26438/ijcse/v7i2.544548 Danti, A., M., S., 2012. Effective Multiclassifier for Arecanut Grading, in: Venugopal, K.R., Patnaik, L.M. (Eds.), Wireless Networks and Computational Intelligence, Communications in Computer and Information Science. Springer Berlin Heidelberg, Berlin, Heidelberg, pp. 350–359. https://doi.org/10.1007/978-3-642-31686-9_41 Donahue, J., Jia, Y., Vinyals, O., Hoffman, J., Zhang, N., Tzeng, E. and Darrell, T., 2014, January. Decaf: A deep convolutional activation feature for generic visual recognition. In International conference on machine learning (pp. 647-655). PMLR. Ghate, D. D., Pallavi, K. N., & Poojari, A., 2024. Enhancing Arecanut Farming Profits through Technological Advancements: A CNN-based Approach for Efficient Grading and Sorting. In 2024 5th International Conference on Mobile Computing and Sustainable Informatics (ICMCSI) pp. 441-445. IEEE. Goutte, C. and Gaussier, E., 2005, March. A probabilistic interpretation of precision, recall and F-score, with implication for evaluation. In European conference on information retrieval (pp. 345-359). Berlin, Heidelberg: Springer Berlin Heidelberg. Hindarto, D. and Afarini, N., 2023. Comparison Efficacy of VGG16 and VGG19 Insect Classification Models. JIKO (Jurnal Informatika dan Komputer), 6(3), pp.189-195. Ho, Y. and Wookey, S., 2019. The real-world-weight cross-entropy loss function: Modeling the costs of mislabeling. IEEE access, 8, pp.4806-4813. Hossain, Md Mamun, Hossain, Md Moazzem, Arefin, M.B., Akhtar, F., Blake, J., 2024. Combining State-of-the-Art Pre-Trained Deep Learning Models: A Noble Approach for Skin Cancer Detection Using Max Voting Ensemble. Diagnostics 14, 89. https://doi.org/10.3390/diagnostics14010089 Huang, G., Liu, Z., Van Der Maaten, L. and Weinberger, K.Q., 2017. Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition (pp. 4700-4708). Huang, K.-Y., 2012. Detection and classification of areca nuts with machine vision. Computers & Mathematics with Applications 64, 739–746. https://doi.org/10.1016/j.camwa.2011.11.041 Indian Council of Agricultural Research (ICAR) report 2023 Mallikarjuna, S.B., Shivakumara, P., Khare, V., Kumar N, V., M, B., Pal, U., B, P., 2021. CNN based method for multi-type diseased arecanut image classification. MJCS 34, 255–265. https://doi.org/10.22452/mjcs.vol34no3.3 Naik, P.M., Rudra, B., 2023. Classification of Arecanut X-Ray Images for Quality Assessment Using Adaptive Genetic Algorithm and Deep Learning. IEEE Access 11, 127619–127636. https://doi.org/10.1109/ACCESS.2023.3332215 Naranjo-Torres, J., Mora, M., Hernández-García, R., Barrientos, R.J., Fredes, C., Valenzuela, A., 2020. A Review of Convolutional Neural Network Applied to Fruit Image Processing. Applied Sciences 10, 3443. https://doi.org/10.3390/app10103443 Nguyen Chi, T., Le Thi Thu, H., Doan Quang, T. and Taniar, D., 2024. A Lightweight Method for Breast Cancer Detection Using Thermography Images with Optimized CNN Feature and Efficient Classification. Journal of Imaging Informatics in Medicine, pp.1-18. Patil, S., Naik, A., Parab, J., 2023. Efficient Deep Learning model for de-husked Areca nut classification. JANS 15, 1529–1540. https://doi.org/10.31018/jans.v15i4.5067 Patil, S., Naik, A., Sequeira, M., Naik, G. and Parab, J., 2021. An algorithm for pre-processing of areca nut for quality classification. In Second International Conference on Image Processing and Capsule Networks: ICIPCN 2021 2 (pp. 79-93). Springer International Publishing. Peng, C., Liu, Y., Yuan, X. and Chen, Q., 2022. Research of image recognition method based on enhanced inception-ResNet-V2. Multimedia Tools and Applications, 81(24), pp.34345-34365. Prechelt, L., 2002. Early stopping-but when?. In Neural Networks: Tricks of the trade (pp. 55-69). Berlin, Heidelberg: Springer Berlin Heidelberg. Russakovsky, O., Deng, J., Su, H., Krause, J., Satheesh, S., Ma, S., Huang, Z., Karpathy, A., Khosla, A., Bernstein, M. and Berg, A.C., 2015. Imagenet large scale visual recognition challenge. International journal of computer vision, 115, pp.211-252. Sachdeva, J., Sharma, D. and Ahuja, C.K., 2024. Comparative Analysis of Different Deep Convolutional Neural Network Architectures for Classification of Brain Tumor on Magnetic Resonance Images. Archives of Computational Methods in Engineering, pp.1-20. Sandler, M., Howard, A., Zhu, M., Zhmoginov, A., Chen, L.-C., 2019. MobileNetV2: Inverted Residuals and Linear Bottlenecks. https://doi.org/10.48550/arXiv.1801.04381 Shankar, K., Kumar, S., Dutta, A.K., Alkhayyat, A., Jawad, A.J.A.M., Abbas, A.H. and Yousif, Y.K., 2022. An automated hyperparameter tuning recurrent neural network model for fruit classification. Mathematics , 10 (13), p.2358. Shedthi B, S., Siddappa, M., Shetty, S., Shetty, V., 2023. Classification of arecanut using machine learning techniques. IJECE 13, 1914. https://doi.org/10.11591/ijece.v13i2.pp1914-1921 Shorten, C. and Khoshgoftaar, T.M., 2019. A survey on image data augmentation for deep learning. Journal of big data, 6(1), pp.1-48. Snoek, J., Larochelle, H. and Adams, R.P., 2012. Practical bayesian optimization of machine learning algorithms. Advances in neural information processing systems, 25. Sujatha, S., Bhat, R., Chowdappa, P., 2016. Cropping systems approach for improving resource use in arecanut (Areca catechu) plantation. The Indian Journal of Agricultural Sciences 86, 1113–20. https://doi.org/10.56093/ijas.v86i9.61349 Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., Wojna, Z., 2016. Rethinking the Inception Architecture for Computer Vision, in: 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). IEEE, Las Vegas, NV, USA, pp. 2818–2826. https://doi.org/10.1109/CVPR.2016.308 Tan, M., Le, Q.V., 2020. EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks. Taner, A., Öztekin, Y.B., Duran, H., 2021. Performance Analysis of Deep Learning CNN Models for Variety Classification in Hazelnut. Sustainability 13, 6527. https://doi.org/10.3390/su13126527 Xiao, F., Wang, H., Xu, Y., Zhang, R., 2023. Fruit Detection and Recognition Based on Deep Learning for Automatic Harvesting: An Overview and Review. Agronomy 13, 1625. https://doi.org/10.3390/agronomy13061625 Additional Declarations The authors declare no competing interests. Supplementary Files Supplementalinformation.docx Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-5841671","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":402997609,"identity":"05143417-5d8d-4b6e-bffb-fc131bff3452","order_by":0,"name":"Dhanush Ghate D","email":"","orcid":"https://orcid.org/0009-0004-9143-1267","institution":"Department of Computer Science and Engineering, NMAM Institute of Technology, NITTE deemed to be University","correspondingAuthor":false,"prefix":"","firstName":"Dhanush","middleName":"Ghate","lastName":"D","suffix":""},{"id":402997610,"identity":"7d24ed36-e76b-466f-8eb1-c0009cff22c8","order_by":1,"name":"Pramukh S Hegde","email":"","orcid":"https://orcid.org/0000-0001-9808-1571","institution":"Department of Physiology, KS Hegde Medical Academy NITTE deemed to be University","correspondingAuthor":false,"prefix":"","firstName":"Pramukh","middleName":"S","lastName":"Hegde","suffix":""},{"id":402997611,"identity":"50194dd4-5140-432f-9a61-5b5eef358201","order_by":2,"name":"Saishma H","email":"","orcid":"https://orcid.org/0009-0003-4454-3584","institution":"Center for Bioinformatics, NITTE deemed to be University","correspondingAuthor":false,"prefix":"","firstName":"Saishma","middleName":"","lastName":"H","suffix":""},{"id":402997612,"identity":"e54e7444-ccca-4bc9-9867-9afc8520e287","order_by":3,"name":"Pallavi K N","email":"","orcid":"","institution":"Department of Computer Science and Engineering, NMAM Institute of Technology, NITTE deemed to be University","correspondingAuthor":false,"prefix":"","firstName":"Pallavi","middleName":"K","lastName":"N","suffix":""},{"id":402997613,"identity":"29b45411-65cb-4dbd-a387-4a1c721e2914","order_by":4,"name":"Sudeep D Ghate","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAA5UlEQVRIiWNgGAWjYHACAyCW4OFnbz4AYsgQq8VCRrLnWAJYL7FaKmwMbuSAGAyEtcjPSN744OMOoOE3cj6/ulFjwcPAfvjoBrxW3EgrNpx5RoKHseftNuucY0C9PGlpN/Bqkcgxk+Ztk+BhZs/dZpzDBtQiwWOGV4v8jBzz33+BWtgYcp4Z5/wjQgvQC2bMjEAtPBw5zI9z24jQYnDmWbFkL9AvEjzHzJhz+4DWEfKLfHvyxg8/d9TZ2x9vfvw551udHD/74WP4HQYCjA1gik0CTBJUjqSF+QNRqkfBKBgFo2DEAQDor0VP/Ng/dAAAAABJRU5ErkJggg==","orcid":"https://orcid.org/0000-0001-9996-3605","institution":"Center for Bioinformatics, NITTE deemed to be University","correspondingAuthor":true,"prefix":"","firstName":"Sudeep","middleName":"D","lastName":"Ghate","suffix":""}],"badges":[],"createdAt":"2025-01-16 12:05:40","currentVersionCode":1,"declarations":{"humanSubjects":false,"vertebrateSubjects":false,"conflictsOfInterestStatement":false,"humanSubjectEthicalGuidelines":false,"humanSubjectConsent":false,"humanSubjectClinicalTrial":false,"humanSubjectCaseReport":false,"vertebrateSubjectEthicalGuidelines":false},"doi":"10.21203/rs.3.rs-5841671/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-5841671/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":74256922,"identity":"4ed19574-1252-4df0-8c80-9755f1c762f1","added_by":"auto","created_at":"2025-01-20 11:36:32","extension":"png","order_by":1,"title":"Figure 1","display":"","copyAsset":false,"role":"figure","size":35319,"visible":true,"origin":"","legend":"\u003cp\u003eWorkflow illustrating the process for arecanut classification using machine learning techniques. The diagram illustrates the process from data acquisition and preprocessing to model training, optimization, validation, and performance analysis, showcasing the use of CNN architectures and transfer learning for accurate arecanut classification.\u003c/p\u003e","description":"","filename":"1.png","url":"https://assets-eu.researchsquare.com/files/rs-5841671/v1/f7c253ebc66eaa5261e6e48b.png"},{"id":74256923,"identity":"6df82828-3e72-4382-9575-1e940fc2f4dd","added_by":"auto","created_at":"2025-01-20 11:36:32","extension":"png","order_by":2,"title":"Figure 2","display":"","copyAsset":false,"role":"figure","size":271318,"visible":true,"origin":"","legend":"\u003cp\u003eData augmentation techniques applied to arecanut images, with original images for each grade given on the left panel.\u003c/p\u003e","description":"","filename":"2.png","url":"https://assets-eu.researchsquare.com/files/rs-5841671/v1/bd2f5693e1ed54b45a88f4b4.png"},{"id":74256629,"identity":"97dea04f-b9eb-4de8-b6f5-3cf319818c0d","added_by":"auto","created_at":"2025-01-20 11:28:32","extension":"png","order_by":3,"title":"Figure 3","display":"","copyAsset":false,"role":"figure","size":669439,"visible":true,"origin":"","legend":"\u003cp\u003ePerformance metrics of CNN models for arecanut classification through transfer learning. (A) DenseNet121 (B) EfficientNetB4 (C) InceptionResNetV2 (D) InceptionV3 (Left Panel: Accuracy vs. Epoch curves show the classification accuracy of each model over 50 epochs, reflecting their learning progress. Right Panel: Loss vs. Epoch curves display the corresponding loss values for each model, indicating training effectiveness.)\u003c/p\u003e","description":"","filename":"3.png","url":"https://assets-eu.researchsquare.com/files/rs-5841671/v1/e7b9712d0a009c549812ea9c.png"},{"id":74256631,"identity":"b0fe6d38-ad56-48cd-b1b1-da46a8ab7fdb","added_by":"auto","created_at":"2025-01-20 11:28:32","extension":"png","order_by":4,"title":"Figure 4","display":"","copyAsset":false,"role":"figure","size":856058,"visible":true,"origin":"","legend":"\u003cp\u003ePerformance metrics of CNN models for arecanut classification through transfer learning. (A) MobileNetV2 (B) ResNet50 (C) VGG16 (D) VGG19 (Left Panel: Accuracy vs. Epoch curves show the classification accuracy of each model over 50 epochs, reflecting their learning progress. Right Panel: Loss vs. Epoch curves display the corresponding loss values for each model, indicating training effectiveness.\u003c/p\u003e","description":"","filename":"4.png","url":"https://assets-eu.researchsquare.com/files/rs-5841671/v1/f763692469f298060a4f6bc6.png"},{"id":74256634,"identity":"bd4027ca-7de3-40c9-96b0-f2b8db9747b9","added_by":"auto","created_at":"2025-01-20 11:28:32","extension":"png","order_by":5,"title":"Figure 5","display":"","copyAsset":false,"role":"figure","size":344662,"visible":true,"origin":"","legend":"\u003cp\u003eConfusion matrix for testing of fine-tuned for 8 models (A) DenseNet121 (B) EfficientNetB4 (c) InceptionResNetV2 (D) InceptionV3, (E) MobileNetV2, (G) ResNet50, (G) VGG16 and (H) VGG19. (The diagonal values represent correctly classified instances, while off-diagonal values indicate misclassifications, with predicted labels on the x-axis and actual labels on the y-axis.)\u003c/p\u003e","description":"","filename":"5.png","url":"https://assets-eu.researchsquare.com/files/rs-5841671/v1/d92c576fbd7da554c8197ed9.png"},{"id":74256638,"identity":"0e5f202f-d43b-48a4-90b7-506e5b5bfa58","added_by":"auto","created_at":"2025-01-20 11:28:32","extension":"png","order_by":6,"title":"Figure 6","display":"","copyAsset":false,"role":"figure","size":213817,"visible":true,"origin":"","legend":"\u003cp\u003eDual-axis plot comparing CNN models based on model size, total parameters, and test accuracy. The primary y-axis represents model size and parameters, while the secondary y-axis depicts test accuracy with a trendline highlighting its variation.\u003c/p\u003e","description":"","filename":"6.png","url":"https://assets-eu.researchsquare.com/files/rs-5841671/v1/26f6241a497418a31c93bbec.png"},{"id":74256928,"identity":"9265c328-a948-4cf2-8305-4007e457bb35","added_by":"auto","created_at":"2025-01-20 11:36:33","extension":"png","order_by":7,"title":"Figure 7","display":"","copyAsset":false,"role":"figure","size":806679,"visible":true,"origin":"","legend":"\u003cp\u003eROC-AUC curves illustrating the classification performance of fine-tuned CNN models for arecanut grading.\u003c/p\u003e","description":"","filename":"7.png","url":"https://assets-eu.researchsquare.com/files/rs-5841671/v1/2e9df65943986eb78718aa44.png"},{"id":74258174,"identity":"ece7947d-2417-4dc6-b6d2-521f8ee34f6d","added_by":"auto","created_at":"2025-01-20 11:52:35","extension":"pdf","order_by":0,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":4366226,"visible":true,"origin":"","legend":"","description":"","filename":"manuscript.pdf","url":"https://assets-eu.researchsquare.com/files/rs-5841671/v1/16291a41-0110-41b7-9a6c-7e0dff1c4dec.pdf"},{"id":74256630,"identity":"7f41f5ae-9dbf-4d15-a6e1-53157aab3f7f","added_by":"auto","created_at":"2025-01-20 11:28:32","extension":"docx","order_by":1,"title":"","display":"","copyAsset":false,"role":"supplement","size":1018471,"visible":true,"origin":"","legend":"","description":"","filename":"Supplementalinformation.docx","url":"https://assets-eu.researchsquare.com/files/rs-5841671/v1/bd47051ee02e539bffb69a6d.docx"}],"financialInterests":"The authors declare no competing interests.","formattedTitle":"\u003cp\u003e\u003cstrong\u003eEnhancing Arecanut Quality Grading: A Comparison of Custom CNNs and Transfer Learning Models\u003c/strong\u003e\u003c/p\u003e","fulltext":[{"header":"1. Introduction","content":"\u003cp\u003eArecanut (\u003cem\u003eAreca catechu L\u003c/em\u003e.) is a prominent palm species known for their economic significance and is predominantly cultivated in the southern parts of India (Ansari et al., \u003cspan citationid=\"CR1\" class=\"CitationRef\"\u003e2021\u003c/span\u003e). The plant yields a fruit known as arecanut, supari, or betelnut with diverse applications, such as chewing material, medicinal purposes, and other commercial products. India, as the largest consumer and producer globally, accounts for 50% of the world's arecanut output. In 2020-21, India produced 15.59 lakh tonnes of arecanut from an area of 7.93 lakh hectares, valued approximately at 656.03\u0026nbsp;million USD with Karnataka contributing 79% of this output (Indian Council of Agricultural Research, ICAR report 2023). Grading arecanuts by quality is essential for determining market value and ensuring farmer profitability, but the process remains labor-intensive and inconsistent due to size, shape, and texture variations (Sujatha et al., \u003cspan citationid=\"CR30\" class=\"CitationRef\"\u003e2016\u003c/span\u003e). Manual grading challenges are exacerbated by labor shortages, underscoring the need for efficient, automated solutions to enhance accuracy and reduce processing time.\u003c/p\u003e \u003cp\u003eRecent advancements in artificial intelligence (AI) and machine learning (ML) have revolutionized agricultural operations, enabling precision crop monitoring, quality assessment, and efficient resource management. Convolutional Neural Networks (CNNs), a class of deep learning algorithms, have shown exceptional performance in agricultural classification tasks, including citrus fruit grading, seed type identification, and pest detection, achieving accuracies exceeding 90% (Huang, \u003cspan citationid=\"CR13\" class=\"CitationRef\"\u003e2012\u003c/span\u003e; Xiao et al., \u003cspan citationid=\"CR34\" class=\"CitationRef\"\u003e2023\u003c/span\u003e;). Despite their potential, CNNs often require large, annotated datasets for optimal performance, posing a challenge in data-scarce domains. To address this limitation, transfer learning - a technique that employs pre-trained deep learning models to perform specific tasks with limited data has emerged as a promising approach. In our earlier study, we developed a hardware device that classifies arecanuts into grades using the InceptionV3 model. The device analyzes attributes such as color, texture, and density, achieving a classification accuracy of 98.23% (Ghate et al., \u003cspan citationid=\"CR7\" class=\"CitationRef\"\u003e2024\u003c/span\u003e). Building on this foundation, the current study focuses on improving arecanut classification accuracy by integrating advanced CNN architectures and transfer learning to address challenges such as scarcity of annotated data in agricultural settings. This study explores CNN-based models integrated with transfer learning to develop a reliable and automated arecanut grading system aimed to reduce manual effort and enhance grading accuracy in a cost-effective manner.\u003c/p\u003e \u003cp\u003eThis study aims to develop a powerful machine learning model capable of classifying arecanut into four distinct quality categories using advanced deep learning techniques. By training and evaluating eight state-of-the-art CNN architectures, including ResNet, VGG, Inception, and EfficientNet, augmented with custom dense layers for transfer learning and fine-tuned hyperparameters, the research seeks to minimize manual effort and processing time while enhancing classification accuracy. A curated dataset of 2000 labeled arecanut images ensures replicability and scalability for broader applications. This study advances prior work by leveraging CNN architectures and transfer learning to improve accuracy and scalability in multi-grade arecanut classification. The findings aim to benefit farmers by automating a traditionally labor-intensive process, improving grading consistency, and enabling equitable market opportunities. Additionally, the methodology and dataset presented here are expected to inspire further innovations in agricultural product classification, contributing to the wider adoption of machine learning in precision agriculture.\u003c/p\u003e"},{"header":"2. Related works","content":"\u003cdiv id=\"Sec3\" class=\"Section2\"\u003e \u003ch2\u003e2.1 Traditional classification\u003c/h2\u003e \u003cp\u003eThe traditional classification of arecanuts is based on manual inspection, which is a labour-intensive and error-prone technique. Farmers and traders often grade nuts based on visual features such as color, size, shape, and texture, which frequently results in errors owing to subjective interpretation (Danti and M., 2012; Huang, \u003cspan citationid=\"CR13\" class=\"CitationRef\"\u003e2012\u003c/span\u003e). Factors like lighting, fatigue, and individual bias exacerbate the risk of misclassification, especially when nuts exhibit subtle visual differences after processing. Additionally, manual grading depends heavily on skilled personnel, making it impractical for small-scale farmers or large-scale operations (Bhat et al., \u003cspan citationid=\"CR3\" class=\"CitationRef\"\u003e2023\u003c/span\u003e). Labor shortages and a high demand for efficiency highlight the critical need for scalable, objective solutions that provide consistent, accurate grading while lowering costs and reliance on manual labor.\u003c/p\u003e \u003c/div\u003e \u003cdiv id=\"Sec4\" class=\"Section2\"\u003e \u003ch2\u003e2.2 Machine learning-based classification\u003c/h2\u003e \u003cp\u003eAdvancements in machine learning (ML) have significantly enhanced the automation of arecanut classification, overcoming many limitations of traditional methods. Studies employing techniques such as texture extraction, feature-based analysis, and deep learning have shown promising results. Recent ML studies and deep learning approaches have relied on extracting features like color, texture, and geometry to improve the accuracy and efficiency of arecanut grading. For instance, Shedthi et al. (\u003cspan citationid=\"CR27\" class=\"CitationRef\"\u003e2023\u003c/span\u003e) used Grey Level Co-occurrence Matrix (GLCM) for texture extraction, combined with classifiers like logistic regression, k-NN, Na\u0026iuml;ve Bayes, SVM, and ANN, achieving an accuracy of 98.8%. Similarly, Chandrashekar and Suresha (2019) employed structural matrix decomposition (SMD) and GLCM-based features with a feed-forward neural network to classify four arecanut types, attaining 88.13% accuracy. Naik and Rudra (\u003cspan citationid=\"CR16\" class=\"CitationRef\"\u003e2023\u003c/span\u003e) introduced a non-destructive approach for quality assessment through X-ray imaging and deep learning, utilizing YOLOv5 alongside an adaptive genetic algorithm to attain a mean average precision (mAP) of 97.84%. Mallikarjuna et al. (\u003cspan citationid=\"CR15\" class=\"CitationRef\"\u003e2021\u003c/span\u003e) employed deep CNNs, including AlexNet, alongside multi-gradient imaging techniques to classify disease-affected nuts, showing improved performance in terms of recall, precision, and F1 scores.\u003c/p\u003e \u003cp\u003eBalipa et al. (\u003cspan citationid=\"CR2\" class=\"CitationRef\"\u003e2022\u003c/span\u003e) created a dataset of 180 healthy and diseased arecanut images to train CNN and SVM models using Wavelet and Gabor filters for feature extraction, achieving promising classification rates. Recent advancements also underscore integration of deep learning with image processing techniques. Huang (\u003cspan citationid=\"CR13\" class=\"CitationRef\"\u003e2012\u003c/span\u003e) combined image processing with back-propagation neural networks (BPNNs), grading nuts into three quality categories with 90.9% accuracy. Patil et al. (\u003cspan citationid=\"CR19\" class=\"CitationRef\"\u003e2023\u003c/span\u003e) developed a customized CNN that surpassed AlexNet for classifying de-husked arecanuts, achieving a mAP of 98.34% and an F1 score of 98.45% on a small dataset of 300 samples using 10-fold cross-validation. These advancements demonstrate the increasing effectiveness of CNNs in agricultural tasks, especially in improving grading consistency and scalability.\u003c/p\u003e \u003cp\u003eDespite the contributions of aforementioned studies to the advancement in automated classification of arecanuts, several limitations remain within these investigations. Table\u0026nbsp;\u003cspan refid=\"Tab1\" class=\"InternalRef\"\u003e1\u003c/span\u003e summarises the comparison of previously published machine learning studies used for the classification of areca. Several existing studies face significant limitations, such as small, non-standard datasets (e.g., Shedthi et al., 180 images; Patil et al., 300 images), limiting model scalability and generalizability. To address this, the current study introduces a standardised dataset of 2000 arecanut images, considerably larger and more diversified than prior datasets, enabling vigorous training and better real-world applicability. Additionally, most prior works focus on binary classification (e.g., healthy vs. diseased nuts), which falls short of the multi-grade quality assessment needed for commercial applications. Our study addresses this gap by employing a four-grade classification framework for comprehensive evaluation. Furthermore, while advanced techniques like X-ray imaging and YOLOv5 achieve high accuracy, their cost and complexity make them impractical for small-scale farmers. Our approach focuses on affordable solutions validated under real-world conditions (e.g., varying lighting and nut appearances), ensuring both reliability and accessibility .\u003c/p\u003e \u003cp\u003e \u003cdiv class=\"gridtable\"\u003e\u003ctable float=\"Yes\" id=\"Tab1\" border=\"1\"\u003e \u003ccaption language=\"En\"\u003e \u003cdiv class=\"CaptionNumber\"\u003eTable 1\u003c/div\u003e \u003cdiv class=\"CaptionContent\"\u003e \u003cp\u003eSummary of published studies using machine learning for arecanut classification\u003c/p\u003e \u003c/div\u003e \u003c/caption\u003e \u003ccolgroup cols=\"5\"\u003e \u003cdiv align=\"left\" class=\"colspec\" colname=\"c1\" colnum=\"1\"\u003e\u003c/div\u003e \u003cdiv align=\"left\" class=\"colspec\" colname=\"c2\" colnum=\"2\"\u003e\u003c/div\u003e \u003cdiv align=\"left\" class=\"colspec\" colname=\"c3\" colnum=\"3\"\u003e\u003c/div\u003e \u003cdiv align=\"left\" class=\"colspec\" colname=\"c4\" colnum=\"4\"\u003e\u003c/div\u003e \u003cdiv align=\"left\" class=\"colspec\" colname=\"c5\" colnum=\"5\"\u003e\u003c/div\u003e \u003cthead\u003e \u003ctr\u003e \u003cth align=\"left\" colname=\"c1\"\u003e \u003cp\u003eStudy\u003c/p\u003e \u003c/th\u003e \u003cth align=\"left\" colname=\"c2\"\u003e \u003cp\u003eDataset Size\u003c/p\u003e \u003c/th\u003e \u003cth align=\"left\" colname=\"c3\"\u003e \u003cp\u003eTechnique/Algorithms\u003c/p\u003e \u003c/th\u003e \u003cth align=\"left\" colname=\"c4\"\u003e \u003cp\u003ePerformance\u003c/p\u003e \u003c/th\u003e \u003cth align=\"left\" colname=\"c5\"\u003e \u003cp\u003eLimitations\u003c/p\u003e \u003c/th\u003e \u003c/tr\u003e \u003c/thead\u003e \u003ctbody\u003e \u003ctr\u003e \u003ctd align=\"left\" colname=\"c1\"\u003e \u003cp\u003eChandrashekhara and Suresha, \u003cspan citationid=\"CR4\" class=\"CitationRef\"\u003e2019\u003c/span\u003e\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c2\"\u003e \u003cp\u003e300 images\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c3\"\u003e \u003cp\u003eSMD\u0026thinsp;+\u0026thinsp;GLCM\u0026thinsp;+\u0026thinsp;FFNN\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c4\"\u003e \u003cp\u003eAccuracy: 88.13%\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c5\"\u003e \u003cp\u003eBinary Classification\u003c/p\u003e \u003c/td\u003e \u003c/tr\u003e \u003ctr\u003e \u003ctd align=\"left\" colname=\"c1\"\u003e \u003cp\u003eNaik and Rudra, \u003cspan citationid=\"CR16\" class=\"CitationRef\"\u003e2023\u003c/span\u003e\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c2\"\u003e \u003cp\u003eX-ray imaging\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c3\"\u003e \u003cp\u003eYOLOv5\u0026thinsp;+\u0026thinsp;Genetic Algorithm\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c4\"\u003e \u003cp\u003emAP: 97.84%\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c5\"\u003e \u003cp\u003eHigh computational cost, requires specialized hardware\u003c/p\u003e \u003c/td\u003e \u003c/tr\u003e \u003ctr\u003e \u003ctd align=\"left\" colname=\"c1\"\u003e \u003cp\u003ePatil et al., \u003cspan citationid=\"CR19\" class=\"CitationRef\"\u003e2023\u003c/span\u003e\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c2\"\u003e \u003cp\u003e300 images\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c3\"\u003e \u003cp\u003eCustomized CNN\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c4\"\u003e \u003cp\u003eF1 Score: 98.45%\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c5\"\u003e \u003cp\u003eInsufficient dataset for multi-grade classification\u003c/p\u003e \u003c/td\u003e \u003c/tr\u003e \u003ctr\u003e \u003ctd align=\"left\" colname=\"c1\"\u003e \u003cp\u003eShedthi et al., \u003cspan citationid=\"CR27\" class=\"CitationRef\"\u003e2023\u003c/span\u003e\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c2\"\u003e \u003cp\u003e180 images\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c3\"\u003e \u003cp\u003eGLCM\u0026thinsp;+\u0026thinsp;ANN\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c4\"\u003e \u003cp\u003eAccuracy: 98.8%\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c5\"\u003e \u003cp\u003eSmall dataset, lacks scalability\u003c/p\u003e \u003c/td\u003e \u003c/tr\u003e \u003ctr\u003e \u003ctd align=\"left\" colname=\"c1\"\u003e \u003cp\u003eGhate et al., \u003cspan citationid=\"CR7\" class=\"CitationRef\"\u003e2024\u003c/span\u003e\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c2\"\u003e \u003cp\u003e2000\u0026thinsp;+\u0026thinsp;images\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c3\"\u003e \u003cp\u003eInceptionV3\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c4\"\u003e \u003cp\u003eAccuracy: 98.23%\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c5\"\u003e \u003cp\u003eHardware constraints to try multiple models. Overlap between testing and training images.\u003c/p\u003e \u003c/td\u003e \u003c/tr\u003e \u003ctr\u003e \u003ctd align=\"left\" colname=\"c1\"\u003e \u003cp\u003e\u003cb\u003eCurrent study\u003c/b\u003e\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c2\"\u003e \u003cp\u003e2000 images\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c3\"\u003e \u003cp\u003eCNNs\u0026thinsp;+\u0026thinsp;Transfer Learning\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c4\"\u003e \u003cp\u003eAchieves\u0026thinsp;\u0026gt;\u0026thinsp;95% accuracy across multiple grades.\u003c/p\u003e \u003c/td\u003e \u003ctd align=\"left\" colname=\"c5\"\u003e \u003cp\u003eOvercomes scalability issues and supports multi-grade classification in resource-constrained environments.\u003c/p\u003e \u003c/td\u003e \u003c/tr\u003e \u003c/tbody\u003e \u003c/colgroup\u003e \u003c/table\u003e\u003c/div\u003e \u003c/p\u003e \u003c/div\u003e"},{"header":"3. Methodology","content":"\u003cdiv id=\"Sec6\" class=\"Section2\"\u003e \u003ch2\u003e3.1 Dataset Collection and Annotation\u003c/h2\u003e \u003cp\u003eThe original dataset consists of 2,000 arecanut images categorized into four distinct grades, each containing 500 images. Arecanut plantations in the Puttur region of Dakshina Kannada district, Karnataka, India (12.40\u0026deg;N, 75.10\u0026deg;E), served as the source for the images. The images were captured in diverse conditions, including varying lighting, angles, and backgrounds, to ensure well-constructed representation of real-world scenarios. Experts at the Central Plantation Crops Research Institute (CPCRI) Regional Station, Vittal, Karnataka provided annotations based on visual parameters such as color, texture, and size, which are standard criteria in commercial grading practices. The images were captured using a Vivo Y200e 5G mobile camera with a resolution of 50 MP (6120x6120), resulting in file sizes ranging between 7.5 MB and 9.0 MB. For processing, the images were resized to 224x224 pixels across three RGB channels, a standard resolution for deep learning models like CNNs (Russakovsky et al., \u003cspan citationid=\"CR23\" class=\"CitationRef\"\u003e2015\u003c/span\u003e). This resizing ensured compatibility with the chosen architectures while preserving key visual features that are essential for classification. An 80:20 distribution divided the dataset into training and validation sets. In Karnataka, classification of the de-husked arecanuts into four distinct categories based on their quality: Grade 1 (Best) exhibits a light brown color and lack of peel, Grade 2 (Phatora) displays surface cuts, Grade 3 (Cheppugotu) maintains its skin and appears white, and Grade 4 (Karigotu) displays a dark brown color and signs of rot. The training set was further subdivided into four distinct sub-classes: Grade 1, Grade 2, Grade 3, and Grade 4.\u003c/p\u003e \u003c/div\u003e \u003cdiv id=\"Sec7\" class=\"Section2\"\u003e \u003ch2\u003e3.2 Data Augmentation\u003c/h2\u003e \u003cp\u003ePixel values of the images were normalized by rescaling them by a factor of 1/255. To enhance model adaptability and performance in complex environments, eight distinct data augmentation techniques were applied to the images. These techniques included rotation, width shift, height shift, and fill, as illustrated in Fig.\u0026nbsp;\u003cspan refid=\"Fig3\" class=\"InternalRef\"\u003e2\u003c/span\u003e. Random horizontal flips, shearing (up to 0.2 degrees), and zooming (by a factor of 0.2) were also incorporated. These techniques were specifically chosen to tackle common challenges in arecanut classification, such as variability in shape, size, and orientation of the nuts. For instance, rotation and zooming help account for irregularities in nut appearance during real-world grading processes. The augmentation process increased the training dataset by generating an additional 8,000 images, ensuring equal representation across all four grades (Shorten et al., 2019). Pixels introduced during transformations were managed using a fill mode set to 'constant' with a constant value of 125. Augmented datasets were generated using the \u003cem\u003e\u0026lsquo;train_data_gen\u0026rsquo;\u003c/em\u003e and \u003cem\u003e\u0026lsquo;val_data_gen\u0026rsquo;\u003c/em\u003e objects. This augmentation strategy not only introduced variability into the training data but also ensured that the model was better equipped to handle the diverse appearances of arecanuts in real-world settings.\u003c/p\u003e \u003c/div\u003e \u003cdiv id=\"Sec8\" class=\"Section2\"\u003e \u003ch2\u003e3.3 Hyperparameter Tuning\u003c/h2\u003e \u003cp\u003eBayesian optimization with Keras Tuner facilitated hyperparameter tuning by efficiently predicting the most promising hyperparameter combinations (Snoek et al., \u003cspan citationid=\"CR29\" class=\"CitationRef\"\u003e2012\u003c/span\u003e). A custom HyperModel class encapsulated the model architecture and hyperparameters, enabling flexible adjustments and experimentation. The tuning process involved running 25 trials for each of the eight models, balancing computational efficiency with a thorough exploration of the search space. The primary hyperparameters included the number of convolutional layers which ranged from 3 to 7, each containing 512 neurons, influencing the model's ability to extract features at different abstraction levels. The schematic architecture of custom Convolutional Neural Network (CNN) model for arecanut classification is shown in Fig. S1. The learning rate, adjusted within the range of 0.0001 to 0.01, and dropout rates, ranging from 0.1 to 0.6, decided by a combination of prior research and preliminary experiments. These choices reflect the importance of layer count for model capacity; while learning and dropout rates ensure effective training and prevent overfitting. This tuning approach maximized validation accuracy and optimized model performance while remaining computationally efficient.\u003c/p\u003e \u003c/div\u003e \u003cdiv id=\"Sec9\" class=\"Section2\"\u003e \u003ch2\u003e3.4 Transfer Learning for Arecanut Classification\u003c/h2\u003e \u003cp\u003eK-fold cross-validation with eight folds was employed to ensure a thorough evaluation of the model\u0026rsquo;s performance. This technique helps in evaluating how the model will generalize to an independent dataset by training and validating it on different subsets of the data. Eight pre-trained deep learning models - ResNet50, VGG16, VGG19, InceptionV3, InceptionResNetV2, EfficientNetB4, DenseNet121, and MobileNetV2 - were adapted for the arecanut classification task. These models were chosen based on their proven performance in various classification tasks, making them suitable for our application. The base layers of these pre-trained models were frozen to retain their learned features, while global average pooling was applied to reduce feature maps efficiently without introducing additional parameters (Donahue et al., \u003cspan citationid=\"CR6\" class=\"CitationRef\"\u003e2014\u003c/span\u003e). Custom dense layers with ReLU activation were added to capture non-linear relationships in the arecanut features, ensuring effective classification performance. Dropout layers were incorporated after dense layers to mitigate overfitting by randomly deactivating neurons during training. The choice of ReLU stems from its simplicity, computational efficiency, and ability to mitigate the vanishing gradient problem, while dropout improves generalization - key for handling the variability in arecanut images. The final output layer used softmax activation to classify the images into four quality grades.\u003c/p\u003e \u003c/div\u003e \u003cdiv id=\"Sec10\" class=\"Section2\"\u003e \u003ch2\u003e3.5 Model Compilation and Training\u003c/h2\u003e \u003cp\u003eThe models were compiled using the categorical cross-entropy loss function, which is appropriate for multi-class classification (Ho and Wookey, \u003cspan citationid=\"CR10\" class=\"CitationRef\"\u003e2019\u003c/span\u003e). A dropout rate of 0.5 was applied after the global average pooling layer and between the fully connected layers to prevent overfitting. Early stopping was implemented with a patience of eight epochs, monitoring validation loss (Prechelt, \u003cspan citationid=\"CR22\" class=\"CitationRef\"\u003e2002\u003c/span\u003e). A learning rate reduction strategy further refined the model by reducing the learning rate by a factor of 0.2 if the validation loss did not improve for five epochs, with a minimum learning rate set to 0.000001. To address potential class imbalance, the dataset was carefully analyzed to ensure equal representation of all four grades. After initial training for 50 epochs, the best-performing model from hyperparameter tuning was selected for further evaluation.\u003c/p\u003e \u003c/div\u003e \u003cdiv id=\"Sec11\" class=\"Section2\"\u003e \u003ch2\u003e3.6 Initial Model Evaluation and Fine-Tuning\u003c/h2\u003e \u003cp\u003eThe best-performing model from each architecture was selected based on validation accuracy and F1-score for further evaluation (Goutte and Gaussier, \u003cspan citationid=\"CR8\" class=\"CitationRef\"\u003e2005\u003c/span\u003e). The model was evaluated on the validation dataset to assess its performance on unseen data. Key metrics, including a confusion matrix, precision, recall, and F1-scores were recorded. Observations from the confusion matrix were analyzed to identify misclassifications, particularly among adjacent grades. This further led to the refinement of the model architecture and hyperparameters to improve performance. For fine-tuning, all layers of the selected model were initially frozen to retain pre-trained features. The total number of layers in the base model was determined, and the last 50 layers (or the last 10 layers in the case of VGG) were unfrozen to allow for adaptation to the specific task while retaining learned features from earlier layers. Early stopping and learning rate reduction were implemented to prevent overfitting and optimize training efficiency. TensorBoard was used to monitor the training process. Post-fine-tuning, the model was re-evaluated, and a new confusion matrix was generated to assess improvements in classification performance, particularly for challenging grades. The comparisons between initial and fine-tuned evaluations presented significant gain in overall accuracy and class-wise precision, validating the effectiveness of the fine-tuning strategy.\u003c/p\u003e \u003c/div\u003e \u003cdiv id=\"Sec12\" class=\"Section2\"\u003e \u003ch2\u003e3.7 Experimental Setup\u003c/h2\u003e \u003cp\u003eThe experiments were conducted on a system with an 11th-generation Intel Core i7 processor, 32GB of RAM, and an NVIDIA RTX 3060 GPU with 12GB of memory. The computational setup also enabled the use of advanced techniques like Bayesian optimization for hyperparameter tuning and K-fold cross-validation without compromising on speed or performance. Both the initial and fine-tuned models were saved as .h5 (hierarchical data format) files - one reflecting the state after initial training and another after fine-tuning, to ensure reproducibility and enable further experimentation.\u003c/p\u003e \u003c/div\u003e"},{"header":"4. Results and discussion","content":"\u003cp\u003eThe arecanut industry faces significant challenges in maintaining uniform and accurate grading of arecanuts due to variability in its size, shape, and texture, coupled with the subjectivity of manual evaluation. This study aims to address these limitations by using convolutional neural networks (CNNs) for automated arecanut classification. Using a balanced dataset of 2,000 arecanut images across four quality grades, we explored various CNN architectures, including DenseNet121, EfficientNetB4, and MobileNetV2, to identify the optimal model for this task. Preliminary studies suggest that the adoption of CNNs not only improves classification accuracy but also significantly reduces the time and effort associated with traditional grading methods. This research highlights the potential of deep learning to transform agricultural quality assessment, particularly for resource-intensive tasks like arecanut grading. Figure \u003cspan class=\"InternalRef\"\u003e1\u003c/span\u003e is a flowchart illustrating the process of arecanut classification using custom-designed CNN models in this study.\u003c/p\u003e\n\u003cdiv id=\"Sec14\" class=\"Section2\"\u003e\n \u003ch2\u003e\u003cstrong\u003e4.1 Augmentation and image datasets\u003c/strong\u003e\u003c/h2\u003e\n \u003cp\u003eThe present study used the dataset consisting of 2000 images categorized into four quality grades with 500 images in each category. The images were captured under varying conditions to reflect real-world variability, including differences in lighting, angles, and background textures. Figure \u003cspan class=\"InternalRef\"\u003e2\u003c/span\u003e illustrates the augmentation methods applied. By incorporating augmented samples during training, the model improved its ability to generalize across diverse scenarios, enhancing accuracy on validation and test sets. Similar nut classification studies, such as those on groundnuts and hazelnuts, utilized datasets with 300 to 4,250 images distributed across multiple classes (Patil et al., \u003cspan class=\"CitationRef\"\u003e2023\u003c/span\u003e; Taner et al., \u003cspan class=\"CitationRef\"\u003e2021\u003c/span\u003e). The comparable size of our dataset and the use of augmentation align with these approaches, demonstrating their effectiveness in addressing variability and improving classification performance.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"Sec15\" class=\"Section2\"\u003e\n \u003ch2\u003e4.2 Justification for choosing different CNN models\u003c/h2\u003e\n \u003cp\u003eIdentifying a suitable Convolutional Neural Network (CNN) model for classifying arecanut images means finding the right balance between task-specific criteria, performance, and computational complexity. This study evaluated eight distinct CNN architectures: DenseNet121, EfficientNetB4, InceptionResNetV2, InceptionV3, MobileNetV2, ResNet50, VGG16, and VGG19. The models were chosen for their ability to address specific challenges in arecanut classification, such as texture variability, resource constraints, and deployment efficiency. Table \u003cspan class=\"InternalRef\"\u003e2\u003c/span\u003e summarizes the computational requirements, and key strengths of these CNN models, providing a comparative overview. For instance, DenseNet121 and ResNet50 are well-suited for environments requiring high accuracy and texture-sensitive classification, while MobileNetV2 excels in applications with resource constraints, such as mobile or edge devices. In contrast, models such as VGG16 and InceptionResNetV2 deliver superior accuracy in resource-rich environments at the cost of higher computational overhead. Practical deployment considerations, such as inference speed and memory usage are critical in selecting models for different applications. By evaluating these models against several criteria, this study focuses on the trade-offs between performance and computational efficiency, offering insights into how state-of-the-art CNNs can address the challenges of automating arecanut grading in diverse environments. \u0026nbsp;\u003c/p\u003e\n \u003ctable id=\"Tab2\" border=\"1\"\u003e\n \u003ccaption language=\"En\"\u003e\n \u003cdiv class=\"CaptionNumber\"\u003eTable 2\u003c/div\u003e\n \u003cdiv class=\"CaptionContent\"\u003e\n \u003cp\u003eComparative analysis of CNN models used : strengths and practical considerations\u003c/p\u003e\n \u003c/div\u003e\n \u003c/caption\u003e\n \u003cthead\u003e\n \u003ctr\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eCNN Model\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eKey strengths\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003ePractical considerations\u003c/p\u003e\n \u003c/th\u003e\n \u003c/tr\u003e\n \u003c/thead\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eDenseNet121\u003c/p\u003e\n \u003cp\u003e(Huang et al., \u003cspan class=\"CitationRef\"\u003e2017\u003c/span\u003e)\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eEfficient feature reuse improves texture and shape detection.\u003c/p\u003e\n \u003cp\u003eSmooth gradient flow enhances performance and reduces redundancy.\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eModerate computational requirements; well-suited for small datasets with limited redundancy.\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eEfficientNetB4\u003c/p\u003e\n \u003cp\u003e(Tan and Le, \u003cspan class=\"CitationRef\"\u003e2020\u003c/span\u003e)\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eCompound scaling achieves a balance between accuracy and efficiency.\u003c/p\u003e\n \u003cp\u003eDelivers optimal performance with minimal computational resources..\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eIdeal for resource-constrained environments due to high scalability and efficiency.\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eInceptionV3\u003c/p\u003e\n \u003cp\u003e(Szegedy et al., \u003cspan class=\"CitationRef\"\u003e2016\u003c/span\u003e)\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eFactorized convolutions enhance multi-scale feature detection.\u003c/p\u003e\n \u003cp\u003eMulti-scale feature extraction enhances adaptability.\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eEfficient for real-time classification tasks with a robust architecture for complex patterns.\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eInceptionResNetV2\u003c/p\u003e\n \u003cp\u003e(Peng et al., \u003cspan class=\"CitationRef\"\u003e2022\u003c/span\u003e)\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eCombines Inception and residual blocks for precision and adaptability.\u003c/p\u003e\n \u003cp\u003eHandles complex feature hierarchies effectively with skip connections.\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eComputationally intensive; requires robust hardware for optimal performance.\u003c/p\u003e\n \u003cp\u003eSuitable for tasks requiring fine-grained detail detection.\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eMobileNetV2\u003c/p\u003e\n \u003cp\u003e(Sandler et al., 2018)\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eLinear bottlenecks enhance efficiency without sacrificing accuracy.\u003c/p\u003e\n \u003cp\u003eOptimized for low-resource environments with lightweight design.\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eFast inference, making it ideal for edge deployment.\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eResNet50\u003c/p\u003e\n \u003cp\u003e(Sachdeva et al., \u003cspan class=\"CitationRef\"\u003e2024\u003c/span\u003e)\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eDeep residual learning mitigates vanishing gradients, ensuring stable training.\u003c/p\u003e\n \u003cp\u003eMaintains high accuracy in deep networks through effective gradient propagation.\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eVersatile for processing large datasets but requires significant memory.\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eVGG16/VGG19\u003c/p\u003e\n \u003cp\u003e(Hindarto, \u003cspan class=\"CitationRef\"\u003e2023\u003c/span\u003e)\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eSimple architecture with consistent performance for fine-grained feature tasks.\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eHigh memory consumption makes it better suited for high-resource systems.\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n \u003c/table\u003e\n \u003cp\u003e\u003c/p\u003e\n \u003cp\u003e\u003cbr\u003e\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"Sec16\" class=\"Section2\"\u003e\n \u003ch2\u003e4.3 Hyperparameter tuning\u003c/h2\u003e\n \u003cp\u003eHyperparameter tuning was crucial to enhancing the classification accuracy of CNN models for arecanut grading. We utilized the Bayesian classifier to identify promising hyperparameter ranges before conducting fine-tuning with K-fold cross-validation. Key hyperparameters for each CNN model were optimized to enhance classification accuracy for arecanut grading. The DenseNet121 model, which had three custom dense layers, a learning rate of 0.0001, and a dropout rate of 0.1, did very well, as shown in Table \u003cspan class=\"InternalRef\"\u003e3\u003c/span\u003e, with the RMSprop optimizer enhancing its training by adaptively adjusting the learning rate for each parameter based on the gradient\u0026apos;s magnitude, ensuring stable and efficient convergence. EfficientNetB4 necessitated additional layers and a slightly elevated dropout rate of 0.4, which may stem from its propensity to overfit small datasets due to its depth and parameter richness. The SGD optimizer achieved a fine-tuned learning rate of approximately 0.00021. Even though most CNN models showed RMSprop and Adam optimizers as best hyperparameters, they had different optimal configurations showing the intricacy involved in balancing depth and regularization. Notably, VGG16 and VGG19, known for their depth, required relatively higher learning rates, with VGG19 needing the highest learning rate of 0.001 among the models tested, allowing us to compare the performance of models with similar architectures but varying depths. Table \u003cspan class=\"InternalRef\"\u003e3\u003c/span\u003e explains optimal hyperparameter settings for selecting the best CNN models in the current study. These results emphasize that both complex and simpler models can achieve competitive performance when optimally tuned, illustrating the importance of tailored hyperparameter configurations.\u003c/p\u003e\n \u003cp\u003e\u0026nbsp;\u0026nbsp;\u003c/p\u003e\n \u003ctable id=\"Tab3\" border=\"1\" style=\"margin-right: calc(22%); width: 78%;\"\u003e\n \u003ccaption language=\"En\"\u003e\n \u003cdiv class=\"CaptionNumber\"\u003eTable 3\u003c/div\u003e\n \u003cdiv class=\"CaptionContent\"\u003e\n \u003cp\u003eOptimal hyperparameter settings for selecting the best CNN models for arecanut classification\u003c/p\u003e\n \u003c/div\u003e\n \u003c/caption\u003e\n \u003cthead\u003e\n \u003ctr\u003e\n \u003cth align=\"left\" style=\"width: 16.9737%;\"\u003e\n \u003cp\u003eCNN model\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\" style=\"width: 18.5405%;\"\u003e\n \u003cp\u003eNo. of custom layers\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\" colspan=\"2\" style=\"width: 14.2318%;\"\u003e\n \u003cp\u003eLearning rate\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\" colspan=\"2\" style=\"width: 16.3209%;\"\u003e\n \u003cp\u003eDropout rate\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\" style=\"width: 3.4731%;\"\u003e\n \u003cp\u003eOptimizer\u003c/p\u003e\n \u003c/th\u003e\n \u003c/tr\u003e\n \u003c/thead\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\" style=\"width: 16.9737%;\"\u003e\n \u003cp\u003eDenseNet121\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" style=\"width: 18.5405%;\"\u003e\n \u003cp\u003e3\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" style=\"width: 12.7956%;\"\u003e\n \u003cp\u003e0.0001\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" colspan=\"2\" style=\"width: 13.4484%;\"\u003e\n \u003cp\u003e0.1\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" colspan=\"2\" style=\"width: 12.0122%;\"\u003e\n \u003cp\u003eRMSprop\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\" style=\"width: 16.9737%;\"\u003e\n \u003cp\u003eEfficientNetB4\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" style=\"width: 18.5405%;\"\u003e\n \u003cp\u003e7\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" style=\"width: 12.7956%;\"\u003e\n \u003cp\u003e0.000209\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" colspan=\"2\" style=\"width: 13.4484%;\"\u003e\n \u003cp\u003e0.4\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" colspan=\"2\" style=\"width: 12.0122%;\"\u003e\n \u003cp\u003eSGD\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\" style=\"width: 16.9737%;\"\u003e\n \u003cp\u003eInceptionResNetV2\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" style=\"width: 18.5405%;\"\u003e\n \u003cp\u003e3\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" style=\"width: 12.7956%;\"\u003e\n \u003cp\u003e0.0001\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" colspan=\"2\" style=\"width: 13.4484%;\"\u003e\n \u003cp\u003e0.2\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" colspan=\"2\" style=\"width: 12.0122%;\"\u003e\n \u003cp\u003eRMSprop\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\" style=\"width: 16.9737%;\"\u003e\n \u003cp\u003eInceptionV3\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" style=\"width: 18.5405%;\"\u003e\n \u003cp\u003e4\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" style=\"width: 12.7956%;\"\u003e\n \u003cp\u003e0.000879\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" colspan=\"2\" style=\"width: 13.4484%;\"\u003e\n \u003cp\u003e0.2\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" colspan=\"2\" style=\"width: 12.0122%;\"\u003e\n \u003cp\u003eAdam\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\" style=\"width: 16.9737%;\"\u003e\n \u003cp\u003eMobileNetV2\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" style=\"width: 18.5405%;\"\u003e\n \u003cp\u003e3\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" style=\"width: 12.7956%;\"\u003e\n \u003cp\u003e0.00012\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" colspan=\"2\" style=\"width: 13.4484%;\"\u003e\n \u003cp\u003e0.2\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" colspan=\"2\" style=\"width: 12.0122%;\"\u003e\n \u003cp\u003eAdam\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\" style=\"width: 16.9737%;\"\u003e\n \u003cp\u003eResNet50\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" style=\"width: 18.5405%;\"\u003e\n \u003cp\u003e4\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" style=\"width: 12.7956%;\"\u003e\n \u003cp\u003e0.000226\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" colspan=\"2\" style=\"width: 13.4484%;\"\u003e\n \u003cp\u003e0.1\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" colspan=\"2\" style=\"width: 12.0122%;\"\u003e\n \u003cp\u003eAdam\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\" style=\"width: 16.9737%;\"\u003e\n \u003cp\u003eVGG16\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" style=\"width: 18.5405%;\"\u003e\n \u003cp\u003e5\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" style=\"width: 12.7956%;\"\u003e\n \u003cp\u003e0.000193\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" colspan=\"2\" style=\"width: 13.4484%;\"\u003e\n \u003cp\u003e0.1\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" colspan=\"2\" style=\"width: 12.0122%;\"\u003e\n \u003cp\u003eRMSprop\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\" style=\"width: 16.9737%;\"\u003e\n \u003cp\u003eVGG19\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" style=\"width: 18.5405%;\"\u003e\n \u003cp\u003e3\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" style=\"width: 12.7956%;\"\u003e\n \u003cp\u003e0.001087\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" colspan=\"2\" style=\"width: 13.4484%;\"\u003e\n \u003cp\u003e0.2\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\" colspan=\"2\" style=\"width: 12.0122%;\"\u003e\n \u003cp\u003eRMSprop\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n \u003c/table\u003e\n \u003cp\u003e\u003c/p\u003e\n \u003cp\u003e\u003cbr\u003e\u003c/p\u003e\n \u003cp\u003eRecent studies underline the major role of hyperparameter tuning in optimizing deep learning models for agricultural classification tasks. For instance, Patil et al. (\u003cspan class=\"CitationRef\"\u003e2023\u003c/span\u003e) reported that an eight-layer AlexNet underperformed compared to a customized CNN trained with a learning rate of 0.0002 and Adam optimizer for arecanut quality classification. Similarly, Naik and Rudra (\u003cspan class=\"CitationRef\"\u003e2023\u003c/span\u003e) achieved state-of-the-art results using YOLOv5 models for non-invasive X-ray-based arecanut quality assessment, with adaptive genetic algorithms improving the mAP of YOLOv5m to 97.78%. While the approaches used in the above differ methodologically, the focus on adaptive hyperparameter optimization matches with our findings. Shankar et al. (\u003cspan class=\"CitationRef\"\u003e2022\u003c/span\u003e) indicated the importance of automated hyperparameter tuning for fruit classification, achieving remarkable accuracy improvements using the Aquila Optimization Algorithm for RNN models. These studies jointly suggest that precise hyperparameter tuning, whether manual or automated, is necessary for achieving optimal performance in various agricultural classification tasks.\u003c/p\u003e\n \u003cp\u003eCompared to these studies, our CNN model, DenseNet121, demonstrates superior performance in accuracy, model size, and parameters. To further improve the model\u0026apos;s performance, experimenting with hybrid optimization strategies could help balance generalization and computational efficiency, while layer-wise freezing during transfer learning might mitigate overfitting in small datasets.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"Sec17\" class=\"Section2\"\u003e\n \u003ch2\u003e4.4 Model validation performance evaluation:\u003c/h2\u003e\n \u003cp\u003eTable \u003cspan class=\"InternalRef\"\u003e4\u003c/span\u003e summarizes the model validation performance evaluation of the tested CNN models, showing significant differences in accuracy and other metrics. DenseNet121 emerged as the top performer with 98.50% accuracy and a balanced F1-Score, showcasing its ability to capture complex features. MobileNetV2, with slightly lower accuracy (98.42%), offers a lightweight architecture ideal for resource-constrained applications like mobile devices and agricultural machinery. InceptionResNetV2 and InceptionV3 both achieved high accuracy (96.75%) and performed well in precision, recall, and F1-Score, demonstrating their reliability for arecanut classification. VGG16 and VGG19 provided good results with accuracies around 90%, but had lower recall rates, suggesting room for improvement in classifying all relevant classes. In contrast, EfficientNetB4 underperformed with an accuracy of just 24.75%, likely due to a mismatch between its general-purpose design and the texture-specific features of arecanut images. ResNet50 also performed moderately, with an accuracy of 65.25%, indicating the need for further optimization, particularly due its more complex architecture.\u003c/p\u003e\n \u003cdiv class=\"gridtable\"\u003e\n \u003cdiv align=\"left\" class=\"colspec\"\u003e\u003cbr\u003e\u003c/div\u003e\u0026nbsp;\u0026nbsp;\u003ctable id=\"Tab4\" border=\"1\"\u003e\n \u003ccaption language=\"En\"\u003e\n \u003cdiv class=\"CaptionNumber\"\u003eTable 4\u003c/div\u003e\n \u003cdiv class=\"CaptionContent\"\u003e\n \u003cp\u003eValidation metrics for CNN models in arecanut classification\u003c/p\u003e\n \u003c/div\u003e\n \u003c/caption\u003e\n \u003cthead\u003e\n \u003ctr\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eModel\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eAccuracy\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003ePrecision\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eRecall\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eF1-Score\u003c/p\u003e\n \u003c/th\u003e\n \u003c/tr\u003e\n \u003c/thead\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eDenseNet121\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.985\u0026thinsp;\u0026plusmn;\u0026thinsp;0.001\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.986\u0026thinsp;\u0026plusmn;\u0026thinsp;0.009\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.995\u0026thinsp;\u0026plusmn;\u0026thinsp;0.0099\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.985\u0026thinsp;\u0026plusmn;\u0026thinsp;0.001\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eEfficientNetB4\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.2475\u0026thinsp;\u0026plusmn;\u0026thinsp;0.02\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.63\u0026thinsp;\u0026plusmn;\u0026thinsp;0.013\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.2475\u0026thinsp;\u0026plusmn;\u0026thinsp;0.0275\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.099\u0026thinsp;\u0026plusmn;\u0026thinsp;0.019\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eInceptionResNetV2\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.9675\u0026thinsp;\u0026plusmn;\u0026thinsp;0.012\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.969\u0026thinsp;\u0026plusmn;\u0026thinsp;0.009\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.968\u0026thinsp;\u0026plusmn;\u0026thinsp;0.0115\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.9673\u0026thinsp;\u0026plusmn;\u0026thinsp;0.011\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eInceptionV3\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.9675\u0026thinsp;\u0026plusmn;\u0026thinsp;0.017\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.969\u0026thinsp;\u0026plusmn;\u0026thinsp;0.016\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.967\u0026thinsp;\u0026plusmn;\u0026thinsp;0.0173\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.968\u0026thinsp;\u0026plusmn;\u0026thinsp;0.017\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eMobileNetV2\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.984\u0026thinsp;\u0026plusmn;\u0026thinsp;0.009\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.985\u0026thinsp;\u0026plusmn;\u0026thinsp;0.008\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.984\u0026thinsp;\u0026plusmn;\u0026thinsp;0.0094\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.9842\u0026thinsp;\u0026plusmn;\u0026thinsp;0.009\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eResNet50\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.6525\u0026thinsp;\u0026plusmn;\u0026thinsp;0.03\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.634\u0026thinsp;\u0026plusmn;\u0026thinsp;0.035\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.6525\u0026thinsp;\u0026plusmn;\u0026thinsp;0.0299\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.6311\u0026thinsp;\u0026plusmn;\u0026thinsp;0.03\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eVGG16\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.9033\u0026thinsp;\u0026plusmn;\u0026thinsp;0.02\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.912\u0026thinsp;\u0026plusmn;\u0026thinsp;0.019\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.903\u0026thinsp;\u0026plusmn;\u0026thinsp;0.0211\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.9039\u0026thinsp;\u0026plusmn;\u0026thinsp;0.02\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eVGG19\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.891\u0026thinsp;\u0026plusmn;\u0026thinsp;0.033\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.913\u0026thinsp;\u0026plusmn;\u0026thinsp;0.022\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.891\u0026thinsp;\u0026plusmn;\u0026thinsp;0.0330\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.8926\u0026thinsp;\u0026plusmn;\u0026thinsp;0.03\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n \u003c/table\u003e\n \u003c/div\u003e\n \u003cp\u003e\u003cbr\u003e\u003c/p\u003e\n \u003cp\u003eFigures \u003cspan class=\"InternalRef\"\u003e3\u003c/span\u003e and \u003cspan class=\"InternalRef\"\u003e4\u003c/span\u003e illustrate the variations in accuracy and loss across 25 trials of hyperparameter tuning with 50 epochs in each trial. Most models stabilized after the first few epochs, indicating neither overfitting nor underfitting. Notably, DenseNet121, InceptionV3, and EfficientNetB4 demonstrated enhanced training performance compared to other models. In contrast, the remaining models experienced either overfitting or underfitting at various epochs. The trial with low loss and high accuracy was considered the best model with the best hyperparameters. The results indicate that while DenseNet121 and InceptionV3 are the most suitable models for this task, future work needs to focus on improving underperforming models like EfficientNetB4 and ResNet50, maybe by tailored pretraining or dataset-specific augmentations. The dense connections in DenseNet121\u0026apos;s architecture make gradient flow and feature reuse more efficient, which leads to better performance (Nguyen et al., 2024). InceptionV3\u0026apos;s factorized convolutional and aggressive regularization ensure high accuracy while maintaining computational efficiency (Hossain et al., \u003cspan class=\"CitationRef\"\u003e2024\u003c/span\u003e). According to (Sachdeva et al., \u003cspan class=\"CitationRef\"\u003e2024\u003c/span\u003e), EfficientNetB4 and ResNet50\u0026apos;s higher level of complexity and sensitivity to hyperparameters often lead to overfitting or poor generalization on certain datasets.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"Sec18\" class=\"Section2\"\u003e\n \u003ch2\u003e4.5 Model testing\u003c/h2\u003e\n \u003cp\u003eUpon further evaluation using the test dataset, DenseNet121 and InceptionV3 models emerged as the top performers, achieving a test accuracy of 95.67% and strong F1-scores, precision, and recall of 96% (Table \u003cspan class=\"InternalRef\"\u003e5\u003c/span\u003e). Both models showed consistent performance across validation and test phases, underscoring their reliability for arecanut classification. DenseNet121\u0026rsquo;s dense connections improve feature reuse and gradient flow, while InceptionV3\u0026rsquo;s factorized convolutions and regularization capture fine-grained textures. Both models improved after fine-tuning, with significant gains in precision, recall, and F1-scores compared to their initial evaluation. For instance, fine-tuned DenseNet121 demonstrated an accuracy of 95.67%, with a precision, recall, and F1-score of 96%, improving upon the baseline results, which underscores the value of refining the model to better adapt to the specific task at hand. In contrast, models such as EfficientNetB4, InceptionResNetV2, VGG16, VGG19, and ResNet50 exhibited poor test results, with accuracies below 25.45% and failing to maintain performance outside the validation phase (Table \u003cspan class=\"InternalRef\"\u003e5\u003c/span\u003e). These models showed low F1-scores and near-zero Cohen\u0026apos;s Kappa values, suggesting significant underfitting for this task. The architectural choices in these models might not be well-suited for this dataset, requiring more specialized tuning or adjustments to handle arecanut\u0026rsquo;s unique features effectively.\u003c/p\u003e\n \u003cdiv class=\"gridtable\"\u003e\n \u003cdiv align=\"left\" class=\"colspec\"\u003e\u003cbr\u003e\u003c/div\u003e\u0026nbsp;\u003ctable id=\"Tab5\" border=\"1\"\u003e\n \u003ccaption language=\"En\"\u003e\n \u003cdiv class=\"CaptionNumber\"\u003eTable 5\u003c/div\u003e\n \u003cdiv class=\"CaptionContent\"\u003e\n \u003cp\u003eComparison of test performance metrics for initial and fine-tuned CNN models in arecanut classification\u003c/p\u003e\n \u003c/div\u003e\n \u003c/caption\u003e\n \u003cthead\u003e\n \u003ctr\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eModel\\Metrics\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eAccuracy\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003ePrecision\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eRecall\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eF1\u003c/p\u003e\n \u003cp\u003e-Score\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eCohen\u0026apos;s Kappa\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eLog loss\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eTotal time\u003c/p\u003e\n \u003cp\u003e(s)\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eAverage time/image (s)\u003c/p\u003e\n \u003c/th\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003cth align=\"left\" colspan=\"9\"\u003e\n \u003cp\u003eInitial models\u003c/p\u003e\n \u003c/th\u003e\n \u003c/tr\u003e\n \u003c/thead\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e\u003cstrong\u003eDenseNet121\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.9567\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.96\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.96\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.96\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.94\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.15\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e6.02\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.015\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eEfficientNetB4\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.2545\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.06\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.25\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.1\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e1.39\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e7.25\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.018\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eInceptionResNetV2\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.2545\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.06\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.25\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.1\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e2.89\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e6.58\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.017\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e\u003cstrong\u003eInceptionV3\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.9567\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.96\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.96\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.96\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.94\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.17\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e4.27\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.011\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eMobileNetV2\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.3511\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.32\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.35\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.25\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.13\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e10.01\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e3.21\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.008\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eResNet50\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.2366\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.06\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.25\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.1\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e12.17\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e3.84\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.010\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eVGG16\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.2545\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.06\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.25\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.1\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e1.41\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e2.28\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.006\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eVGG19\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.2545\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.06\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.25\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.1\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e1.39\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e2.72\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.007\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\" colspan=\"9\"\u003e\n \u003cp\u003e\u003cstrong\u003eFine-tuned models\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e\u003cstrong\u003eDenseNet121\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.9567\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.96\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.96\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.96\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.94\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.15\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e5.88\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.015\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eEfficientNetB4\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.2545\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.06\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.25\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.1\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e1.39\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e6.96\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.018\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eInceptionResNetV2\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.2545\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.06\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.25\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.1\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e2.89\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e5.88\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.015\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e\u003cstrong\u003eInceptionV3\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.9567\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.96\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.96\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.96\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.94\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.17\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e4.33\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.011\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eMobileNetV2\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.3511\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.32\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.35\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.25\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.13\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e10.01\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e3.20\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.008\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eResNet50\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.2366\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.06\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.25\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.1\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e12.17\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e3.45\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.009\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eVGG16\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.2545\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.06\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.25\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.1\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e1.41\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e2.28\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.006\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eVGG19\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.2545\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.06\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.25\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.1\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e1.39\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e2.71\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.007\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n \u003c/table\u003e\n \u003c/div\u003e\n \u003cp\u003e\u003cbr\u003e\u003c/p\u003e\n \u003cp\u003eIn terms of computational efficiency, MobileNetV2 proved to be the fastest, with an average classification time of 0.008 seconds per image, although its accuracy of 35.11% limits its practical utility (Table \u003cspan class=\"InternalRef\"\u003e5\u003c/span\u003e). DenseNet121 and InceptionV3, while slightly slower at 0.015 and 0.011 seconds per image, respectively, offer a good balance between computational cost and high accuracy. In comparison, models like ResNet50 and EfficientNetB4 exhibited notably slower performance, with higher average classification times and lower accuracy, further emphasizing their unsuitability for this task (Table \u003cspan class=\"InternalRef\"\u003e5\u003c/span\u003e).\u003c/p\u003e\n \u003cp\u003eIn contrast to earlier works (Chandrashekhara et al., 2019) which focused on geometrical features, this study utilizes advanced CNN architectures, achieving a 10% improvement in the precision and recall. DenseNet121\u0026rsquo;s superior ability to model fine-grained textures is a key factor in this improvement, particularly after fine-tuning steps. Naik and Rudra\u0026apos;s (2023) YOLOv5 model, while effective, was limited by a small dataset (900 X-ray images), which may not fully capture the complexity of arecanut quality. Additionally, this study\u0026apos;s use of CNN models offers more scalable and robust performance for large, complex datasets. Our proposed fine-tuned DenseNet121 and InceptionV3 models outperform existing models for arecanut classification. DenseNet121\u0026rsquo;s efficiency and compact model size make it an ideal choice for practical deployment in real-world agricultural settings.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"Sec19\" class=\"Section2\"\u003e\n \u003ch2\u003e4.6 Complexity of CNN Models for Arecanut Classification\u003c/h2\u003e\n \u003cp\u003eTable \u003cspan class=\"InternalRef\"\u003e6\u003c/span\u003e presents a comprehensive overview of the key metrics- total parameters, trainable and non-trainable parameters, model size, and layer count, highlighting the varying complexities of the CNN models used for arecanut classification. Trainable parameters are those that the model learns during training, while non-trainable parameters are typically fixed weights from pretrained layers. The DenseNet121 model, with 8.09 million total parameters and a 30.86 MB model size, strikes a balance between architectural complexity and efficiency, making it well-suited for fine-grained feature extraction. In contrast, EfficientNetB4, although larger at 76.94 MB, offers a favorable trade-off between performance and computational cost, with 20.17 million parameters. InceptionResNetV2, the most complex of the models, requires substantial computational resources, with 55.65 million parameters and a 212.29 MB size as shown in Fig. \u003cspan class=\"InternalRef\"\u003e6\u003c/span\u003e. While MobileNetV2 offers a lightweight model size of 13.13 MB and only 3.44 million parameters, it prioritizes efficiency over accuracy, making it suitable for mobile or edge devices where real-time inference is critical.\u003c/p\u003e\n \u003cdiv class=\"gridtable\"\u003e\u0026nbsp;\u0026nbsp;\u003ctable id=\"Tab6\" border=\"1\"\u003e\n \u003ccaption language=\"En\"\u003e\n \u003cdiv class=\"CaptionNumber\"\u003eTable 6\u003c/div\u003e\n \u003cdiv class=\"CaptionContent\"\u003e\n \u003cp\u003eCharacteristics of selected fine-tuned CNN models for arecanut classification\u003c/p\u003e\n \u003c/div\u003e\n \u003c/caption\u003e\n \u003cthead\u003e\n \u003ctr\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eCNN model\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eTotal parameters (million)\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eTrainable parameters\u003c/p\u003e\n \u003cp\u003e(million)\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eNon- trainable\u003c/p\u003e\n \u003cp\u003e(million)\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eSize (mb)\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eTotal layers\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eNo. of weights\u003c/p\u003e\n \u003c/th\u003e\n \u003c/tr\u003e\n \u003c/thead\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eDenseNet121\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e8.09\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e1.05\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e7.037\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e30.86\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e439\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e612\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eEfficientNetB4\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e2.016\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e2.5\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e17.67\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e76.94\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e492\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e627\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eInceptionResNetV2\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e55.65\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e1.31\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e54.36\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e212.29\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e789\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e904\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eInceptionV3\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e23.64\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e1.84\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e21.8\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e90.19\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e322\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e386\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eMobileNetV2\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e3.44\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e1.18\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e2.26\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e13.13\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e163\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e268\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eResNet50\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e25.43\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e1.84\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e23.59\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e97\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e186\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e328\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eVGG16\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e16.03\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e1.32\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e14.71\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e61.15\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e32\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e38\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003eVGG19\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e20.81\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e0.79\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e20.02\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e79.4\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e31\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e40\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n \u003c/table\u003e\n \u003c/div\u003e\n \u003cp\u003e\u003cbr\u003e\u003c/p\u003e\n \u003cp\u003eDespite differences in model complexity, the accuracy results as shown in Table \u003cspan class=\"InternalRef\"\u003e5\u003c/span\u003e reveal that more complex models like InceptionResNetV2 and InceptionV3 did not perform as expected. InceptionV3, with 23.64 million parameters and a 90.19 MB size, pointed to high computational demand but did not surpass DenseNet121, which achieved 95.67% accuracy. This accentuates the importance of model selection beyond complexity\u0026mdash;DenseNet121, while less computationally demanding than InceptionResNetV2, outperformed it in accuracy. The trade-off between accuracy and computational efficiency is clear: while InceptionResNetV2 and InceptionV3 offer high computational capacity, they did not exceed DenseNet121 in performance. MobileNetV2, prioritizing speed and efficiency, sacrifices accuracy but is more suitable for real-time applications. For this task, DenseNet121 - a balanced approach of moderate complexity and strong performance - proved more effective for arecanut classification.\u003c/p\u003e\n \u003cp\u003ePrevious research on fruit quality inspection, as reviewed by Naranjo-Torres et al. (\u003cspan class=\"CitationRef\"\u003e2020\u003c/span\u003e), often used simpler models like LeNet, AlexNet, and ResNet. While these models were effective, more advanced architectures like DenseNet121 and InceptionV3 have shown superior performance, particularly in handling complex features like texture variation in arecanut images. Our findings indicate that the larger input sizes in DenseNet121 and InceptionV3 may have contributed to improved results, aligning with the growing trend towards deeper, more complex models in image classification.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"Sec20\" class=\"Section2\"\u003e\n \u003ch2\u003e4.7 Confusion matrix\u003c/h2\u003e\n \u003cp\u003eThe confusion matrix offers a detailed assessment of classification performance, capturing true positives, false positives, true negatives, and false negatives. This analysis is critical for assessing the accuracy and reliability of the models. Figure \u003cspan class=\"InternalRef\"\u003e5\u003c/span\u003e displays the confusion matrices for the testing phase of the fine-tuned eight models, Figs. S2 and S3 present the validated confusion matrices for all models, and the testing results for both initial and fine-tuned models. Darker shades in the matrices indicate higher accuracy in predictions for each grade.\u003c/p\u003e\n \u003cp\u003e\u003cstrong\u003eTrue Positive (TP):\u0026nbsp;\u003c/strong\u003eThis refers to the number of positive samples that the model correctly classified as positive.\u003c/p\u003e\n \u003cp\u003e\u003cstrong\u003eTrue Negative (TN):\u0026nbsp;\u003c/strong\u003eThis specifies the number of negative samples that the model correctly classified as negative.\u003c/p\u003e\n \u003cp\u003e\u003cstrong\u003eFalse Positive (FP):\u0026nbsp;\u003c/strong\u003eThis specifies the number of negative samples that the model mistakenly categorized as good samples.\u003c/p\u003e\n \u003cp\u003e\u003cstrong\u003eFalse Negative (FN):\u0026nbsp;\u003c/strong\u003eThis specifies the number of positive samples that the model mistook for negative.\u003c/p\u003e\n \u003cp\u003eAccuracy is the percentage of correct outputs among all the outputs produced by the model, as indicated in the equation below.\u003c/p\u003e\n \u003cdiv id=\"Equa\" class=\"Equation\"\u003e\n \u003cdiv class=\"mathdisplay\" id=\"FileID_Equa\" name=\"EquationSource\"\u003e$$\\:Accuracy=\\frac{(TP+TN)}{(TP+TN+FP+FN)}$$\u003c/div\u003e\n \u003c/div\u003e\n \u003cp\u003ePrecision is the proportion of TP predictions (correctly predicted positive instances) out of predictions made by the model. It measures how accurate the model\u0026rsquo;s positive predictions are, and is calculated as given in the equation below.\u003c/p\u003e\n \u003cdiv id=\"Equb\" class=\"Equation\"\u003e\n \u003cdiv class=\"mathdisplay\" id=\"FileID_Equb\" name=\"EquationSource\"\u003e$$\\:Precision=\\:\\frac{TP}{(TP+FP)}$$\u003c/div\u003e\n \u003c/div\u003e\n \u003cp\u003eRecall is the proportion of TP predictions out of all actual positive instances in the data, as shown in the equation below.\u003c/p\u003e\n \u003cdiv id=\"Equc\" class=\"Equation\"\u003e\n \u003cdiv class=\"mathdisplay\" id=\"FileID_Equc\" name=\"EquationSource\"\u003e$$\\:Recall=\\:\\frac{TP}{(TP+FN)}$$\u003c/div\u003e\n \u003c/div\u003e\n \u003cp\u003eF1 Score represents the harmonic mean of Precision and Recall and it is used to balance the trade-off between precision and recall as given below.\u003c/p\u003e\n \u003cdiv id=\"Equd\" class=\"Equation\"\u003e\n \u003cdiv class=\"mathdisplay\" id=\"FileID_Equd\" name=\"EquationSource\"\u003e$$\\:F1\\:Score=\\frac{2*Precision*Recall}{Precision+Recall}$$\u003c/div\u003e\n \u003c/div\u003e\n \u003cp\u003eDenseNet121 (Fig. \u003cspan class=\"InternalRef\"\u003e5\u003c/span\u003eA) and InceptionV3 (Fig. \u003cspan class=\"InternalRef\"\u003e5\u003c/span\u003eD) exhibited strong predictive accuracy, with high diagonal values in their confusion matrices, indicating consistent performance across grades. DenseNet121 achieved a true positive rate (TPR) of over 90% across all grades, but showed slight difficulty in identifying Grade 2 compared to InceptionV3. In contrast, InceptionV3 also performed well but exhibited slightly lower accuracy in handling grades 1 and 3 compared to DenseNet121. ResNet50 (Fig. \u003cspan class=\"InternalRef\"\u003e5\u003c/span\u003eE) exhibited significant flaws, primarily over-predicting the class Grade 1 while struggling with other grades. This misclassification is likely caused by insufficient feature extraction, which affects its ability to capture finer grade variations. Similarly, EfficientNetB4 showed limited effectiveness, achieving a TPR of only 25% for Grade 1. Models like VGG16 and VGG19 also suffered from high false positive rates (FPR), frequently misclassifying other grades as Grade 1. Higher grades (Grades 3 and 4) were particularly prone to misclassification across most models, highlighting difficulties in distinguishing finer-grade differences. Overall, the confusion matrix analysis provides critical insights into model performance, revealing areas for improvement, particularly in handling underrepresented grades. DenseNet121 and InceptionV3 emerged as most reliable models, but further refinements in data handling and model architectures are necessary to optimize classification accuracy across all grades.\u003c/p\u003e\n \u003cp\u003eThe architecture of DenseNet121 consists of 121 layers, each connected to all previous layers, thereby reducing the number of parameters required and enhancing efficiency. The InceptionV3 model comprises 48 layers, including various convolutional, pooling, and fully connected layers. Its unique Inception module, which captures features at multiple scales, made it effective in handling diverse image characteristics. DenseNet121\u0026rsquo;s dense connectivity enabled efficient feature extraction, while InceptionV3\u0026rsquo;s multiscale processing was advantageous for images with distinct feature sizes.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"Sec21\" class=\"Section2\"\u003e\n \u003ch2\u003e4.8 ROC-AUC curves\u003c/h2\u003e\n \u003cp\u003eThe Receiver Operating Characteristic (ROC) curves for the fine-tuned CNN models in Fig. \u003cspan class=\"InternalRef\"\u003e7\u003c/span\u003e compare the true positive rate (TPR) and false positive rate (FPR) at different classification thresholds, providing an extensive evaluation of binary classifiers. The area under the curve (AUC) is a critical metric, with values closer to 1 indicating superior performance. For clarity, we present ROC curves for the top eight models. DenseNet121 (Fig. \u003cspan class=\"InternalRef\"\u003e7\u003c/span\u003eA) displayed superior performance, achieving AUC values of 1.00 for three grades and 0.99 for one, reflecting excellent class separation and predictive capability. Similarly, InceptionV3 (Fig. \u003cspan class=\"InternalRef\"\u003e7\u003c/span\u003eD) performed admirably with AUC values near 1.00 across all grades. These results justify their suitability for tasks requiring precise classification across a wide range of grades. In contrast, EfficientNetB4 (Fig. \u003cspan class=\"InternalRef\"\u003e7\u003c/span\u003eB) exhibits moderate performance with AUC values ranging from 0.45 to 0.73, particularly struggling with Grades 3 and 4. InceptionResNetV2 (Fig. \u003cspan class=\"InternalRef\"\u003e7\u003c/span\u003eC) reflects random prediction behavior with an AUC of 0.50, indicating an inability to differentiate between classes. VGG16 and VGG19 (Fig. \u003cspan class=\"InternalRef\"\u003e7\u003c/span\u003eG,H) also exhibit random performance with flat ROC curves, further demonstrating their ineffectiveness for this task. MobileNetV2 (Fig. \u003cspan class=\"InternalRef\"\u003e7\u003c/span\u003eE) performs well for Grade 3 and Grade 4, with AUC values near 1. It shows limited ability to distinguish Grade 1 and Grade 2, with AUC values of 0.61 and 0.62.7Additionally, inconsistent performance across grades in ResNet50 (Fig. \u003cspan class=\"InternalRef\"\u003e7\u003c/span\u003eF) with an AUC of 0.66 for Grade 1 but only 0.33 for Grade 3 emphasizes the need for better feature engineering tailored to grade-specific variations. The ROC-AUC curves for initial-tuned CNN models in arecanut classification are provided in Fig. S4 for comparison.\u003c/p\u003e\n\u003c/div\u003e"},{"header":"5. Limitations of the Study","content":"\u003cp\u003eThis study indicates the potential of Convolutional Neural Network (CNN) models for automating arecanut grading, while it also recognizes certain limitations. A key constraint is the relatively small and regionally limited dataset, which may restrict the models' ability to generalize across different arecanut varieties and growing conditions. The dataset majorly consists of frontal images, which may not capture important features such as surface texture, color uniformity, or hidden defects visible from other angles. This single-perspective approach might limit the model\u0026rsquo;s ability to fully differentiate between quality grades. Additionally, the lack of advanced imaging techniques, such as multi-angle imaging, further limits the representation of key features important for fine-grained classification. These limitations can be addressed by expanding the dataset and employing advanced imaging systems, which will enhance both the reliability and accuracy of the models.\u003c/p\u003e"},{"header":"6. Conclusion","content":"\u003cp\u003eThis study demonstrates the feasibility and efficacy of deep learning, specifically Convolutional Neural Networks (CNNs), for automating arecanut classification. Traditional grading methods are inefficient, time-intensive, and are reliant on expert knowledge, presenting challenges for small-scale farmers. Among the eight transfer learning models fine-tuned in this study, DenseNet121 and InceptionV3 emerged as the top-performing models, achieving overall accuracies of 95.67%. These results highlight the potential of CNNs to handle texture-based image classification tasks with high reliability. DenseNet121\u0026rsquo;s dense connectivity structure optimized feature reuse and reduced parameter complexity, making it effective for complex feature extraction, while InceptionV3\u0026rsquo;s multi-scale Inception modules enhanced adaptability to diverse image features. Both models exhibited robust generalization, as reflected in their high Cohen\u0026rsquo;s Kappa values (0.94) and low log loss scores, ensuring reliability across unseen data. This study also analyzed confusion matrices and AUC-ROC plots, revealing DenseNet121\u0026rsquo;s and InceptionV3\u0026rsquo;s ability to achieve near-perfect predictions, with minimal errors across all four grades.\u003c/p\u003e \u003cp\u003eThe proposed CNN-based system offers a scalable, rapid, and reliable solution for automating arecanut grading, which can benefit small-scale farmers by providing more accurate and consistent grading. This could also lead to fairer pricing and improved market opportunities. Future work should focus on expanding the dataset to include more arecanut varieties, multi-angle imaging, and larger sample sizes. Additionally, exploring hybrid architectures and lightweight models for real-time deployment will enhance robustness and efficiency, paving the way for AI-driven solutions in precision agriculture and sustainable farming practices.\u003c/p\u003e "},{"header":"Declarations","content":"\u003cp\u003e\u003cstrong\u003eCRediT authorship contribution statement\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eDDG\u003c/strong\u003e: Data curation, Methodology, Software, Validation, Visualization, Writing - original draft. \u003cstrong\u003ePSH\u003c/strong\u003e: Writing - original draft, Visualization, Writing - review \u0026amp; editing. \u003cstrong\u003eSH\u003c/strong\u003e: Writing, review \u0026amp; editing. \u003cstrong\u003ePKN\u003c/strong\u003e: Writing - review \u0026amp; editing. \u003cstrong\u003eSDG\u003c/strong\u003e: Conceptualization, Resources, Software, Validation, Methodology, Supervision, Writing - original draft, Writing - review \u0026amp; editing.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eDeclaration of generative AI and AI-assisted technologies in the writing process\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eDuring the preparation of this work the author(s) used [QuillBot] in order to [improve clarity, engagement and grammar related]. After using this tool/service, the author(s) reviewed and edited the content as needed and take(s) full responsibility for the content of the publication.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eDeclaration of Competing Interest\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThe authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eFunding\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThis research did not receive any specific grant from funding agencies in the public, commercial, or not-for-profit sectors. Open-access publication funding will be provided by the NITTE Deemed to be University, Deralakatte.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eAcknowledgments\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThe authors would like to thank Dr. Nagaraj , Plant Pathologist, ICAR-CPCRI, Vitla, Puttur, Karnataka for the assistance provided during field data collection.\u003c/p\u003e"},{"header":"References","content":"\u003col\u003e\n\u003cli\u003eAnsari, A., Mahmood, T., Bagga, P., Ahsan, F., Shamim, A., Ahmad, S., Shariq, M., Parveen, S., 2021. \u003cem\u003eAreca catechu\u003c/em\u003e : A phytopharmacological legwork. Food Frontiers 2, 163\u0026ndash;183. https://doi.org/10.1002/fft2.70\u003c/li\u003e\n\u003cli\u003eBalipa, M., Shetty, P., Kumar, A. and Puneeth, B.R., 2022. Arecanut Disease Detection Using CNN and SVM Algorithms. In 2022 International Conference on Artificial Intelligence and Data Engineering (AIDE) (pp. 01-04).\u003c/li\u003e\n\u003cli\u003eBhat, A., Shetty, A.S., Suvarna, D.M., Anchan, R.S., 2023. A Cnn-Based Approach To Classify Areca Nuts Based On Grades. Journal of Emerging Technologies and Innovative Research (JETIR) 10,4\u003c/li\u003e\n\u003cli\u003eChandrashekhara, H. and Suresha, M., 2019. Classification of healthy and diseased arecanuts using SVM classifier. International Journal of Computer Sciences and Engineering, 7(2), pp.544-548. https://doi.org/10.26438/ijcse/v7i2.544548\u003c/li\u003e\n\u003cli\u003eDanti, A., M., S., 2012. Effective Multiclassifier for Arecanut Grading, in: Venugopal, K.R., Patnaik, L.M. (Eds.), Wireless Networks and Computational Intelligence, Communications in Computer and Information Science. Springer Berlin Heidelberg, Berlin, Heidelberg, pp. 350\u0026ndash;359. https://doi.org/10.1007/978-3-642-31686-9_41\u003c/li\u003e\n\u003cli\u003eDonahue, J., Jia, Y., Vinyals, O., Hoffman, J., Zhang, N., Tzeng, E. and Darrell, T., 2014, January. Decaf: A deep convolutional activation feature for generic visual recognition. In International conference on machine learning (pp. 647-655). PMLR.\u003c/li\u003e\n\u003cli\u003eGhate, D. D., Pallavi, K. N., \u0026amp; Poojari, A., 2024. Enhancing Arecanut Farming Profits through Technological Advancements: A CNN-based Approach for Efficient Grading and Sorting. In 2024 5th International Conference on Mobile Computing and Sustainable Informatics (ICMCSI) pp. 441-445. IEEE.\u003c/li\u003e\n\u003cli\u003eGoutte, C. and Gaussier, E., 2005, March. A probabilistic interpretation of precision, recall and F-score, with implication for evaluation. In European conference on information retrieval (pp. 345-359). Berlin, Heidelberg: Springer Berlin Heidelberg.\u003c/li\u003e\n\u003cli\u003eHindarto, D. and Afarini, N., 2023. Comparison Efficacy of VGG16 and VGG19 Insect Classification Models. JIKO (Jurnal Informatika dan Komputer), 6(3), pp.189-195.\u003c/li\u003e\n\u003cli\u003eHo, Y. and Wookey, S., 2019. The real-world-weight cross-entropy loss function: Modeling the costs of mislabeling. IEEE access, 8, pp.4806-4813.\u003c/li\u003e\n\u003cli\u003eHossain, Md Mamun, Hossain, Md Moazzem, Arefin, M.B., Akhtar, F., Blake, J., 2024. Combining State-of-the-Art Pre-Trained Deep Learning Models: A Noble Approach for Skin Cancer Detection Using Max Voting Ensemble. Diagnostics 14, 89. https://doi.org/10.3390/diagnostics14010089\u003c/li\u003e\n\u003cli\u003eHuang, G., Liu, Z., Van Der Maaten, L. and Weinberger, K.Q., 2017. Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition (pp. 4700-4708).\u003c/li\u003e\n\u003cli\u003eHuang, K.-Y., 2012. Detection and classification of areca nuts with machine vision. Computers \u0026amp; Mathematics with Applications 64, 739\u0026ndash;746. https://doi.org/10.1016/j.camwa.2011.11.041\u003c/li\u003e\n\u003cli\u003eIndian Council of Agricultural Research (ICAR) report 2023\u003c/li\u003e\n\u003cli\u003eMallikarjuna, S.B., Shivakumara, P., Khare, V., Kumar N, V., M, B., Pal, U., B, P., 2021. CNN based method for multi-type diseased arecanut image classification. MJCS 34, 255\u0026ndash;265. https://doi.org/10.22452/mjcs.vol34no3.3\u003c/li\u003e\n\u003cli\u003eNaik, P.M., Rudra, B., 2023. Classification of Arecanut X-Ray Images for Quality Assessment Using Adaptive Genetic Algorithm and Deep Learning. IEEE Access 11, 127619\u0026ndash;127636. https://doi.org/10.1109/ACCESS.2023.3332215\u003c/li\u003e\n\u003cli\u003eNaranjo-Torres, J., Mora, M., Hern\u0026aacute;ndez-Garc\u0026iacute;a, R., Barrientos, R.J., Fredes, C., Valenzuela, A., 2020. A Review of Convolutional Neural Network Applied to Fruit Image Processing. Applied Sciences 10, 3443. https://doi.org/10.3390/app10103443\u003c/li\u003e\n\u003cli\u003eNguyen Chi, T., Le Thi Thu, H., Doan Quang, T. and Taniar, D., 2024. A Lightweight Method for Breast Cancer Detection Using Thermography Images with Optimized CNN Feature and Efficient Classification. Journal of Imaging Informatics in Medicine, pp.1-18.\u003c/li\u003e\n\u003cli\u003ePatil, S., Naik, A., Parab, J., 2023. Efficient Deep Learning model for de-husked Areca nut classification. JANS 15, 1529\u0026ndash;1540. https://doi.org/10.31018/jans.v15i4.5067\u003c/li\u003e\n\u003cli\u003ePatil, S., Naik, A., Sequeira, M., Naik, G. and Parab, J., 2021. An algorithm for pre-processing of areca nut for quality classification. In Second International Conference on Image Processing and Capsule Networks: ICIPCN 2021 2 (pp. 79-93). Springer International Publishing.\u003c/li\u003e\n\u003cli\u003ePeng, C., Liu, Y., Yuan, X. and Chen, Q., 2022. Research of image recognition method based on enhanced inception-ResNet-V2. Multimedia Tools and Applications, 81(24), pp.34345-34365.\u003c/li\u003e\n\u003cli\u003ePrechelt, L., 2002. Early stopping-but when?. In Neural Networks: Tricks of the trade (pp. 55-69). Berlin, Heidelberg: Springer Berlin Heidelberg.\u003c/li\u003e\n\u003cli\u003eRussakovsky, O., Deng, J., Su, H., Krause, J., Satheesh, S., Ma, S., Huang, Z., Karpathy, A., Khosla, A., Bernstein, M. and Berg, A.C., 2015. Imagenet large scale visual recognition challenge. International journal of computer vision, 115, pp.211-252.\u003c/li\u003e\n\u003cli\u003eSachdeva, J., Sharma, D. and Ahuja, C.K., 2024. Comparative Analysis of Different Deep Convolutional Neural Network Architectures for Classification of Brain Tumor on Magnetic Resonance Images. Archives of Computational Methods in Engineering, pp.1-20.\u003c/li\u003e\n\u003cli\u003eSandler, M., Howard, A., Zhu, M., Zhmoginov, A., Chen, L.-C., 2019. MobileNetV2: Inverted Residuals and Linear Bottlenecks. https://doi.org/10.48550/arXiv.1801.04381\u003c/li\u003e\n\u003cli\u003eShankar, K., Kumar, S., Dutta, A.K., Alkhayyat, A., Jawad, A.J.A.M., Abbas, A.H. and Yousif, Y.K., 2022. An automated hyperparameter tuning recurrent neural network model for fruit classification. \u003cem\u003eMathematics\u003c/em\u003e, \u003cem\u003e10\u003c/em\u003e(13), p.2358.\u003c/li\u003e\n\u003cli\u003eShedthi B, S., Siddappa, M., Shetty, S., Shetty, V., 2023. Classification of arecanut using machine learning techniques. IJECE 13, 1914. https://doi.org/10.11591/ijece.v13i2.pp1914-1921\u003c/li\u003e\n\u003cli\u003eShorten, C. and Khoshgoftaar, T.M., 2019. A survey on image data augmentation for deep learning. Journal of big data, 6(1), pp.1-48.\u003c/li\u003e\n\u003cli\u003eSnoek, J., Larochelle, H. and Adams, R.P., 2012. Practical bayesian optimization of machine learning algorithms. Advances in neural information processing systems, 25.\u003c/li\u003e\n\u003cli\u003eSujatha, S., Bhat, R., Chowdappa, P., 2016. Cropping systems approach for improving resource use in arecanut (Areca catechu) plantation. The Indian Journal of Agricultural Sciences 86, 1113\u0026ndash;20. https://doi.org/10.56093/ijas.v86i9.61349\u003c/li\u003e\n\u003cli\u003eSzegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., Wojna, Z., 2016. Rethinking the Inception Architecture for Computer Vision, in: 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). IEEE, Las Vegas, NV, USA, pp. 2818\u0026ndash;2826. https://doi.org/10.1109/CVPR.2016.308\u003c/li\u003e\n\u003cli\u003eTan, M., Le, Q.V., 2020. EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks.\u003c/li\u003e\n\u003cli\u003eTaner, A., \u0026Ouml;ztekin, Y.B., Duran, H., 2021. Performance Analysis of Deep Learning CNN Models for Variety Classification in Hazelnut. Sustainability 13, 6527. https://doi.org/10.3390/su13126527\u003c/li\u003e\n\u003cli\u003eXiao, F., Wang, H., Xu, Y., Zhang, R., 2023. Fruit Detection and Recognition Based on Deep Learning for Automatic Harvesting: An Overview and Review. Agronomy 13, 1625. https://doi.org/10.3390/agronomy13061625\u003c/li\u003e\n\u003c/ol\u003e"}],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":true,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":true,"hideJournal":true,"highlight":"","institution":"Nitte University","isAcceptedByJournal":false,"isAuthorSuppliedPdf":false,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":false,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"Arecanut, Grading, CNN, Agriculture, Deep learning, Image classification","lastPublishedDoi":"10.21203/rs.3.rs-5841671/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-5841671/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003eEffective grading of arecanut is essential for ensuring product quality, maximizing market competitiveness, and satisfying consumer preferences. However, traditional methods of arecanut grading are challenging due to variations in arecanut size, shape, and appearance, resulting in subjective and inconsistent evaluations. Deep learning can enhance this process by automating grading and using sophisticated algorithms to assess both visual and non-visual attributes, thereby increasing efficiency, accuracy, and consistency. This study presents two standalone CNN-based methodologies for automated arecanut quality grading, leveraging DenseNet121 and InceptionV3 with custom layers tailored for arecanut classification. A dataset of 2,000 high-resolution images, manually curated from farms and augmented for diversity, was used for training and validation. Eight CNN architectures - DenseNet121, EfficientNetB4, InceptionResNetV2, InceptionV3, MobileNetV2, ResNet50, VGG16, and VGG19 were evaluated. Experimental findings showed DenseNet121 and InceptionV3 achieved the highest accuracy (95.67%) and strong precision/recall scores (96%), making them the most promising models. Meanwhile, MobileNetV2 was identified as the fastest model in terms of classification speed; however, its relatively low accuracy limits its practical application in grading tasks. DenseNet121 and InceptionV3, while marginally slower at 0.015 and 0.011 seconds per image, respectively, offered a good balance between computational cost and elevated accuracy. DenseNet121 excels in feature reuse through its dense connectivity, reducing redundancy and improving performance on smaller datasets, while InceptionV3 utilizes multi-scale feature extraction to capture intricate patterns effectively. Both models demonstrate robustness under varying conditions, ensuring reliability in practical deployment scenarios. This study highlights the potential of CNNs to provide a reliable, and scalable solution for arecanut grading, benefiting farmers by expanding market opportunities.\u003c/p\u003e","manuscriptTitle":"Enhancing Arecanut Quality Grading: A Comparison of Custom CNNs and Transfer Learning Models","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2025-01-20 11:28:27","doi":"10.21203/rs.3.rs-5841671/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"29cf4949-0f02-49cf-a5ef-29e5228b426b","owner":[],"postedDate":"January 20th, 2025","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[{"id":42963123,"name":"Artificial Intelligence and Machine Learning"}],"tags":[],"updatedAt":"2025-01-20T11:28:27+00:00","versionOfRecord":[],"versionCreatedAt":"2025-01-20 11:28:27","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-5841671","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-5841671","identity":"rs-5841671","version":["v1"]},"buildId":"XKTyCvWXoU3ODBz1xrDgd","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}
Text is read by the "Ask this paper" AI Q&A widget below.
Extraction quality varies by source — PMC NXML preserves structure
cleanly, OA-HTML may include some navigation residue, and OA-PDF can
have broken hyphenation. The publisher copy
(via DOI)
is the canonical version.