Type bioimageio__spec__application__v0_2__ApplicationDescr | bioimageio__spec__application__v0_3__ApplicationDescr | bioimageio__spec__dataset__v0_2__DatasetDescr | bioimageio__spec__dataset__v0_3__DatasetDescr | bioimageio__spec__model__v0_4__ModelDescr | bioimageio__spec__model__v0_5__ModelDescr | bioimageio__spec__notebook__v0_2__NotebookDescr | bioimageio__spec__notebook__v0_3__NotebookDescr
File match bioimageio.yaml *.bioimageio.yaml
Schema URL https://catalog.lintel.tools/schemas/schemastore/bioimageio-resource-description/latest.json
Source https://bioimage-io.github.io/spec-bioimage-io/bioimageio_schema_latest.json

Validate with Lintel

npx @lintel/lintel check
Type: bioimageio__spec__application__v0_2__ApplicationDescr | bioimageio__spec__application__v0_3__ApplicationDescr | bioimageio__spec__dataset__v0_2__DatasetDescr | bioimageio__spec__dataset__v0_3__DatasetDescr | bioimageio__spec__model__v0_4__ModelDescr | bioimageio__spec__model__v0_5__ModelDescr | bioimageio__spec__notebook__v0_2__NotebookDescr | bioimageio__spec__notebook__v0_3__NotebookDescr

One of

1. application bioimageio__spec__application__v0_2__ApplicationDescr | bioimageio__spec__application__v0_3__ApplicationDescr
2. dataset bioimageio__spec__dataset__v0_2__DatasetDescr | bioimageio__spec__dataset__v0_3__DatasetDescr
3. model bioimageio__spec__model__v0_4__ModelDescr | bioimageio__spec__model__v0_5__ModelDescr
4. notebook bioimageio__spec__notebook__v0_2__NotebookDescr | bioimageio__spec__notebook__v0_3__NotebookDescr

Definitions

ArchitectureFromFileDescr object
source string | RelativeFilePath | string required

Architecture source file

callable string required

Identifier of the callable that returns a torch.nn.Module instance.

Examples: "MyNetworkClass", "get_my_model"
minLength=1
sha256 string | null

SHA256 hash value of the source file.

Default: null

key word arguments for the callable

ArchitectureFromLibraryDescr object
callable string required

Identifier of the callable that returns a torch.nn.Module instance.

Examples: "MyNetworkClass", "get_my_model"
minLength=1
import_from string required

Where to import the callable from, i.e. from <import_from> import <callable>

key word arguments for the callable

AttachmentsDescr object
files string | RelativeFilePath | string[]

File attachments

BadgeDescr object

A custom badge

label string required

badge label to display on hover

Examples: "Open in Colab"
url string required

target URL

Examples: "https://colab.research.google.com/github/HenriquesLab/ZeroCostDL4Mic/blob/master/Colab_notebooks/U-net_2D_ZeroCostDL4Mic.ipynb"
format=uriminLength=1maxLength=2083
icon string | RelativeFilePath | string | string | null

badge icon (included in bioimage.io package if not a URL)

Default: null
Examples: "https://colab.research.google.com/assets/colab-badge.svg"
BatchAxis object
type string required
Constant: "batch"
id string
Default: "batch"
minLength=1maxLength=16
description string

A short description of this axis beyond its type and id.

Default: ""
maxLength=128
size integer | null

The batch size may be fixed to 1, otherwise (the default) it may be chosen arbitrarily depending on available memory

Default: null
BiasRisksLimitations object

Known biases, risks, technical limitations, and recommendations for model use.

known_biases string

Biases in training data or model behavior.

Default: "In general bioimage models may suffer from biases caused by: - Imaging protocol dependencies - Use of a specific cell type - Species-specific training data limitations "
risks string

Potential risks in the context of bioimage analysis.

Default: "Common risks in bioimage analysis include: - Erroneously assuming generalization to unseen experimental conditions - Trusting (overconfident) model outputs without validation - Misinterpretation of results "
limitations string | null

Technical limitations and failure modes.

Default: null
recommendations string

Mitigation strategies regarding known_biases, risks, and limitations, as well as applicable best practices.

Consider:

  • How to use a validation dataset?
  • How to manually validate?
  • Feasibility of domain adaptation for different experimental setups?
Default: "Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model."
BinarizeAlongAxisKwargs object

key word arguments for BinarizeDescr

threshold number[] required

The fixed threshold values along axis

minItems=1
axis string required

The threshold axis

Examples: "channel"
minLength=1maxLength=16
ChannelAxis object
type string required
Constant: "channel"
channel_names string[] required
minItems=1
id string
Default: "channel"
minLength=1maxLength=16
description string

A short description of this axis beyond its type and id.

Default: ""
maxLength=128
DataDependentSize object
min integer
Default: 1
exclusiveMin=0
max integer | null
Default: null
Datetime string

Timestamp in ISO 8601> format with a few restrictions listed here.

EnsureDtypeDescr object

Cast the tensor data type to EnsureDtypeKwargs.dtype (if not matching).

This can for example be used to ensure the inner neural network model gets a different input tensor data type than the fully described bioimage.io model does.

Examples: The described bioimage.io model (incl. preprocessing) accepts any float32-compatible tensor, normalizes it with percentiles and clipping and then casts it to uint8, which is what the neural network in this example expects. - in YAML yaml inputs: - data: type: float32 # described bioimage.io model is compatible with any float32 input tensor preprocessing: - id: scale_range kwargs: axes: ['y', 'x'] max_percentile: 99.8 min_percentile: 5.0 - id: clip kwargs: min: 0.0 max: 1.0 - id: ensure_dtype # the neural network of the model requires uint8 kwargs: dtype: uint8 - in Python: >>> preprocessing = [ ... ScaleRangeDescr( ... kwargs=ScaleRangeKwargs( ... axes= (AxisId('y'), AxisId('x')), ... max_percentile= 99.8, ... min_percentile= 5.0, ... ) ... ), ... ClipDescr(kwargs=ClipKwargs(min=0.0, max=1.0)), ... EnsureDtypeDescr(kwargs=EnsureDtypeKwargs(dtype="uint8")), ... ]

id string required
Constant: "ensure_dtype"
kwargs object required

key word arguments for EnsureDtypeDescr

1 nested properties
dtype string required
Values: "float32" "float64" "uint8" "int8" "uint16" "int16" "uint32" "int32" "uint64" "int64" "bool"
EnsureDtypeKwargs object

key word arguments for EnsureDtypeDescr

dtype string required
Values: "float32" "float64" "uint8" "int8" "uint16" "int16" "uint32" "int32" "uint64" "int64" "bool"
EnvironmentalImpact object

Environmental considerations for model training and deployment.

Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).

hardware_type string | null

GPU/CPU specifications

Default: null
hours_used number | null

Total compute hours

Default: null
cloud_provider string | null

If applicable

Default: null
compute_region string | null

Geographic location

Default: null
co2_emitted number | null

kg CO2 equivalent

Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).

Default: null
Evaluation object
dataset_id string required

Dataset used for evaluation.

minLength=1
dataset_source string required

Source of the dataset.

format=uriminLength=1maxLength=2083
dataset_role string required

Role of the dataset used for evaluation.

  • train: dataset was (part of) the training data
  • validation: dataset was (part of) the validation data used during training, e.g. used for model selection or hyperparameter tuning
  • test: dataset was (part of) the designated test data; not used during training or validation, but acquired from the same source/distribution as training data
  • independent: dataset is entirely independent test data; not used during training or validation, and acquired from a different source/distribution than training data
  • unknown: role of the dataset is unknown; choose this if you are not certain if (a subset) of the data was seen by the model during training.
Values: "train" "validation" "test" "independent" "unknown"
sample_count integer required

Number of evaluated samples.

evaluation_factors string[] required

(Abbreviations of) each evaluation factor.

Evaluation factors are criteria along which model performance is evaluated, e.g. different image conditions like 'low SNR', 'high cell density', or different biological conditions like 'cell type A', 'cell type B'. An 'overall' factor may be included to summarize performance across all conditions.

evaluation_factors_long string[] required

Descriptions (long form) of each evaluation factor.

metrics string[] required

(Abbreviations of) metrics used for evaluation.

metrics_long string[] required

Description of each metric used.

results string | number | integer[][] required

Results for each metric (rows; outer list) and each evaluation factor (columns; inner list).

model_id string | null

Model being evaluated.

Default: null
results_summary string | null

Interpretation of results for general audience.

Consider: - Overall model performance - Comparison to existing methods - Limitations and areas for improvement

Default: null
FileDescr object

A file description

source string | RelativeFilePath | string required

File source

sha256 string | null

SHA256 hash value of the source file.

Default: null
FixedZeroMeanUnitVarianceAlongAxisKwargs object

key word arguments for FixedZeroMeanUnitVarianceDescr

mean number[] required

The mean value(s) to normalize with.

minItems=1
std number[] required

The standard deviation value(s) to normalize with. Size must match mean values.

minItems=1
axis string required

The axis of the mean/std values to normalize each entry along that dimension separately.

Examples: "channel", "index"
minLength=1maxLength=16
FixedZeroMeanUnitVarianceDescr object

Subtract a given mean and divide by the standard deviation.

Normalize with fixed, precomputed values for FixedZeroMeanUnitVarianceKwargs.mean and FixedZeroMeanUnitVarianceKwargs.std Use FixedZeroMeanUnitVarianceAlongAxisKwargs for independent scaling along given axes.

Examples:

  1. scalar value for whole tensor

    • in YAML
    preprocessing:
      - id: fixed_zero_mean_unit_variance
        kwargs:
          mean: 103.5
          std: 13.7
    
    • in Python

    preprocessing = [FixedZeroMeanUnitVarianceDescr( ... kwargs=FixedZeroMeanUnitVarianceKwargs(mean=103.5, std=13.7) ... )]

  2. independently along an axis

    • in YAML
    preprocessing:
      - id: fixed_zero_mean_unit_variance
        kwargs:
          axis: channel
          mean: [101.5, 102.5, 103.5]
          std: [11.7, 12.7, 13.7]
    
    • in Python

    preprocessing = [FixedZeroMeanUnitVarianceDescr( ... kwargs=FixedZeroMeanUnitVarianceAlongAxisKwargs( ... axis=AxisId("channel"), ... mean=[101.5, 102.5, 103.5], ... std=[11.7, 12.7, 13.7], ... ) ... )]

id string required
Constant: "fixed_zero_mean_unit_variance"
FixedZeroMeanUnitVarianceKwargs object

key word arguments for FixedZeroMeanUnitVarianceDescr

mean number required

The mean value to normalize with.

std number required

The standard deviation value to normalize with.

min=1e-6
ImplicitOutputShape object

Output tensor shape depending on an input tensor shape. shape(output_tensor) = shape(input_tensor) * scale + 2 * offset

reference_tensor string required

Name of the reference tensor.

minLength=1
scale number | null[] required

output_pix/input_pix for each dimension. 'null' values indicate new dimensions, whose length is defined by 2*offset

minItems=1
offset integer | number[] required

Position of origin wrt to input.

minItems=1
IndexInputAxis object
size integer | ParameterizedSize | SizeReference required

The size/length of this axis can be specified as

  • fixed integer
  • parameterized series of valid sizes (ParameterizedSize)
  • reference to another axis with an optional offset (SizeReference)
Examples: 10, {"min":32,"step":16}, {"axis_id":"a","offset":5,"tensor_id":"t"}
type string required
Constant: "index"
id string
Default: "index"
minLength=1maxLength=16
description string

A short description of this axis beyond its type and id.

Default: ""
maxLength=128
concatenable boolean

If a model has a concatenable input axis, it can be processed blockwise, splitting a longer sample axis into blocks matching its input tensor description. Output axes are concatenable if they have a SizeReference to a concatenable input axis.

Default: false
IndexOutputAxis object
type string required
Constant: "index"
size integer | SizeReference | DataDependentSize required

The size/length of this axis can be specified as

  • fixed integer
  • reference to another axis with an optional offset (SizeReference)
  • data dependent size using DataDependentSize (size is only known after model inference)
Examples: 10, {"axis_id":"a","offset":5,"tensor_id":"t"}
id string
Default: "index"
minLength=1maxLength=16
description string

A short description of this axis beyond its type and id.

Default: ""
maxLength=128
IntervalOrRatioDataDescr object
type string
Default: "float32"
Values: "float32" "float64" "uint8" "int8" "uint16" "int16" "uint32" "int32" "uint64" "int64"
Examples: "float32", "float64", "uint8", "uint16"
range array

Tuple (minimum, maximum) specifying the allowed range of the data in this tensor. None corresponds to min/max of what can be expressed by type.

Default:
[
  null,
  null
]
minItems=2maxItems=2
unit string | string
Default: "arbitrary unit"
scale number

Scale for data on an interval (or ratio) scale.

Default: 1.0
offset number | null

Offset for data on a ratio scale.

Default: null
KerasV3WeightsDescr object
source string | RelativeFilePath | string required

Source of the .keras weights file.

keras_version string | integer | number required

wraps a packaging.version.Version instance for validation in pydantic models

backend array required

Keras backend used to create these weights.

minItems=2maxItems=2
sha256 string | null

SHA256 hash value of the source file.

Default: null

Authors Either the person(s) that have trained this model resulting in the original weights file. (If this is the initial weights entry, i.e. it does not have a parent) Or the person(s) who have converted the weights to this weights format. (If this is a child weight, i.e. it has a parent field)

Default: null
parent string | null

The source weights these weights were converted from. For example, if a model's weights were converted from the pytorch_state_dict format to torchscript, The pytorch_state_dict weights entry has no parent and is the parent of the torchscript weights. All weight entries except one (the initial set of weights resulting from training the model), need to have this field.

Default: null
Examples: "pytorch_state_dict"
comment string

A comment about this weights entry, for example how these weights were created.

Default: ""
NominalOrOrdinalDataDescr object
values integer[] | number[] | boolean[] | string[] required

