Instructions to use shkelqim2026/EfficientNet with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use shkelqim2026/EfficientNet with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://shkelqim2026/EfficientNet") - Notebooks
- Google Colab
- Kaggle
- Model Card: EfficientNet-B0--B7 for Four-Class SD-OCT Retinal Image Classification
- 1. Model details
- 2. Intended prediction
- 3. Training data
- 4. Input processing
- 5. Architecture and training procedure
- 6. Reported results
- EfficientNet-B7 96.73% 0.8720 0.9177 65.54M
- 7. CPU inference measurements reported in the paper
- EfficientNet-B7 1,247.88 1,232.05 0.801
- 8. Evaluation
- 9. Limitations and risks
- 10. Ethical considerations and recommended safeguards
- 11. Recommended model selection
- 12. Reproducibility and release status
- Clinical approval / regulatory Not established; do not assume
status approval
- 13. Citation
Model Card: EfficientNet-B0--B7 for Four-Class SD-OCT Retinal Image Classification
Study: Within-Family EfficientNet Scaling under Fixed-Resolution
Transfer Learning for Spectral-Domain Optical Coherence Tomography
Retinal Disease Classification
Researcher: Shkëlqim Sherifi, University of Tetova
Model family: ImageNet-pretrained EfficientNet-B0, B1, B2, B3, B4,
B5, B6, and B7
Task: Four-class classification of spectral-domain optical coherence
tomography (SD-OCT) retinal images
Status: Research prototype; not clinically validated
Primary result: EfficientNet-B1 achieved the highest reported test
accuracy (96.95%) in this experiment.
Important use restriction: These models are research models, not medical devices. They must not be used as the sole basis for diagnosis, screening, triage, treatment, or other patient-management decisions. Clinical use would require independent validation, appropriate regulatory review, and evaluation in the intended clinical setting.
1. Model details
Model description
This study compares the eight members of the EfficientNet family, B0 through B7, under a shared fixed-resolution transfer-learning protocol. Each backbone was initialized with ImageNet-pretrained weights and adapted to classify SD-OCT images into four dataset labels: CNV, DME, Drusen, and Normal.
The experiment was designed to assess how scaling within the EfficientNet family affects classification performance and computational cost when the input resolution is held constant at 224 × 224 pixels. Results therefore describe this particular dataset and training protocol; they do not establish that a larger EfficientNet is generally better or worse for OCT.
Model variants and parameter counts
The paper reports experimentally instantiated backbone parameters and total parameters after adding the classification head.
Variant Backbone parameters Total model parameters
EfficientNet-B0 4.05 million 4.84 million EfficientNet-B1 6.58 million 7.37 million EfficientNet-B2 7.77 million 8.63 million EfficientNet-B3 10.78 million 11.71 million EfficientNet-B4 17.67 million 18.73 million EfficientNet-B5 28.51 million 29.70 million EfficientNet-B6 40.96 million 42.28 million EfficientNet-B7 64.10 million 65.54 million
Intended use
- Research on transfer learning for four-class SD-OCT image classification.
- Reproducible comparison of EfficientNet model scaling at a fixed 224 × 224 input resolution.
- Educational and methodological investigations into performance, class-wise errors, interpretability, and computational trade-offs.
Out-of-scope use
- Clinical diagnosis or exclusion of retinal disease.
- Patient screening, referral, triage, treatment selection, or prognosis.
- Use on fundus photographs, other imaging modalities, or OCT datasets with different acquisition and labeling procedures without new validation.
- Autonomous clinical deployment or use as a replacement for qualified eye-care professionals.
2. Intended prediction
The model produces a four-class probability distribution over the following labels:
Output label Meaning in the dataset
CNV Choroidal neovascularization
DME Diabetic macular edema
Drusen Drusen
Normal Normal OCT image
The class order used by the classification head is CNV, DME, Drusen, Normal. Implementations should preserve this order when interpreting the output vector.
3. Training data
Dataset and scale
The study used the four-class Kermany SD-OCT dataset, with 109,309 images in the supplied training, validation, and test partitions.
Class Training Validation Test Total
CNV 26,218 7,491 3,746 37,455 DME 8,118 2,319 1,161 11,598 Drusen 6,206 1,773 887 8,866 Normal 35,973 10,278 5,139 51,390 Total 76,515 21,861 10,933 109,309
The class distribution is imbalanced: Normal and CNV are more represented than Drusen and DME. The training procedure used class weights to address this imbalance.
Split provenance and data-integrity caveats
The study retained the partitions supplied with the dataset release. The paper does not establish that patient-level separation was independently verified, and it does not report an independent duplicate-image audit across the exact partitions used. Consequently, the reported test results should not be interpreted as proof of generalization to unseen patients or independent clinical sites. These are unresolved validation questions, not evidence that leakage definitely occurred.
The results are tied to this dataset and its label definitions. Dataset-level performance may not transfer to images from other devices, clinics, patient populations, or acquisition protocols.
4. Input processing
- Input size: 224 × 224 pixels.
- Image channels: Grayscale OCT images are converted to three channels by replicating the grayscale channel.
- Backbone initialization: ImageNet-pretrained EfficientNet
weights (
weights='imagenet',include_top=False). - Preprocessing: The EfficientNet model's embedded preprocessing was retained.
- Training-only augmentation: Random horizontal flip, random rotation up to ±5°, translation up to ±5%, zoom up to ±5%, and contrast variation with factor 0.15. Vertical flipping was not used.
For inference, the same resize, channel-replication, and model preprocessing conventions used in training should be followed. The paper does not specify a universally applicable preprocessing pipeline for arbitrary external OCT exports; deployments should document and verify their exact image-loading and resizing implementation.
5. Architecture and training procedure
Classification head
The ImageNet classification top was removed. The task-specific head consisted of:
- Global average pooling.
- Dense layer with 512 units and ReLU activation.
- Batch normalization.
- Dropout (0.5).
- Dense layer with 256 units and ReLU activation.
- Batch normalization.
- Dropout (0.3).
- Four-unit softmax output layer.
Two-stage transfer learning
- Stage 1 --- frozen backbone: Train the classification head while keeping the pretrained backbone frozen; maximum 15 epochs.
- Stage 2 --- partial fine-tuning: Unfreeze approximately the upper 50% of the backbone and fine-tune jointly with the head; maximum 30 epochs. The optimizer was reinitialized for this stage and the learning rate was reduced relative to Stage 1.
Early stopping and learning-rate reduction on validation loss were used. Stage 1 used early-stopping patience 5 and learning-rate-reduction patience 2; Stage 2 used patience 6 and 3, respectively. The paper reports AdamW, class-weighted categorical cross-entropy with label smoothing (α = 0.1), and a common random seed of 42. Exact learning-rate and weight-decay values should be copied from the authors' training configuration before attempting a bit-for-bit reproduction; they are not reproduced here because the available paper extraction does not reliably preserve the exponent formatting.
Training environment
- TensorFlow 2.20.0 with Keras.
- Google Colab.
- NVIDIA Tesla T4 GPU with 16 GB memory.
- Mixed precision: float16 computation with float32 output.
- Batch size: 16.
- Class weights reported approximately as CNV 0.73, DME 2.36, Drusen 3.08, and Normal 0.53.
6. Reported results
Main finding
The study found that test accuracy did not increase monotonically with EfficientNet scale. EfficientNet-B1 achieved the highest reported test accuracy, 96.95%, and the highest reported Drusen F1 score, 0.8780. EfficientNet-B7 reached 96.73% accuracy and the highest Drusen recall, 0.9177, but had a lower Drusen F1 score of 0.8720 and substantially higher parameter count and CPU latency.
Variant Test accuracy Drusen F1 Drusen recall Total parameters
EfficientNet-B0 95.93% --- --- 4.84M
EfficientNet-B1 96.95% 0.8780 --- 7.37M
EfficientNet-B7 96.73% 0.8720 0.9177 65.54M
Dashes mean that the corresponding value is not included in this concise summary; they should not be interpreted as zero or as unavailable in the full paper.
Class-wise observations
- Drusen was the lowest-F1 class for all eight variants.
- Across the evaluated models, the reported F1 ranking was Normal > CNV > DME > Drusen.
- Drusen accounted for 82.2% of the summed squared deviation in class-specific F1 across the family, according to the paper's analysis.
- B7's higher Drusen recall did not produce the best Drusen F1 because its precision was lower than B1's.
- Larger models incurred substantially greater computational cost without a monotonic improvement in test accuracy.
These findings support choosing a model based on the required balance of accuracy, class-specific errors, latency, memory, and deployment constraints---not parameter count alone. They do not demonstrate clinical superiority of B1 over other models.
7. CPU inference measurements reported in the paper
Measurements were made on an Intel Core i7-6700HQ 2.60 GHz CPU, Windows 10, batch size 1, float32; the procedure used 50 warm-up runs and 200 timed runs. The paper notes that these measurements are approximate and may be affected by background processes.
Variant Mean latency Median latency Throughput (ms/image) (ms/image) (images/s)
EfficientNet-B0 407.48 345.51 2.454
EfficientNet-B1 512.79 474.43 1.950
EfficientNet-B2 479.46 474.48 2.086
EfficientNet-B3 544.27 543.42 1.837
EfficientNet-B4 683.46 681.20 1.463
EfficientNet-B5 844.98 841.37 1.183
EfficientNet-B6 971.32 970.17 1.030
EfficientNet-B7 1,247.88 1,232.05 0.801
These values are specific to the reported hardware, software, precision, and benchmark procedure. They are not guaranteed production latency figures.
8. Evaluation
The paper reports evaluation using aggregate classification metrics, including accuracy, weighted F1, macro F1, balanced accuracy, Matthews correlation coefficient (MCC), and Cohen's kappa. The analyses also include class-wise precision, recall and F1, confusion matrices, ROC and precision--recall analyses, training dynamics, predictive-probability structure, Grad-CAM, and t-SNE representations.
The results summarized here are retrospective test-set results from the dataset used in the study. The paper does not establish prospective clinical performance or external validation on independently collected clinical data.
9. Limitations and risks
- No established clinical validation. This is a research comparison, not a clinically validated diagnostic system.
- Generalization is unknown. Performance on other hospitals, OCT devices, acquisition protocols, and patient populations has not been established by this experiment.
- Patient-level split verification is unresolved. The study retained supplied dataset partitions but did not independently establish patient-level separation.
- Duplicate audit is unresolved. The exact partitions used were not independently audited for duplicate images across train, validation, and test.
- Class imbalance and Drusen errors. Drusen had the weakest F1 across all variants, so aggregate accuracy can obscure clinically important class-specific weaknesses.
- Single-seed evidence. The common seed was 42; multi-seed uncertainty and confidence intervals are not established in this card.
- Fixed resolution. The comparison uses 224 × 224 inputs. It does not establish whether different resolutions would improve results.
- Limited external reproducibility information. Exact hyperparameter exponents are not reliably preserved in the available text extraction. Public release of trained weights and code is not confirmed by the information summarized here.
- Interpretability is not proof of correctness. Grad-CAM and t-SNE can support exploratory analysis but do not establish causal reasoning or clinical validity.
- Hardware-specific timing. CPU latency is approximate and should be benchmarked again on target hardware.
10. Ethical considerations and recommended safeguards
- Keep a qualified clinician responsible for interpretation of OCT findings.
- Do not use model output as the sole basis for patient-care decisions.
- Before any clinical research or deployment, conduct external validation on patient-separated, institutionally diverse data and report class-specific metrics and uncertainty.
- Audit duplicate images, patient overlap, label quality, and acquisition-device distribution.
- Review false negatives and false positives by class, especially Drusen.
- Define an abstention or human-review pathway for uncertain predictions before any prospective evaluation.
- Monitor performance across relevant subgroups and acquisition conditions where legally and ethically appropriate.
- Follow applicable data-protection, institutional-review, and medical-device requirements.
11. Recommended model selection
For the reported experiment, EfficientNet-B1 is the best-performing choice by test accuracy (96.95%) and reported Drusen F1 (0.8780). EfficientNet-B0 is smaller and had the lowest reported mean CPU latency among the listed variants. EfficientNet-B7 achieved the highest reported Drusen recall (0.9177), but it used 65.54 million total parameters and had a reported mean CPU latency of approximately 1.25 seconds per image.
This is a study-specific recommendation, not a clinical recommendation. The most appropriate variant depends on the target hardware and the relative cost of class-specific errors; external validation is required before selecting a model for real-world use.
12. Reproducibility and release status
Item Status based on the paper
Dataset name Kermany four-class SD-OCT dataset
Input resolution 224 × 224
Model family EfficientNet-B0 through B7
Pretrained weights ImageNet
Framework TensorFlow 2.20.0 / Keras
Random seed 42
Training hardware NVIDIA Tesla T4, 16 GB
Public source-code URL Not established in the paper information summarized here
Public trained-weight URL Not established in the paper information summarized here
External clinical validation Not established
Clinical approval / regulatory Not established; do not assume status approval
13. Citation
Sherifi, Shkëlqim. Within-Family EfficientNet Scaling under Fixed-Resolution Transfer Learning for Spectral-Domain Optical Coherence Tomography Retinal Disease Classification. Manuscript submitted for possible publication in Diagnostics (2026), as identified in the supplied research paper.
Model-card maintenance note
This card reflects the experimental protocol and results reported in the supplied manuscript. Update it if the dataset split, preprocessing, code, checkpoint, class order, training configuration, or evaluation results change. Before publishing a checkpoint, record the exact model variant, checkpoint checksum, software versions, preprocessing code, and a reproducible inference example.
- Downloads last month
- 440