Skip to main content

Deep Fine-Tuning Templates

Train the entire graph of your custom model

Clarifai offers a variety of pre-built models that are designed to help you create AI solutions quickly and efficiently.

Clarifai models are the recommended starting point for many users because they offer incredibly fast training times, especially when you customize them using the transfer learning model type.

But there are many cases where accuracy and the ability to carefully target solutions takes priority over speed and ease of use. Additionally, you may need a model to learn new features not recognized by existing Clarifai models.

For such cases, it is possible to "deep fine-tune" your custom models and integrate them directly within your workflows.

You might consider deep fine-tuning if:

  • You have a custom tailored dataset. This will help you to tailor the model to a specific application or domain, such as customizing it with proprietary data from a private company.
  • You have accurate labels. This provides a strong foundation for training your models, resulting in improved performance, reduced errors, and better alignment with the desired task or domain.
  • You have the expertise and time to fine-tune models. So, you can modify the model's behavior to eliminate unwanted traits and instill desired ones.
  • You want to reduce hallucinations, especially when presenting the model with questions or prompts it hasn't encountered during its initial training.

Template Typesโ€‹

You can take advantage of a variety of templates when building your deep fine-tuned models. Templates give you the control to choose the specific architecture used by your neural network, and also define a set of hyperparameters that you can use to fine-tune the way that your model learns.

Here are the template types we offer:

Create Your Deep Fine-Tuned Modelโ€‹

Creating and working with deep fine-tuned models is very similar to working with Clarifai models.

Let's demonstrate how you can create a deep fine-tuned model.

Create App and Upload Inputsโ€‹

Get started by creating your app and uploading inputs.


In general, deep trained models need more data than the ones trained on top of Clarifai models. For most applications, youโ€™ll need at least 1000 training inputs, but it could be much more than this depending on your specific use case.

Click the Create an App button and provide the information required to create a new application.

create an app

To upload inputs into your app, select the Inputs option on the collapsible left sidebar. Next, click the Upload Inputs button and upload the inputs you want to add to the app.

upload inputs

The small window that pops up allows you to upload inputs.

upload inputs window

Create Concepts and Label Inputsโ€‹

The process of creating concepts and labeling inputs is the same for deep trained models as for other Clarifai models.

Clicking the Show Upload Settings button on the small window that pops up when uploading inputs exposes a section that lets you create concepts and label inputs.

Show Upload Settings

The section allows you to add the following to your inputs:

  • Datasetsโ€”A dataset is a set of data input examples for actions like training and evaluation. You can select a previously created dataset or create a new one. For this example, you may not provide it.
  • Conceptsโ€”Adding concepts help in training your model. You can select a previously created concept or create a new one. For this example, create new concepts and label your image inputs with them.
  • Metadataโ€”You can also add inputs with custom metadata, which can be searched or filtered. Metadata can be any arbitrary JSON. For this example, you may not provide it.

Click the Upload inputs button at the button of the pop-up window to finalize uploading your inputs.

Model Modeโ€‹

Next, select the App Models option on the collapsible left sidebar to enter the model mode.

Create the Custom Model you Needโ€‹

On the ensuing page, click the Create Model button on the top-right corner of the page.

create app models

Next, on the page for choosing the type of model you want to create, select a Visual Classifier, Visual Embedder, or Visual Detector.

For this example, letโ€™s choose a Visual Classifier, which would classify images into set of concepts.

choose visual classifier

Configure Your Modelโ€‹

On the ensuing page, provide the details required to create the deep trained model.

For this example, let's provide the model id, select the concepts we created previously, and select a template name. You can also fill the other fields if you want to.

configure model

The pre-configured model template is essential for training with on your data. When you choose your deep training template, you will see the hyperparameters that are available within that template populated with default values. You can adjust these values as desired.

template configuration

After configuring the model, click the Create Model button at the bottom of the page.

Train Your Modelโ€‹

Next, train your model by clicking the Train Model button on the upper right-hand corner of the created model's page.

train model

Deep training can take much longer time than custom training a model. Many hours are required to deep train models with large numbers of inputs and complex taxonomies. You can check the progress in the model details view and monitor the training as it continues.

model training progress

Once you've created and trained your new model, you can put it to work, such as by adding it to a workflow and using it in your app.

Job Cancellationโ€‹

You can cancel a deep training job at any time by deleting the model version that you are training.

delete model version

Deep training is billed at an hourly rate and for cancelled jobs, you will be charged for the time that you've used to train your model.

You can learn more about deep training pricing here.