efficientnet_b0
orchard.architectures.efficientnet_b0
¶
EfficientNet-B0 Architecture for 224x224 Image Classification.
Adapts EfficientNet-B0 (compound scaling architecture) for image classification with transfer learning support. Handles both RGB and grayscale inputs through dynamic first-layer adaptation.
Key Features:
- Efficient Scaling: Balances depth, width, and resolution
- Transfer Learning: Leverages ImageNet pretrained weights
- Adaptive Input: Customizes first layer for grayscale datasets
- Channel Compression: Weight morphing for RGB→grayscale (3→1) adaptation
build_efficientnet_b0(num_classes, in_channels, *, pretrained)
¶
Constructs EfficientNet-B0 adapted for image classification datasets.
Workflow
- Load pretrained weights from ImageNet (if enabled)
- Modify first conv layer to accept custom input channels
- Apply weight morphing for channel compression (if grayscale)
- Replace classification head with dataset-specific linear layer
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_classes
|
int
|
Number of dataset classes for classification head |
required |
in_channels
|
int
|
Input channels (1=Grayscale, 3=RGB) |
required |
pretrained
|
bool
|
Whether to load ImageNet pretrained weights |
required |
Returns:
| Type | Description |
|---|---|
Module
|
Adapted EfficientNet-B0 model (device placement handled by factory). |