Team ID | C22-PS083 |
---|---|
Theme | Human Healthcare & Animal Welfare |
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 |
You can see all the machine learning code in this repository
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).
- 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.
The dataset were gathered from 2 resources publicly available on the internet.
- Kaggle Dataset. URL: https://www.kaggle.com/datasets/ma7555/cat-breeds-dataset
- Robots. URL:
-
Kaggle Dataset. by ___ Description
-
Robots. URL: Description
On progress
As of: 24 May 2022 (Since this documentation is written) Note: might likely to change.
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.
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.
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.
Model already converted to TFLite and can be used by the Mobile Devs Team.
Hyperpareter Tuning to gain optimized model. If have to, we need to reduce the variance of the images.
Repeat the process untill we can get the desired performance
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).
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
: 0gray
: 1orange
: 2silver
: 3
Supported Color for Female ['base_color_female']
:
black
: 0gray
: 1orange
: 2silver
: 3black tortie
: 4gray 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
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
You can see all the user interface and user experience at the following link
- 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
- 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?
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 theCredentials 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. ClickCREATE
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
. SelectMaps SDK for Android
and clickEnable
. - Then select the Credentials menu on the side menu and click the
CREATE CREDENTIALS
→API 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 clickingADD AN ITEM
. Then fill in the package name of yourapplication and SHA-1
of the device used. Notes: Each device has a differentSHA certificate
. To getSHA-1
, you can run the commandgradlew signingreport
onTerminal
- When finished, click
SAVE
andcopy
the key with the prefix"AIza ..."
that has been obtained to the meta-data in the followingAndroidManifest
.
<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>
- Kotlin
- Tensorflow Lite
- Retrofit
- Room
- Room Paging
- Camerax
- Datastore
- Gson
- Glide
- Navigation Dynamic
- Viewmodel
- Live Data
- Navigation UI
- Constraint Layout
- Circle Image
- Android 9.0 (Pie) API 28
- Internet Connection
- Camera
- GPS
- Download the APK
- Install the APK
- Create a new account
- Login
- And then run all the features in the application
Cat API is an API built using PHP programming language using laravel framework, you can see all the cat api code in this repository
- 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
You can view the documentation here or via the following link
- URL
/register
- Method
POST
- Request Body
name
AsString
username
AsString
, must be uniqueemail
ASString
, must be uniquepassword
ASString
, 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,
}
}
}
- URL
/login
- Method
POST
- Request Body
email
ASString
,password
ASString
, 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,
}
}
}
- URL
/logout
- Method
POST
- Header
Authorization
:Bearer <Token>
- Response
{
"code": 200,
"status": "success",
"message": "Token Revoked",
"data": true
}
- URL
/user
- Method
GET
- Header
Authorization
:Bearer <Token>
- Parameters
id
ASInteger
, optionalnama
ASString
, 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": []
}
]
}
- URL
/user
- Method
POST
- Header
Authorization
:Bearer <Token>
- Request Body
name
ASString
username
ASString
, must beUnique
bio
ASString
- 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,
}
}
- URL
/change
- Method
POST
- Header
Authorization
:Bearer <Token>
Content-Type
:multipart/form-data
- Request Body
profile_photo_path
ASString
- 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,
}
}
- URL
/user/email
- Method
POST
- Header
Authorization
:Bearer <Token>
- Request Body
email
ASString
, must beunique
- 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,
}
}
- URL
/user/password
- Method
POST
- Header
Authorization
:Bearer <Token>
- Request Body
password
ASString
, must be at least8 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,
}
}
- URL
/user/delete
- Method
DELETE
- Header
Authorization
:Bearer <Token>
- Parameters
id
ASInteger
- Response
{
"code": 200,
"status": "success",
"message": "User deleted successfully",
"data": 1
}
- 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
}
]
}
- URL
/cat/all
- Method
GET
- Header
Authorization
:Bearer <Token>
- Parameters
id
ASInteger
,optional
name
ASString
,optional
breed
ASString
,optional
gender
ASString
,optional
color
ASString
,optional
age
ASInteger
,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,
}
}
]
}
- URL
/cat/search
- Method
GET
- Header
Authorization
:Bearer <Token>
- Parameters
breed
ASString
,optional
gender
ASString
,optional
color
ASString
,optional
isWhite
ASInteger
,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,
}
}
]
}
- URL
/cat/create
- Method
POST
- Header
Authorization
:Bearer <Token>
- Request Body
name
ASString
breed
ASString
gender
ASString
color
ASString
eye_color
ASString
hair_color
ASString
ear_shape
ASString
weight
ASDouble
age
ASInt
photo
ASString
isWhite
ASInt
must be1
| `0|story
ASString
- 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
}
}
- URL
/cat/update
- Method
POST
- Header
Authorization
:Bearer <Token>
- Request Body
name
ASString
breed
ASString
gender
ASString
color
ASString
eye_color
ASString
hair_color
ASString
ear_shape
ASString
weight
ASDouble
age
ASInt
photo
ASString
isWhite
ASInt
must be1
| `0|story
ASString
- Parameters
id
ASInteger
must berequired
- 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",
}
}
- URL
/cat/delete
- Method
DELETE
- Header
Authorization
:Bearer <Token>
- Parameters
id
ASInteger
must berequired
- Response
{
"code": 200,
"status": "success",
"message": "data deleted successfully",
"data": 1
}
- URL
/post/all
- Method
POST
- Header
Authorization
:Bearer <Token>
- Request Body
user_id
ASInteger
id
ASInteger
- 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": []
}
]
}
- URL
/post/create
- Method
POST
- Header
Authorization
:Bearer <Token>
- Request Body
title
ASString
description
ASString
photo
ASString
- 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
}
}
- URL
/post/delete
- Method
DELETE
- Header
Authorization
:Bearer <Token>
- Parameters
id
ASInteger
- Response
{
"code": 200,
"status": "success",
"message": "data deleted successfully",
"data": 1
}
- URL
/post/update
- Method
POST
- Header
Authorization
:Bearer <Token>
- Request Body
title
ASString
description
ASString
photo
ASString
- Parameters
photo
ASString
- 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
}
}
- 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,
}
}
]
}
- URL
/love/create
- Method
POST
- Header
Authorization
:Bearer <Token>
- Request Body
post_id
ASInteger
user_id
ASInteger
- Response
{
"code": 200,
"status": "success",
"message": "Data added successfully",
"data": {
"post_id": "2",
"user_id": 2,
"id": 2
}
}
- URL
/love/delete
- Method
DELETE
- Header
Authorization
:Bearer <Token>
- Parameters
post_id
ASInteger
Must berequired
user_id
ASInteger
Must berequired
- Response
{
"code": 200,
"status": "success",
"message": "data deleted successfully",
"data": {}
}
- URL
/comment/create
- Method
POST
- Header
Authorization
:Bearer <Token>
- Request Body
post_id
ASInteger
description
ASString
- 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
}
}
- URL
/comment/all
- Method
GET
- Header
Authorization
:Bearer <Token>
- Request Body
post_id
ASInteger
user_id
ASString
- 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,
}
}
]
}
- URL
/follow/create
- Method
POST
- Header
Authorization
:Bearer <Token>
- Request Body
user_id
ASInteger
follower_id
ASInteger
- Response
{
"code": 200,
"status": "success",
"message": "Data added successfully",
"data": {
"user_id": "2",
"follower_id": "3",
"id": 2
}
}
- URL
/follow/delete
- Method
DELETE
- Header
Authorization
:Bearer <Token>
- Parameters
user_id
ASInteger
Must berequired
follower_id
ASInteger
Must berequired
- Response
{
"code": 200,
"status": "success",
"message": "Data deleted successfully",
"data": 1
}
- URL
/follow/all
- Method
GET
- Header
Authorization
:Bearer <Token>
- Parameters
user_id
ASInteger
Must beoptional
follower_id
ASInteger
Must beoptional
- 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,
}
}
]
}