convnext_tiny
orchard.architectures.convnext_tiny
¶
ConvNeXt-Tiny Architecture for 224x224 Image Classification.
Adapts ConvNeXt-Tiny (modernized ConvNet architecture) for image classification with transfer learning support. Handles both RGB and grayscale inputs through dynamic first-layer adaptation.
Key Features:
- Modern ConvNet Design: Incorporates design choices from transformers
- Transfer Learning: Leverages ImageNet pretrained weights
- Adaptive Input: Customizes first layer for grayscale datasets
- Channel Compression: Weight morphing for RGB→grayscale adaptation
build_convnext_tiny(num_classes, in_channels, *, pretrained)
¶
Constructs ConvNeXt-Tiny 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 ConvNeXt-Tiny model (device placement handled by factory). |