A fixed set of nominal or an ascending sequence of ordinal values. In this case data.type is required to be an unsigend integer type, e.g. 'uint8'. String values are interpreted as labels for tensor values 0, ..., N. Note: as YAML 1.2 does not natively support a "set" datatype, nominal values should be given as a sequence (aka list/array) as well.

type string
Default: "uint8"
Values: "float32" "float64" "uint8" "int8" "uint16" "int16" "uint32" "int32" "uint64" "int64" "bool"
Examples: "float32", "uint8", "uint16", "int64", "bool"
unit string | string | null
Default: null
ParameterizedInputShape object

A sequence of valid shapes given by shape_k = min + k * step for k in {0, 1, ...}.

min integer[] required

The minimum input shape

minItems=1
step integer[] required

The minimum shape change

minItems=1
ParameterizedSize object

Describes a range of valid tensor axis sizes as size = min + n*step.

  • min and step are given by the model description.
  • All blocksize paramters n = 0,1,2,... yield a valid size.
  • A greater blocksize paramter n = 0,1,2,... results in a greater size. This allows to adjust the axis size more generically.
min integer required
exclusiveMin=0
step integer required
exclusiveMin=0
RelativeFilePath string

A path relative to the rdf.yaml file (also if the RDF source is a URL).

ReproducibilityTolerance object

Describes what small numerical differences -- if any -- may be tolerated in the generated output when executing in different environments.

A tensor element output is considered mismatched to the test_tensor if abs(output - test_tensor) > absolute_tolerance + relative_tolerance * abs(test_tensor). (Internally we call numpy.testing.assert_allclose.)

Motivation: For testing we can request the respective deep learning frameworks to be as reproducible as possible by setting seeds and chosing deterministic algorithms, but differences in operating systems, available hardware and installed drivers may still lead to numerical differences.

relative_tolerance number

Maximum relative tolerance of reproduced test tensor.

Default: 0.001
min=0max=0.01
absolute_tolerance number

Maximum absolute tolerance of reproduced test tensor.

Default: 0.001
min=0
mismatched_elements_per_million integer

Maximum number of mismatched elements/pixels per million to tolerate.

Default: 100
min=0max=1000
output_ids string[]

Limits the output tensor IDs these reproducibility details apply to.

Default:
[]
weights_formats string[]

Limits the weights formats these details apply to.

Default:
[]
RunMode object
name string | string required

Run mode name

kwargs object

Run mode specific key word arguments

ScaleLinearAlongAxisKwargs object

Key word arguments for ScaleLinearDescr

axis string required

The axis of gain and offset values.

Examples: "channel"
minLength=1maxLength=16
gain number | number[]

multiplicative factor

Default: 1.0
offset number | number[]

additive term

Default: 0.0
SizeReference object

A tensor axis size (extent in pixels/frames) defined in relation to a reference axis.

axis.size = reference.size * reference.scale / axis.scale + offset

Note:

  1. The axis and the referenced axis need to have the same unit (or no unit).
  2. Batch axes may not be referenced.
  3. Fractions are rounded down.
  4. If the reference axis is concatenable the referencing axis is assumed to be concatenable as well with the same block order.

Example: An unisotropic input image of wh=10049 pixels depicts a phsical space of 200196mm². Let's assume that we want to express the image height h in relation to its width w instead of only accepting input images of exactly 10049 pixels (for example to express a range of valid image shapes by parametrizing w, see ParameterizedSize).

w = SpaceInputAxis(id=AxisId("w"), size=100, unit="millimeter", scale=2) h = SpaceInputAxis( ... id=AxisId("h"), ... size=SizeReference(tensor_id=TensorId("input"), axis_id=AxisId("w"), offset=-1), ... unit="millimeter", ... scale=4, ... ) print(h.size.get_size(h, w)) 49

⇒ h = w * w.scale / h.scale + offset = 100 * 2mm / 4mm - 1 = 49

tensor_id string required

tensor id of the reference axis

minLength=1maxLength=32
axis_id string required

axis id of the reference axis

minLength=1maxLength=16
offset integer
Default: 0
SoftmaxDescr object

The softmax function.

Examples:

  • in YAML

    postprocessing:
      - id: softmax
        kwargs:
          axis: channel
    
  • in Python:

    postprocessing = [SoftmaxDescr(kwargs=SoftmaxKwargs(axis=AxisId("channel")))]

id string required
Constant: "softmax"
kwargs object

key word arguments for SoftmaxDescr

1 nested properties
axis string

The axis to apply the softmax function along. Note: Defaults to 'channel' axis (which may not exist, in which case a different axis id has to be specified).

Default: "channel"
Examples: "channel"
minLength=1maxLength=16
SoftmaxKwargs object

key word arguments for SoftmaxDescr

axis string

The axis to apply the softmax function along. Note: Defaults to 'channel' axis (which may not exist, in which case a different axis id has to be specified).

Default: "channel"
Examples: "channel"
minLength=1maxLength=16
SpaceInputAxis object
size integer | ParameterizedSize | SizeReference required

The size/length of this axis can be specified as

  • fixed integer
  • parameterized series of valid sizes (ParameterizedSize)
  • reference to another axis with an optional offset (SizeReference)
Examples: 10, {"min":32,"step":16}, {"axis_id":"a","offset":5,"tensor_id":"t"}
type string required
Constant: "space"
id string
Default: "x"
Examples: "x", "y", "z"
minLength=1maxLength=16
description string

A short description of this axis beyond its type and id.

Default: ""
maxLength=128
unit string | null
Default: null
scale number
Default: 1.0
exclusiveMin=0
concatenable boolean

If a model has a concatenable input axis, it can be processed blockwise, splitting a longer sample axis into blocks matching its input tensor description. Output axes are concatenable if they have a SizeReference to a concatenable input axis.

Default: false
SpaceOutputAxis object
size integer | SizeReference required

The size/length of this axis can be specified as

  • fixed integer
  • reference to another axis with an optional offset (see SizeReference)
Examples: 10, {"axis_id":"a","offset":5,"tensor_id":"t"}
type string required
Constant: "space"
id string
Default: "x"
Examples: "x", "y", "z"
minLength=1maxLength=16
description string

A short description of this axis beyond its type and id.

Default: ""
maxLength=128
unit string | null
Default: null
scale number
Default: 1.0
exclusiveMin=0
SpaceOutputAxisWithHalo object
halo integer required

The halo should be cropped from the output tensor to avoid boundary effects. It is to be cropped from both sides, i.e. size_after_crop = size - 2 * halo. To document a halo that is already cropped by the model use size.offset instead.

min=1
size object required

A tensor axis size (extent in pixels/frames) defined in relation to a reference axis.

axis.size = reference.size * reference.scale / axis.scale + offset

Note:

  1. The axis and the referenced axis need to have the same unit (or no unit).
  2. Batch axes may not be referenced.
  3. Fractions are rounded down.
  4. If the reference axis is concatenable the referencing axis is assumed to be concatenable as well with the same block order.

Example: An unisotropic input image of wh=10049 pixels depicts a phsical space of 200196mm². Let's assume that we want to express the image height h in relation to its width w instead of only accepting input images of exactly 10049 pixels (for example to express a range of valid image shapes by parametrizing w, see ParameterizedSize).

w = SpaceInputAxis(id=AxisId("w"), size=100, unit="millimeter", scale=2) h = SpaceInputAxis( ... id=AxisId("h"), ... size=SizeReference(tensor_id=TensorId("input"), axis_id=AxisId("w"), offset=-1), ... unit="millimeter", ... scale=4, ... ) print(h.size.get_size(h, w)) 49

⇒ h = w * w.scale / h.scale + offset = 100 * 2mm / 4mm - 1 = 49

3 nested properties
tensor_id string required

tensor id of the reference axis

minLength=1maxLength=32
axis_id string required

axis id of the reference axis

minLength=1maxLength=16
offset integer
Default: 0
type string required
Constant: "space"
id string
Default: "x"
Examples: "x", "y", "z"
minLength=1maxLength=16
description string

A short description of this axis beyond its type and id.

Default: ""
maxLength=128
unit string | null
Default: null
scale number
Default: 1.0
exclusiveMin=0
StardistPostprocessingDescr object

Stardist postprocessing including non-maximum suppression and converting polygon representations to instance labels

as described in:

Note: Only available if the stardist package is installed.

id string required
Constant: "stardist_postprocessing"
StardistPostprocessingKwargs2D object
prob_threshold number required

The probability threshold for object candidate selection.

nms_threshold number required

The IoU threshold for non-maximum suppression.

grid array required

Grid size of network predictions.

minItems=2maxItems=2
b integer | array required

Border region in which object probability is set to zero.

StardistPostprocessingKwargs3D object
prob_threshold number required

The probability threshold for object candidate selection.

nms_threshold number required

The IoU threshold for non-maximum suppression.

grid array required

Grid size of network predictions.

minItems=3maxItems=3
b integer | array required

Border region in which object probability is set to zero.

n_rays integer required

Number of rays for 3D star-convex polyhedra.

anisotropy array required

Anisotropy factors for 3D star-convex polyhedra, i.e. the physical pixel size along each spatial axis.

minItems=3maxItems=3
overlap_label integer | null

Optional label to apply to any area of overlapping predicted objects.

Default: null
TimeInputAxis object
size integer | ParameterizedSize | SizeReference required

The size/length of this axis can be specified as

  • fixed integer
  • parameterized series of valid sizes (ParameterizedSize)
  • reference to another axis with an optional offset (SizeReference)
Examples: 10, {"min":32,"step":16}, {"axis_id":"a","offset":5,"tensor_id":"t"}
type string required
Constant: "time"
id string
Default: "time"
minLength=1maxLength=16
description string

A short description of this axis beyond its type and id.

Default: ""
maxLength=128
unit string | null
Default: null
scale number
Default: 1.0
exclusiveMin=0
concatenable boolean

If a model has a concatenable input axis, it can be processed blockwise, splitting a longer sample axis into blocks matching its input tensor description. Output axes are concatenable if they have a SizeReference to a concatenable input axis.

Default: false
TimeOutputAxis object
size integer | SizeReference required

The size/length of this axis can be specified as

  • fixed integer
  • reference to another axis with an optional offset (see SizeReference)
Examples: 10, {"axis_id":"a","offset":5,"tensor_id":"t"}
type string required
Constant: "time"
id string
Default: "time"
minLength=1maxLength=16
description string

A short description of this axis beyond its type and id.

Default: ""
maxLength=128
unit string | null
Default: null
scale number
Default: 1.0
exclusiveMin=0
TimeOutputAxisWithHalo object
halo integer required

The halo should be cropped from the output tensor to avoid boundary effects. It is to be cropped from both sides, i.e. size_after_crop = size - 2 * halo. To document a halo that is already cropped by the model use size.offset instead.

min=1
size object required

A tensor axis size (extent in pixels/frames) defined in relation to a reference axis.

axis.size = reference.size * reference.scale / axis.scale + offset

Note:

  1. The axis and the referenced axis need to have the same unit (or no unit).
  2. Batch axes may not be referenced.
  3. Fractions are rounded down.
  4. If the reference axis is concatenable the referencing axis is assumed to be concatenable as well with the same block order.

Example: An unisotropic input image of wh=10049 pixels depicts a phsical space of 200196mm². Let's assume that we want to express the image height h in relation to its width w instead of only accepting input images of exactly 10049 pixels (for example to express a range of valid image shapes by parametrizing w, see ParameterizedSize).

w = SpaceInputAxis(id=AxisId("w"), size=100, unit="millimeter", scale=2) h = SpaceInputAxis( ... id=AxisId("h"), ... size=SizeReference(tensor_id=TensorId("input"), axis_id=AxisId("w"), offset=-1), ... unit="millimeter", ... scale=4, ... ) print(h.size.get_size(h, w)) 49

⇒ h = w * w.scale / h.scale + offset = 100 * 2mm / 4mm - 1 = 49

3 nested properties
tensor_id string required

tensor id of the reference axis

minLength=1maxLength=32
axis_id string required

axis id of the reference axis

minLength=1maxLength=16
offset integer
Default: 0
type string required
Constant: "time"
id string
Default: "time"
minLength=1maxLength=16
description string

A short description of this axis beyond its type and id.

Default: ""
maxLength=128
unit string | null
Default: null
scale number
Default: 1.0
exclusiveMin=0
TrainingDetails object
training_preprocessing string | null

Detailed image preprocessing steps during model training:

Mention:

  • Normalization methods
  • Augmentation strategies
  • Resizing/resampling procedures
  • Artifact handling
Default: null
training_epochs number | null

Number of training epochs.

Default: null
training_batch_size number | null

Batch size used in training.

Default: null
initial_learning_rate number | null

Initial learning rate used in training.

Default: null
learning_rate_schedule string | null

Learning rate schedule used in training.

Default: null
loss_function string | null

Loss function used in training, e.g. nn.MSELoss.

Default: null

key word arguments for the loss_function

optimizer string | null

optimizer, e.g. torch.optim.Adam

Default: null

key word arguments for the optimizer

regularization string | null

Regularization techniques used during training, e.g. drop-out or weight decay.

Default: null
training_duration number | null

Total training duration in hours.

Default: null
Uploader object
email string required

Email

format=email
name string | null

name

Default: null
Version string | integer | number

wraps a packaging.version.Version instance for validation in pydantic models

YamlValue boolean | string | string | integer | number | string | YamlValue[] | object | null
bioimageio__spec__application__v0_2__ApplicationDescr object

Bioimage.io description of an application.

name string required

A human-friendly name of the resource description

minLength=1
description string required
format_version string required

The format version of this resource specification (not the version of the resource description) When creating a new resource always use the latest micro/patch version described here. The format_version is important for any consumer software to understand how to parse the fields.

Constant: "0.2.4"
type string required
Constant: "application"
covers string | RelativeFilePath | string[]

