Skip to content
@cat-pedigree

Cat Pedigree

📔 Table of Contents

About Project

Team ID C22-PS083
Theme Human Healthcare & Animal Welfare

Team

Cat Pedigree Teams

ID NAME PATH University CONTACT
M7269J2321 Bugi Sulistiyo Machine Learning Universitas Mulawarman
M2272J2364 Zahrizhal Ali Machine Learning Universitas Muslim Indonesia
M2208K1922 Wardatun Sayyidah Machine Learning Universitas Hasanuddin
A2152G1665 Robby Ramadhan Anshory Mobile Development Sekolah Tinggi Teknologi Bandung
A7314F2733 Budi Setiawan Mobile Development Universitas Singaperbangsa Karawang
C7312F2682 Fina Enno Rizki Oktavia Cloud Computing Universitas Sebelas Maret

Repository

We have a repository

Name Link Repository
Machine Learning https://github.com/cat-pedigree/CatPedigree_ML_Model
Mobile Development https://github.com/cat-pedigree/app
Cloud Computing https://github.com/cat-pedigree/api-cat

Machine Learning

contributors last update forks stars open issues

You can see all the machine learning code in this repository

The Cat Pedigree Model for Classifying and Predicting Breeds of the Cats.

The CatPedigree - Cat App uses Machine Learning to classify and predict Cat Breeds. The model were build using TensorFlow Convolutional Neural Network.

End Goal: Take a photo of a cat and gain their respective breed and information about them also to predict their crossbirth (currently supports only color pedigree prediction).

What's in this repo?

  • images/ (soon) - folder with sample of cat images
  • cp_preprocessing_data.py - Python script that collects the photos from the post-cleaned dataset and split them into train/test directories automatically respective to their train/test split proportion.
  • requirements.txt - A text file with the dependency requirements for this project.

Dataset

The dataset were gathered from 2 resources publicly available on the internet.

  1. Kaggle Dataset. by ___ Description

  2. Robots. URL: Description

Classification Workflow

On progress

Timeline and Master Plan

As of: 24 May 2022 (Since this documentation is written) Note: might likely to change.

Stage 1 - Gathering and Cleaning Dataset (done)

Gathering the dataset. We also clean the dataset for each breeds to remove unrelated or corrupted images to avoid overfit/underfit or even worst model performance. We need to store images at large scale, using Google Storage and Google Drive to store the dataset and accessible to the CatPedigree ML Team.

Stage 2 - Image Preprocessing and data augmentation (done)

Perform Feature Engineering to remove unwanted noise from images. Perform Image Augmentation to avoid overfit and slightly improve the model from only 20% to 80% of accuracy.

Stage 3 - Build the model prototype (done)

Build simple model architecture using Tensorflow Sequential, apply some of the Transfer Learning Model from TensorflowHub like MobileNet, ResNet, and InceptionV3 and perform Fine Tuning to retrain the model to the spesific cases of cats classification.

Stage 4 - Convert to TFLite and ready for deployment (done)

Model already converted to TFLite and can be used by the Mobile Devs Team.

Stage 5 - Optimizing model performance (on progress)

Hyperpareter Tuning to gain optimized model. If have to, we need to reduce the variance of the images.

Stage 6

Repeat the process untill we can get the desired performance

The Pedigree Models API

The models are available in Keras Saved model form and also Already converted into TensorFlow Lite Model that can be embedded into mobile app. Download the labels under labels.txt and also the desired model. Since the model is still optimized, used the latest model version. model_latestrelease.tflite . Currently the latest model has the highest performance with over >80% of accuracy (and still will be improved).

Datasets for Pedigree

The datasets were handmade by The Machine Learning Engineer Team collected by CatBreeds Calculator that spesifically predicting the color of the breeds crossbirth. URL: https://catbreedersensei.com/cat-genetics-calculator/ . The datasets collected under the .csv format and using the team model architecture with TensorFlow and converted into separate tflite model from the classification model.

Model for predicting the pedigree but currently supporting only color predictio Supported Color for Male ['base_color_male']:

  • black : 0
  • gray : 1
  • orange : 2
  • silver : 3

