Integrate Haut.AI Image Analysis with Your App
The steps needed to integrate Haut.AI image analysis into your Custom App.
In the previous step, you already configured your backend and SaaS platform, have a valid Dataset, and attached an image analysis Algorithm Application.
Now, let's continue with image upload and processing with SaaS.
About Image Analysis
Algorithms are an AI core functionality of Haut.AI products. Algorithms enable AI image analysis. You can read more about each application here: Algorithms
For face skin use cases, use Face Skin Analysis 3.0 and its API reference: API for Face Skin Analysis 3.0.
Create Subject in SaaS (repeat this for every unique end-user)
To upload Images, you need to create a Subject. SaaS Subject is a representation of a unique end-user (person) that uses your application, powered by Haut.AI technology, e.g., one of your customers or one of your study participants.
The only required key for subject creation is
name.The Subject is always stored in the Dataset.
Critical Information
New Subject creation action must be performed every time a new customer (end-user) uses your app and does the image analysis.
We highly encourage you to implement the logic of end-user authentication/detection on the side of your app to ensure that you can identify different real customers (end-users).
Avoid storing images of different people in one Subject!
This implementation significantly limits your app in:
GDPR compliance: with 1 Subject representing only 1 real person, you can always perform GDPR-compliant actions like full personal data deletion easily.
Historical data and dynamics: with 1 Subject representing only 1 real person, your app can show the dynamics in skin health change over time.
Upload Image to SaaS
When the Subject is created successfully, you can upload Images to it.
The Face Skin Analysis 3.0 flow is batch-based:
Initiate image upload for the Subject.
Upload the image file or files to the signed storage URL returned by the API.
Save the
image_batch_id.Send the image batch to computation by calling the compute method.
Receive results by webhook or fetch them for the completed batch.
FAQ about images
When will Algorithms process my Image?
Image is sent to Algorithms only if the Subject's Dataset has attached at least 1 Algorithms Application. If no Algorithms are attached to Dataset of the Subject, the Image will be simply stored in the Dataset without being processed.
If I attach the Algorithm Application after the image upload, will it process all previously uploaded images?
Unfortunately, no. Haut.AI services currently do not support the function for retrospective image analysis. Only images uploaded after the Algorithm Application is attached are processed with this Application.
Receive Metrics and Submetrics from SaaS to Your App Server
Metrics and Submetrics are the results of image analysis performed by one or more of Algorithms on the uploaded image batch.
After you upload your image batch and call the /compute/ method, algorithm processing begins. Once calculation is complete, you can receive results by Webhook or fetch them with the batch results API.
For Face Skin Analysis 3.0, results are returned under the face_skin_analysis_3 object:
Your app should expect:
face_skin_analysis_3.parametersas an object keyed by parameter name.all_algorithms_calculatedto indicate whether all enabled algorithms finished for the batch.predicted_imagesto contain signed URLs for generated image variants such asoriginal,aligned_face, andanonymised.Per-parameter
errorsvalues for available sides (front,left,right).
Face Skin Analysis 3.0 may add new parameters to the response over time. Parse only the parameters your app needs and safely ignore unknown fields.
Receive Masks
Masks are additional results of image analysis, representing the spatial information about detected skin/hair health returned by the selected set of Algorithms.
In Face Skin Analysis 3.0, masks are returned as signed SVG URLs inside specific parameters:
Use the mask URL that matches the image variant you display. For example, overlay masks.front.aligned_face on top of predicted_images.front.aligned_face.
Receive Smoothed Metrics
Some Algorithms' Metrics vary naturally across images, because skin and image quality both vary. Haut.AI marks the Algorithms that show higher variability with a disclaimer — see Face Metrics 2.0 for an example.
If your application has returning users who submit photos daily, weekly, or monthly, historical Metrics Smoothing may help. Smoothing adjusts the numerical value of each new result using previous analyses of the same Subject.
Smoothing works only if your application stores every image of one real person under a single Subject. See Create Subject in SaaS.
To fetch smoothed values, see API for Metrics and Submetrics.
Design a Fallback in Your App for Algorithm Processing Errors
It is important to prepare your app to navigate end-users correctly if Haut.AI services can not process an image batch or a specific parameter.
For Face Skin Analysis 3.0, handle two levels of issues:
Image quality issues: use the Quality parameter to decide whether the user should retake the photo.
Individual parameter issues: use each parameter's
errorsobject to decide whether a specific metric can be shown.
Example Quality result:
Next Steps
Follow our next guide Create the Best End-User Experience for Image Collection in Your App to learn how to:
Integrate smart camera experience for high-quality image collection.
Handle image collection for laptop/desktop users to ensure the high quality of the analysis.
Not a Haut.AI client yet?
Last updated