Cover images. Please use an image smaller than 500KB and an aspect ratio width to height of 2:1. The supported image formats are: ('.gif', '.jpeg', '.jpg', '.png', '.svg', '.tif', '.tiff')

Examples: ["cover.png"]
id_emoji string | null

UTF-8 emoji for display alongside the id.

Default: null

The authors are the creators of the RDF and the primary points of contact.

attachments AttachmentsDescr | null

file and other attachments

Default: null

A field for custom configuration that can contain any keys not present in the RDF spec. This means you should not store, for example, a github repo URL in config since we already have the git_repo field defined in the spec. Keys in config may be very specific to a tool or consumer software. To avoid conflicting definitions, it is recommended to wrap added configuration into a sub-field named with the specific domain or tool name, for example:

config:
    bioimageio:  # here is the domain name
        my_custom_key: 3837283
        another_key:
            nested: value
    imagej:       # config specific to ImageJ
        macro_dir: path/to/macro/file

If possible, please use snake_case for keys in config. You may want to list linked files additionally under attachments to include them when packaging a resource (packaging a resource means downloading/copying important linked files and creating a ZIP archive that contains an altered rdf.yaml file with local references to the downloaded files)

Examples: {"bioimageio":{"another_key":{"nested":"value"},"my_custom_key":3837283},"imagej":{"macro_dir":"path/to/macro/file"}}
download_url string | null

URL to download the resource from (deprecated)

Default: null
git_repo string | null

A URL to the Git repository where the resource is being developed.

Default: null
Examples: "https://github.com/bioimage-io/spec-bioimage-io/tree/main/example_descriptions/models/unet2d_nuclei_broad"
icon string | string | RelativeFilePath | string | null

An icon for illustration

Default: null
links string[]

IDs of other bioimage.io resources

Examples: ["ilastik/ilastik","deepimagej/deepimagej","zero/notebook_u-net_3d_zerocostdl4mic"]
uploader Uploader | null

The person who uploaded the model (e.g. to bioimage.io)

Default: null

Maintainers of this resource. If not specified authors are maintainers and at least some of them should specify their github_user name

rdf_source string | RelativeFilePath | string | null

Resource description file (RDF) source; used to keep track of where an rdf.yaml was loaded from. Do not set this field in a YAML file.

Default: null
tags string[]

Associated tags

Examples: ["unet2d","pytorch","nucleus","segmentation","dsb2018"]
version Version | null

The version of the resource following SemVer 2.0.

Default: null
version_number integer | null

version number (n-th published version, not the semantic version)

Default: null
badges BadgeDescr[]

badges associated with this resource

documentation string | RelativeFilePath | string | null

URL or relative path to a markdown file with additional documentation. The recommended documentation file name is README.md. An .md suffix is mandatory.

Default: null
Examples: "https://raw.githubusercontent.com/bioimage-io/spec-bioimage-io/main/example_descriptions/models/unet2d_nuclei_broad/README.md", "README.md"
license string | string | string | null

A SPDX license identifier. We do not support custom license beyond the SPDX license list, if you need that please open a GitHub issue to discuss your intentions with the community.

Default: null
Examples: "CC0-1.0", "MIT", "BSD-2-Clause"
id string | null

bioimage.io-wide unique resource identifier assigned by bioimage.io; version unspecific.

Default: null
source string | RelativeFilePath | string | null

URL or path to the source of the application

Default: null
bioimageio__spec__application__v0_3__ApplicationDescr object

Bioimage.io description of an application.

name string required

A human-friendly name of the resource description. May only contains letters, digits, underscore, minus, parentheses and spaces.

minLength=5maxLength=128
format_version string required

The format version of this resource specification

Constant: "0.3.0"
type string required
Constant: "application"
description string

A string containing a brief description.

Default: ""
maxLength=1024
covers string | RelativeFilePath | string[]

Cover images. Please use an image smaller than 500KB and an aspect ratio width to height of 2:1 or 1:1. The supported image formats are: ('.gif', '.jpeg', '.jpg', '.png', '.svg')

Examples: ["cover.png"]
id_emoji string | null

UTF-8 emoji for display alongside the id.

Default: null

The authors are the creators of this resource description and the primary points of contact.

attachments FileDescr[]

file attachments

license string | string | null

A SPDX license identifier. We do not support custom license beyond the SPDX license list, if you need that please open a GitHub issue to discuss your intentions with the community.

Default: null
Examples: "CC0-1.0", "MIT", "BSD-2-Clause"
git_repo string | null

A URL to the Git repository where the resource is being developed.

Default: null
Examples: "https://github.com/bioimage-io/spec-bioimage-io/tree/main/example_descriptions/models/unet2d_nuclei_broad"
icon string | string | RelativeFilePath | string | null

An icon for illustration, e.g. on bioimage.io

Default: null
links string[]

IDs of other bioimage.io resources

Examples: ["ilastik/ilastik","deepimagej/deepimagej","zero/notebook_u-net_3d_zerocostdl4mic"]
uploader Uploader | null

The person who uploaded the model (e.g. to bioimage.io)

Default: null

Maintainers of this resource. If not specified, authors are maintainers and at least some of them has to specify their github_user name

tags string[]

Associated tags

Examples: ["unet2d","pytorch","nucleus","segmentation","dsb2018"]
version Version | null

The version of the resource following SemVer 2.0.

Default: null
version_comment string | null

A comment on the version of the resource.

Default: null
documentation string | RelativeFilePath | string | null

URL or relative path to a markdown file encoded in UTF-8 with additional documentation. The recommended documentation file name is README.md. An .md suffix is mandatory.

Default: null
badges BadgeDescr[]

badges associated with this resource

config object

A place to store additional metadata (often tool specific).

Such additional metadata is typically set programmatically by the respective tool or by people with specific insights into the tool. If you want to store additional metadata that does not match any of the other fields, think of a key unlikely to collide with anyone elses use-case/tool and save it here.

Please consider creating an issue in the bioimageio.spec repository if you are not sure if an existing field could cover your use case or if you think such a field should exist.

1 nested properties
bioimageio object

bioimage.io internal metadata.

id string | null

bioimage.io-wide unique resource identifier assigned by bioimage.io; version unspecific.

Default: null
parent string | null

The description from which this one is derived

Default: null
source string | RelativeFilePath | string | null

URL or path to the source of the application

Default: null
bioimageio__spec__dataset__v0_2__DatasetDescr object

A bioimage.io dataset resource description file (dataset RDF) describes a dataset relevant to bioimage processing.

name string required

A human-friendly name of the resource description

minLength=1
description string required
format_version string required

The format version of this resource specification (not the version of the resource description) When creating a new resource always use the latest micro/patch version described here. The format_version is important for any consumer software to understand how to parse the fields.

Constant: "0.2.4"
type string required
Constant: "dataset"
covers string | RelativeFilePath | string[]

Cover images. Please use an image smaller than 500KB and an aspect ratio width to height of 2:1. The supported image formats are: ('.gif', '.jpeg', '.jpg', '.png', '.svg', '.tif', '.tiff')

Examples: ["cover.png"]
id_emoji string | null

UTF-8 emoji for display alongside the id.

Default: null

The authors are the creators of the RDF and the primary points of contact.

attachments AttachmentsDescr | null

file and other attachments

Default: null

A field for custom configuration that can contain any keys not present in the RDF spec. This means you should not store, for example, a github repo URL in config since we already have the git_repo field defined in the spec. Keys in config may be very specific to a tool or consumer software. To avoid conflicting definitions, it is recommended to wrap added configuration into a sub-field named with the specific domain or tool name, for example:

config:
    bioimageio:  # here is the domain name
        my_custom_key: 3837283
        another_key:
            nested: value
    imagej:       # config specific to ImageJ
        macro_dir: path/to/macro/file

If possible, please use snake_case for keys in config. You may want to list linked files additionally under attachments to include them when packaging a resource (packaging a resource means downloading/copying important linked files and creating a ZIP archive that contains an altered rdf.yaml file with local references to the downloaded files)

Examples: {"bioimageio":{"another_key":{"nested":"value"},"my_custom_key":3837283},"imagej":{"macro_dir":"path/to/macro/file"}}
download_url string | null

URL to download the resource from (deprecated)

Default: null
git_repo string | null

A URL to the Git repository where the resource is being developed.

Default: null
Examples: "https://github.com/bioimage-io/spec-bioimage-io/tree/main/example_descriptions/models/unet2d_nuclei_broad"
icon string | string | RelativeFilePath | string | null

An icon for illustration

Default: null
links string[]

IDs of other bioimage.io resources

Examples: ["ilastik/ilastik","deepimagej/deepimagej","zero/notebook_u-net_3d_zerocostdl4mic"]
uploader Uploader | null

The person who uploaded the model (e.g. to bioimage.io)

Default: null

Maintainers of this resource. If not specified authors are maintainers and at least some of them should specify their github_user name

rdf_source string | RelativeFilePath | string | null

Resource description file (RDF) source; used to keep track of where an rdf.yaml was loaded from. Do not set this field in a YAML file.

Default: null
tags string[]

Associated tags

Examples: ["unet2d","pytorch","nucleus","segmentation","dsb2018"]
version Version | null

The version of the resource following SemVer 2.0.

Default: null
version_number integer | null

version number (n-th published version, not the semantic version)

Default: null
badges BadgeDescr[]

badges associated with this resource

documentation string | RelativeFilePath | string | null

URL or relative path to a markdown file with additional documentation. The recommended documentation file name is README.md. An .md suffix is mandatory.

Default: null
Examples: "https://raw.githubusercontent.com/bioimage-io/spec-bioimage-io/main/example_descriptions/models/unet2d_nuclei_broad/README.md", "README.md"
license string | string | string | null

A SPDX license identifier. We do not support custom license beyond the SPDX license list, if you need that please open a GitHub issue to discuss your intentions with the community.

Default: null
Examples: "CC0-1.0", "MIT", "BSD-2-Clause"
id string | null

bioimage.io-wide unique resource identifier assigned by bioimage.io; version unspecific.

Default: null
source string | null

"URL to the source of the dataset.

Default: null
bioimageio__spec__dataset__v0_2__LinkedDataset object

Reference to a bioimage.io dataset.

id string required

A valid dataset id from the bioimage.io collection.

minLength=1
version_number integer | null

version number (n-th published version, not the semantic version) of linked dataset

Default: null
bioimageio__spec__dataset__v0_3__DatasetDescr object

A bioimage.io dataset resource description file (dataset RDF) describes a dataset relevant to bioimage processing.

name string required

A human-friendly name of the resource description. May only contains letters, digits, underscore, minus, parentheses and spaces.

minLength=5maxLength=128
format_version string required

The format version of this resource specification

Constant: "0.3.0"
type string required
Constant: "dataset"
description string

A string containing a brief description.

Default: ""
maxLength=1024
covers string | RelativeFilePath | string[]

Cover images. Please use an image smaller than 500KB and an aspect ratio width to height of 2:1 or 1:1. The supported image formats are: ('.gif', '.jpeg', '.jpg', '.png', '.svg')

Examples: ["cover.png"]
id_emoji string | null

UTF-8 emoji for display alongside the id.

Default: null

The authors are the creators of this resource description and the primary points of contact.

attachments FileDescr[]

file attachments

license string | string | null

A SPDX license identifier. We do not support custom license beyond the SPDX license list, if you need that please open a GitHub issue to discuss your intentions with the community.

Default: null
Examples: "CC0-1.0", "MIT", "BSD-2-Clause"
git_repo string | null

A URL to the Git repository where the resource is being developed.

Default: null
Examples: "https://github.com/bioimage-io/spec-bioimage-io/tree/main/example_descriptions/models/unet2d_nuclei_broad"
icon string | string | RelativeFilePath | string | null

An icon for illustration, e.g. on bioimage.io

Default: null
links string[]

IDs of other bioimage.io resources

Examples: ["ilastik/ilastik","deepimagej/deepimagej","zero/notebook_u-net_3d_zerocostdl4mic"]
uploader Uploader | null

The person who uploaded the model (e.g. to bioimage.io)

Default: null

Maintainers of this resource. If not specified, authors are maintainers and at least some of them has to specify their github_user name

tags string[]

Associated tags

Examples: ["unet2d","pytorch","nucleus","segmentation","dsb2018"]
version Version | null

The version of the resource following SemVer 2.0.

Default: null
version_comment string | null

A comment on the version of the resource.

Default: null
documentation string | RelativeFilePath | string | null

URL or relative path to a markdown file encoded in UTF-8 with additional documentation. The recommended documentation file name is README.md. An .md suffix is mandatory.

Default: null
badges BadgeDescr[]

badges associated with this resource

config object

A place to store additional metadata (often tool specific).

Such additional metadata is typically set programmatically by the respective tool or by people with specific insights into the tool. If you want to store additional metadata that does not match any of the other fields, think of a key unlikely to collide with anyone elses use-case/tool and save it here.

Please consider creating an issue in the bioimageio.spec repository if you are not sure if an existing field could cover your use case or if you think such a field should exist.

1 nested properties
bioimageio object

bioimage.io internal metadata.

id string | null

bioimage.io-wide unique resource identifier assigned by bioimage.io; version unspecific.

Default: null
parent string | null

The description from which this one is derived

Default: null
source string | null

"URL to the source of the dataset.

Default: null
bioimageio__spec__dataset__v0_3__LinkedDataset object

Reference to a bioimage.io dataset.

id string required

A valid dataset id from the bioimage.io collection.

minLength=1
version Version | null

The version of the linked resource following SemVer 2.0.

Default: null
bioimageio__spec__generic__v0_2__Author object
name string required
affiliation string | null

Affiliation

Default: null
email string | null

Email

Default: null
orcid string | null

An ORCID iD in hyphenated groups of 4 digits, (and valid as per ISO 7064 11,2.)

Default: null
Examples: "0000-0001-2345-6789"
github_user string | null
Default: null
bioimageio__spec__generic__v0_2__CiteEntry object
text string required

free text description

doi string | null

A digital object identifier (DOI) is the prefered citation reference. See https://www.doi.org/ for details. (alternatively specify url)