Supported Color for Female ['base_color_female']:

  • black: 0
  • gray: 1
  • orange: 2
  • silver : 3
  • black tortie: 4
  • gray tortie: 5

Output:

  • black
  • gray
  • orange
  • silver
  • black tortie
  • gray tortie

Another feature ['with_white']: 1 - Has White Color 0 - Has now White color

parameters: features ==> float labels ==> string

Example of usage: Predicting the following cats matching male color:
black , has white color

female color: gray, has white color

then the model parameter will be [black, 1, gray, 1] --> with their respective numerical representation model prediction: Black Tortie

Mobile Development

contributors last update forks stars open issues

Cat Pedigree is an application built using Kotlin programming language, you can see all the mobile development code in this repository and to see the application usage guide you can see the following link

User Interface

You can see all the user interface and user experience at the following link

User Interface User Interface
User Interface User Interface

How to clone this project

Clone Manual

  • You can clone the Cat Pedigree App repository or download the zip file from the app repository by:
git clone https://github.com/cat-pedigree/app.git
  • Open In Android studio
  • Please wait gradle project synchronization
  • End

Clone project in android studio

  • Open the android studio
  • Click menu file -> new -> project from version control
  • Enter the cat pedigree app repository link https://github.com/cat-pedigree/app.git
  • Please wait gradle project synchronization
  • End

How to Get Google Maps API key

how to get Google Maps API key? Don't worry, Android Studio will provide a link that you can directly use to create a project in Google Console and get an API Key for Google Maps.

  • First, sign in to the Google Cloud Console and go to the Credentials tab.
  • Check and click AGREE AND CONTINUE to agree to the Terms of Service.
  • Then go to the side menu and select API & Services → Credentials.
  • Create a new project by clicking CREATE PROJECT and changing the project name to your liking. Click CREATE to continue.
  • Next, activate the Google Maps feature by selecting Enabled APIs & Services on the side menu and clicking the + ENABLED APIS AND SERVICES button.
  • Various features will appear that you can use in the Google Cloud Console. Select Maps SDK for Android and click Enable.
  • Then select the Credentials menu on the side menu and click the CREATE CREDENTIALSAPI key button to create a new credential.
  • At this point, you have got a key that usually starts with the word “AIza…”. Actually you can already use this API key, but this key is still not secure because any project can use it. To be more secure, click the Edit API key link.
  • Select the Android apps checkbox under Application restrictions and add new data by clicking ADD AN ITEM. Then fill in the package name of your application and SHA-1 of the device used. Notes: Each device has a different SHA certificate. To get SHA-1, you can run the command gradlew signingreport on Terminal
  • When finished, click SAVE and copy the key with the prefix "AIza ..." that has been obtained to the meta-data in the following AndroidManifest.
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.catpedigree.capstone.catpedigreebase">
    <application
      ...
        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="YOUR_API_KEY" />
    </application>
    ...
</manifest>

Tech Stack

Prerequisites

  • Android 9.0 (Pie) API 28
  • Internet Connection
  • Camera
  • GPS

Installation

  • Download the APK
  • Install the APK
  • Create a new account
  • Login
  • And then run all the features in the application

Cloud Computing

contributors last update forks stars open issues

Cat API is an API built using PHP programming language using laravel framework, you can see all the cat api code in this repository

How to clone this project

  • You can clone the Api Cat repository or download the zip file from the app repository by:
git clone https://github.com/cat-pedigree/api-cat.git
  • Open In Visual Studio Code
  • Make sure you copy all of the project files including the hidden ones(.env).
  • Prepare your destination computer as in http://laravel.com/docs/
  • Check you have all the necessary PHP extensions available in php.ini as in above link requirements. Also, watch your PHP version!
  • Install composer https://getcomposer.org/doc/00-intro.md
  • Run composer install.
  • Run php artisan key:generate from the command line.
  • Run php artisan cache:clear from command line
  • Run php artisan migrate:fresh --seed
  • Enjoy

Documentation API

You can view the documentation here or via the following link

Endpoint

Authentication

