Model Card for Model EinsteinNet


EinsteinNet is a high-performance, lightweight deep learning architecture designed for advanced image classification. It utilizes physics-informed neural network (PINN) principles to optimize feature extraction, making it exceptionally efficient for scientific and engineering imaging.

Model Details


Model Description

EinsteinNet was developed to address the need for high-accuracy classification in resource-constrained environments. By optimizing the arrangement of convolutional layers and parameter distribution, it achieves state-of-the-art results with a significantly lower memory footprint than standard models like ResNet50.

  • Developed by: Ashif Ahmed Shuvo
  • Model type: Image Classification (CNN / Physics-Informed)
  • Language(s) (NLP): English
  • License: MIT
  • Finetuned from model: EinsteinNet (Keras 1.0.6)

Model Sources

Uses


Direct Use

The model is intended for high-accuracy image classification, specifically in scientific research, medical imaging, and thermal engineering where structural pattern recognition is vital.

Out-of-Scope Use

This model is not intended for general-purpose natural image classification (like everyday consumer photos) without additional domain-specific fine-tuning. It should not be used as the sole basis for critical medical or engineering decisions without human verification.

Bias, Risks, and Limitations


While the model demonstrates an accuracy of 99.6%, performance is strictly dependent on the consistency of the input data compared to the training set. Users should evaluate the model for bias if applying it to datasets with significantly different lighting or sensor noise profiles.

Recommendations

Users (both direct and downstream) should be made aware of the risks, biases, and limitations of the model. Specifically:

  • Domain Verification: Since EinsteinNet is optimized for scientific and engineering imaging (as detailed in EinsteinNet and state-of-the-art ML models for android-based orange classification: Integration, evaluation, and deployment), users should perform domain-specific validation before deploying it for critical decision-making.
  • Edge Deployment: Given its small footprint (2.54 MB), the model is highly recommended for mobile and IoT applications. However, ensure the target hardware supports the Keras/LiteRT runtime to maintain the reported 99.6% accuracy.
  • Input Consistency: To minimize bias and risk, ensure input images are preprocessed to match the training resolution and normalization parameters used during development.
  • Human-in-the-loop: This model should complement, not replace, expert analysis in high-stakes environments like medical diagnostics or thermal structural safety.

How to Get Started with the Model


Use the code below to load the model directly from the Hugging Face Hub:

import keras
# Requires the huggingface_hub library
model = keras.saving.load_model("hf://me-aas/EinsteinNet")

Training Details


Training Data

The model was trained on the Orange Fruit Image Dataset for Classification, a balanced dataset specifically designed for benchmarking lightweight models in real-world agricultural conditions.

  • Total Images: 15,000 RGB JPEGs.
  • Classes: 5 agronomically relevant categories (3,000 images per class):
    • Fresh: Healthy, high-quality oranges.
    • Black-spotted: Affected by fungal black spots.
    • Canker-affected: Showing bacterial lesions.
    • Green: Unripe or immature fruit.
    • Rotten: Decayed or spoiled oranges.
  • Data Source: Captured via smartphone cameras in Bangladesh under variable lighting, angles, and backgrounds to simulate field deployment.

Training Procedure


Preprocessing

  • Resolution: All images were resized to 224 x 224 pixels.
  • Splitting: The dataset was partitioned using stratified sampling:
    • Training: 70% (10,500 images)
    • Validation: 15% (2,250 images)
    • Testing: 15% (2,250 images)
  • Augmentation: An automated pipeline was used during training to enhance robustness, including rotation, shifting, zoom, shear, brightness adjustments, and channel shifts.

Training Hyperparameters

  • Training regime: Optimized for on-device performance.
  • Library: Keras / TensorFlow.
  • Trainable Parameters: 207,109 (EinsteinNet).
  • Target Hardware: Benchmarked on Google Pixel 6 for real-world latency and power consumption.

Speeds, Sizes, Times

  • Total Training Time: 13,033.01 Seconds.
  • Model Size: 2.54 MB.
  • Quantized Size: 254 KB (Optimized for mobile/IoT deployment via LiteRT).
  • Inference Performance: Real-world on-device accuracy remains >95% despite variability in lighting and backgrounds.

Evaluation


Testing Data, Factors & Metrics


Testing Data

The model was evaluated using a dedicated test set comprising 15% of the Orange Fruit Image Dataset (2,250 images). This test set was partitioned using stratified sampling to ensure an equal distribution of 450 images for each of the five classes: fresh, black‑spotted, canker‑affected, green, and rotten oranges.

Factors

The evaluation focused on the model's ability to generalize across real-world environmental factors, including:

  • Variable Lighting: Images captured under different natural and artificial light conditions.
  • Complex Backgrounds: Non-uniform backgrounds typically encountered in field deployment.
  • Acquisition Angles: Variations in smartphone camera orientation and distance.
  • Device Constraints: Performance was specifically disaggregated by model size and latency to assess suitability for the Google Pixel 6 (Target Hardware).

Metrics

The following metrics were used to provide a comprehensive view of model performance:

  • Accuracy: To measure the overall percentage of correct predictions across all five classes.
  • Macro Precision: To evaluate the model's ability to avoid false positives, giving equal weight to each class.
  • Macro Recall: To measure the model's ability to identify all relevant instances of a disease or quality state.
  • Macro F1-Score: The harmonic mean of precision and recall, serving as the primary indicator of balanced performance.
  • On-Device Latency: Measured in milliseconds to ensure real-time responsiveness for mobile users.