Default: null
url string | null

URL to cite (preferably specify a doi instead)

Default: null
bioimageio__spec__generic__v0_2__Maintainer object
github_user string required
affiliation string | null

Affiliation

Default: null
email string | null

Email

Default: null
orcid string | null

An ORCID iD in hyphenated groups of 4 digits, (and valid as per ISO 7064 11,2.)

Default: null
Examples: "0000-0001-2345-6789"
name string | null
Default: null
bioimageio__spec__generic__v0_3__Author object
name string required
affiliation string | null

Affiliation

Default: null
email string | null

Email

Default: null
orcid string | null

An ORCID iD in hyphenated groups of 4 digits, (and valid as per ISO 7064 11,2.)

Default: null
Examples: "0000-0001-2345-6789"
github_user string | null
Default: null
bioimageio__spec__generic__v0_3__BioimageioConfig object

bioimage.io internal metadata.

bioimageio__spec__generic__v0_3__CiteEntry object

A citation that should be referenced in work using this resource.

text string required

free text description

doi string | null

A digital object identifier (DOI) is the prefered citation reference. See https://www.doi.org/ for details. Note: Either doi or url have to be specified.

Default: null
url string | null

URL to cite (preferably specify a doi instead/also). Note: Either doi or url have to be specified.

Default: null
bioimageio__spec__generic__v0_3__Config object

A place to store additional metadata (often tool specific).

Such additional metadata is typically set programmatically by the respective tool or by people with specific insights into the tool. If you want to store additional metadata that does not match any of the other fields, think of a key unlikely to collide with anyone elses use-case/tool and save it here.

Please consider creating an issue in the bioimageio.spec repository if you are not sure if an existing field could cover your use case or if you think such a field should exist.

bioimageio object

bioimage.io internal metadata.

bioimageio__spec__generic__v0_3__Maintainer object
github_user string required
affiliation string | null

Affiliation

Default: null
email string | null

Email

Default: null
orcid string | null

An ORCID iD in hyphenated groups of 4 digits, (and valid as per ISO 7064 11,2.)

Default: null
Examples: "0000-0001-2345-6789"
name string | null
Default: null
bioimageio__spec__model__v0_4__BinarizeDescr object

BinarizeDescr the tensor with a fixed BinarizeKwargs.threshold. Values above the threshold will be set to one, values below the threshold to zero.

name string required
Constant: "binarize"
kwargs object required

key word arguments for BinarizeDescr

1 nested properties
threshold number required

The fixed threshold

bioimageio__spec__model__v0_4__BinarizeKwargs object

key word arguments for BinarizeDescr

threshold number required

The fixed threshold

bioimageio__spec__model__v0_4__ClipDescr object

Clip tensor values to a range.

Set tensor values below ClipKwargs.min to ClipKwargs.min and above ClipKwargs.max to ClipKwargs.max.

name string required
Constant: "clip"
kwargs object required

key word arguments for ClipDescr

2 nested properties
min number required

minimum value for clipping

max number required

maximum value for clipping

bioimageio__spec__model__v0_4__ClipKwargs object

key word arguments for ClipDescr

min number required

minimum value for clipping

max number required

maximum value for clipping

bioimageio__spec__model__v0_4__InputTensorDescr object
name string required

Tensor name. No duplicates are allowed.

minLength=1
axes string required

Axes identifying characters. Same length and order as the axes in shape.

axisdescription
bbatch (groups multiple samples)
iinstance/index/element
ttime
cchannel
zspatial dimension z
yspatial dimension y
xspatial dimension x
data_type string required

For now an input tensor is expected to be given as float32. The data flow in bioimage.io models is explained in this diagram..

Values: "float32" "uint8" "uint16"
shape integer[] | ParameterizedInputShape required

Specification of input tensor shape.

Examples: [1,512,512,1], {"min":[1,64,64,1],"step":[0,32,32,0]}
description string
Default: ""
data_range array | null

Tuple (minimum, maximum) specifying the allowed range of the data in this tensor. If not specified, the full data range that can be expressed in data_type is allowed.

Default: null
preprocessing bioimageio__spec__model__v0_4__BinarizeDescr | bioimageio__spec__model__v0_4__ClipDescr | bioimageio__spec__model__v0_4__ScaleLinearDescr | bioimageio__spec__model__v0_4__SigmoidDescr | bioimageio__spec__model__v0_4__ZeroMeanUnitVarianceDescr | bioimageio__spec__model__v0_4__ScaleRangeDescr[]

Description of how this input should be preprocessed.

bioimageio__spec__model__v0_4__KerasHdf5WeightsDescr object
source string | RelativeFilePath | string required

The weights file.

sha256 string | null

SHA256 hash value of the source file.

Default: null
attachments AttachmentsDescr | null

Attachments that are specific to this weights entry.

Default: null

Authors Either the person(s) that have trained this model resulting in the original weights file. (If this is the initial weights entry, i.e. it does not have a parent) Or the person(s) who have converted the weights to this weights format. (If this is a child weight, i.e. it has a parent field)

Default: null
dependencies string | null

Dependency manager and dependency file, specified as <dependency manager>:<relative file path>.

Default: null
Examples: "conda:environment.yaml", "maven:./pom.xml", "pip:./requirements.txt"
parent string | null

The source weights these weights were converted from. For example, if a model's weights were converted from the pytorch_state_dict format to torchscript, The pytorch_state_dict weights entry has no parent and is the parent of the torchscript weights. All weight entries except one (the initial set of weights resulting from training the model), need to have this field.

Default: null
Examples: "pytorch_state_dict"
tensorflow_version Version | null

TensorFlow version used to create these weights

Default: null
bioimageio__spec__model__v0_4__LinkedModel object

Reference to a bioimage.io model.

id string required

A valid model id from the bioimage.io collection.

Examples: "affable-shark", "ambitious-sloth"
minLength=1
version_number integer | null

version number (n-th published version, not the semantic version) of linked model

Default: null
bioimageio__spec__model__v0_4__ModelDescr object

Specification of the fields used in a bioimage.io-compliant RDF that describes AI models with pretrained weights.

These fields are typically stored in a YAML file which we call a model resource description file (model RDF).

name string required

A human-readable name of this model. It should be no longer than 64 characters and only contain letter, number, underscore, minus or space characters.

minLength=1
description string required

The authors are the creators of the model RDF and the primary points of contact.

minItems=1
format_version string required

Version of the bioimage.io model description specification used. When creating a new model always use the latest micro/patch version described here. The format_version is important for any consumer software to understand how to parse the fields.

Constant: "0.4.10"
type string required

Specialized resource type 'model'

Constant: "model"
documentation string | RelativeFilePath | string required

URL or relative path to a markdown file with additional documentation. The recommended documentation file name is README.md. An .md suffix is mandatory. The documentation should include a '[#[#]]# Validation' (sub)section with details on how to quantitatively validate the model on unseen data.

Examples: "https://raw.githubusercontent.com/bioimage-io/spec-bioimage-io/main/example_descriptions/models/unet2d_nuclei_broad/README.md", "README.md"

Describes the input tensors expected by this model.

minItems=1
license string | string required

A SPDX license identifier. We do notsupport custom license beyond the SPDX license list, if you need that please open a GitHub issue to discuss your intentions with the community.

Examples: "CC0-1.0", "MIT", "BSD-2-Clause"

Describes the output tensors.

minItems=1
test_inputs string | RelativeFilePath | string[] required

Test input tensors compatible with the inputs description for a single test case. This means if your model has more than one input, you should provide one URL/relative path for each input. Each test input should be a file with an ndarray in numpy.lib file format. The extension must be '.npy'.

minItems=1
test_outputs string | RelativeFilePath | string[] required

Analog to test_inputs.

minItems=1
timestamp string required

Timestamp in ISO 8601> format with a few restrictions listed here.

format=date-time
weights object required
6 nested properties
Default: null
Default: null
Default: null
covers string | RelativeFilePath | string[]

Cover images. Please use an image smaller than 500KB and an aspect ratio width to height of 2:1. The supported image formats are: ('.gif', '.jpeg', '.jpg', '.png', '.svg', '.tif', '.tiff')

Examples: ["cover.png"]
id_emoji string | null

UTF-8 emoji for display alongside the id.

Default: null
attachments AttachmentsDescr | null

file and other attachments

Default: null

A field for custom configuration that can contain any keys not present in the RDF spec. This means you should not store, for example, a github repo URL in config since we already have the git_repo field defined in the spec. Keys in config may be very specific to a tool or consumer software. To avoid conflicting definitions, it is recommended to wrap added configuration into a sub-field named with the specific domain or tool name, for example:

config:
    bioimageio:  # here is the domain name
        my_custom_key: 3837283
        another_key:
            nested: value
    imagej:       # config specific to ImageJ
        macro_dir: path/to/macro/file

If possible, please use snake_case for keys in config. You may want to list linked files additionally under attachments to include them when packaging a resource (packaging a resource means downloading/copying important linked files and creating a ZIP archive that contains an altered rdf.yaml file with local references to the downloaded files)

Examples: {"bioimageio":{"another_key":{"nested":"value"},"my_custom_key":3837283},"imagej":{"macro_dir":"path/to/macro/file"}}
download_url string | null

URL to download the resource from (deprecated)

Default: null
git_repo string | null

A URL to the Git repository where the resource is being developed.

Default: null
Examples: "https://github.com/bioimage-io/spec-bioimage-io/tree/main/example_descriptions/models/unet2d_nuclei_broad"
icon string | string | RelativeFilePath | string | null

An icon for illustration

Default: null
links string[]

IDs of other bioimage.io resources

Examples: ["ilastik/ilastik","deepimagej/deepimagej","zero/notebook_u-net_3d_zerocostdl4mic"]
uploader Uploader | null

The person who uploaded the model (e.g. to bioimage.io)

Default: null

Maintainers of this resource. If not specified authors are maintainers and at least some of them should specify their github_user name

rdf_source string | RelativeFilePath | string | null

Resource description file (RDF) source; used to keep track of where an rdf.yaml was loaded from. Do not set this field in a YAML file.

Default: null
tags string[]

Associated tags

Examples: ["unet2d","pytorch","nucleus","segmentation","dsb2018"]
version Version | null

The version of the resource following SemVer 2.0.

Default: null
version_number integer | null

version number (n-th published version, not the semantic version)

Default: null
id string | null

bioimage.io-wide unique resource identifier assigned by bioimage.io; version unspecific.

Default: null

The persons that have packaged and uploaded this model. Only required if those persons differ from the authors.

The model from which this model is derived, e.g. by fine-tuning the weights.

Default: null
run_mode RunMode | null

Custom run mode for this model: for more complex prediction procedures like test time data augmentation that currently cannot be expressed in the specification. No standard run modes are defined yet.

Default: null
sample_inputs string | RelativeFilePath | string[]

URLs/relative paths to sample inputs to illustrate possible inputs for the model, for example stored as PNG or TIFF images. The sample files primarily serve to inform a human user about an example use case

sample_outputs string | RelativeFilePath | string[]

URLs/relative paths to sample outputs corresponding to the sample_inputs.

The dataset used to train this model

Default: null
bioimageio__spec__model__v0_4__OnnxWeightsDescr object
source string | RelativeFilePath | string required

The weights file.

sha256 string | null

SHA256 hash value of the source file.

Default: null
attachments AttachmentsDescr | null

Attachments that are specific to this weights entry.

Default: null

Authors Either the person(s) that have trained this model resulting in the original weights file. (If this is the initial weights entry, i.e. it does not have a parent) Or the person(s) who have converted the weights to this weights format. (If this is a child weight, i.e. it has a parent field)

Default: null
dependencies string | null

Dependency manager and dependency file, specified as <dependency manager>:<relative file path>.

Default: null
Examples: "conda:environment.yaml", "maven:./pom.xml", "pip:./requirements.txt"
parent string | null

The source weights these weights were converted from. For example, if a model's weights were converted from the pytorch_state_dict format to torchscript, The pytorch_state_dict weights entry has no parent and is the parent of the torchscript weights. All weight entries except one (the initial set of weights resulting from training the model), need to have this field.

Default: null
Examples: "pytorch_state_dict"
opset_version integer | null

ONNX opset version

Default: null
bioimageio__spec__model__v0_4__OutputTensorDescr object
name string required

Tensor name. No duplicates are allowed.

minLength=1
axes string required

Axes identifying characters. Same length and order as the axes in shape.

axisdescription
bbatch (groups multiple samples)
iinstance/index/element
ttime
cchannel
zspatial dimension z
yspatial dimension y
xspatial dimension x
data_type string required

Data type. The data flow in bioimage.io models is explained in this diagram..

Values: "float32" "float64" "uint8" "int8" "uint16" "int16" "uint32" "int32" "uint64" "int64" "bool"
shape integer[] | ImplicitOutputShape required

Output tensor shape.

description string
Default: ""
data_range array | null

Tuple (minimum, maximum) specifying the allowed range of the data in this tensor. If not specified, the full data range that can be expressed in data_type is allowed.

Default: null
halo integer[] | null

The halo that should be cropped from the output tensor to avoid boundary effects. The halo is to be cropped from both sides, i.e. shape_after_crop = shape - 2 * halo. To document a halo that is already cropped by the model shape.offset has to be used instead.

Default: null
postprocessing bioimageio__spec__model__v0_4__BinarizeDescr | bioimageio__spec__model__v0_4__ClipDescr | bioimageio__spec__model__v0_4__ScaleLinearDescr | bioimageio__spec__model__v0_4__SigmoidDescr | bioimageio__spec__model__v0_4__ZeroMeanUnitVarianceDescr | bioimageio__spec__model__v0_4__ScaleRangeDescr | bioimageio__spec__model__v0_4__ScaleMeanVarianceDescr[]

Description of how this output should be postprocessed.

bioimageio__spec__model__v0_4__PytorchStateDictWeightsDescr object
source string | RelativeFilePath | string required

