Are you interested in computer vision and looking for a user-friendly library to work with image models in Keras? Look no further than Keras Image Models (KIMM)! KIMM is a fantastic collection of image models, blocks, and layers written in Keras 3, making it easy for you to perform various computer vision tasks with state-of-the-art models and pre-trained weights.

What is KIMM?

KIMM stands for Keras Image Models and is an open-source library developed by Hongyu Chiu. It aims to provide a wide range of image models in a user-friendly manner, making it accessible to both beginners and experienced practitioners in the field of computer vision.

Key Features of KIMM:

  1. Model zoo: KIMM offers a comprehensive model zoo with almost all models coming with pre-trained weights on the ImageNet dataset. This means you can quickly get started with these models without having to train them from scratch.
  2. Easy model export: KIMM provides APIs to export models to .tflite and .onnx formats, making it convenient to deploy your models on different platforms.
  3. Reparameterization support: KIMM supports the reparameterization technique, allowing you to optimize your models for better performance and efficiency.
  4. Feature extraction: With KIMM, you can easily extract features from your models, enabling you to use them for various downstream tasks like image classification, object detection, and more.


Installing KIMM is a breeze! Simply run the following command in your terminal or command prompt:

# Installation
pip install keras kimm -U

Make sure you have Keras installed as well, as KIMM depends on it.


KIMM provides a simple and intuitive API for working with image models. Here are some key functions and their usage:

  1. kimm.list_models: Lists the available models in KIMM.
  2. kimm.models.*.available_feature_keys: Returns the available feature keys for a specific model.
  3. kimm.models.*(): Initializes a specific model with optional arguments.
  4. kimm.models.*(..., feature_extractor=True, feature_keys=...): Enables feature extraction for a specific model.
  5. kimm.utils.get_reparameterized_model: Reparameterizes a model for optimization.
  6. kimm.export.export_tflite: Exports a model to the .tflite format.
  7. kimm.export.export_onnx: Exports a model to the .onnx format.

Here’s a simple example of how you can use KIMM to initialize a MobileOneS0 model with pre-trained ImageNet weights and perform feature extraction:

import keras
import kimm
import numpy as np

# List available models
print(kimm.list_models("mobileone", weights="imagenet"))
# ['MobileOneS0', 'MobileOneS1', 'MobileOneS2', 'MobileOneS3']

# Initialize model with pretrained ImageNet weights
x = keras.random.uniform([1, 224, 224, 3])
model = kimm.models.MobileOneS0()
y = model.predict(x)
# (1, 1000)

# List available feature keys of the model class
# ['STEM_S2', 'BLOCK0_S4', 'BLOCK1_S8', 'BLOCK2_S16', 'BLOCK3_S32']

# Enable feature extraction by setting `feature_extractor=True`
model = kimm.models.MobileOneS0(
    feature_extractor=True, feature_keys=["BLOCK2_S16", "BLOCK3_S32"]
features = model.predict(x)
for feature_name, feature in features.items():
    print(feature_name, feature.shape)
# BLOCK2_S16 (1, 14, 14, 256)
# BLOCK3_S32 (1, 7, 7, 1024)
# TOP (1, 1000)

Practical examples

To help you get started with KIMM, the library provides several practical examples in the form of Colab notebooks. These examples cover various tasks and demonstrate how to use KIMM effectively. Here are a few noteworthy examples:

  1. Image classification with ImageNet weights:
  2. Fine-Tuning on Cats vs. Dogs dataset:
  3. Grad-CAM visualization:

Model zoo

KIMM offers a wide range of image models in its model zoo, covering various architectures and tasks. Some of the notable models include:

  • ConvMixer
  • ConvNeXt
  • DenseNet
  • EfficientNet
  • EfficientNetLite
  • EfficientNetV2
  • GhostNet
  • GhostNetV2
  • HGNet
  • HGNetV2
  • InceptionNeXt
  • InceptionV3
  • LCNet
  • MobileNetV2
  • MobileNetV3
  • MobileOne
  • MobileViT
  • MobileViTV2
  • RegNet
  • RepVGG
  • ResNet
  • TinyNet
  • VGG
  • ViT
  • Xception

Each model comes with pre-trained weights on the ImageNet dataset, making it easy to use them for transfer learning or as feature extractors.


Keras Image Models (KIMM) is a powerful and user-friendly library that simplifies working with image models in Keras. With its extensive model zoo, pre-trained weights, and feature extraction capabilities, KIMM empowers you to tackle various computer vision tasks with ease. Whether you are a beginner or an experienced practitioner, KIMM provides a seamless experience for leveraging state-of-the-art models in your projects.

To get started with KIMM, simply install it via pip and explore the provided examples and documentation. The library’s GitHub repository at serves as a valuable resource, containing the source code, documentation, and issue tracker. You can also find KIMM on PyPI at for easy installation.

Last Update: 22/05/2024