Mole Analysis Use Case for HMS ML Kit Custom Model

Overview

Mole Analysis

Mole Analysis Use Case for HMS ML Kit Custom Model

Open Source Love svg3 hms-2022 mindsporeLite hms-mlkit mlkit-custom image-class


Kotlin Minimum SDK Version Android Gradle Version Gradle Version


Introduction

What is Melanoma?

Melanoma is the most serious among skin cancers because it can spread to various parts of the body. Its incidence has also increased in our country and it has fatal results.The key to the treatment of this serious melanoma is early diagnosis. Providing this is simple: The person should detect the changes by self-controlling the moles in his body.Therefore, it is important for a person to be aware of the changes in the moles in his body and to follow them. We trained our model on cancerous me-cells using Huawei ML Kit Custom Model Generation with our Mole Analysis application, which will help you in your diagnosis and follow-up.

Sign of Melanoma?


Factors that may increase your risk of melanoma include: Fair skin, A history of sunburn, Excessive ultraviolet (UV) light exposure, Living closer to the equator or at a higher elevation, Having many moles or unusual moles, A family history of melanoma, Weakened immune system.

If you have one of the risk factors for melanoma, experts recommend doing a skin self-exam. One of the most common methods for detecting melanomas is the ABCDE method. Developed by doctors to help patients easily remember the symptoms of melanoma, it details the warning signs in moles that often indicate cancer. Monthly skin checks are important as most melanomas start as a new mole or skin growth.


How will the Mole Analysis app help me ?

Mole Analysis application is trained with Huawei ML Kit model with collected mole data. Although there is an accuracy rate of 89% according to Train and Test data, but also of course there is a possibility of error. The machine learning trained Mole Analysis app will give you an idea to detect your changes and get a preliminary idea by comparing it with the data it is trained on.

You can get an idea of the symptoms of melanoma with the Mole Analysis app, but it's NOT a definitive diagnosis. We aim to provide early diagnosis and early diagnosis despite its potential risk. We recommend that you CONSULT A DOCTOR about the results for a definitive diagnosis.

About Huawei ML Kit

ML Kit allows your apps to easily leverage Huawei's long-term proven expertise in machine learning to support diverse artificial intelligence (AI) applications throughout a wide range of industries. Thanks to Huawei's technology accumulation, ML Kit provides diversified leading machine learning capabilities that are easy to use, helping you develop various AI apps. More..

Mindspore Lite

As an on-device inference framework of the custom model, the on-device inference framework MindSpore Lite provided by ML Kit facilitates integration and development and can be running on devices

Advantages

  • It provides simple and complete APIs for you to integrate the inference framework of an on-device custom model. In this way, you can customize the model in the simplest and quickest way, providing you with excellent experience of machine learning.
  • It is compatible with all mainstream model inference platforms or frameworks, such as MindSpore Lite, TensorFlow Lite, Caffe, and Onnx in the market. Different models can be converted into the .ms format without any loss, and then run perfectly through the on-device inference framework.
  • Custom models occupy small storage space and can be quantized and compressed. Models can be quickly deployed and executed. In addition, models can be hosted on the cloud and downloaded as required, reducing the APK size.
  • The kernel code of the inference framework is open-source for global developers. It gathers the wisdom of global contributors to improve and continuously iterate itself. It not only brings you a friendly development ecosystem, but also is your mentor on the path of machine learning inference.

Model Preparation

Used Dataset

ISIC Melanoma Research Datasets
The HAM10000 dataset

Preparation

  1. Two labels were identified:
  • Benign: Non-cancerous
  • Malignant: Suspected of Melonama
  1. Incomprehensible data in the dataset has been cleared. (important to increase the success of the model, but challenge for the mole dataset)

  2. Data is foldered by labels

  3. The dataset is split into Train: 80%, Test: 20%. At the same time, a close number of data was separated according to the labels.

  • Train Dataset: 8k Benign, 8k Malignant image files
  • Test Dataset: 1.5k Benign, 1.5k Malignant image files

Getting Started

Development Enviroment

  • JDK version: 1.8.211 or later
  • Android Studio version: 3.X or later
  • minSdkVersion: 19 or later (mandatory)
  • targetSdkVersion: 30 (recommended)
  • compileSdkVersion: 30 (recommended)
  • Gradle version: 4.6 or later (recommended)
  • Test device: a Huawei phone running EMUI 5.0 or later, or a non-Huawei phone running

