softmax_temperature

Updated: 28-6-2023
Experimental

Experimental: parameter and/or its behaviour may change or be removed without notification. Please contact for more information.

A float value that influences the confidence of predictions. Increasing the value reduces confidence, while decreasing it increases confidence.

The optimal value will give the best calibration of the model. A model that is correctly calibrated provides probabilities matching the real-world accuracy of predictions. The optimal value is dependent on which specialized model is used.

Example use

Get test image

Requires curl and jq.

curl \                                                                                                                                                                                        11:28:18
    -X POST \
    -F "image=@buteo2.jpg" \
    -F "softmax_temperature=1.75" \
    "https://multi-source.identify.biodiversityanalysis.eu/v2/observation/identify" | \
jq
import json

import requests


def example_request():
    url = (
        "https://multi-source.identify."
        "biodiversityanalysis.eu/v2/"
        "observation/identify"
    )
    test_image = "buteo2.jpg"
    data = {"softmax_temperature": 1.75}

    with open(test_image, "rb") as image:
        response = requests.post(
            url=url,
            files={"image": image},
            data=data,
        )
    return response.json()


if __name__ == "__main__":
    json_response = example_request()
    print(json.dumps(json_response, indent=2))

Requires the Python requests library. Available with pip install requests.

{
  "api_implementation": {
    "tag": "api-v2:2.1.0-20230616",
    "version": "49476035"
  },
  "generated_by": {
    "datetime": "2023-09-13T09:30:43.939139",
    "parameters": {},
    "tag": "algorithm=msm-eur:1.1-20230619,api=api-v2:2.1.0-20230616",
    "version": "algorithm=df722733dc3eb9647870d237c918cecd0d8aabeb,api=49476035"
  },
  "identification": {
    "image": {
      "confidence": "confident"
    }
  },
  "links": {
    "taxa": {
      "url": "v2/taxa/main_order"
    },
    "taxa_with_filter": {
      "url": "v2/taxa/main_order?id={taxon_id}"
    }
  },
  "media": [
    {
      "filename": "buteo2",
      "id": "image0"
    }
  ],
  "model_implementation": {
    "algorithm_tag": "msm-eur:1.1-20230619",
    "tag": "main_order",
    "version": "df722733dc3eb9647870d237c918cecd0d8aabeb"
  },
  "predictions": [
    {
      "region_group_id": "image0?region=full",
      "taxa": {
        "items": [
          {
            "probability": 0.996807,
            "scientific_name": "Buteo buteo",
            "scientific_name_id": "GBIF:2480537"
          },
          {
            "probability": 0.001399,
            "scientific_name": "Falco rusticolus",
            "scientific_name_id": "GBIF:8069880"
          },
          {
            "probability": 0.000341,
            "scientific_name": "Buteo buteo insularum",
            "scientific_name_id": "GBIF:5844379"
          },
          {
            "probability": 0.000334,
            "scientific_name": "Buteo buteo buteo",
            "scientific_name_id": "GBIF:7191157"
          },
          {
            "probability": 0.000242,
            "scientific_name": "Accipiter gentilis",
            "scientific_name_id": "GBIF:2480589"
          },
          {
            "probability": 8.7e-5,
            "scientific_name": "Haliaeetus albicilla",
            "scientific_name_id": "GBIF:2480449"
          },
          {
            "probability": 5.5e-5,
            "scientific_name": "Buteo buteo vulpinus",
            "scientific_name_id": "GBIF:5844375"
          },
          {
            "probability": 5e-5,
            "scientific_name": "Anser albifrons albifrons",
            "scientific_name_id": "GBIF:7191107"
          },
          {
            "probability": 4.7e-5,
            "scientific_name": "Sorex araneus/coronatus",
            "scientific_name_id": "NIA:fb23df20659b7b164bb3995b853b26931f80ae87f0b2edab4f0e51d7"
          },
          {
            "probability": 4.4e-5,
            "scientific_name": "Podiceps nigricollis",
            "scientific_name_id": "GBIF:2482065"
          }
        ],
        "type": "multiclass"
      }
    }
  ],
  "region_groups": [
    {
      "id": "image0?region=full",
      "individual_id": "individual0",
      "regions": [
        {
          "box": {
            "x1": 0.166875,
            "x2": 0.833125,
            "y1": 0.0,
            "y2": 1.0
          },
          "id": "image0?region=full",
          "media_id": "image0"
        }
      ]
    }
  ]
}