The weights file.

architecture string | string required

callable returning a torch.nn.Module instance. Local implementation: <relative path to file>:<identifier of implementation within the file>. Implementation in a dependency: <dependency-package>.<[dependency-module]>.<identifier>.

Examples: "my_function.py:MyNetworkClass", "my_module.submodule.get_my_model"
sha256 string | null

SHA256 hash value of the source file.

Default: null
attachments AttachmentsDescr | null

Attachments that are specific to this weights entry.

Default: null

Authors Either the person(s) that have trained this model resulting in the original weights file. (If this is the initial weights entry, i.e. it does not have a parent) Or the person(s) who have converted the weights to this weights format. (If this is a child weight, i.e. it has a parent field)

Default: null
dependencies string | null

Dependency manager and dependency file, specified as <dependency manager>:<relative file path>.

Default: null
Examples: "conda:environment.yaml", "maven:./pom.xml", "pip:./requirements.txt"
parent string | null

The source weights these weights were converted from. For example, if a model's weights were converted from the pytorch_state_dict format to torchscript, The pytorch_state_dict weights entry has no parent and is the parent of the torchscript weights. All weight entries except one (the initial set of weights resulting from training the model), need to have this field.

Default: null
Examples: "pytorch_state_dict"
architecture_sha256 string | null

The SHA256 of the architecture source file, if the architecture is not defined in a module listed in dependencies You can drag and drop your file to this online tool to generate a SHA256 in your browser. Or you can generate a SHA256 checksum with Python's hashlib, here is a codesnippet.

Default: null
kwargs object

key word arguments for the architecture callable

pytorch_version Version | null

Version of the PyTorch library used. If depencencies is specified it should include pytorch and the verison has to match. (dependencies overrules pytorch_version)

Default: null
bioimageio__spec__model__v0_4__ScaleLinearDescr object

Fixed linear scaling.

name string required
Constant: "scale_linear"
kwargs object required

key word arguments for ScaleLinearDescr

3 nested properties
axes string | null

The subset of axes to scale jointly. For example xy to scale the two image axes for 2d data jointly.

Default: null
Examples: "xy"
gain number | number[]

multiplicative factor

Default: 1.0
offset number | number[]

additive term

Default: 0.0
bioimageio__spec__model__v0_4__ScaleLinearKwargs object

key word arguments for ScaleLinearDescr

axes string | null

The subset of axes to scale jointly. For example xy to scale the two image axes for 2d data jointly.

Default: null
Examples: "xy"
gain number | number[]

multiplicative factor

Default: 1.0
offset number | number[]

additive term

Default: 0.0
bioimageio__spec__model__v0_4__ScaleMeanVarianceDescr object

Scale the tensor s.t. its mean and variance match a reference tensor.

name string required
Constant: "scale_mean_variance"
kwargs object required

key word arguments for ScaleMeanVarianceDescr

4 nested properties
mode string required

Mode for computing mean and variance.

modedescription
per_datasetCompute for the entire dataset
per_sampleCompute for each sample individually
Values: "per_dataset" "per_sample"
reference_tensor string required

Name of tensor to match.

minLength=1
axes string | null

The subset of axes to scale jointly. For example xy to normalize the two image axes for 2d data jointly. Default: scale all non-batch axes jointly.

Default: null
Examples: "xy"
eps number

Epsilon for numeric stability: "`out = (tensor - mean) / (std + eps) * (ref_std + eps) + ref_mean.

Default: 1e-6
max=0.1exclusiveMin=0
bioimageio__spec__model__v0_4__ScaleMeanVarianceKwargs object

key word arguments for ScaleMeanVarianceDescr

mode string required

Mode for computing mean and variance.

modedescription
per_datasetCompute for the entire dataset
per_sampleCompute for each sample individually
Values: "per_dataset" "per_sample"
reference_tensor string required

Name of tensor to match.

minLength=1
axes string | null

The subset of axes to scale jointly. For example xy to normalize the two image axes for 2d data jointly. Default: scale all non-batch axes jointly.

Default: null
Examples: "xy"
eps number

Epsilon for numeric stability: "`out = (tensor - mean) / (std + eps) * (ref_std + eps) + ref_mean.

Default: 1e-6
max=0.1exclusiveMin=0
bioimageio__spec__model__v0_4__ScaleRangeDescr object

Scale with percentiles.

name string required
Constant: "scale_range"
kwargs object required

key word arguments for ScaleRangeDescr

For min_percentile=0.0 (the default) and max_percentile=100 (the default) this processing step normalizes data to the [0, 1] intervall. For other percentiles the normalized values will partially be outside the [0, 1] intervall. Use ScaleRange followed by ClipDescr if you want to limit the normalized values to a range.

6 nested properties
mode string required

Mode for computing percentiles.

modedescription
per_datasetcompute for the entire dataset
per_samplecompute for each sample individually
Values: "per_dataset" "per_sample"
axes string required

The subset of axes to normalize jointly. For example xy to normalize the two image axes for 2d data jointly.

Examples: "xy"
min_percentile integer | number

The lower percentile used to determine the value to align with zero.

Default: 0.0
max_percentile integer | number

The upper percentile used to determine the value to align with one. Has to be bigger than min_percentile. The range is 1 to 100 instead of 0 to 100 to avoid mistakenly accepting percentiles specified in the range 0.0 to 1.0.

Default: 100.0
eps number

Epsilon for numeric stability. out = (tensor - v_lower) / (v_upper - v_lower + eps); with v_lower,v_upper values at the respective percentiles.

Default: 1e-6
max=0.1exclusiveMin=0
reference_tensor string | null

Tensor name to compute the percentiles from. Default: The tensor itself. For any tensor in inputs only input tensor references are allowed. For a tensor in outputs only input tensor refereences are allowed if mode: per_dataset

Default: null
bioimageio__spec__model__v0_4__ScaleRangeKwargs object

key word arguments for ScaleRangeDescr

For min_percentile=0.0 (the default) and max_percentile=100 (the default) this processing step normalizes data to the [0, 1] intervall. For other percentiles the normalized values will partially be outside the [0, 1] intervall. Use ScaleRange followed by ClipDescr if you want to limit the normalized values to a range.

mode string required

Mode for computing percentiles.

modedescription
per_datasetcompute for the entire dataset
per_samplecompute for each sample individually
Values: "per_dataset" "per_sample"
axes string required

The subset of axes to normalize jointly. For example xy to normalize the two image axes for 2d data jointly.

Examples: "xy"
min_percentile integer | number

The lower percentile used to determine the value to align with zero.

Default: 0.0
max_percentile integer | number

The upper percentile used to determine the value to align with one. Has to be bigger than min_percentile. The range is 1 to 100 instead of 0 to 100 to avoid mistakenly accepting percentiles specified in the range 0.0 to 1.0.

Default: 100.0
eps number

Epsilon for numeric stability. out = (tensor - v_lower) / (v_upper - v_lower + eps); with v_lower,v_upper values at the respective percentiles.

Default: 1e-6
max=0.1exclusiveMin=0
reference_tensor string | null

Tensor name to compute the percentiles from. Default: The tensor itself. For any tensor in inputs only input tensor references are allowed. For a tensor in outputs only input tensor refereences are allowed if mode: per_dataset

Default: null
bioimageio__spec__model__v0_4__SigmoidDescr object

The logistic sigmoid funciton, a.k.a. expit function.

name string required
Constant: "sigmoid"
bioimageio__spec__model__v0_4__TensorflowJsWeightsDescr object
source string | RelativeFilePath | string required

The multi-file weights. All required files/folders should be a zip archive.

sha256 string | null

SHA256 hash value of the source file.

Default: null
attachments AttachmentsDescr | null

Attachments that are specific to this weights entry.

Default: null

Authors Either the person(s) that have trained this model resulting in the original weights file. (If this is the initial weights entry, i.e. it does not have a parent) Or the person(s) who have converted the weights to this weights format. (If this is a child weight, i.e. it has a parent field)

Default: null
dependencies string | null

Dependency manager and dependency file, specified as <dependency manager>:<relative file path>.

Default: null
Examples: "conda:environment.yaml", "maven:./pom.xml", "pip:./requirements.txt"
parent string | null

The source weights these weights were converted from. For example, if a model's weights were converted from the pytorch_state_dict format to torchscript, The pytorch_state_dict weights entry has no parent and is the parent of the torchscript weights. All weight entries except one (the initial set of weights resulting from training the model), need to have this field.

Default: null
Examples: "pytorch_state_dict"
tensorflow_version Version | null

Version of the TensorFlow library used.

Default: null
bioimageio__spec__model__v0_4__TensorflowSavedModelBundleWeightsDescr object
source string | RelativeFilePath | string required

The weights file.

sha256 string | null

SHA256 hash value of the source file.

Default: null
attachments AttachmentsDescr | null

Attachments that are specific to this weights entry.

Default: null

Authors Either the person(s) that have trained this model resulting in the original weights file. (If this is the initial weights entry, i.e. it does not have a parent) Or the person(s) who have converted the weights to this weights format. (If this is a child weight, i.e. it has a parent field)

Default: null
dependencies string | null

Dependency manager and dependency file, specified as <dependency manager>:<relative file path>.

Default: null
Examples: "conda:environment.yaml", "maven:./pom.xml", "pip:./requirements.txt"
parent string | null

The source weights these weights were converted from. For example, if a model's weights were converted from the pytorch_state_dict format to torchscript, The pytorch_state_dict weights entry has no parent and is the parent of the torchscript weights. All weight entries except one (the initial set of weights resulting from training the model), need to have this field.

Default: null
Examples: "pytorch_state_dict"
tensorflow_version Version | null

Version of the TensorFlow library used.

Default: null
bioimageio__spec__model__v0_4__TorchscriptWeightsDescr object
source string | RelativeFilePath | string required

The weights file.

sha256 string | null

SHA256 hash value of the source file.

Default: null
attachments AttachmentsDescr | null

Attachments that are specific to this weights entry.

Default: null

Authors Either the person(s) that have trained this model resulting in the original weights file. (If this is the initial weights entry, i.e. it does not have a parent) Or the person(s) who have converted the weights to this weights format. (If this is a child weight, i.e. it has a parent field)

Default: null
dependencies string | null

Dependency manager and dependency file, specified as <dependency manager>:<relative file path>.

Default: null
Examples: "conda:environment.yaml", "maven:./pom.xml", "pip:./requirements.txt"
parent string | null

The source weights these weights were converted from. For example, if a model's weights were converted from the pytorch_state_dict format to torchscript, The pytorch_state_dict weights entry has no parent and is the parent of the torchscript weights. All weight entries except one (the initial set of weights resulting from training the model), need to have this field.

Default: null
Examples: "pytorch_state_dict"
pytorch_version Version | null

Version of the PyTorch library used.

Default: null
bioimageio__spec__model__v0_4__WeightsDescr object
Default: null
Default: null
Default: null
bioimageio__spec__model__v0_4__ZeroMeanUnitVarianceDescr object

Subtract mean and divide by variance.

name string required
Constant: "zero_mean_unit_variance"
kwargs object required

key word arguments for ZeroMeanUnitVarianceDescr

5 nested properties
axes string required

The subset of axes to normalize jointly. For example xy to normalize the two image axes for 2d data jointly.

Examples: "xy"
mode string

Mode for computing mean and variance.

modedescription
fixedFixed values for mean and variance
per_datasetCompute for the entire dataset
per_sampleCompute for each sample individually
Default: "fixed"
Values: "fixed" "per_dataset" "per_sample"
mean number | number[] | null

The mean value(s) to use for mode: fixed. For example [1.1, 2.2, 3.3] in the case of a 3 channel image with axes: xy.

Default: null
Examples: [1.1,2.2,3.3]
std number | number[] | null

The standard deviation values to use for mode: fixed. Analogous to mean.

Default: null
Examples: [0.1,0.2,0.3]
eps number

epsilon for numeric stability: out = (tensor - mean) / (std + eps).

Default: 1e-6
max=0.1exclusiveMin=0
bioimageio__spec__model__v0_4__ZeroMeanUnitVarianceKwargs object

key word arguments for ZeroMeanUnitVarianceDescr

axes string required

The subset of axes to normalize jointly. For example xy to normalize the two image axes for 2d data jointly.

Examples: "xy"
mode string

Mode for computing mean and variance.

modedescription
fixedFixed values for mean and variance
per_datasetCompute for the entire dataset
per_sampleCompute for each sample individually
Default: "fixed"
Values: "fixed" "per_dataset" "per_sample"
mean number | number[] | null

The mean value(s) to use for mode: fixed. For example [1.1, 2.2, 3.3] in the case of a 3 channel image with axes: xy.

Default: null
Examples: [1.1,2.2,3.3]
std number | number[] | null

The standard deviation values to use for mode: fixed. Analogous to mean.

Default: null
Examples: [0.1,0.2,0.3]
eps number

epsilon for numeric stability: out = (tensor - mean) / (std + eps).

Default: 1e-6
max=0.1exclusiveMin=0
bioimageio__spec__model__v0_5__BinarizeDescr object

Binarize the tensor with a fixed threshold.

Values above BinarizeKwargs.threshold/BinarizeAlongAxisKwargs.threshold will be set to one, values below the threshold to zero.

Examples:

  • in YAML

    postprocessing:
      - id: binarize
        kwargs:
          axis: 'channel'
          threshold: [0.25, 0.5, 0.75]
    
  • in Python:

    postprocessing = [BinarizeDescr( ... kwargs=BinarizeAlongAxisKwargs( ... axis=AxisId('channel'), ... threshold=[0.25, 0.5, 0.75], ... ) ... )]

id string required
Constant: "binarize"
bioimageio__spec__model__v0_5__BinarizeKwargs object

key word arguments for BinarizeDescr

threshold number required

The fixed threshold

bioimageio__spec__model__v0_5__BioimageioConfig object
reproducibility_tolerance ReproducibilityTolerance[]

