Skip to content
heliaEDGE
Reference
HELIA

unext

U-NeXt is a modification of U-Net that utilizes techniques from ResNeXt and EfficientNetV2. During the encoding phase, mbconv blocks are used to efficiently process the input.

Parameters are in helia_edge.models.unext_params.

Functions

Name Description
build U-NeXt model from UNextParams
unext_block Create U-NeXt block
se_block Squeeze and excite block
norm_layer Normalization layer
unext_core Create U-NeXt core
unext_layer Create U-NeXt layer

The U-NeXt architecture has been modified to allow the following:

  • MBConv blocks used in the encoding phase.
  • Squeeze and excitation (SE) blocks added within blocks.

Machine-readable model

function

Normalization layer

helia_edge/models/unext.py:61

norm_layer(norm: str, name: str) -> keras.Layer

Normalization layer

Parameters of norm_layer
NameTypeDefaultDescription
normstrRequiredNormalization type
namestrRequiredName
Returns of norm_layer
TypeDescription
keras.Layerkeras.Layer: Layer
function

Create UNext block

helia_edge/models/unext.py:91

unext_block(
output_filters: int,
expand_ratio: float = 1,
kernel_size: int | tuple[int, int] = 3,
strides: int | tuple[int, int] = 1,
se_ratio: float = 4,
dropout: float | None = 0,
norm: Literal['batch', 'layer'] | None = 'batch',
name: str | None = None,
) -> keras.Layer

Create UNext block

function

Create UNext TF functional core

helia_edge/models/unext.py:181

unext_core(x: keras.KerasTensor, params: UNextParams) -> keras.KerasTensor

Create UNext TF functional core

Parameters of unext_core
NameTypeDefaultDescription
xkeras.KerasTensorRequiredInput tensor
paramsUNextParamsRequiredModel parameters.
Returns of unext_core
TypeDescription
keras.KerasTensorkeras.KerasTensor: Output tensor
function

Create UNext TF functional model

helia_edge/models/unext.py:328

unext_layer(inputs: keras.KerasTensor, params: UNextParams) -> keras.KerasTensor

Create UNext TF functional model

Parameters of unext_layer
NameTypeDefaultDescription
inputskeras.KerasTensorRequiredInput tensor
paramsUNextParamsRequiredModel parameters.
Returns of unext_layer
TypeDescription
keras.KerasTensorkeras.KerasTensor: Output tensor
function

build

Python

Build a UNext model.

helia_edge/models/unext.py:371

build(
params: UNextParams,
input_shape: tuple[int | None, ...],
*,
batch_size: int | None = None,
name: str | None = None,
) -> keras.Model

Build a UNext model.

Parameters of build
NameTypeDefaultDescription
paramsUNextParamsRequiredModel parameters.
input_shapetuple[int | None, ...]RequiredInput shape without the batch axis; None for a variable axis.
batch_sizeint | NoneNoneStatic batch size; None for a dynamic batch.
namestr | NoneNoneModel name; the family when None.
Returns of build
TypeDescription
keras.Modelkeras.Model: The model, named ``unext`` unless ``name`` is given.