How To Start

  • Register a developer account on HUAWEI Developers and configure.
  • Register in to Huawei Developer Console and Create and configure an app
  • To use ML Kit, you need to enable it in AppGallery Connect. For details, please refer to Enabling Services.
  • Adding the AppGallery Connect Configuration File of Your App - Sign in to AppGallery Connect and click My projects. - Find your project and click the app for which you want to integrate the HMS Core SDK. - On the Project Setting page, set SHA-256 certificate fingerprint to the SHA-256 fingerprint you've generated. - Go to Project settings > General information. In the App information area, download the agconnect-services.json file.
  • Configuring the Maven Repository Address for the HMS Core SDK
  • Open the build.gradle file in the root directory of your Android Studio project.
  • Add the AppGallery Connect plugin and the Maven repository.
buildscript { 
    repositories { 
        google() 
        jcenter() 
        // Configure the Maven repository address for the HMS Core SDK. 
        maven {url 'https://developer.huawei.com/repo/'} 
    } 
    dependencies { 
        ... 
        // Add the AppGallery Connect plugin configuration. You are advised to use the latest plugin version. 
        classpath 'com.huawei.agconnect:agcp:1.6.0.300' 
    } 
} 
 
allprojects { 
    repositories { 
        google() 
        jcenter() 
        // Configure the Maven repository address for the HMS Core SDK. 
        maven {url 'https://developer.huawei.com/repo/'} 
    } 
} 

Adding Build Dependencies (app build gradle)

 implementation 'com.huawei.hms:base:6.4.0.302'
    //HMS Custom Model
    implementation 'com.huawei.hms:ml-computer-model-executor:3.5.0.301'
    //MindsporeLite
    implementation 'mindspore:mindspore-lite:5.0.5.300'

Permissions ( AndroidManifest.xml )

">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

Important adding this aaptOptions for your model .ms file

aaptOptions {
        noCompress "ms", "mnn", "cambricon"
        cruncherEnabled false
        useNewCruncher false
    }

ML Kit Model Training

Preparing the Environment

mindsporeLite

  1. Install the HMS Tool Kit plugin in Android Studio. Installation
  2. HMS Toolkit > Coding Assistant > AI > AI Create
  3. HMS Toolkit automatically downloads resources. 4- Python version should be 3.7.5 and Python environment variable to path. 5- The MindSpore tool is automatically installed. If the installation fails, the following dialog box is displayed, asking you whether to install it manually.
    • Open the command line tool to manually install MindSpore.
run pip install MindSpore installation file 

Model Training

  1. In Coding Assistant, go to AI > AI Create > Image.
  2. Drag or add the image classification folders to the Please select train image folder area, then set Output model file path and train parameters.
  3. Advanced
    • Iteration count: The default value is 100.
    • Learning rate: The default value is 0.01.
  4. Click Create Model to start training and generate an image classification model. Then you will see results:

Learning Results:

  1. After the model training is complete, you can verify the model by adding the image folders in the Add test image area

Challenges

As with any machine learning project, the challenges and aspects of this project that need improvement:

  • Mole data is very difficult to distinguish
  • The process of cleaning the data is challenging
  • Analysis of no moles when irrelevant data is loaded
  • Importance of camera angle

References

The resources used in the development of the project are as follows:

License GitHub visitors
Copyright © 2022

You might also like...
Native android application that scans for text in images. Uses ML kit under the hood.
Native android application that scans for text in images. Uses ML kit under the hood.

Scannerate - Ad free Text Recognition Android application built using Kotlin to extract text from images. Uses Google's ML kit library under the hood.

WalletConnect Kit is the Swiss Army toolkit for WalletConnect!
WalletConnect Kit is the Swiss Army toolkit for WalletConnect!

WalletConnectKit WalletConnectKit is the Swiss Army toolkit for WalletConnect! It will allow you to connect your DApp with an Ethereum Wallet in a few

SmartLens uses Google's ML Kit for Barcode scanning, Face recognition, Text recognition, and Image labeling.
SmartLens uses Google's ML Kit for Barcode scanning, Face recognition, Text recognition, and Image labeling.

