---
title: "Keras metadata"
method: GET
path: "/api/{projectId}/training/keras/{learnId}/metadata"
tags: ["Learn"]
---

# Keras metadata

`GET /api/{projectId}/training/keras/{learnId}/metadata`

## Request

- Base URL: `https://studio.edgeimpulse.com/v1`
- URL: `https://studio.edgeimpulse.com/v1/api/{projectId}/training/keras/{learnId}/metadata`
- Auth: one of:
  - API key in header `x-api-key`
  - API key in cookie `jwt`
  - API key in header `x-jwt-token`
  - OAuth 2
    - Authorization code: `/v1/oauth/authorize`
    - Client credentials
    - Implicit: `/v1/oauth/authorize`
    - Password
    - Token URL: `/v1/oauth/token`
- TypeScript: <https://skmtc.dev/edgeimpulse/apis/edge-impulse-api/docs/api/:projectId/training/keras/:learnId/metadata/get.ts> (a function with typed inputs; its response is checked against the schema)

Get metadata about a trained Keras block. Use the impulse blocks to find the learnId.

## Path parameters

- `projectId` integer, required
- `learnId` integer, required

## Query parameters

- `excludeLabels` boolean

## Response `200`

OK

- KerasModelMetadataResponse
  - `success` boolean, required: Whether the operation succeeded
  - `error` string: Optional error description (set if 'success' was false)
  - `created` string, date-time, required: Date when the model was trained
  - `layers` KerasModelLayer[], required: Layers of the neural network
    - `input` object, required
      - `shape` integer, required: Input size
      - `name` string, required: TensorFlow name
      - `type` string, required: TensorFlow type
    - `output` object, required
      - `shape` integer, required: Output size
      - `name` string, required: TensorFlow name
      - `type` string, required: TensorFlow type
  - `classNames` string[], required: Labels for the output layer
  - `labels` string[], required: Original labels in the dataset when features were generated, e.g. used to render the feature explorer.
  - `availableModelTypes` KerasModelTypeEnum[], required: The types of model that are available
  - `recommendedModelType` 'int8' | 'float32' | 'akida' | 'requiresRetrain', required
  - `modelValidationMetrics` KerasModelMetadataMetrics[], required: Metrics for each of the available model types
    - `type` 'int8' | 'float32' | 'akida' | 'requiresRetrain', required
    - `loss` number, required: The model's loss on the validation set after training
    - `accuracy` number: The model's accuracy on the validation set after training
    - `confusionMatrix` array[], required
      - number[]
    - `report` object, required: Precision, recall, F1 and support scores
    - `onDevicePerformance` object[], required
      - `mcu` string, required
      - `name` string, required
      - `isDefault` boolean, required
      - `latency` number, required
      - `tflite` object, required
        - `ramRequired` integer, required
        - `romRequired` integer, required
        - `arenaSize` integer, required
        - `modelSize` integer, required
      - `eon` object, required
        - `ramRequired` integer, required
        - `romRequired` integer, required
        - `arenaSize` integer, required
        - `modelSize` integer, required
      - `eon_ram_optimized` object
        - `ramRequired` integer, required
        - `romRequired` integer, required
        - `arenaSize` integer, required
        - `modelSize` integer, required
      - `customMetrics` KerasCustomMetric[]: Custom, device-specific performance metrics
        - `name` string, required: The name of the metric
        - `value` string, required: The value of this metric for this model type
      - `hasPerformance` boolean, required: If false, then no metrics are available for this target
      - `profilingError` string: Specific error during profiling (e.g. model not supported)
    - `predictions` ModelPrediction[]
      - `sampleId` integer, required
      - `startMs` number, required
      - `endMs` number, required
      - `label` string
      - `prediction` string, required
      - `predictionCorrect` boolean
      - `expectedAnomalyOutcome` string: Only set for anomaly detection projects. The expected anomaly outcome for this window — either “anomaly” or “no anomaly”. The outcome is determined by which labels are marked as anomalous in the project setup, or by the sample label if no such configuration is defined.
      - `f1Score` number: Only set for object detection projects
      - `anomalyScores` array[]: Only set for visual anomaly projects. 2D array of shape (n, n) with raw anomaly scores, where n varies based on the image input size and the specific visual anomaly algorithm used. The scores corresponds to each grid cell in the image's spatial matrix.
        - number[]
      - `boundingBoxes` BoundingBoxWithScore[]: Only set for object detection projects. Coordinates are scaled 0..1, not absolute values.
        - `label` string, required
        - `x` number, required
        - `y` number, required
        - `width` number, required
        - `height` number, required
        - `score` number, required
      - `labelMapPredictions` object: For samples with structured labels (in the form of a key/value label map), this object will contain per-key prediction info for the sample.
    - `visualization` 'featureExplorer' | 'dataExplorer' | 'none', required
    - `isSupportedOnMcu` boolean, required
    - `mcuSupportError` string
    - `profilingJobId` integer: If this is set, then we're still profiling this model. Subscribe to job updates to see when it's done (afterward the metadata will be updated).
    - `profilingJobFailed` boolean: If this is set, then the profiling job failed (get the status by getting the job logs for 'profilingJobId').
    - `additionalMetrics` AdditionalMetric[], required
      - `name` string, required
      - `value` string, required
      - `fullPrecisionValue` number, required
      - `tooltipText` string
      - `link` string
  - `hasTrainedModel` boolean, required
  - `mode` 'classification' | 'regression' | 'object-detection' | 'visual-anomaly' | 'anomaly-gmm' | 'freeform' | 'anomaly', required
  - `objectDetectionLastLayer` 'mobilenet-ssd' | 'fomo' | 'yolov2-akida' | 'yolov5' | 'yolov5v5-drpai' | 'yolox' | 'yolov7' | 'yolo-pro' | 'tao-retinanet' | 'tao-ssd' | 'tao-yolov3' | 'tao-yolov4' | 'yolov11' | 'yolov11-abs' | 'paddleocr-detector' | 'qc-face-det-lite' | 'qc-yolox'
  - `imageInputScaling` '0..1' | '-1..1' | '-128..127' | '0..255' | 'torch' | 'bgr-subtract-imagenet-mean', required: Normalization that is applied to images. If this is not set then 0..1 is used. "0..1" gives you non-normalized pixels between 0 and 1. "-1..1" gives you non-normalized pixels between -1 and 1. "0..255" gives you non-normalized pixels between 0 and 255. "-128..127" gives you non-normalized pixels between -128 and 127. "torch" first scales pixels between 0 and 1, then applies normalization using the ImageNet dataset (same as `torchvision.transforms.Normalize()`). "bgr-subtract-imagenet-mean" scales to 0..255, reorders pixels to BGR, and subtracts the ImageNet mean from each channel.
  - `thresholds` BlockThreshold[], required: List of configurable thresholds for this block.
    - `key` string, required: Identifier to reference the threshold. You'll need to refer to the threshold by this key when you set the threshold).
    - `description` string, required: User-friendly description of the threshold.
    - `helpText` string, required: Additional help text (shown in the UI under a "?" icon)
    - `suggestedValue` number: If the threshold has a suggested value, e.g. a max. absolute error for regression projects; or the min. anomaly score for visual anomaly detection, then this is the numeric value of that threshold.
    - `suggestedValueText` string: If the threshold has a suggested value, e.g. a max. absolute error for regression projects; or the min. anomaly score for visual anomaly detection, then this is the stringified value of that threshold.
    - `value` union, required: Current value of the threshold
      - number
      - string
    - `dropdownOptions` object[]: Optional list of options, will be shown in a dropdown.
      - `description` string, required: Full description of the value
      - `value` string, required: Value, maps back to "BlockThreshold#value"
  - `tensorboardGraphs` KerasModelMetadataGraph[]
    - `title` string, required: Graph title
    - `xLabel` string: X-axis title
    - `yLabel` string: Y-axis title
    - `description` string: A description for the graph
    - `hideInUI` boolean: Whether this graph should be hidden by default in the Studio UI
    - `data` KerasModelMetadataGraphSeries[], required
      - `title` string, required
      - `values` number[], required
  - `kFoldsMetadata` KFoldsMetadata
    - `folds` FoldModelMetadata[], required
      - `created` string, date-time, required: Date when the model was trained
      - `layers` KerasModelLayer[], required: Layers of the neural network
        - `input` object, required
          - `shape` integer, required: Input size
          - `name` string, required: TensorFlow name
          - `type` string, required: TensorFlow type
        - `output` object, required
          - `shape` integer, required: Output size
          - `name` string, required: TensorFlow name
          - `type` string, required: TensorFlow type
      - `classNames` string[], required: Labels for the output layer
      - `labels` string[], required: Original labels in the dataset when features were generated, e.g. used to render the feature explorer.
      - `availableModelTypes` KerasModelTypeEnum[], required: The types of model that are available
      - `recommendedModelType` 'int8' | 'float32' | 'akida' | 'requiresRetrain', required
      - `modelValidationMetrics` KerasModelMetadataMetrics[], required: Metrics for each of the available model types
        - `type` 'int8' | 'float32' | 'akida' | 'requiresRetrain', required
        - `loss` number, required: The model's loss on the validation set after training
        - `accuracy` number: The model's accuracy on the validation set after training
        - `confusionMatrix` array[], required
          - number[]
        - `report` object, required: Precision, recall, F1 and support scores
        - `onDevicePerformance` object[], required
          - `mcu` string, required
          - `name` string, required
          - `isDefault` boolean, required
          - `latency` number, required
          - `tflite` object, required
            - `ramRequired` integer, required
            - `romRequired` integer, required
            - `arenaSize` integer, required
            - `modelSize` integer, required
          - `eon` object, required
            - `ramRequired` integer, required
            - `romRequired` integer, required
            - `arenaSize` integer, required
            - `modelSize` integer, required
          - `eon_ram_optimized` object
            - `ramRequired` integer, required
            - `romRequired` integer, required
            - `arenaSize` integer, required
            - `modelSize` integer, required
          - `customMetrics` KerasCustomMetric[]: Custom, device-specific performance metrics
            - `name` string, required: The name of the metric
            - `value` string, required: The value of this metric for this model type
          - `hasPerformance` boolean, required: If false, then no metrics are available for this target
          - `profilingError` string: Specific error during profiling (e.g. model not supported)
        - `predictions` ModelPrediction[]
          - `sampleId` integer, required
          - `startMs` number, required
          - `endMs` number, required
          - `label` string
          - `prediction` string, required
          - `predictionCorrect` boolean
          - `expectedAnomalyOutcome` string: Only set for anomaly detection projects. The expected anomaly outcome for this window — either “anomaly” or “no anomaly”. The outcome is determined by which labels are marked as anomalous in the project setup, or by the sample label if no such configuration is defined.
          - `f1Score` number: Only set for object detection projects
          - `anomalyScores` array[]: Only set for visual anomaly projects. 2D array of shape (n, n) with raw anomaly scores, where n varies based on the image input size and the specific visual anomaly algorithm used. The scores corresponds to each grid cell in the image's spatial matrix.
            - number[]
          - `boundingBoxes` BoundingBoxWithScore[]: Only set for object detection projects. Coordinates are scaled 0..1, not absolute values.
            - `label` string, required
            - `x` number, required
            - `y` number, required
            - `width` number, required
            - `height` number, required
            - `score` number, required
          - `labelMapPredictions` object: For samples with structured labels (in the form of a key/value label map), this object will contain per-key prediction info for the sample.
        - `visualization` 'featureExplorer' | 'dataExplorer' | 'none', required
        - `isSupportedOnMcu` boolean, required
        - `mcuSupportError` string
        - `profilingJobId` integer: If this is set, then we're still profiling this model. Subscribe to job updates to see when it's done (afterward the metadata will be updated).
        - `profilingJobFailed` boolean: If this is set, then the profiling job failed (get the status by getting the job logs for 'profilingJobId').
        - `additionalMetrics` AdditionalMetric[], required
          - `name` string, required
          - `value` string, required
          - `fullPrecisionValue` number, required
          - `tooltipText` string
          - `link` string
      - `hasTrainedModel` boolean, required
      - `mode` 'classification' | 'regression' | 'object-detection' | 'visual-anomaly' | 'anomaly-gmm' | 'freeform' | 'anomaly', required
      - `objectDetectionLastLayer` 'mobilenet-ssd' | 'fomo' | 'yolov2-akida' | 'yolov5' | 'yolov5v5-drpai' | 'yolox' | 'yolov7' | 'yolo-pro' | 'tao-retinanet' | 'tao-ssd' | 'tao-yolov3' | 'tao-yolov4' | 'yolov11' | 'yolov11-abs' | 'paddleocr-detector' | 'qc-face-det-lite' | 'qc-yolox'
      - `imageInputScaling` '0..1' | '-1..1' | '-128..127' | '0..255' | 'torch' | 'bgr-subtract-imagenet-mean', required: Normalization that is applied to images. If this is not set then 0..1 is used. "0..1" gives you non-normalized pixels between 0 and 1. "-1..1" gives you non-normalized pixels between -1 and 1. "0..255" gives you non-normalized pixels between 0 and 255. "-128..127" gives you non-normalized pixels between -128 and 127. "torch" first scales pixels between 0 and 1, then applies normalization using the ImageNet dataset (same as `torchvision.transforms.Normalize()`). "bgr-subtract-imagenet-mean" scales to 0..255, reorders pixels to BGR, and subtracts the ImageNet mean from each channel.
      - `thresholds` BlockThreshold[], required: List of configurable thresholds for this block.
        - `key` string, required: Identifier to reference the threshold. You'll need to refer to the threshold by this key when you set the threshold).
        - `description` string, required: User-friendly description of the threshold.
        - `helpText` string, required: Additional help text (shown in the UI under a "?" icon)
        - `suggestedValue` number: If the threshold has a suggested value, e.g. a max. absolute error for regression projects; or the min. anomaly score for visual anomaly detection, then this is the numeric value of that threshold.
        - `suggestedValueText` string: If the threshold has a suggested value, e.g. a max. absolute error for regression projects; or the min. anomaly score for visual anomaly detection, then this is the stringified value of that threshold.
        - `value` union, required: Current value of the threshold
          - number
          - string
        - `dropdownOptions` object[]: Optional list of options, will be shown in a dropdown.
          - `description` string, required: Full description of the value
          - `value` string, required: Value, maps back to "BlockThreshold#value"
      - `tensorboardGraphs` KerasModelMetadataGraph[]
        - `title` string, required: Graph title
        - `xLabel` string: X-axis title
        - `yLabel` string: Y-axis title
        - `description` string: A description for the graph
        - `hideInUI` boolean: Whether this graph should be hidden by default in the Studio UI
        - `data` KerasModelMetadataGraphSeries[], required
          - `title` string, required
          - `values` number[], required
      - `foldId` integer, required: A zero-indexed fold identifier
      - `foldName` string, required: A one-indexed human-frendly fold name
    - `hasFinalRun` boolean: Set to true when the k-fold run includes a final-pass on all training data.
    - `persistedFoldId` integer, required: A zero-indexed identifier for the selected downstream fold (set to -1 if final run)
    - `persistedFoldName` string, required: A one-indexed human-friendly fold name of the selected downstream fold
    - `persistedFoldMetricType` 'int8' | 'float32' | 'akida' | 'requiresRetrain'

---

[API](https://skmtc.dev/edgeimpulse/apis/edge-impulse-api.md) - [All operations](https://skmtc.dev/edgeimpulse/apis/edge-impulse-api/llms.txt) - [OpenAPI document](https://skmtc.dev/edgeimpulse/apis/edge-impulse-api/revisions/e2a976d38427?raw)