Register

  • URL
    • /register
  • Method
    • POST
  • Request Body
    • name As String
    • username As String, must be unique
    • email AS String, must be unique
    • password AS String, must be at least 8 characters
  • Response
{
    "code": 200,
    "status": "success",
    "message": "User Registered",
    "data": {
        "token_type": "Bearer",
        "user": {
            "id": 1,
            "name": "Example",
            "username": "example",
            "email": "example@test.com",
            "bio": null,
            "profile_photo_path": null,
        }
    }
}

Login

  • URL
    • /login
  • Method
    • POST
  • Request Body
    • email AS String,
    • password AS String, must be at least 8 characters
  • Response
{
    "code": 200,
    "status": "success",
    "message": "Authenticated",
    "data": {
        "token": "2|I90qc0BYVOyiGckrLtInFVzDZ7UXKto5uo6HHXSM",
        "token_type": "Bearer",
        "user": {
            "id": 1,
            "name": "Example",
            "username": "example",
            "email": "example@test.com",
            "bio": null,
            "profile_photo_path": null,
            "posts_count": 0,
            "cats_count": 0,
            "followers_count": 0,
        }
    }
}

Logout

  • URL
    • /logout
  • Method
    • POST
  • Header
    • Authorization : Bearer <Token>
  • Response
{
    "code": 200,
    "status": "success",
    "message": "Token Revoked",
    "data": true
}

User

Show User

  • URL
    • /user
  • Method
    • GET
  • Header
    • Authorization : Bearer <Token>
  • Parameters
    • id AS Integer, optional
    • nama AS String, optional
  • Response
{
    "code": 200,
    "status": "success",
    "message": "User data successfully retrieved",
    "data": [
        {
            "id": 1,
            "name": "Example",
            "username": "example",
            "email": "example@test.com",
            "bio": null,
            "profile_photo_path": null,
            "following": 0,
            "posts_count": 0,
            "cats_count": 0,
            "followers_count": 0,
            "posts": [],
            "cats": []
        }
    ]
}

Update Profile

  • URL
    • /user
  • Method
    • POST
  • Header
    • Authorization : Bearer <Token>
  • Request Body
    • name AS String
    • username AS String, must be Unique
    • bio AS String
  • Response
{
    "code": 200,
    "status": "success",
    "message": "Profile Updated",
    "data": {
        "id": 1,
        "name": "Example",
        "username": "dejong",
        "email": "indra@gmail.com",
        "bio": "example",
        "profile_photo_path": null,
        "following": 0,
    }
}

Update Photo Profile

  • URL
    • /change
  • Method
    • POST
  • Header
    • Authorization : Bearer <Token>
    • Content-Type : multipart/form-data
  • Request Body
    • profile_photo_path AS String
  • Response
{
    "code": 200,
    "status": "success",
    "message": "Profile Updated",
    "data": {
        "id": 1,
        "name": "Example",
        "username": "example",
        "email": "example@test.com",
        "bio": "example",
        "profile_photo_path": null,
    }
}

Update Email

  • URL
    • /user/email
  • Method
    • POST
  • Header
    • Authorization : Bearer <Token>
  • Request Body
    • email AS String, must be unique
  • Response
{
    "code": 200,
    "status": "success",
    "message": "Email Updated",
    "data": {
        "id": 1,
        "name": "Example",
        "username": "example",
        "email": "example@test.com",
        "bio": "example",
        "profile_photo_path": null,
    }
}

Update Password

  • URL
    • /user/password
  • Method
    • POST
  • Header
    • Authorization : Bearer <Token>
  • Request Body
    • password AS String, must be at least 8 characters
  • Response
{
    "code": 200,
    "status": "success",
    "message": "Password Updated",
    "data": {
        "id": 1,
        "name": "Example",
        "username": "example",
        "email": "example@test.com",
        "bio": "example",
        "profile_photo_path": null,
    }
}

Delete User

  • URL
    • /user/delete
  • Method
    • DELETE
  • Header
    • Authorization : Bearer <Token>
  • Parameters
    • id AS Integer
  • Response
{
    "code": 200,
    "status": "success",
    "message": "User deleted successfully",
    "data": 1
}

Veterinary

