stouputils.data_science.models.keras.vgg module#

VGG models implementation.

This module provides wrapper classes for the VGG family of models from the Keras applications. VGG models are characterized by their simplicity, using only 3x3 convolutional layers stacked on top of each other with increasing depth.

Available models: - VGG16: 16-layer model with 13 convolutional layers and 3 fully connected layers - VGG19: 19-layer model with 16 convolutional layers and 3 fully connected layers

Both models support transfer learning from ImageNet pre-trained weights.

class VGG19(num_classes: int, kfold: int = 0, transfer_learning: str = 'imagenet', **override_params: Any)[source]#

Bases: BaseKeras

VGG19 implementation using advanced model class with common functionality. For information, refer to the ModelInterface class.

class_routine(kfold: int = 0, transfer_learning: str = 'imagenet', verbose: int = 0, **override_params: Any) ModelInterface#

Run the full routine for VGG19 model.

Parameters:
  • dataset (Dataset) – Dataset to use for training and evaluation.

  • kfold (int) – K-fold cross validation index.

  • transfer_learning (str) – Pre-trained weights to use, can be “imagenet” or a dataset path like ‘data/pizza_not_pizza’.

  • verbose (int) – Verbosity level.

  • **kwargs (Any) – Additional arguments.

Returns:

Trained model instance.

Return type:

VGG19

class VGG16(num_classes: int, kfold: int = 0, transfer_learning: str = 'imagenet', **override_params: Any)[source]#

Bases: BaseKeras

VGG16 implementation using advanced model class with common functionality. For information, refer to the ModelInterface class.

class_routine(kfold: int = 0, transfer_learning: str = 'imagenet', verbose: int = 0, **override_params: Any) ModelInterface#

Run the full routine for VGG16 model.

Parameters:
  • dataset (Dataset) – Dataset to use for training and evaluation.

  • kfold (int) – K-fold cross validation index.

  • transfer_learning (str) – Pre-trained weights to use, can be “imagenet” or a dataset path like ‘data/pizza_not_pizza’.

  • verbose (int) – Verbosity level.

  • **kwargs (Any) – Additional arguments.

Returns:

Trained model instance.

Return type:

VGG16

model#

alias of VGG16