Skip to content

Neural network

A pillar of any AUCMEDI pipeline: aucmedi.neural_network.model.NeuralNetwork

The Neural Network class is a powerful interface to the deep neural network world in AUCMEDI.

Pillars of AUCMEDI

With an initialized Neural Network instance, it is possible to run training and predictions.

Example
# Import
from aucmedi import *

# Initialize model
model = NeuralNetwork(n_labels=8, channels=3, architecture="2D.ResNet50")

# Do some training
datagen_train = DataGenerator(samples[:100], "images_dir/", labels=class_ohe[:100],
                              resize=model.meta_input, standardize_mode=model.meta_standardize)
model.train(datagen_train, epochs=50)

# Do some predictions
datagen_test = DataGenerator(samples[100:150], "images_dir/", labels=None,
                             resize=model.meta_input, standardize_mode=model.meta_standardize)
preds = model.predict(datagen_test)