Tolerances to allow when reproducing the model's test outputs from the model's test inputs. Only the first entry matching tensor id and weights format is considered.

Default:
[]
funded_by string | null

Funding agency, grant number if applicable

Default: null
architecture_type string | null

Model architecture type, e.g., 3D U-Net, ResNet, transformer

Default: null
architecture_description string | null

Text description of model architecture.

Default: null
modality string | null

Input modality, e.g., fluorescence microscopy, electron microscopy

Default: null
target_structure string[]

Biological structure(s) the model is designed to analyze, e.g., nuclei, mitochondria, cells

task string | null

Bioimage-specific task type, e.g., segmentation, classification, detection, denoising

Default: null
new_version string | null

A new version of this model exists with a different model id.

Default: null
out_of_scope_use string | null

Describe how the model may be misused in bioimage analysis contexts and what users should not do with the model.

Default: null
bias_risks_limitations object

Known biases, risks, technical limitations, and recommendations for model use.

4 nested properties
known_biases string

Biases in training data or model behavior.

Default: "In general bioimage models may suffer from biases caused by: - Imaging protocol dependencies - Use of a specific cell type - Species-specific training data limitations "
risks string

Potential risks in the context of bioimage analysis.

Default: "Common risks in bioimage analysis include: - Erroneously assuming generalization to unseen experimental conditions - Trusting (overconfident) model outputs without validation - Misinterpretation of results "
limitations string | null

Technical limitations and failure modes.

Default: null
recommendations string

Mitigation strategies regarding known_biases, risks, and limitations, as well as applicable best practices.

Consider:

  • How to use a validation dataset?
  • How to manually validate?
  • Feasibility of domain adaptation for different experimental setups?
Default: "Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model."
model_parameter_count integer | null

Total number of model parameters.

Default: null
training object
11 nested properties
training_preprocessing string | null

Detailed image preprocessing steps during model training:

Mention:

  • Normalization methods
  • Augmentation strategies
  • Resizing/resampling procedures
  • Artifact handling
Default: null
training_epochs number | null

Number of training epochs.

Default: null
training_batch_size number | null

Batch size used in training.

Default: null
initial_learning_rate number | null

Initial learning rate used in training.

Default: null
learning_rate_schedule string | null

Learning rate schedule used in training.

Default: null
loss_function string | null

Loss function used in training, e.g. nn.MSELoss.

Default: null

key word arguments for the loss_function

optimizer string | null

optimizer, e.g. torch.optim.Adam

Default: null

key word arguments for the optimizer

regularization string | null

Regularization techniques used during training, e.g. drop-out or weight decay.

Default: null
training_duration number | null

Total training duration in hours.

Default: null
inference_time string | null

Average inference time per image/tile. Specify hardware and image size. Multiple examples can be given.

Default: null
memory_requirements_inference string | null

GPU memory needed for inference. Multiple examples with different image size can be given.

Default: null
memory_requirements_training string | null

GPU memory needed for training. Multiple examples with different image/batch sizes can be given.

Default: null
evaluations Evaluation[]

Quantitative model evaluations.

Note: At the moment we recommend to include only a single test dataset (with evaluation factors that may mark subsets of the dataset) to avoid confusion and make the presentation of results cleaner.

environmental_impact object

Environmental considerations for model training and deployment.

Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).

5 nested properties
hardware_type string | null

GPU/CPU specifications

Default: null
hours_used number | null

Total compute hours

Default: null
cloud_provider string | null

If applicable

Default: null
compute_region string | null

Geographic location

Default: null
co2_emitted number | null

kg CO2 equivalent

Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).

Default: null
bioimageio__spec__model__v0_5__ClipDescr object

Set tensor values below min to min and above max to max.

See ScaleRangeDescr for examples.

id string required
Constant: "clip"
kwargs object required

key word arguments for ClipDescr

5 nested properties
min number | null

Minimum value for clipping.

Exclusive with min_percentile

Default: null
min_percentile number | null

Minimum percentile for clipping.

Exclusive with min.

In range [0, 100).

Default: null
max number | null

Maximum value for clipping.

Exclusive with max_percentile.

Default: null
max_percentile number | null

Maximum percentile for clipping.

Exclusive with max.

In range (1, 100].

Default: null
axes string[] | null

The subset of axes to determine percentiles jointly,

i.e. axes to reduce to compute min/max from min_percentile/max_percentile. For example to clip 'batch', 'x' and 'y' jointly in a tensor ('batch', 'channel', 'y', 'x') resulting in a tensor of equal shape with clipped values per channel, specify axes=('batch', 'x', 'y'). To clip samples independently, leave out the 'batch' axis.

Only valid if min_percentile and/or max_percentile are set.

Default: Compute percentiles over all axes jointly.

Default: null
Examples: ["batch","x","y"]
bioimageio__spec__model__v0_5__ClipKwargs object

key word arguments for ClipDescr

min number | null

Minimum value for clipping.

Exclusive with min_percentile

Default: null
min_percentile number | null

Minimum percentile for clipping.

Exclusive with min.

In range [0, 100).

Default: null
max number | null

Maximum value for clipping.

Exclusive with max_percentile.

Default: null
max_percentile number | null

Maximum percentile for clipping.

Exclusive with max.

In range (1, 100].

Default: null
axes string[] | null

The subset of axes to determine percentiles jointly,

i.e. axes to reduce to compute min/max from min_percentile/max_percentile. For example to clip 'batch', 'x' and 'y' jointly in a tensor ('batch', 'channel', 'y', 'x') resulting in a tensor of equal shape with clipped values per channel, specify axes=('batch', 'x', 'y'). To clip samples independently, leave out the 'batch' axis.

Only valid if min_percentile and/or max_percentile are set.

Default: Compute percentiles over all axes jointly.

Default: null
Examples: ["batch","x","y"]
bioimageio__spec__model__v0_5__Config object
bioimageio object
17 nested properties
reproducibility_tolerance ReproducibilityTolerance[]

Tolerances to allow when reproducing the model's test outputs from the model's test inputs. Only the first entry matching tensor id and weights format is considered.

Default:
[]
funded_by string | null

Funding agency, grant number if applicable

Default: null
architecture_type string | null

Model architecture type, e.g., 3D U-Net, ResNet, transformer

Default: null
architecture_description string | null

Text description of model architecture.

Default: null
modality string | null

Input modality, e.g., fluorescence microscopy, electron microscopy

Default: null
target_structure string[]

Biological structure(s) the model is designed to analyze, e.g., nuclei, mitochondria, cells

task string | null

Bioimage-specific task type, e.g., segmentation, classification, detection, denoising

Default: null
new_version string | null

A new version of this model exists with a different model id.

Default: null
out_of_scope_use string | null

Describe how the model may be misused in bioimage analysis contexts and what users should not do with the model.

Default: null
bias_risks_limitations object

Known biases, risks, technical limitations, and recommendations for model use.

4 nested properties
known_biases string

Biases in training data or model behavior.

Default: "In general bioimage models may suffer from biases caused by: - Imaging protocol dependencies - Use of a specific cell type - Species-specific training data limitations "
risks string

Potential risks in the context of bioimage analysis.

Default: "Common risks in bioimage analysis include: - Erroneously assuming generalization to unseen experimental conditions - Trusting (overconfident) model outputs without validation - Misinterpretation of results "
limitations string | null

Technical limitations and failure modes.

Default: null
recommendations string

Mitigation strategies regarding known_biases, risks, and limitations, as well as applicable best practices.

Consider:

  • How to use a validation dataset?
  • How to manually validate?
  • Feasibility of domain adaptation for different experimental setups?
Default: "Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model."
model_parameter_count integer | null

Total number of model parameters.

Default: null
training object
11 nested properties
training_preprocessing string | null

Detailed image preprocessing steps during model training:

Mention:

  • Normalization methods
  • Augmentation strategies
  • Resizing/resampling procedures
  • Artifact handling
Default: null
training_epochs number | null

Number of training epochs.

Default: null
training_batch_size number | null

Batch size used in training.

Default: null
initial_learning_rate number | null

Initial learning rate used in training.

Default: null
learning_rate_schedule string | null

Learning rate schedule used in training.

Default: null
loss_function string | null

Loss function used in training, e.g. nn.MSELoss.

Default: null

key word arguments for the loss_function

optimizer string | null

optimizer, e.g. torch.optim.Adam

Default: null

key word arguments for the optimizer

regularization string | null

Regularization techniques used during training, e.g. drop-out or weight decay.

Default: null
training_duration number | null

Total training duration in hours.

Default: null
inference_time string | null

Average inference time per image/tile. Specify hardware and image size. Multiple examples can be given.

Default: null
memory_requirements_inference string | null

GPU memory needed for inference. Multiple examples with different image size can be given.

Default: null
memory_requirements_training string | null

GPU memory needed for training. Multiple examples with different image/batch sizes can be given.

Default: null
evaluations Evaluation[]

Quantitative model evaluations.

Note: At the moment we recommend to include only a single test dataset (with evaluation factors that may mark subsets of the dataset) to avoid confusion and make the presentation of results cleaner.

environmental_impact object

Environmental considerations for model training and deployment.

Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).

5 nested properties
hardware_type string | null

GPU/CPU specifications

Default: null
hours_used number | null

Total compute hours

Default: null
cloud_provider string | null

If applicable

Default: null
compute_region string | null

Geographic location

Default: null
co2_emitted number | null

kg CO2 equivalent

Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).

Default: null
stardist boolean | string | string | integer | number | string | YamlValue[] | object | null
bioimageio__spec__model__v0_5__InputTensorDescr object
axes BatchAxis | ChannelAxis | IndexInputAxis | TimeInputAxis | SpaceInputAxis[] required

tensor axes

minItems=1
id string

Input tensor id. No duplicates are allowed across all inputs and outputs.

Default: "input"
minLength=1maxLength=32
description string

free text description

Default: ""
maxLength=128
test_tensor FileDescr | null

An example tensor to use for testing. Using the model with the test input tensors is expected to yield the test output tensors. Each test tensor has be a an ndarray in the numpy.lib file format. The file extension must be '.npy'.

Default: null
sample_tensor FileDescr | null

