Image
architecture_dict = {'Vanilla': Vanilla, 'ResNet50': ResNet50, 'ResNet101': ResNet101, 'ResNet152': ResNet152, 'ResNet50V2': ResNet50V2, 'ResNet101V2': ResNet101V2, 'ResNet152V2': ResNet152V2, 'DenseNet121': DenseNet121, 'DenseNet169': DenseNet169, 'DenseNet201': DenseNet201, 'EfficientNetB0': EfficientNetB0, 'EfficientNetB1': EfficientNetB1, 'EfficientNetB2': EfficientNetB2, 'EfficientNetB3': EfficientNetB3, 'EfficientNetB4': EfficientNetB4, 'EfficientNetB5': EfficientNetB5, 'EfficientNetB6': EfficientNetB6, 'EfficientNetB7': EfficientNetB7, 'InceptionResNetV2': InceptionResNetV2, 'InceptionV3': InceptionV3, 'MobileNet': MobileNet, 'MobileNetV2': MobileNetV2, 'NASNetMobile': NASNetMobile, 'NASNetLarge': NASNetLarge, 'VGG16': VGG16, 'VGG19': VGG19, 'Xception': Xception, 'ConvNeXtBase': ConvNeXtBase, 'ConvNeXtTiny': ConvNeXtTiny, 'ConvNeXtSmall': ConvNeXtSmall, 'ConvNeXtLarge': ConvNeXtLarge}
module-attribute
¤
Dictionary of implemented 2D Architectures Methods in AUCMEDI.
The base key (str) or an initialized Architecture can be passed to the NeuralNetwork class as architecture
parameter.
Example
my_model = NeuralNetwork(n_labels=4, channels=3, architecture="2D.Xception",
input_shape(512, 512), activation_output="softmax")
from aucmedi.neural_network.architectures import Classifier, architecture_dict
classification_head = Classifier(n_labels=4, activation_output="softmax")
my_arch = architecture_dict["2D.Xception"](classification_head,
channels=3, input_shape=(512,512))
my_model = NeuralNetwork(n_labels=None, channels=None, architecture=my_arch)
from aucmedi.neural_network.architectures import Classifier
from aucmedi.neural_network.architectures.image import Xception
classification_head = Classifier(n_labels=4, activation_output="softmax")
my_arch = Xception(classification_head,
channels=3, input_shape=(512,512))
my_model = NeuralNetwork(n_labels=None, channels=None, architecture=my_arch)
Warning
If passing an architecture key to the NeuralNetwork class, be aware that you have to add "2D." in front of it.
For example:
# for the image architecture "ResNet101"
architecture="2D.ResNet101"
Architectures are based on the abstract base class aucmedi.neural_network.architectures.arch_base.Architecture_Base.
supported_standardize_mode = {'Vanilla': 'z-score', 'ResNet50': 'caffe', 'ResNet101': 'caffe', 'ResNet152': 'caffe', 'ResNet50V2': 'tf', 'ResNet101V2': 'tf', 'ResNet152V2': 'tf', 'DenseNet121': 'torch', 'DenseNet169': 'torch', 'DenseNet201': 'torch', 'EfficientNetB0': 'caffe', 'EfficientNetB1': 'caffe', 'EfficientNetB2': 'caffe', 'EfficientNetB3': 'caffe', 'EfficientNetB4': 'caffe', 'EfficientNetB5': 'caffe', 'EfficientNetB6': 'caffe', 'EfficientNetB7': 'caffe', 'InceptionResNetV2': 'tf', 'InceptionV3': 'tf', 'MobileNet': 'tf', 'MobileNetV2': 'tf', 'NASNetMobile': 'tf', 'NASNetLarge': 'tf', 'VGG16': 'caffe', 'VGG19': 'caffe', 'Xception': 'tf', 'ConvNeXtBase': None, 'ConvNeXtTiny': None, 'ConvNeXtSmall': None, 'ConvNeXtLarge': None}
module-attribute
¤
Dictionary of recommended Standardize techniques for 2D Architectures Methods in AUCMEDI.
The base key (str) can be passed to the DataGenerator as standardize_mode
parameter.
Info
If training a new model from scratch, any Standardize technique can be used at will.
However, if training via transfer learning, it is required to use the recommended Standardize technique!
Example
my_model = NeuralNetwork(n_labels=8, channels=3, architecture="2D.DenseNet121")
my_dg = DataGenerator(samples, "images_dir/", labels=None,
resize=my_model.meta_input, # (224, 224)
standardize_mode=my_model.meta_standardize) # "torch"
from aucmedi.neural_network.architectures import supported_standardize_mode
sf_norm = supported_standardize_mode["2D.DenseNet121"]
my_dg = DataGenerator(samples, "images_dir/", labels=None,
resize=(224, 224), # (224, 224)
standardize_mode=sf_norm) # "torch"
Warning
If using an architecture key for the supported_standardize_mode dictionary, be aware that you have to add "2D." in front of it.
For example:
# for the image architecture "ResNet101"
from aucmedi.neural_network.architectures import supported_standardize_mode
sf_norm = supported_standardize_mode["2D.ResNet101"]