All Veterinary

  • URL
    • /veterinary
  • Method
    • GET
  • Header
    • Authorization : Bearer <Token>
  • Response
{
    "code": 200,
    "status": "success",
    "message": "Veterinary data successfully retrieved",
    "data": [
        {
            "id": 50,
            "name": "Alana Vet",
            "city": "Jakarta",
            "country": "Indonesia",
            "lat": -6.282974808,
            "lon": 106.9024418,
            "created_at": null,
            "updated_at": null
        }
    ]
}

Cat

All Cat

  • URL
    • /cat/all
  • Method
    • GET
  • Header
    • Authorization : Bearer <Token>
  • Parameters
    • id AS Integer, optional
    • name AS String, optional
    • breed AS String, optional
    • gender AS String, optional
    • color AS String, optional
    • age AS Integer, optional
  • Response
{
    "code": 200,
    "status": "success",
    "message": "cat data successfully retrieved",
    "data": [
        {
            "id": 1,
            "user_id": 2,
            "name": "Example",
            "breed": "Example",
            "gender": "Example",
            "color": "Example",
            "eye_color": "Example",
            "hair_color": "Example",
            "ear_shape": "Example",
            "weight": 5.6,
            "age": 12,
            "photo": "cats/photo-siska-1655023811.jpg",
            "lat": null,
            "lon": null,
            "isWhite": 1,
            "story": "Hello my friends",
            "user": {
                "id": 2,
                "name": "Example",
                "username": "example",
                "email": "example@test.com",
                "bio": null,
                "profile_photo_path": null,
            }
        }
    ]
}

Search Cat

  • URL
    • /cat/search
  • Method
    • GET
  • Header
    • Authorization : Bearer <Token>
  • Parameters
    • breed AS String, optional
    • gender AS String, optional
    • color AS String, optional
    • isWhite AS Integer, optional, 1|0
  • Response
{
    "code": 200,
    "status": "success",
    "message": "cat data successfully retrieved",
    "data": [
        {
            "id": 1,
            "user_id": 2,
            "name": "Example",
            "breed": "Example",
            "gender": "Example",
            "color": "Example",
            "eye_color": "Example",
            "hair_color": "Example",
            "ear_shape": "Example",
            "weight": 5.6,
            "age": 12,
            "photo": "cats/photo-siska-1655023811.jpg",
            "lat": null,
            "lon": null,
            "isWhite": 1,
            "story": "Hello my friends",
            "user": {
                "id": 2,
                "name": "Example",
                "username": "example",
                "email": "example@test.com",
                "bio": null,
                "profile_photo_path": null,
            }
        }
    ]
}

Create Cat

  • URL
    • /cat/create
  • Method
    • POST
  • Header
    • Authorization : Bearer <Token>
  • Request Body
    • name AS String
    • breed AS String
    • gender AS String
    • color AS String
    • eye_color AS String
    • hair_color AS String
    • ear_shape AS String
    • weight AS Double
    • age AS Int
    • photo AS String
    • isWhite AS Int must be 1 | `0|
    • story AS String
  • Response
{
    "code": 200,
    "status": "success",
    "message": "Data added successfully",
    "data": {
        "user_id": 2,
        "name": "Example",
        "breed": "Example",
        "gender": "example",
        "color": "example",
        "eye_color": "Example",
        "hair_color": "Example",
        "ear_shape": "Example",
        "weight": "5.6",
        "age": "12",
        "photo": "cats/photo-example-1655023811.jpg",
        "lat": null,
        "lon": null,
        "isWhite": "1",
        "story": "Hello my friends",
        "id": 1
    }
}

Update Cat

  • URL
    • /cat/update
  • Method
    • POST
  • Header
    • Authorization : Bearer <Token>
  • Request Body
    • name AS String
    • breed AS String
    • gender AS String
    • color AS String
    • eye_color AS String
    • hair_color AS String
    • ear_shape AS String
    • weight AS Double
    • age AS Int
    • photo AS String
    • isWhite AS Int must be 1 | `0|
    • story AS String
  • Parameters
    • id AS Integer must be required
  • Response
{
    "code": 200,
    "status": "success",
    "message": "cat updated",
    "data": {
        "id": 1,
        "user_id": 2,
        "name": "Example",
        "breed": "Example",
        "gender": "example",
        "color": "example",
        "eye_color": "Example",
        "hair_color": "Example",
        "ear_shape": "Example",
        "weight": "5.6",
        "age": "12",
        "photo": "cats/photo-example-1655025295.jpg",
        "lat": null,
        "lon": null,
        "isWhite": 1,
        "story": "Hello my friends",
    }
}

