stouputils.data_science.models.keras.efficientnet module#

EfficientNetV2 models implementation.

This module provides wrapper classes for the EfficientNetV2 family of models from the Keras applications. EfficientNetV2 models are a family of convolutional neural networks that achieve better parameter efficiency and faster training speed compared to prior models.

Available models:

  • EfficientNetV2M: Medium-sized variant balancing performance and computational cost

  • EfficientNetV2L: Large variant with higher capacity for complex tasks

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

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

Bases: BaseKeras

EfficientNetV2M 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 EfficientNetV2M 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:

EfficientNetV2M

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

Bases: BaseKeras

EfficientNetV2L 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 EfficientNetV2L 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:

EfficientNetV2L

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

Bases: BaseKeras

EfficientNetV2B0 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 EfficientNetV2B0 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:

EfficientNetV2B0

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

Bases: BaseKeras

EfficientNetV2S 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 EfficientNetV2S 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:

EfficientNetV2S

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

Bases: BaseKeras

EfficientNetB0 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 EfficientNetB0 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:

EfficientNetB0

model#

alias of EfficientNetB0