← Back to list

Object Classification with AI + Flutter

There are many examples of using AI in Flutter applications. For instance, the use of libraries like google_mlkit_image_labeling and…

Mohammad Jamali · 2024-09-02 11:26 · 84 claps · 2.3 min read
#ai #flutter #object-classification #small-language-model #fire-detection
Open on Medium ↗
Wiki topics: ML · Machine Learning AI · AI · General 📱 · Mobile Development

Object Classification with AI + Flutter

There are many examples of using AI in Flutter applications. For instance, the use of libraries like google_mlkit_image_labeling and google_mlkit, which belong to Google, can be utilized for classification, object detection, or even creating content with AI.

However, my intention in writing this article is to create an application for image classification with a specific purpose using a customized model, one that is either personalized or created by you. For example, the model I used in this application is designed to detect fires.

My goal is to produce a custom SLM (small language model) using Google’s model creation tools.

You can access the project’s code and repository through my GitHub account.

[embed]GitHub - mohammadreza-jamali/tfliteFireDetectionApp Contribute to mohammadreza-jamali/tfliteFireDetectionApp development by creating an account on GitHub.github.com

To create the model, we need to gather various images of fire, smoke, and normal conditions. For this purpose, I used a project available on GitHub, and with the help of Google’s machine learning tools, we create our model. As shown in the image below, we create the classes and upload the images for each class.

The model project file is available in the GitHub repository under project.tm.

After uploading the images, click on “Train Model” to create our model.

Then click on “Export Model” and export our model in Floating Point format. Pay attention at this stage because to differentiate components, we need to download the model based on TensorFlow Lite, as shown in the image below:

Now that we have created our model, we proceed to create our Flutter project and add the libraries camera and tflite_v2 to the pubspec.yaml file.

Then, add the downloaded model and label file to the project’s assets folder and configure its path in the pubspec.yaml file. Next, add the following code to the main.dart file to use the model.

After this stage, our project is ready, and we can run it on our phone to test it with various images of fires, smoke, and natural scenes.

I hope this article is helpful, and if anyone would like to contribute to its completion in the Object Detection section, it would make me very happy, and I would be eager to share this experience.


메타데이터
post_id
dc902ef57188
slug
object-classification-with-ai-flutter-dc902ef57188
url
https://medium.com/@mohammad_jamali/object-classification-with-ai-flutter-dc902ef57188
canonical_url
https://medium.com/@mohammad_jamali/object-classification-with-ai-flutter-dc902ef57188
author_url
https://medium.com/@mohammad_jamali
status
ok
fetched_at
2026-06-27 18:20:27