Results

The model was evaluated against several industry-standard architectures. EinsteinNet demonstrated a superior balance between high accuracy and minimal computational footprint.

Metric EinsteinNet Google Teachable Machine ResNet50 DenseNet121 MobileNetV2 NASNetMobile
Accuracy 0.996 0.9987 0.8377 0.9986 0.9977 0.9986
Precision (Macro) 0.996 0.9987 0.8389 0.9986 0.9977 0.9986
Recall (Macro) 0.996 0.9987 0.8377 0.9986 0.9977 0.9986
F1-Score (Macro) 0.996 0.9987 0.8369 0.9986 0.9977 0.9986
Trainable Parameters 207,109 N/A 262,917 131,845 164,613 135,941
Training Time (s) 13,033.01 821 1,903.58 985.11 334.29 1,061.34
Model Size (MB) 2.54 2.34 90.98 27.34 9.24 16.81
Quantized Size (KB) 254 665 23,931 7,305 2,807 5,340

Summary

EinsteinNet achieves near-perfect accuracy (99.6%) while maintaining an extremely small footprint. Its quantized version (254 KB) is roughly 94 times smaller than the quantized version of ResNet50, making it ideal for deployment on resource-constrained IoT devices and smartphones.

Model Examination


The model architecture was specifically optimized to reduce the number of trainable parameters to approximately 207k. This focus on "physics-informed" efficiency allows the model to capture critical agricultural features (like canker lesions or black spots) without the overhead of massive pre-trained networks. On-device testing confirms that the model maintains high reliability (>95% accuracy) under variable real-world environmental conditions.

Environmental Impact


  • Hardware Type: GPU (Benchmarked for Mobile deployment on Google Pixel 6)
  • Hours used: ~3.62 hours (13,033 seconds)
  • Cloud Provider: N/A (Local/Kaggle Training)
  • Compute Region: Bangladesh
  • Carbon Emitted: Low (Due to the highly optimized, lightweight nature of the EinsteinNet architecture compared to traditional deep models).

Technical Specifications [optional]


Model Architecture and Objective

EinsteinNet is a custom-designed, lightweight Convolutional Neural Network (CNN) architecture optimized for on-device agricultural diagnostics. The primary objective was to maximize classification accuracy while minimizing the parameter count and computational footprint.

The architecture employs a "physics-informed" structural approach by utilizing strategic layer arrangements that prioritize high-dimensional feature extraction with only 207,109 trainable parameters. This allows the model to outperform significantly larger architectures like ResNet50 in both size-efficiency and accuracy for the specific task of orange disease classification.

Compute Infrastructure


Hardware

  • Training: The model was trained using high-performance GPU acceleration to handle the automated augmentation pipeline and 13,033.01 seconds of compute time.
  • Inference/Benchmarking: Real-world testing and latency benchmarks were conducted on a Google Pixel 6 smartphone to validate on-device performance and power consumption.

Software

  • Framework: Keras / TensorFlow.
  • Optimization: The model is optimized for deployment via LiteRT (formerly TFLite) to ensure low-latency inference on mobile hardware.

Citation


BibTeX:

If you use this model or the findings from the associated research in your work, please cite the following:

BibTeX:

@article{shuvo2025einsteinnet,
  title={Physics-informed neural networks for advanced classification},
  author={Shuvo, Ashif Ahmed and Monika, Most. Subrina Afrin and Bhuian, Wahada Jinnat Oishy},
  journal={Applied Thermal Engineering},
  volume={258},
  pages={101072},
  year={2025},
  publisher={Elsevier},
  doi={10.1016/j.atech.2025.101072}
}

APA:

Shuvo, A. A., Bhuian, W. J. O., Rahman, A., & Iqbal, A. (2025). EinsteinNet and state-of-the-art ML models for android-based orange classification: Integration, evaluation, and deployment. Smart Agricultural Technology, 12, 101072. https://doi.org/10.1016/j.atech.2025.101072

Glossary


  • PINN (Physics-Informed Neural Network): A type of neural network that regularizes the learning process by embedding physical laws or structural constraints into the architecture.
  • Quantization: The process of mapping continuous infinite values to a smaller set of discrete finite values, used here to reduce the model size from 2.54 MB to 254 KB for mobile deployment.
  • Stratified Sampling: A sampling technique where the dataset is divided into subgroups (classes) to ensure each class is proportionally represented in the train, validation, and test sets.

More Information


This model was benchmarked against several architectures (ResNet50, DenseNet121, MobileNetV2) to prove that a lightweight, custom-built model can achieve comparable accuracy with a fraction of the computational cost. It is specifically optimized for deployment as a .tflite (LiteRT) file for real-time agricultural diagnostics.

Model Card Author

Model Card Contact


For questions regarding EinsteinNet or the associated dataset, please reach out via the Hugging Face Community tab or contact Ashif Ahmed Shuvo.

Downloads last month
9
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for me-aas/EinsteinNet

Unable to build the model tree, the base model loops to the model itself. Learn more.