A sample tensor to illustrate a possible input/output for the model, The sample image primarily serves to inform a human user about an example use case and is typically stored as .hdf5, .png or .tiff. It has to be readable by the imageio library (numpy's .npy format is not supported). The image dimensionality has to match the number of axes specified in this tensor description.

Default: null
data NominalOrOrdinalDataDescr | IntervalOrRatioDataDescr | NominalOrOrdinalDataDescr | IntervalOrRatioDataDescr[]

Description of the tensor's data values, optionally per channel. If specified per channel, the data type needs to match across channels.

Default:
{
  "type": "float32",
  "range": [
    null,
    null
  ],
  "unit": "arbitrary unit",
  "scale": 1.0,
  "offset": null
}
optional boolean

indicates that this tensor may be None

Default: false
preprocessing bioimageio__spec__model__v0_5__BinarizeDescr | bioimageio__spec__model__v0_5__ClipDescr | EnsureDtypeDescr | FixedZeroMeanUnitVarianceDescr | bioimageio__spec__model__v0_5__ScaleLinearDescr | bioimageio__spec__model__v0_5__ScaleRangeDescr | bioimageio__spec__model__v0_5__SigmoidDescr | SoftmaxDescr | bioimageio__spec__model__v0_5__ZeroMeanUnitVarianceDescr[]

Description of how this input should be preprocessed.

notes:

  • If preprocessing does not start with an 'ensure_dtype' entry, it is added to ensure an input tensor's data type matches the input tensor's data description.
  • If preprocessing does not end with an 'ensure_dtype' or 'binarize' entry, an 'ensure_dtype' step is added to ensure preprocessing steps are not unintentionally changing the data type.
bioimageio__spec__model__v0_5__KerasHdf5WeightsDescr object
source string | RelativeFilePath | string required

Source of the weights file.

tensorflow_version string | integer | number required

wraps a packaging.version.Version instance for validation in pydantic models

sha256 string | null

SHA256 hash value of the source file.

Default: null

Authors Either the person(s) that have trained this model resulting in the original weights file. (If this is the initial weights entry, i.e. it does not have a parent) Or the person(s) who have converted the weights to this weights format. (If this is a child weight, i.e. it has a parent field)

Default: null
parent string | null

The source weights these weights were converted from. For example, if a model's weights were converted from the pytorch_state_dict format to torchscript, The pytorch_state_dict weights entry has no parent and is the parent of the torchscript weights. All weight entries except one (the initial set of weights resulting from training the model), need to have this field.

Default: null
Examples: "pytorch_state_dict"
comment string

A comment about this weights entry, for example how these weights were created.

Default: ""
bioimageio__spec__model__v0_5__LinkedModel object

Reference to a bioimage.io model.

id string required

A valid model id from the bioimage.io collection.

minLength=1
version Version | null

The version of the linked resource following SemVer 2.0.

Default: null
bioimageio__spec__model__v0_5__ModelDescr object

Specification of the fields used in a bioimage.io-compliant RDF to describe AI models with pretrained weights. These fields are typically stored in a YAML file which we call a model resource description file (model RDF).

name string required

A human-readable name of this model. It should be no longer than 64 characters and may only contain letter, number, underscore, minus, parentheses and spaces. We recommend to chose a name that refers to the model's task and image modality.

minLength=5maxLength=128
format_version string required

Version of the bioimage.io model description specification used. When creating a new model always use the latest micro/patch version described here. The format_version is important for any consumer software to understand how to parse the fields.

Constant: "0.5.9"
type string required

Specialized resource type 'model'

Constant: "model"

Describes the input tensors expected by this model.

minItems=1

Describes the output tensors.

minItems=1
weights object required
7 nested properties
keras_v3 KerasV3WeightsDescr | null
Default: null
Default: null
Default: null
Default: null
description string

A string containing a brief description.

Default: ""
maxLength=1024
covers string | RelativeFilePath | string[]

Cover images. Please use an image smaller than 500KB and an aspect ratio width to height of 2:1 or 1:1. The supported image formats are: ('.gif', '.jpeg', '.jpg', '.png', '.svg')

Examples: ["cover.png"]
id_emoji string | null

UTF-8 emoji for display alongside the id.

Default: null

The authors are the creators of the model RDF and the primary points of contact.

attachments FileDescr[]

file attachments

license string | string | null

A SPDX license identifier. We do not support custom license beyond the SPDX license list, if you need that please open a GitHub issue to discuss your intentions with the community.

Default: null
Examples: "CC0-1.0", "MIT", "BSD-2-Clause"
git_repo string | null

A URL to the Git repository where the resource is being developed.

Default: null
Examples: "https://github.com/bioimage-io/spec-bioimage-io/tree/main/example_descriptions/models/unet2d_nuclei_broad"
icon string | string | RelativeFilePath | string | null

An icon for illustration, e.g. on bioimage.io

Default: null
links string[]

IDs of other bioimage.io resources

Examples: ["ilastik/ilastik","deepimagej/deepimagej","zero/notebook_u-net_3d_zerocostdl4mic"]
uploader Uploader | null

The person who uploaded the model (e.g. to bioimage.io)

Default: null

Maintainers of this resource. If not specified, authors are maintainers and at least some of them has to specify their github_user name

tags string[]

Associated tags

Examples: ["unet2d","pytorch","nucleus","segmentation","dsb2018"]
version Version | null

The version of the resource following SemVer 2.0.

Default: null
version_comment string | null

A comment on the version of the resource.

Default: null
id string | null

bioimage.io-wide unique resource identifier assigned by bioimage.io; version unspecific.

Default: null
documentation string | RelativeFilePath | string | null

URL or relative path to a markdown file with additional documentation. The recommended documentation file name is README.md. An .md suffix is mandatory. The documentation should include a '#[#] Validation' (sub)section with details on how to quantitatively validate the model on unseen data.

Default: null

The persons that have packaged and uploaded this model. Only required if those persons differ from the authors.

The model from which this model is derived, e.g. by fine-tuning the weights.

Default: null
run_mode RunMode | null

Custom run mode for this model: for more complex prediction procedures like test time data augmentation that currently cannot be expressed in the specification. No standard run modes are defined yet.

Default: null
timestamp string

Timestamp in ISO 8601> format with a few restrictions listed here.

format=date-time
config object
2 nested properties
bioimageio object
17 nested properties
reproducibility_tolerance ReproducibilityTolerance[]

Tolerances to allow when reproducing the model's test outputs from the model's test inputs. Only the first entry matching tensor id and weights format is considered.

Default:
[]
funded_by string | null

Funding agency, grant number if applicable

Default: null
architecture_type string | null

Model architecture type, e.g., 3D U-Net, ResNet, transformer

Default: null
architecture_description string | null

Text description of model architecture.

Default: null
modality string | null

Input modality, e.g., fluorescence microscopy, electron microscopy

Default: null
target_structure string[]

Biological structure(s) the model is designed to analyze, e.g., nuclei, mitochondria, cells

task string | null

Bioimage-specific task type, e.g., segmentation, classification, detection, denoising

Default: null
new_version string | null

A new version of this model exists with a different model id.

Default: null
out_of_scope_use string | null

Describe how the model may be misused in bioimage analysis contexts and what users should not do with the model.

Default: null
bias_risks_limitations object

Known biases, risks, technical limitations, and recommendations for model use.

model_parameter_count integer | null

Total number of model parameters.

Default: null
training object
inference_time string | null

Average inference time per image/tile. Specify hardware and image size. Multiple examples can be given.

Default: null
memory_requirements_inference string | null

GPU memory needed for inference. Multiple examples with different image size can be given.

Default: null
memory_requirements_training string | null

GPU memory needed for training. Multiple examples with different image/batch sizes can be given.

Default: null
evaluations Evaluation[]

Quantitative model evaluations.

Note: At the moment we recommend to include only a single test dataset (with evaluation factors that may mark subsets of the dataset) to avoid confusion and make the presentation of results cleaner.

environmental_impact object

Environmental considerations for model training and deployment.

Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).

stardist boolean | string | string | integer | number | string | YamlValue[] | object | null
bioimageio__spec__model__v0_5__OnnxWeightsDescr object
source string | RelativeFilePath | string required

Source of the weights file.

opset_version integer required

ONNX opset version

min=7
sha256 string | null

SHA256 hash value of the source file.

Default: null

Authors Either the person(s) that have trained this model resulting in the original weights file. (If this is the initial weights entry, i.e. it does not have a parent) Or the person(s) who have converted the weights to this weights format. (If this is a child weight, i.e. it has a parent field)

Default: null
parent string | null

The source weights these weights were converted from. For example, if a model's weights were converted from the pytorch_state_dict format to torchscript, The pytorch_state_dict weights entry has no parent and is the parent of the torchscript weights. All weight entries except one (the initial set of weights resulting from training the model), need to have this field.

Default: null
Examples: "pytorch_state_dict"
comment string

A comment about this weights entry, for example how these weights were created.

Default: ""
external_data FileDescr | null

Source of the external ONNX data file holding the weights. (If present source holds the ONNX architecture without weights).

Default: null
bioimageio__spec__model__v0_5__OutputTensorDescr object
axes BatchAxis | ChannelAxis | IndexOutputAxis | TimeOutputAxis | TimeOutputAxisWithHalo | SpaceOutputAxis | SpaceOutputAxisWithHalo[] required

tensor axes

minItems=1
id string

Output tensor id. No duplicates are allowed across all inputs and outputs.

Default: "output"
minLength=1maxLength=32
description string

free text description

Default: ""
maxLength=128
test_tensor FileDescr | null

An example tensor to use for testing. Using the model with the test input tensors is expected to yield the test output tensors. Each test tensor has be a an ndarray in the numpy.lib file format. The file extension must be '.npy'.

Default: null
sample_tensor FileDescr | null

