You can classify an image either from a file or a URL.
This section explains how to make a request using a file. For a URL, the process is similar, with the main difference being the endpoint to call in step 1.

Submission guidelines

Given the highly variable nature of images, it is recommended to follow these simple guidelines:
  • Send the “closest” image to the source to the system: this means, for example, not sending screenshots or photos of screens.
  • Image analysis models are not currently trained to recognize photos of documents: therefore, the result, in case of submission of images of that type, is not reliable.
  • In the case of images taken from social media, the most accurate results are obtained by sending images without overlaid texts or modifications typical of social sharing.
  • If available from other sources, avoid submitting social links due to the post-processing of various platforms.

Submit an image using the API

To classify an image, you need to make a POST request to /api/classification with the required parameters (for details on the parameters, refer to the API Reference section).
curl --request POST \
  --url https://backend.identifai.net/api/classification \
  --header 'Content-Type: multipart/form-data' \
  --header 'X-Api-Key: <api-key>' \
  --header 'Accept: application/json' \
  --form "image=@/path/to/sample.jpg" \
  --form with_morphing=false\
  --form with_tampering=false
In response you will receive the identifier of the classified image.

Retrieve the results

Use the provided identifier to retrieve the classification results by making a GET request to /api/classification/{identifier} (for details on how to structure this request, see the API Reference section).
curl --request GET \
  --url https://backend.identifai.net/api/classification/{identifier} \
  --header 'X-Api-Key: <api-key>'
The response will contain the classification results for the image in JSON format. In the response, you will find a results array, which includes the classification results for each model used, and a verdicts array, which contains the results for each heuristic applied.
The classification may not be finished yet! If the classification is not yet complete, continue sending the GET request until the result is available.

Heatmap

he heatmap functionality (provided by the Ardē model) aims to assist in analyzing image details. An image submitted without a heatmap might be detected as human, while an analysis of the same image with a heatmap could highlight artificial traits. This is due to how the models interpret the images provided as input. If the heatmap is available for your user, you can request the heatmap analysis by providing the argument with_heatmap=true
curl --request POST \
  --url https://backend.identifai.net/api/classification \
  --header 'Content-Type: multipart/form-data' \
  --header 'X-Api-Key: <api-key>' \
  --header 'Accept: application/json' \
  --form "image=@/path/to/sample.jpg" \
  --form with_heatmap=true \
  --form with_morphing=false \
  --form with_tampering=false
The heatmap computation will take a while. Upon completion, the result will also include a model named Ardē:
{
  "results": {
      "model": "Ardē",
      "unknown": false,
      "elapsed_time": 5.606042385101318,
      "classification": [
        {
          "label": "human",
          "score": 0.8
        },
        {
          "label": "artificial",
          "score": 0.2
        }
      ]
    }
}
The score value represent the total area that is human or artificial. In the example, the result means that 20% of the image was classified as artificial. You can also downlaod the heatmap as a colored image by using the appropriate endpoint.

Guidelines on interpreting results

Regarding the interpretation of the result, the advice is to focus on:
  • Revelio as the main result for the verdict (platform’s default choice), with higher confidence if faces and people are present.
  • Aide for a detailed analysis with the support of the heatmap feature.
  • Morphing to be considered only in the presence of faces.
  • Ellen, if the image comes from sources where the use of photo editing tools has been ascertained in the past.
  • V01 and Brokenwand only in the case of very old images (and therefore potentially generated with systems no longer in use today).
In addition, for heatmap analysis, we recommend to:
  • Pay close attention to the size of the submitted images: heatmap analysis is particularly demanding from a computational point of view and processing time increases significantly based on image size. The guideline recommends submitting images with a resolution lower than 2k (or 4 megapixels).

See also