Delete Cat

  • URL
    • /cat/delete
  • Method
    • DELETE
  • Header
    • Authorization : Bearer <Token>
  • Parameters
    • id AS Integer must be required
  • Response
{
    "code": 200,
    "status": "success",
    "message": "data deleted successfully",
    "data": 1
}

Post

All Post

  • URL
    • /post/all
  • Method
    • POST
  • Header
    • Authorization : Bearer <Token>
  • Request Body
    • user_id AS Integer
    • id AS Integer
  • Response
{
    "code": 200,
    "status": "success",
    "message": "Post data successfully retrieved",
    "data": [
        {
            "id": 1,
            "user_id": 2,
            "photo": "posts/photo-example-1655026284.jpg",
            "title": "Examples",
            "description": "Example",
            "loves_count": 0,
            "comments_count": 0,
            "user": {
                "id": 2,
                "name": "Example",
                "username": "Example",
                "email": "example@test.com",
                "bio": null,
                "profile_photo_path": null,
            },
            "loves": [],
            "comments": []
        }
    ]
}

Create Post

  • URL
    • /post/create
  • Method
    • POST
  • Header
    • Authorization : Bearer <Token>
  • Request Body
    • title AS String
    • description AS String
    • photo AS String
  • Response
{
    "code": 200,
    "status": "success",
    "message": "Data added successfully",
    "data": {
        "user_id": 2,
        "photo": "posts/photo-example-1655026284.jpg",
        "title": "Example",
        "description": "Example",
        "id": 1
    }
}

Delete Post

  • URL
    • /post/delete
  • Method
    • DELETE
  • Header
    • Authorization : Bearer <Token>
  • Parameters
    • id AS Integer
  • Response
{
    "code": 200,
    "status": "success",
    "message": "data deleted successfully",
    "data": 1
}

Update Post

  • URL
    • /post/update
  • Method
    • POST
  • Header
    • Authorization : Bearer <Token>
  • Request Body
    • title AS String
    • description AS String
    • photo AS String
  • Parameters
    • photo AS String
  • Response
{
    "code": 200,
    "status": "success",
    "message": "Data added successfully",
    "data": {
        "user_id": 2,
        "photo": "posts/photo-example-1655026284.jpg",
        "title": "Example",
        "description": "Example",
        "id": 1
    }
}

Love

All Love

  • URL
    • /love/all
  • Method
    • GET
  • Header
    • Authorization : Bearer <Token>
  • Response
{
    "code": 200,
    "status": "success",
    "message": "Love data successfully retrieved",
    "data": [
        {
            "id": 2,
            "post_id": 2,
            "user_id": 2,
            "post": {
                "id": 2,
                "user_id": 2,
                "photo": "posts/photo-example-1655032155.jpg",
                "title": "Example",
                "description": "Example",
            },
            "user": {
                "id": 2,
                "name": "Example",
                "username": "Example",
                "email": "example@test.com",
                "bio": null,
                "profile_photo_path": null,
            }
        }
    ]
}

Create Love

  • URL
    • /love/create
  • Method
    • POST
  • Header
    • Authorization : Bearer <Token>
  • Request Body
    • post_id AS Integer
    • user_id AS Integer
  • Response
{
    "code": 200,
    "status": "success",
    "message": "Data added successfully",
    "data": {
        "post_id": "2",
        "user_id": 2,
        "id": 2
    }
}

Delete Love

  • URL
    • /love/delete
  • Method
    • DELETE
  • Header
    • Authorization : Bearer <Token>
  • Parameters
    • post_id AS Integer Must be required
    • user_id AS Integer Must be required
  • Response
{
    "code": 200,
    "status": "success",
    "message": "data deleted successfully",
    "data": {}
}

Comment