A sample tensor to illustrate a possible input/output for the model, The sample image primarily serves to inform a human user about an example use case and is typically stored as .hdf5, .png or .tiff. It has to be readable by the imageio library (numpy's .npy format is not supported). The image dimensionality has to match the number of axes specified in this tensor description.

Default: null
data NominalOrOrdinalDataDescr | IntervalOrRatioDataDescr | NominalOrOrdinalDataDescr | IntervalOrRatioDataDescr[]

Description of the tensor's data values, optionally per channel. If specified per channel, the data type needs to match across channels.

Default:
{
  "type": "float32",
  "range": [
    null,
    null
  ],
  "unit": "arbitrary unit",
  "scale": 1.0,
  "offset": null
}
postprocessing bioimageio__spec__model__v0_5__BinarizeDescr | bioimageio__spec__model__v0_5__ClipDescr | EnsureDtypeDescr | FixedZeroMeanUnitVarianceDescr | bioimageio__spec__model__v0_5__ScaleLinearDescr | bioimageio__spec__model__v0_5__ScaleMeanVarianceDescr | bioimageio__spec__model__v0_5__ScaleRangeDescr | bioimageio__spec__model__v0_5__SigmoidDescr | SoftmaxDescr | StardistPostprocessingDescr | bioimageio__spec__model__v0_5__ZeroMeanUnitVarianceDescr[]

Description of how this output should be postprocessed.

note: postprocessing always ends with an 'ensure_dtype' operation. If not given this is added to cast to this tensor's data.type.

bioimageio__spec__model__v0_5__PytorchStateDictWeightsDescr object
source string | RelativeFilePath | string required

Source of the weights file.

pytorch_version string | integer | number required

wraps a packaging.version.Version instance for validation in pydantic models

sha256 string | null

SHA256 hash value of the source file.

Default: null

Authors Either the person(s) that have trained this model resulting in the original weights file. (If this is the initial weights entry, i.e. it does not have a parent) Or the person(s) who have converted the weights to this weights format. (If this is a child weight, i.e. it has a parent field)

Default: null
parent string | null

The source weights these weights were converted from. For example, if a model's weights were converted from the pytorch_state_dict format to torchscript, The pytorch_state_dict weights entry has no parent and is the parent of the torchscript weights. All weight entries except one (the initial set of weights resulting from training the model), need to have this field.

Default: null
Examples: "pytorch_state_dict"
comment string

A comment about this weights entry, for example how these weights were created.

Default: ""
dependencies FileDescr | null

Custom depencies beyond pytorch described in a Conda environment file. Allows to specify custom dependencies, see conda docs:

The conda environment file should include pytorch and any version pinning has to be compatible with pytorch_version.

Default: null
bioimageio__spec__model__v0_5__ScaleLinearDescr object

Fixed linear scaling.

Examples:

  1. Scale with scalar gain and offset - in YAML ```yaml preprocessing:
    • id: scale_linear kwargs: gain: 2.0 offset: 3.0 ``` - in Python:
>>> preprocessing = [
...     ScaleLinearDescr(kwargs=ScaleLinearKwargs(gain= 2.0, offset=3.0))
... ]
  1. Independent scaling along an axis - in YAML ```yaml preprocessing:
    • id: scale_linear kwargs: axis: 'channel' gain: [1.0, 2.0, 3.0] ``` - in Python:
>>> preprocessing = [
...     ScaleLinearDescr(
...         kwargs=ScaleLinearAlongAxisKwargs(
...             axis=AxisId("channel"),
...             gain=[1.0, 2.0, 3.0],
...         )
...     )
... ]
id string required
Constant: "scale_linear"
bioimageio__spec__model__v0_5__ScaleLinearKwargs object

Key word arguments for ScaleLinearDescr

gain number

multiplicative factor

Default: 1.0
offset number

additive term

Default: 0.0
bioimageio__spec__model__v0_5__ScaleMeanVarianceDescr object

Scale a tensor's data distribution to match another tensor's mean/std. out = (tensor - mean) / (std + eps) * (ref_std + eps) + ref_mean.

id string required
Constant: "scale_mean_variance"
kwargs object required

key word arguments for ScaleMeanVarianceKwargs

3 nested properties
reference_tensor string required

ID of unprocessed input tensor to match.

minLength=1maxLength=32
axes string[] | null

The subset of axes to normalize jointly, i.e. axes to reduce to compute mean/std. For example to normalize 'batch', 'x' and 'y' jointly in a tensor ('batch', 'channel', 'y', 'x') resulting in a tensor of equal shape normalized per channel, specify axes=('batch', 'x', 'y'). To normalize samples independently, leave out the 'batch' axis. Default: Scale all axes jointly.

Default: null
Examples: ["batch","x","y"]
eps number

Epsilon for numeric stability: out = (tensor - mean) / (std + eps) * (ref_std + eps) + ref_mean.

Default: 1e-6
max=0.1exclusiveMin=0
bioimageio__spec__model__v0_5__ScaleMeanVarianceKwargs object

key word arguments for ScaleMeanVarianceKwargs

reference_tensor string required

ID of unprocessed input tensor to match.

minLength=1maxLength=32
axes string[] | null

The subset of axes to normalize jointly, i.e. axes to reduce to compute mean/std. For example to normalize 'batch', 'x' and 'y' jointly in a tensor ('batch', 'channel', 'y', 'x') resulting in a tensor of equal shape normalized per channel, specify axes=('batch', 'x', 'y'). To normalize samples independently, leave out the 'batch' axis. Default: Scale all axes jointly.

Default: null
Examples: ["batch","x","y"]
eps number

Epsilon for numeric stability: out = (tensor - mean) / (std + eps) * (ref_std + eps) + ref_mean.

Default: 1e-6
max=0.1exclusiveMin=0
bioimageio__spec__model__v0_5__ScaleRangeDescr object

Scale with percentiles.

Examples:

  1. Scale linearly to map 5th percentile to 0 and 99.8th percentile to 1.0

    • in YAML
    preprocessing:
      - id: scale_range
        kwargs:
          axes: ['y', 'x']
          max_percentile: 99.8
          min_percentile: 5.0
    
    • in Python

    preprocessing = [ ... ScaleRangeDescr( ... kwargs=ScaleRangeKwargs( ... axes= (AxisId('y'), AxisId('x')), ... max_percentile= 99.8, ... min_percentile= 5.0, ... ) ... ) ... ]

  2. Combine the above scaling with additional clipping to clip values outside the range given by the percentiles. - in YAML ```yaml preprocessing:

    • id: scale_range kwargs: axes: ['y', 'x'] max_percentile: 99.8 min_percentile: 5.0
    • id: clip kwargs: min: 0.0 max: 1.0 ``` - in Python
>>> preprocessing = [
...   ScaleRangeDescr(
...     kwargs=ScaleRangeKwargs(
...       axes= (AxisId('y'), AxisId('x')),
...       max_percentile= 99.8,
...       min_percentile= 5.0,
...     )
...   ),
...   ClipDescr(
...     kwargs=ClipKwargs(
...       min=0.0,
...       max=1.0,
...     )
...   ),
... ]
id string required
Constant: "scale_range"
kwargs object

key word arguments for ScaleRangeDescr

For min_percentile=0.0 (the default) and max_percentile=100 (the default) this processing step normalizes data to the [0, 1] intervall. For other percentiles the normalized values will partially be outside the [0, 1] intervall. Use ScaleRange followed by ClipDescr if you want to limit the normalized values to a range.

5 nested properties
axes string[] | null

The subset of axes to normalize jointly, i.e. axes to reduce to compute the min/max percentile value. For example to normalize 'batch', 'x' and 'y' jointly in a tensor ('batch', 'channel', 'y', 'x') resulting in a tensor of equal shape normalized per channel, specify axes=('batch', 'x', 'y'). To normalize samples independently, leave out the "batch" axis. Default: Scale all axes jointly.

Default: null
Examples: ["batch","x","y"]
min_percentile number

The lower percentile used to determine the value to align with zero.

Default: 0.0
min=0exclusiveMax=100
max_percentile number

The upper percentile used to determine the value to align with one. Has to be bigger than min_percentile. The range is 1 to 100 instead of 0 to 100 to avoid mistakenly accepting percentiles specified in the range 0.0 to 1.0.

Default: 100.0
max=100exclusiveMin=1
eps number

Epsilon for numeric stability. out = (tensor - v_lower) / (v_upper - v_lower + eps); with v_lower,v_upper values at the respective percentiles.

Default: 1e-6
max=0.1exclusiveMin=0
reference_tensor string | null

ID of the unprocessed input tensor to compute the percentiles from. Default: The tensor itself.

Default: null
bioimageio__spec__model__v0_5__ScaleRangeKwargs object

key word arguments for ScaleRangeDescr

For min_percentile=0.0 (the default) and max_percentile=100 (the default) this processing step normalizes data to the [0, 1] intervall. For other percentiles the normalized values will partially be outside the [0, 1] intervall. Use ScaleRange followed by ClipDescr if you want to limit the normalized values to a range.

axes string[] | null

The subset of axes to normalize jointly, i.e. axes to reduce to compute the min/max percentile value. For example to normalize 'batch', 'x' and 'y' jointly in a tensor ('batch', 'channel', 'y', 'x') resulting in a tensor of equal shape normalized per channel, specify axes=('batch', 'x', 'y'). To normalize samples independently, leave out the "batch" axis. Default: Scale all axes jointly.

Default: null
Examples: ["batch","x","y"]
min_percentile number

The lower percentile used to determine the value to align with zero.

Default: 0.0
min=0exclusiveMax=100
max_percentile number

The upper percentile used to determine the value to align with one. Has to be bigger than min_percentile. The range is 1 to 100 instead of 0 to 100 to avoid mistakenly accepting percentiles specified in the range 0.0 to 1.0.

Default: 100.0
max=100exclusiveMin=1
eps number

Epsilon for numeric stability. out = (tensor - v_lower) / (v_upper - v_lower + eps); with v_lower,v_upper values at the respective percentiles.

Default: 1e-6
max=0.1exclusiveMin=0
reference_tensor string | null

ID of the unprocessed input tensor to compute the percentiles from. Default: The tensor itself.

Default: null
bioimageio__spec__model__v0_5__SigmoidDescr object

The logistic sigmoid function, a.k.a. expit function.

Examples:

  • in YAML

    postprocessing:
      - id: sigmoid
    
  • in Python:

    postprocessing = [SigmoidDescr()]

id string required
Constant: "sigmoid"
bioimageio__spec__model__v0_5__TensorflowJsWeightsDescr object
source string | RelativeFilePath | string required

The multi-file weights. All required files/folders should be a zip archive.

tensorflow_version string | integer | number required

wraps a packaging.version.Version instance for validation in pydantic models

sha256 string | null

SHA256 hash value of the source file.

Default: null

Authors Either the person(s) that have trained this model resulting in the original weights file. (If this is the initial weights entry, i.e. it does not have a parent) Or the person(s) who have converted the weights to this weights format. (If this is a child weight, i.e. it has a parent field)

Default: null
parent string | null

The source weights these weights were converted from. For example, if a model's weights were converted from the pytorch_state_dict format to torchscript, The pytorch_state_dict weights entry has no parent and is the parent of the torchscript weights. All weight entries except one (the initial set of weights resulting from training the model), need to have this field.

Default: null
Examples: "pytorch_state_dict"
comment string

A comment about this weights entry, for example how these weights were created.

Default: ""
bioimageio__spec__model__v0_5__TensorflowSavedModelBundleWeightsDescr object
source string | RelativeFilePath | string required

The multi-file weights. All required files/folders should be a zip archive.

tensorflow_version string | integer | number required

wraps a packaging.version.Version instance for validation in pydantic models

sha256 string | null

SHA256 hash value of the source file.

Default: null

Authors Either the person(s) that have trained this model resulting in the original weights file. (If this is the initial weights entry, i.e. it does not have a parent) Or the person(s) who have converted the weights to this weights format. (If this is a child weight, i.e. it has a parent field)

Default: null
parent string | null

The source weights these weights were converted from. For example, if a model's weights were converted from the pytorch_state_dict format to torchscript, The pytorch_state_dict weights entry has no parent and is the parent of the torchscript weights. All weight entries except one (the initial set of weights resulting from training the model), need to have this field.

Default: null
Examples: "pytorch_state_dict"
comment string

A comment about this weights entry, for example how these weights were created.

Default: ""
dependencies FileDescr | null

Custom dependencies beyond tensorflow. Should include tensorflow and any version pinning has to be compatible with tensorflow_version.

Default: null
bioimageio__spec__model__v0_5__TorchscriptWeightsDescr object
source string | RelativeFilePath | string required

Source of the weights file.

pytorch_version string | integer | number required

wraps a packaging.version.Version instance for validation in pydantic models

sha256 string | null

SHA256 hash value of the source file.

Default: null

Authors Either the person(s) that have trained this model resulting in the original weights file. (If this is the initial weights entry, i.e. it does not have a parent) Or the person(s) who have converted the weights to this weights format. (If this is a child weight, i.e. it has a parent field)

Default: null
parent string | null

The source weights these weights were converted from. For example, if a model's weights were converted from the pytorch_state_dict format to torchscript, The pytorch_state_dict weights entry has no parent and is the parent of the torchscript weights. All weight entries except one (the initial set of weights resulting from training the model), need to have this field.

Default: null
Examples: "pytorch_state_dict"
comment string

A comment about this weights entry, for example how these weights were created.

Default: ""
bioimageio__spec__model__v0_5__WeightsDescr object
keras_v3 KerasV3WeightsDescr | null
Default: null
Default: null
Default: null
Default: null
bioimageio__spec__model__v0_5__ZeroMeanUnitVarianceDescr object

Subtract mean and divide by variance.

Examples: Subtract tensor mean and variance - in YAML yaml preprocessing: - id: zero_mean_unit_variance - in Python >>> preprocessing = [ZeroMeanUnitVarianceDescr()]

id string required
Constant: "zero_mean_unit_variance"
kwargs object

key word arguments for ZeroMeanUnitVarianceDescr

2 nested properties
axes string[] | null

The subset of axes to normalize jointly, i.e. axes to reduce to compute mean/std. For example to normalize 'batch', 'x' and 'y' jointly in a tensor ('batch', 'channel', 'y', 'x') resulting in a tensor of equal shape normalized per channel, specify axes=('batch', 'x', 'y'). To normalize each sample independently leave out the 'batch' axis. Default: Scale all axes jointly.

Default: null
Examples: ["batch","x","y"]
eps number

epsilon for numeric stability: out = (tensor - mean) / (std + eps).

Default: 1e-6
max=0.1exclusiveMin=0
bioimageio__spec__model__v0_5__ZeroMeanUnitVarianceKwargs object

key word arguments for ZeroMeanUnitVarianceDescr

axes string[] | null

The subset of axes to normalize jointly, i.e. axes to reduce to compute mean/std. For example to normalize 'batch', 'x' and 'y' jointly in a tensor ('batch', 'channel', 'y', 'x') resulting in a tensor of equal shape normalized per channel, specify axes=('batch', 'x', 'y'). To normalize each sample independently leave out the 'batch' axis. Default: Scale all axes jointly.

Default: null
Examples: ["batch","x","y"]
eps number

epsilon for numeric stability: out = (tensor - mean) / (std + eps).

Default: 1e-6
max=0.1exclusiveMin=0
bioimageio__spec__notebook__v0_2__NotebookDescr object

Bioimage.io description of a Jupyter Notebook.

name string required

A human-friendly name of the resource description

minLength=1
description string required
format_version string required

The format version of this resource specification (not the version of the resource description) When creating a new resource always use the latest micro/patch version described here. The format_version is important for any consumer software to understand how to parse the fields.

Constant: "0.2.4"
type string required
Constant: "notebook"
source string | string | RelativeFilePath required

The Jupyter notebook

covers string | RelativeFilePath | string[]

Cover images. Please use an image smaller than 500KB and an aspect ratio width to height of 2:1. The supported image formats are: ('.gif', '.jpeg', '.jpg', '.png', '.svg', '.tif', '.tiff')

Examples: ["cover.png"]
id_emoji string | null

UTF-8 emoji for display alongside the id.

Default: null

The authors are the creators of the RDF and the primary points of contact.

attachments AttachmentsDescr | null

file and other attachments

Default: null

A field for custom configuration that can contain any keys not present in the RDF spec. This means you should not store, for example, a github repo URL in config since we already have the git_repo field defined in the spec. Keys in config may be very specific to a tool or consumer software. To avoid conflicting definitions, it is recommended to wrap added configuration into a sub-field named with the specific domain or tool name, for example:

config:
    bioimageio:  # here is the domain name
        my_custom_key: 3837283
        another_key:
            nested: value
    imagej:       # config specific to ImageJ
        macro_dir: path/to/macro/file

If possible, please use snake_case for keys in config. You may want to list linked files additionally under attachments to include them when packaging a resource (packaging a resource means downloading/copying important linked files and creating a ZIP archive that contains an altered rdf.yaml file with local references to the downloaded files)

Examples: {"bioimageio":{"another_key":{"nested":"value"},"my_custom_key":3837283},"imagej":{"macro_dir":"path/to/macro/file"}}
download_url string | null

URL to download the resource from (deprecated)

Default: null
git_repo string | null

A URL to the Git repository where the resource is being developed.

Default: null
Examples: "https://github.com/bioimage-io/spec-bioimage-io/tree/main/example_descriptions/models/unet2d_nuclei_broad"
icon string | string | RelativeFilePath | string | null

An icon for illustration

Default: null
links string[]

IDs of other bioimage.io resources

Examples: ["ilastik/ilastik","deepimagej/deepimagej","zero/notebook_u-net_3d_zerocostdl4mic"]
uploader Uploader | null

The person who uploaded the model (e.g. to bioimage.io)

Default: null

Maintainers of this resource. If not specified authors are maintainers and at least some of them should specify their github_user name

rdf_source string | RelativeFilePath | string | null

Resource description file (RDF) source; used to keep track of where an rdf.yaml was loaded from. Do not set this field in a YAML file.

Default: null
tags string[]

Associated tags

Examples: ["unet2d","pytorch","nucleus","segmentation","dsb2018"]
version Version | null

The version of the resource following SemVer 2.0.

Default: null
version_number integer | null

version number (n-th published version, not the semantic version)

Default: null
badges BadgeDescr[]

badges associated with this resource

documentation string | RelativeFilePath | string | null

URL or relative path to a markdown file with additional documentation. The recommended documentation file name is README.md. An .md suffix is mandatory.

Default: null
Examples: "https://raw.githubusercontent.com/bioimage-io/spec-bioimage-io/main/example_descriptions/models/unet2d_nuclei_broad/README.md", "README.md"
license string | string | string | null

A SPDX license identifier. We do not support custom license beyond the SPDX license list, if you need that please open a GitHub issue to discuss your intentions with the community.

Default: null
Examples: "CC0-1.0", "MIT", "BSD-2-Clause"
id string | null

bioimage.io-wide unique resource identifier assigned by bioimage.io; version unspecific.

Default: null
bioimageio__spec__notebook__v0_3__NotebookDescr object

Bioimage.io description of a Jupyter notebook.

name string required

A human-friendly name of the resource description. May only contains letters, digits, underscore, minus, parentheses and spaces.

minLength=5maxLength=128
format_version string required

The format version of this resource specification

Constant: "0.3.0"
type string required
Constant: "notebook"
source string | string | RelativeFilePath required

The Jupyter notebook

description string

A string containing a brief description.

Default: ""
maxLength=1024
covers string | RelativeFilePath | string[]

Cover images. Please use an image smaller than 500KB and an aspect ratio width to height of 2:1 or 1:1. The supported image formats are: ('.gif', '.jpeg', '.jpg', '.png', '.svg')

Examples: ["cover.png"]
id_emoji string | null

UTF-8 emoji for display alongside the id.

Default: null

The authors are the creators of this resource description and the primary points of contact.

attachments FileDescr[]

file attachments

license string | string | null

A SPDX license identifier. We do not support custom license beyond the SPDX license list, if you need that please open a GitHub issue to discuss your intentions with the community.

Default: null
Examples: "CC0-1.0", "MIT", "BSD-2-Clause"
git_repo string | null

A URL to the Git repository where the resource is being developed.

Default: null
Examples: "https://github.com/bioimage-io/spec-bioimage-io/tree/main/example_descriptions/models/unet2d_nuclei_broad"
icon string | string | RelativeFilePath | string | null

An icon for illustration, e.g. on bioimage.io

Default: null
links string[]

IDs of other bioimage.io resources

Examples: ["ilastik/ilastik","deepimagej/deepimagej","zero/notebook_u-net_3d_zerocostdl4mic"]
uploader Uploader | null

The person who uploaded the model (e.g. to bioimage.io)

Default: null

Maintainers of this resource. If not specified, authors are maintainers and at least some of them has to specify their github_user name

tags string[]

Associated tags

Examples: ["unet2d","pytorch","nucleus","segmentation","dsb2018"]
version Version | null

The version of the resource following SemVer 2.0.

Default: null
version_comment string | null

A comment on the version of the resource.

Default: null
documentation string | RelativeFilePath | string | null

URL or relative path to a markdown file encoded in UTF-8 with additional documentation. The recommended documentation file name is README.md. An .md suffix is mandatory.

Default: null
badges BadgeDescr[]

badges associated with this resource

config object

A place to store additional metadata (often tool specific).

Such additional metadata is typically set programmatically by the respective tool or by people with specific insights into the tool. If you want to store additional metadata that does not match any of the other fields, think of a key unlikely to collide with anyone elses use-case/tool and save it here.

Please consider creating an issue in the bioimageio.spec repository if you are not sure if an existing field could cover your use case or if you think such a field should exist.

1 nested properties
bioimageio object

bioimage.io internal metadata.

id string | null

bioimage.io-wide unique resource identifier assigned by bioimage.io; version unspecific.

Default: null
parent string | null

The description from which this one is derived

Default: null