SmartLens SmartLens uses Google's ML Kit for Barcode scanning, Face recognition, Text recognition, and Image labeling. 📷 Screen Shots 🔥 Features It

Face Detector Using Firebase ML Kit
Face Detector Using Firebase ML Kit

Face Detector (Using Firebase ML Kit) Detects Facial Expression ------ Overlays

This application uses Google Play Services Vision library to scan barcodes. It uses Google's on device ML kit to scan for barcodes.
This application uses Google Play Services Vision library to scan barcodes. It uses Google's on device ML kit to scan for barcodes.

Barcode-Scanner This application showcases use of Google Play Services Vision library It uses Google's on device machine learning kit to scan for barc

Lightning Dev Kit Android Demo Wallet

uMlando-wallet Lightning Dev Kit Android Demo Wallet This project uses a .aar package for the Android platforms that provide language bindings for the

Android barcode scanner with ML-Kit vision api
Android barcode scanner with ML-Kit vision api

MLBarcodeScanner A demo project to show how to implement barcode scanner using Google ML-Kit Vision api Supported barcode types 2D formats: QR Code, A

This app using Mlkit along with the TensorFlow Lite model for object detection,

I built this app using Mlkit along with the TensorFlow Lite model for object detection, Arcore is used to place anchors to the detected objects. It's a good blend of Machine learning and Augmented reality to visualise ML information in a much better way than regular bounding boxes

Implement Dog vs Cat Prediction Model in Android app
Implement Dog vs Cat Prediction Model in Android app

This project aims to classify the input image as either a dog or a cat image. The image input which you give to the system will be analyzed and the predicted result will be given as output. Machine learning algorithm [Convolutional Neural Networks] is used to classify the image.

Owner
Aggregate developers' contributions to the HMS ecosystem,and expect to promote communication among more HMS-loving individual developers
null
UML model and code examples of design patterns for Kotlin/Native. The model is created with Astah.

Design Pattern Examples in Kotlin/Native Model and code examples of GoF Design Patterns for Kotlin/Native. This project is available for the following

Takaaki Teshima 3 Jun 27, 2022
A simple app to show case Master detail application for Movies

Decade of Movies App Demo Application to understand the architecture of MVVM App with Unit tests Build Instructions The gradle build system will fetch

Muhammad Nouman 27 Dec 24, 2021
Small library that allows the application to display a small troubleshooting guide in case of repeated app startup crashes.

AppSalvager What is it? AppSalvager allows you to combat the issue of repeating crashes on app startup. Failed data migration, SDKs not handling their

Alexander Leontev 29 Aug 31, 2022
Veyron - Covid 19 analysis using OWID data

veyron Covid 19 & Vaccine history representation by country. The app was designe

Nino Matassa 0 Feb 10, 2022
ArchGuard is a architecture governance tool which can analysis architecture in container, component, code level, create architecure fitness functions, and anaysis system dependencies..

ArchGuard backend ArchGuard is a architecture governance tool which can analysis architecture in container, component, code level, database, create ar

ArchGuard 446 Dec 20, 2022
Android Package Inspector - dynamic analysis with api hooks, start unexported activities and more. (Xposed Module)

Inspeckage - Android Package Inspector Inspeckage is a tool developed to offer dynamic analysis of Android applications. By applying hooks to function

acpm 2.5k Jan 8, 2023
StaCoAn is a crossplatform tool which aids developers, bugbounty hunters and ethical hackers performing static code analysis on mobile applications.

StaCoAn Not maintained anymore! Will be archived soon. StaCoAn is a crossplatform tool which aids developers, bugbounty hunters and ethical hackers pe

Vincent Cox 769 Dec 31, 2022
Easy setup of static analysis tools for Android and Java projects.

[DEPRECATED] Gradle static analysis plugin ⚠️ A fork of this project is maintained at https://github.com/GradleUp/static-analysis-plugin/ Please migra

Novoda 408 Dec 19, 2022
A Minecraft Kit API written in Kotlin

hglabor-kits Dependency The library is available on Maven Central, add the following dependencies: implementation("net.axay:hglabor-kits:$version") hg

Jakob K 8 Apr 8, 2022
Text Recognizer App Using the ML Kit

Features Detects text in images Using the ML Kit Text Recognition API Uses the CameraX to show a viewfinder and display the camera preview Provides a

krishna chaitanya 9 Nov 5, 2022