Create Comment

  • URL
    • /comment/create
  • Method
    • POST
  • Header
    • Authorization : Bearer <Token>
  • Request Body
    • post_id AS Integer
    • description AS String
  • Response
{
    "code": 200,
    "status": "success",
    "message": "Data added successfully",
    "data": {
        "post_id": "2",
        "user_id": 2,
        "description": "Example",
        "updated_at": "2022-06-12T11:17:08.000000Z",
        "created_at": "2022-06-12T11:17:08.000000Z",
        "id": 1
    }
}

All Comment

  • URL
    • /comment/all
  • Method
    • GET
  • Header
    • Authorization : Bearer <Token>
  • Request Body
    • post_id AS Integer
    • user_id AS String
  • Response
{
    "code": 200,
    "status": "success",
    "message": "Comment data successfully retrieved",
    "data": [
        {
            "id": 2,
            "post_id": 2,
            "user_id": 2,
            "description": "Hello",
            "post": {
                "id": 2,
                "user_id": 2,
                "photo": "posts/photo-example-1655032155.jpg",
                "title": "Example",
                "description": "Example",
            },
            "user": {
                "id": 2,
                "name": "Siska",
                "username": "Siska",
                "email": "siska@gmail.com",
                "bio": null,
                "profile_photo_path": null,
            }
        }
    ]
}

Follow

Create Follow

  • URL
    • /follow/create
  • Method
    • POST
  • Header
    • Authorization : Bearer <Token>
  • Request Body
    • user_id AS Integer
    • follower_id AS Integer
  • Response
{
    "code": 200,
    "status": "success",
    "message": "Data added successfully",
    "data": {
        "user_id": "2",
        "follower_id": "3",
        "id": 2
    }
}

Delete Follow

  • URL
    • /follow/delete
  • Method
    • DELETE
  • Header
    • Authorization : Bearer <Token>
  • Parameters
    • user_id AS Integer Must be required
    • follower_id AS Integer Must be required
  • Response
{
    "code": 200,
    "status": "success",
    "message": "Data deleted successfully",
    "data": 1
}

Follow All

  • URL
    • /follow/all
  • Method
    • GET
  • Header
    • Authorization : Bearer <Token>
  • Parameters
    • user_id AS Integer Must be optional
    • follower_id AS Integer Must be optional
  • Response
{
    "code": 200,
    "status": "success",
    "message": "Data successfully retrieved",
    "data": [
        {
            "id": 3,
            "user_id": 2,
            "follower_id": 3,
            "user": {
                "id": 2,
                "name": "Example",
                "username": "Example",
                "email": "example@test.com",
                "bio": null,
                "profile_photo_path": null,
            }
        }
    ]
}

Special Thanks

Bangkit

Pinned Loading

  1. api-cat api-cat Public

    Cat API is an API built using PHP programming language using laravel framework

    JavaScript

  2. CatPedigree_ML_Model CatPedigree_ML_Model Public

    The cat pedigree model for utilizing the Machine Learning Features of the apps.

    Jupyter Notebook 1 1

  3. app app Public

    CatPedigree is an application created using the Kotlin programming language, this application has the following features: social media to connect cat lovers in one community, classification to clas…

    Kotlin 1 1

Repositories

Showing 5 of 5 repositories
  • api-cat Public

    Cat API is an API built using PHP programming language using laravel framework

    cat-pedigree/api-cat’s past year of commit activity
    JavaScript 0 0 0 0 Updated Jun 13, 2022
  • app Public

    CatPedigree is an application created using the Kotlin programming language, this application has the following features: social media to connect cat lovers in one community, classification to classify cat types, pedigree to predict the offspring of crossed cats, veterinary to find a veterinary clinic that available, and cat dating, which provid…

    cat-pedigree/app’s past year of commit activity
    Kotlin 1 1 0 0 Updated Jun 13, 2022
  • .github Public
    cat-pedigree/.github’s past year of commit activity
    0 0 0 0 Updated Jun 12, 2022
  • CatPedigree_ML_Model Public

    The cat pedigree model for utilizing the Machine Learning Features of the apps.

    cat-pedigree/CatPedigree_ML_Model’s past year of commit activity
    Jupyter Notebook 1 1 0 0 Updated Jun 12, 2022
  • cat-pedigree/api-cat-deploy’s past year of commit activity
    0 0 0 0 Updated Jun 10, 2022

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…