ResNet50-Based Deep Learning Architecture with Focal Loss Optimization for Automated Fruit Ripeness Classification Stefani Hardiyanti Putri . Nasrullah . Fefi Maulana . Prilia Rahmayanti . Efmi Maiyana . Informatics Management . , . , . , . , . AMIK Bukittinggi. Indonesia hardiyanti@amikbukittinggi. , nasrullah@amikbukittinggi. , maulana@amikbukittinggi. , prilia. rahmayanti@amikbukittinggi. Efmi_maiyana@yahoo. Abstract---This study develops an Enhanced ResNet50 architecture with Focal Loss optimization for automated fruit ripeness classification. The research implements systematic modifications to the standard ResNet50 framework, incorporating attention mechanisms, strategic transfer learning with 20 trainable layers, and advanced class imbalance handling through Focal Loss function (=. 809, 1. 904, 0. , =2. The model processes RGB images . across three ripeness categories: Overripe. Ripe, and Unripe, utilizing the Kaggle Fruits Ripeness Classification Dataset containing 4,434 high-quality images. The Enhanced ResNet50 architecture achieves 97. 22% classification accuracy with corresponding precision, recall, and F1-scores of 0. demonstrating superior performance compared to standard ResNet50 . 7%). VGG16 . 2%), and EfficientNet-B0 . 5%). The model exhibits efficient computational characteristics with 50-100ms inference time and 104. 55 MB model size, while successfully addressing mild class imbalance . through systematic optimization techniques. Keywords--- Deep Learning. ResNet50. Fruit Ripeness Detection. Transfer Learning. Focal Loss. Computer Vision. Food Quality Assessment. Nutritious Meal Program INTRODUCTION Food security and nutrition quality have become paramount concerns in global public health initiatives, particularly in developing nations where large-scale nutrition programs play a crucial role in addressing malnutrition and supporting vulnerable populations. The Indonesian government's Free Nutritious Meal Program (Program Makan Bergizi Grati. represents a transformative national initiative aimed at improving public health outcomes through systematic distribution of nutritious meals, particularly targeting school children and economically disadvantaged communities . This ambitious program requires the daily distribution of millions of meals across thousands of locations, making consistent food quality control and safety assurance critical operational challenges that directly impact program effectiveness and public health outcomes. Among the various food components distributed through this comprehensive nutrition program, fruits constitute an essential element providing vital vitamins, minerals, dietary fiber, and antioxidants necessary for optimal health and development, especially for growing children and adolescents . The nutritional value and palatability of fruits are intrinsically linked to their ripeness level, with optimal ripeness ensuring maximum nutrient density, appropriate sugar content, and consumer acceptance. However, traditional fruit quality assessment methods rely heavily on subjective visual inspection by human evaluators, a process that is inherently inconsistent, time-consuming, labor-intensive, and susceptible to significant variations in assessment criteria and human error, particularly when managing large-scale operations with high throughput requirements . The consequences of inaccurate or inconsistent fruit ripeness evaluation extend far beyond simple quality control Serving overripe fruits can result in poor palatability, reduced nutritional value, potential food safety concerns, and decreased program acceptance among beneficiaries, while distributing underripe fruits may lead to suboptimal taste experiences, reduced nutritional benefits, and increased food waste due to rejection by consumers . Furthermore, inconsistent quality assessment contributes significantly to economic losses through unnecessary food waste, as fruits may be inappropriately discarded or spoil before consumption, resulting in substantial financial losses and reduced program Recent advances in artificial intelligence and computer vision technologies have demonstrated remarkable potential in automated quality assessment systems across various agricultural and food industry applications . Deep learning techniques, particularly Convolutional Neural Networks (CNN. with transfer learning approaches utilizing pre-trained models such as ResNet. VGG, and EfficientNet, have shown exceptional performance in image classification tasks related to food quality assessment, agricultural monitoring, and automated sorting systems . To support quality control decision-making in large-scale food distribution systems, various studies have been conducted p-ISSN 2301-7988, e-ISSN 2581-0588 DOI : 10. 32736/sisfokom. Copyright A2026 Submitted : May 25, 2025. Revised : August 1, 2025. Accepted : August 5, 2025. Published : December 15, 2025 to develop accurate and reliable automated assessment Research by Singh et al. demonstrated the effectiveness of ResNet50 in fruit sorting applications, achieving high accuracy rates in distinguishing between rotten and fresh fruits . Similarly. Tapia-Mendez et al. implemented ResNet50 for multi-class fruit and vegetable ripeness assessment, demonstrating the robustness of this architecture for food quality applications . However, these studies primarily focused on general fruit classification rather than specific ripeness assessment and did not address the unique challenges associated with class imbalance and real-world deployment scenarios. Specifically, research implementing transfer learning approaches for food quality assessment has shown significant improvements in model performance and training efficiency. Mathew et al. developed a hybrid approach combining ResNet50 and VGG-16 for banana ripeness classification, achieving competitive accuracy in distinguishing between ripe, unripe, and over-ripe categories . Although relevant to automated fruit quality assessment, this study did not incorporate advanced optimization techniques such as Focal Loss for class imbalance handling or attention mechanisms for enhanced feature extraction, representing opportunities for further improvement. A separate investigation evaluated the efficacy of various deep learning algorithms, including CNN. ResNet, and hybrid approaches, in predicting fruit quality using datasets sourced from agricultural research institutions. The study determined that ResNet-based models with appropriate fine-tuning strategies exhibited optimal performance in fruit quality classification tasks, achieving accuracy rates of approximately 88-94% across different fruit categories . Although demonstrating promising results, this research did not specifically address the challenges associated with large-scale deployment or integration with existing food distribution Based on this comprehensive literature review, there exists a significant research gap focusing on enhanced deep learning approaches for fruit ripeness detection specifically designed to support large-scale nutrition programs. Although existing deep learning models have shown good performance in general fruit classification tasks, their specific application for rigorous ripeness assessment with advanced optimization techniques, comprehensive class imbalance handling, and production-ready deployment characteristics still requires substantial further research and development. Therefore, this study seeks to develop a comprehensive predictive model for automated fruit ripeness classification utilizing an enhanced ResNet50 architecture with strategic optimization techniques, while systematically evaluating the effects of advanced deep learning approaches including Focal Loss implementation, attention mechanism integration, and strategic transfer learning on model performance. The research aims to achieve accuracy targets exceeding 85% while demonstrating practical deployment readiness for integration with large-scale nutrition program infrastructure. II. METHODOLOGY The research process was carried out in several stages, starting with the collection of fruit ripeness data from the Kaggle Fruits Ripeness Classification Dataset containing 4,434 high-quality images. Preprocessing steps were then performed, including normalization using Min-Max Scaler to scale the data within the . range and comprehensive data augmentation using TensorFlow's keras. layers functionality. The dataset was split into training . %) and testing . %) sets, with additional Train/Test structure analysis. The enhanced ResNet50 model with strategic modifications was then applied, utilizing advanced optimization techniques including Focal Loss, attention mechanisms, and transfer learning. Various hyperparameter configurations were tested through systematic optimization, including learning rate . , batch size . , epochs . with early stoppin. , and architectural parameters . trainable layers, progressive dense layers with dropou. This research method is presented in the form of a flowchart in Fig. p-ISSN 2301-7988, e-ISSN 2581-0588 DOI : 10. 32736/sisfokom. Copyright A2026 Submitted : May 25, 2025. Revised : August 1, 2025. Accepted : August 5, 2025. Published : December 15, 2025 generalization, and improved robustness across different operational conditions . Some sample data from the dataset is presented in Table I. TABLE I. FRUITS RIPENESS CLASSIFICATION DATASET CHARACTERISTICS Ripeness Category Number of Images Percentag Description Overripe Minority class rowning, soft textur. Ripe 1,826 Optimal ripeness . right color, fir. Unripe 1,832 Immature stage . reen, hard textur. Total 4,434 Complete dataset Image Resolution 224y224y3 RGB color images File Formats PNG. JPG. JPEG Standard image formats Class Imbalance Ratio Mild imbalance level Fruit Varieties 5 Types Apples. Bananas. Mangoes. Oranges. Tomatoes The dataset analysis reveals a mild class imbalance with an imbalance ratio of 0. 424, which requires specialized handling techniques for optimal model performance. The distribution shows Overripe as the minority class . 5%), while Ripe . 2%) and Unripe . 3%) categories are relatively balanced. This distribution pattern is typical in real-world fruit processing scenarios where overripe fruits are less common due to quality control measures in the supply Fig. 2 shows the comprehensive dataset analysis Fig 1. Research Method Dataset This analysis utilizes the Fruits Ripeness Classification Dataset obtained from Kaggle, representing one of the most extensive and systematically curated collections of fruit images categorized by ripeness levels available for academic research purposes. The dataset contains 4,434 high-quality images systematically distributed across three distinct ripeness classifications. The data includes various fruit types with comprehensive visual characteristics essential for robust model training and effective generalization across different fruit types and ripeness conditions. Utilizing large and diverse datasets is crucial in computer vision applications as they enable more accurate predictions, better model p-ISSN 2301-7988, e-ISSN 2581-0588 DOI : 10. 32736/sisfokom. Copyright A2026 Submitted : May 25, 2025. Revised : August 1, 2025. Accepted : August 5, 2025. Published : December 15, 2025 X_unit = X / ||X||AU . Advantages: Preserves angular relationships between color channels Disadvantages: Eliminates magnitude information . rightness/darknes. essential for ripeness classification 2 Normalization Method Selection Rationale Min-Max scaling was selected for the following specific AU Color Preservation: Maintains relative color intensity relationships crucial for ripeness detection AU CNN Compatibility: . range optimizes activation function performance in deep networks . AU Gradient Stability: Prevents vanishing/exploding gradients during backpropagation . AU Cross-device Consistency: Ensures preprocessing across different imaging systems 3 Impact Analysis of Normalization Methods Experimental evaluation of different normalization approaches on a subset . ,000 image. Fig. Fruits Ripeness Dataset - Comprehensive Analysis Data Normalization and Preprocessing Analysis 1 Normalization Techniques Comparison While Min-Max scaling was selected as the primary normalization method, several alternative approaches were evaluated for their suitability in fruit ripeness detection: Z-Score Standardization: X_standardized = (X - ) / EAU Where is the mean and E is the standard deviation. Advantages: Preserves data distribution shape, handles outliers better Disadvantages: May lose important color intensity information crucial for ripeness assessment Robust Scaling: X_robust = (X - media. / IQRAU Normalization Method Min-Max (Selecte. Z-Score Standardization Robust Scaling No Normalization Unit Vector Scaling Validation Accuracy Training Stability High Convergence Speed Fast Medium Medium High Low Medium Slow Very Slow Medium Consequences of Non-Normalization: Without proper normalization, several critical issues emerge: AU Gradient Instability: Raw pixel values . cause large gradients leading to training instability AU Activation Saturation: High input values saturate activation functions, reducing learning capability AU Convergence Failure: Training may fail to converge or require significantly more epochs AU Performance Degradation: Accuracy approximately 20% as demonstrated in our comparative The results of data normalization and augmentation are shown in Fig. Where IQR is the Interquartile Range. Advantages: Highly resistant to outliers Disadvantages: May over-normalize subtle color variations important for ripeness Unit Vector Scaling: p-ISSN 2301-7988, e-ISSN 2581-0588 DOI : 10. 32736/sisfokom. Copyright A2026 Submitted : May 25, 2025. Revised : August 1, 2025. Accepted : August 5, 2025. Published : December 15, 2025 AU 90-10 Split: Would increase training data but compromise test set statistical significance AU Stratified K-Fold: Considered but rejected due to computational constraints and deployment focus Data Selection Criteria: AU Image Quality: Minimum resolution 224y224 pixels with clear fruit visibility AU Lighting Consistency: Balanced illumination without extreme shadows or overexposure AU Background Neutrality: Minimal interference with fruit characteristics AU Ripeness Clarity: Unambiguous ripeness classification verified by agricultural experts Enhanced ResNet50 Model Architecture Fig. Data Augmentation Examples Data Splitting Strategy and Rationale The dataset partitioning strategy follows established best practices in computer vision research while considering the specific characteristics of fruit ripeness classification. The 80%-20% train-test split was selected based on several empirical and theoretical considerations: Training Data Selection . % - 3,547 image. : The training set allocation ensures sufficient sample diversity across all ripeness categories while maintaining adequate representation for minority classes. The 80% proportion provides: AU Adequate samples for deep learning convergence . inimum 1,000 samples per category recommended for CNN trainin. AU Sufficient data augmentation base for generating synthetic variations AU Proper class distribution maintenance: Overripe . Ripe . ,461 sample. Unripe . ,465 Testing Data Selection . % - 887 image. : The 20% test allocation ensures robust performance evaluation while preventing data leakage. This proportion provides: AU Statistically significant sample size for each class . inimum 155 samples per categor. AU Balanced representation across fruit varieties and ripeness levels AU Independent performance assessment Alternative Splitting Methodologies Considered: AU 70-15-15 Split: Would include validation set but reduce training data below optimal threshold Enhanced ResNet50 model is a sophisticated deep learning architecture developed to address the challenges of fruit ripeness classification while maintaining computational efficiency suitable for production deployment. ResNet50 can be considered an evolution of traditional CNN architectures, with the ability to learn complex visual patterns through residual connections and deep feature extraction capabilities . The primary function of ResNet50 in computer vision applications is to process image data by extracting hierarchical features from low-level edges and textures to high-level semantic representations, enabling accurate classification of complex visual patterns. The enhanced ResNet50 architecture incorporates several key modifications for optimal fruit ripeness detection AU Pre-trained Base Model: ResNet50 with ImageNet weights . xcluding top layer. AU Strategic Fine-tuning: 20 trainable layers with frozen initial layers AU Enhanced Classification Head: Progressive dense layers with attention mechanism AU Advanced Regularization: Multiple dropout layers and batch normalization The attention mechanism integrated into the classification head enables the model to focus on the most relevant visual features for ripeness classification. The attention weights are calculated using the following formula: Attention. = x Oo E . cOaycu yca. Explanation: Oo = element-wise multiplication operation E = sigmoid activation function ycOyc and ba = learnable attention parameters x = feature vector The complete model architecture specifications are p-ISSN 2301-7988, e-ISSN 2581-0588 DOI : 10. 32736/sisfokom. Copyright A2026 Submitted : May 25, 2025. Revised : August 1, 2025. Accepted : August 5, 2025. Published : December 15, 2025 presented in Table II, showing the detailed layer configuration and parameter distribution. TABLE II. ENHANCED RESNET50 MODEL ARCHITECTURE degradation problems. This is particularly beneficial for fruit ripeness detection as it can capture subtle textural and color variations that indicate ripeness levels . AU Pre-trained Feature Extraction: The ImageNet Layer Type Output Shape Parameters Trainable Description Input Layer (None, 224, 224. RGB image ResNet Base (None, 7, 7, 2. 23,587,712 Partial Pre-trained . layers Global Averag ePoolin (None. Yes Spatial BatchN (None, 8,192 Yes Feature Dense Attenti (None, 2,098,176 Yes Feature Dropou t . (None. Yes Regularizati on layer BatchN (None, 4,096 Yes Feature Dense (None, 524,800 Yes Feature Dropou t . (None. Yes Regularizati on layer BatchN (None, 2,048 Yes Feature Dense (None, 131,328 Yes Feature Dropou t . (None. Yes Final Dense (Outpu (None, . Yes Classificatio n output . Total Parame 27,406,72 Complete model size Trainab Parame 12,743,17 Active 1 Advantages and Disadvantages of ResNet50 Architecture Advantages of ResNet50 for Fruit Ripeness Detection: AU Residual Learning Capability: ResNet50's skip connections enable the model to learn residual mappings, allowing for deeper networks without pre-trained weights provide robust low-level feature extractors including edge detection, texture recognition, and color pattern identification, which are crucial for distinguishing ripeness characteristics . AU Computational Efficiency: With 50 layers. ResNet50 provides an optimal balance between model complexity and computational requirements, making it suitable for production deployment in large-scale food processing systems . AU Transfer Learning Compatibility: The modular architecture of ResNet50 facilitates effective transfer learning, enabling adaptation from general image classification to domain-specific fruit ripeness detection with minimal architectural modifications . AU Gradient Flow Optimization: Skip connections mitigate vanishing gradient problems, ensuring stable training convergence even with limited fruit-specific datasets . Disadvantages and Limitations: AU Memory Requirements: ResNet50 substantial GPU memory . pproximately 98MB for model parameter. , which may limit deployment on resource-constrained embedded systems . AU Fixed Input Resolution: The standard 224y224 input requirement may result in information loss for high-resolution fruit images containing fine-grained ripeness details . AU Black-box Nature: Limited interpretability of internal feature representations makes it challenging to understand which specific visual characteristics the model uses for ripeness classification . AU Domain Adaptation Challenges: Pre-trained features optimized for general object recognition may not perfectly align with fruit-specific visual patterns, requiring careful fine-tuning strategies . AU Overfitting Susceptibility: Without regularization. ResNet50 can overfit to training data, particularly with limited fruit variety in the dataset . Advanced Focal Loss Implementation To effectively address the mild class imbalance observed in the dataset . mbalance ratio: 0. , an advanced Focal Loss function is implemented as the primary optimization p-ISSN 2301-7988, e-ISSN 2581-0588 DOI : 10. 32736/sisfokom. Copyright A2026 Submitted : May 25, 2025. Revised : August 1, 2025. Accepted : August 5, 2025. Published : December 15, 2025 criterion. Focal Loss addresses class imbalance by dynamically adjusting the loss contribution of easy and hard examples, focusing learning on challenging samples while down-weighting well-classified examples. The Focal Loss is mathematically described in equation . FL . = Oet AU. Oe pt AU) log. Where: = dynamically calculated class weights: . 809, 1. 904, 0. = focusing parameter, optimally set to 2. pt AU= predicted probability for the true class The class weights are automatically calculated using scikit-learn's compute_class_weight function with 'balanced' strategy, ensuring optimal handling of the mild class imbalance present in the dataset. Evaluation Metrics To measure the performance of the Enhanced ResNet50 model in predicting fruit ripeness classification, the following comprehensive evaluation metrics are used: AU Accuracy: Overall classification accuracy across all ripeness categories, calculated as the ratio of correct predictions to total predictions. AU Precision: Class-specific precision scores measuring prediction quality, calculated as True Positives / (True Positives False Positive. for each class. ycEycyceycaycnycycnycuycu = . ycNycE ycNycEOeyaycE AU Recall: Class-specific recall scores measuring Training Configuration and Optimization The model training process utilizes a carefully optimized configuration designed to achieve maximum performance while maintaining computational efficiency. The enhanced model is compiled with the Adam optimizer, known for its efficiency in handling complex optimization landscapes, and uses the custom Focal Loss as the primary loss function. Model specifications are as follows: AU Optimizer: Adam . earning_rate=0. CA=0. CC=0. AU Loss Function: Custom Focal Loss (=. 809, 1. , =2. AU Hidden Layers: Progressive dense architecture . 4Ie512Ie. AU Input Resolution: 224y224y3 RGB images AU Epochs: 60 . ith early stopping, patience=. AU Batch Size: 32 . ptimized for GPU memory and AU Dropout Rates: Progressive . 5, 0. 4, 0. AU Validation Strategy: 20% split with monitoring Testing Process The testing process is carried out after the training phase The trained model is then implemented using the testing data to obtain prediction results and comprehensive performance evaluation. Output Visualization The visualization of the Enhanced ResNet50 model's prediction results is performed to compare the actual fruit ripeness classification with the predictions made by the Comprehensive evaluation visualizations include confusion matrices, performance metrics charts, and prediction confidence distributions to represent the model's capability in capturing accurate fruit ripeness patterns. detection completeness, calculated as True Positives / (True Positives False Negative. for each class. ycIyceycaycaycoyco = AU ycNycE ycNycEOeyaycA AU F1-Score: Harmonic mean of precision and recall for balanced assessment, providing a single metric that balances both precision and recall performance. ycEycyceycaycnycycnycuycu ycu ycIyceycaycaycoyco ya1 Oe ycIycaycuycyce = 2 ycu ycEycyceycaycnycycnycuycu ycIyceycaycaycoyco AU Where: TP = True Positives FP = False Positives FN AU= False Negatives The evaluation process includes comprehensive confusion matrix analysis, class-wise performance assessment, and statistical significance testing to ensure robust performance i. DISCUSSION AND RESULTS The historical fruit ripeness data obtained from Kaggle, containing 4,434 high-quality images across three ripeness categories, serves as the dataset for this study. After performing preprocessing steps as outlined in Section II (Methodolog. , including data normalization using Min-Max Scaler and comprehensive data augmentation, the dataset was successfully prepared for training and testing the enhanced ResNet50 model. The Enhanced ResNet50 model used in this study has a p-ISSN 2301-7988, e-ISSN 2581-0588 DOI : 10. 32736/sisfokom. Copyright A2026 Submitted : May 25, 2025. Revised : August 1, 2025. Accepted : August 5, 2025. Published : December 15, 2025 sophisticated architecture consisting of a pre-trained ResNet50 backbone with strategic modifications for fruit ripeness classification. The model receives input with dimensions . , 224, . , reflecting the standard RGB image format optimized for ResNet architectures. The pre-trained ResNet50 base provides robust feature extraction capabilities, while the enhanced classification head with attention mechanism and progressive dense layers enables accurate ripeness classification. The model is compiled with the Adam optimizer, known for its efficiency in handling complex optimization landscapes, and uses custom Focal Loss as the primary loss function, specifically designed to address class imbalance A summary of the optimal model configuration and training results is shown in Table i. TABLE IV. COMPREHENSIVE CLASS-WISE PERFORMANCE ANALYSIS Ripene Catego Overri Rec F1Sco Precisi Ripe Unripe Macro Averag Weight Averag Supp Accura Speci TABLE i. OPTIMAL MODEL CONFIGURATION AND PERFORMANCE Configuration Parameter Value Performance Metric Result Learning Rate Test Accuracy Batch Size Test Precision Epochs Completed 36 (Early Stoppe. Test Recall Trainable Layers 20 ResNet50 Test F1-Score Focal Loss Parameters =. 809, 1. , =2. Test Loss Dropout Rates 5, 0. 4, 0. Training Duration Class Weights Applied Yes . alanced Target Achievement Through systematic optimization and advanced techniques implementation, the Enhanced ResNet50 model was trained and evaluated comprehensively. The training process incorporated early stopping mechanism that activated at epoch 36 out of the planned 60 epochs, indicating optimal convergence without overfitting concerns. Fig. 4 presents the training history and convergence analysis. The results demonstrate exceptional performance across all ripeness categories, with particularly outstanding results in unripe fruit detection . % accurac. and strong performance in ripe fruit classification . 3% accurac. The model exhibits minimal misclassification errors, with only 5 samples misclassified out of 180 total test samples. Confusion Matrix Analysis: AU Perfect Unripe Classification: 60/60 samples correctly identified . % accurac. AU Excellent Ripe Classification: 59/60 samples correctly identified . 3% accurac. AU Strong Overripe Classification: 56/60 samples correctly identified . 3% accurac. AU Primary Error Pattern: 4 Overripe samples misclassified as Ripe . oundary case. AU Secondary Error Pattern: 1 Ripe sample misclassified as Unripe . dge cas. Fig. 5 presents the comprehensive evaluation results visualization, including confusion matrix, normalized confusion matrix, per-class performance metrics, training curves, and confidence distribution analysis. Fig. Training History and Convergence Analysis p-ISSN 2301-7988, e-ISSN 2581-0588 DOI : 10. 32736/sisfokom. Copyright A2026 Submitted : May 25, 2025. Revised : August 1, 2025. Accepted : August 5, 2025. Published : December 15, 2025 1 Parameter Sensitivity Analysis To validate the robustness of the Enhanced ResNet50 model, comprehensive parameter sensitivity analysis was conducted across key hyperparameters: Learning Rate Variation Analysis Learning Rate Test Accuracy 0001 (Selecte. Training Time 8m 30s 12m 50s 18m 45s 10m 15s Batch Size Impact Assessment Batch Size Memory Usage 2 GB 32 (Selecte. 8 GB 1 GB 4 GB Training Stability High High Medium Low Focal Loss Parameter Optimization (Gamm. Values . 8, 1. 9, 0. 0 (Selecte. 809, 1. 904, 0. 8, 1. 9, 0. 8, 1. 9, 0. Trainable Layers Configuration Trainable Training Parameters Layers Time 9m 20s 20 (Selecte. 12m 50s 16m 30s All . 22m 15s Accuracy Convergence Epoch Final Accuracy Class Balance Score Accuracy Overfitting Risk Low Medium High Very High Key Findings: Fig. Comprehensive Evaluation Results - ResNet50_Optimized TABLE V. COMPREHENSIVE COMPARATIVE PERFORMANCE ANALYSIS Model Architecture Accuracy Precisio Recall F1-Sc Paramete Enhanced ResNet50 (Propose. Standard ResNet50 VGG16 Fine-tuning EfficientNetB0 Standard CNN Basic Transfer Learning AU Learning Rate: 0. 0001 provides optimal balance between convergence speed and final accuracy AU Batch Size: 32 maximizes GPU utilization while maintaining training stability AU Focal Loss: =2. 0 achieves optimal class balance without over-weighting difficult examples AU Fine-tuning: 20 trainable layers prevent overfitting while enabling task-specific adaptation The comparison demonstrates that the Enhanced ResNet50 model significantly outperforms all baseline architectures, achieving a 5. 5% improvement over standard ResNet50 and 13. 4% improvement over basic approaches, while maintaining reasonable computational requirements and training efficiency. Fig. 6 presents the prediction accuracy visualization comparing actual versus predicted ripeness classifications on the test dataset, demonstrating the model's capability to capture accurate fruit ripeness patterns across all categories. p-ISSN 2301-7988, e-ISSN 2581-0588 DOI : 10. 32736/sisfokom. Copyright A2026 Submitted : May 25, 2025. Revised : August 1, 2025. Accepted : August 5, 2025. Published : December 15, 2025 Overall, these findings indicate that the Enhanced ResNet50 model represents a significant advancement in automated fruit ripeness detection, achieving exceptional performance that substantially exceeds research targets while demonstrating practical applicability for real-world deployment scenarios. The comprehensive evaluation validates the effectiveness of the integrated advanced techniques and confirms the model's readiness for implementation in Indonesia's Free Nutritious Meal Program. Fig. Comparative Performance Analysis Statistical Significance and Robustness Analysis: To ensure the reliability and robustness of the achieved results, comprehensive statistical validation was performed: AU Cross-validation: 5-fold cross-validation achieving consistent performance . 8% A 0. AU Bootstrap Analysis: 1000 bootstrap samples confirming statistical significance . < 0. AU Confidence Intervals: 95% CI for accuracy: . AU McNemar's Test: Significant improvement over baseline methods . < 0. Although the Enhanced ResNet50 model shows exceptional results, the analysis of prediction patterns reveals important insights about model behavior and potential areas for future enhancement: AU Effective Class Imbalance Handling: The Focal Loss implementation successfully addressed the mild class imbalance . , with the minority class (Overrip. 3% accuracy, demonstrating that the dynamic weighting strategy effectively prevented majority class bias. AU Attention Mechanism Benefits: The integrated attention mechanism enabled the model to focus on relevant visual features for ripeness classification, contributing to the high precision scores across all categories and reducing misclassification errors. AU Transfer Learning Effectiveness: Strategic fine-tuning of 20 ResNet50 layers provided optimal knowledge transfer from ImageNet features to fruit-specific characteristics, balancing pre-trained knowledge retention with task-specific adaptation. AU Production Deployment Readiness: With inference time of 50-100ms per image and model size of 55 MB, the system demonstrates excellent characteristics for practical deployment in large-scale nutrition program infrastructure. IV. AU CONCLUSION This study successfully implemented and evaluated an Enhanced ResNet50 model with advanced optimization techniques for automated fruit ripeness detection in support of Indonesia's Free Nutritious Meal Program. Through systematic implementation of Focal Loss for class imbalance handling, attention mechanisms for enhanced feature extraction, and strategic transfer learning approaches, the model achieved exceptional performance that substantially exceeds all initial research targets and demonstrates superior capabilities for practical deployment applications. The key research achievements include: . Outstanding Performance Achievement: The Enhanced ResNet50 model achieved remarkable 97. 22% accuracy, substantially exceeding the 85% target by 14. 4%, with equally impressive precision, recall, and F1-scores of 0. 9722, demonstrating exceptional classification capabilities across all fruit ripeness categories. Advanced Optimization Success: Successful implementation and validation of Focal Loss techniques (=. 809, 1. , =2. demonstrated superior performance in addressing mild class imbalance while maintaining high accuracy across minority and majority classes. Efficient Architecture Integration: The strategic combination of ResNet50 transfer learning . trainable layer. , attention mechanisms, progressive regularization, and advanced optimization resulted in a robust, highly effective, and production-ready classification system with 12m 50s training . Production Deployment Readiness: The model demonstrates excellent deployment characteristics including optimal model size . 55 MB), fast inference speed . -100m. , and comprehensive integration capabilities suitable for immediate implementation in large-scale nutrition Evaluation on comprehensive test data showed that this optimal model was able to capture the main patterns and trends in fruit ripeness classification, achieving outstanding performance across all evaluation metrics. These results indicate that the Enhanced ResNet50 model, when properly configured with advanced optimization techniques such as Focal Loss and attention mechanisms, represents a highly promising and immediately applicable approach for automated fruit quality assessment in national nutrition programs. The minimal prediction errors . nly 5 misclassifications out of 180 test sample. demonstrate the model's exceptional reliability and practical applicability for real-world deployment scenarios. The comprehensive evaluation results conclusively demonstrate that the enhanced deep learning approach is not p-ISSN 2301-7988, e-ISSN 2581-0588 DOI : 10. 32736/sisfokom. Copyright A2026 Submitted : May 25, 2025. Revised : August 1, 2025. Accepted : August 5, 2025. Published : December 15, 2025 only technically superior to existing methods but also highly practical and immediately applicable for supporting Indonesia's Free Nutritious Meal Program infrastructure, with significant potential for positive impact on program effectiveness, operational efficiency, and public health outcomes. ACKNOWLEDGMENT We would like to express our deepest gratitude to the faculty and staff at AMIK Bukittinggi for their continuous support and guidance throughout this research. Their valuable insights and feedback have been instrumental in the development and completion of this study. We also extend our sincere thanks to the Kaggle community for providing access to the Fruits Ripeness Classification Dataset, which formed the foundation of this research. Special recognition goes to Indonesia's Free Nutritious Meal Program for inspiring this research effort aimed at improving automated food quality assurance systems in national nutrition programs. REFERENCES