Mole Analysis Use Case for HMS ML Kit Custom Model
![Open Source Love svg3](https://badges.frapsoft.com/os/v3/open-source.svg?v=103)
![hms-2022](https://img.shields.io/badge/Project-2022-1f425f.svg?color=red)
![mindsporeLite](https://img.shields.io/badge/Mindspore-Lite-1f425f.svg)
![hms-mlkit](https://img.shields.io/badge/HMS%20-MLKit-1f425f.svg?color=darkgreen)
![mlkit-custom](https://img.shields.io/badge/MLKit-Custom%20Model-1f425f.svg?color=green)
![image-class](https://img.shields.io/badge/Image%20Classification-HMS%20AI%20Create-1f425f.svg?color=brightgreen)
![Kotlin](https://img.shields.io/badge/language-kotlin-blue)
![Minimum SDK Version](https://img.shields.io/badge/minSDK-22-orange)
![Android Gradle Version](https://img.shields.io/badge/androidGradleVersion-7.0.2-green)
![Gradle Version](https://img.shields.io/badge/gradleVersion-7.0.2-informational)
# 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.
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.
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..
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
ISIC Melanoma Research Datasets
The HAM10000 dataset
Malignant: Suspected of Melonama
Incomprehensible data in the dataset has been cleared. (important to increase the success of the model, but challenge for the mole dataset)
Data is foldered by labels
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
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
}
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
Learning Results:
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
The resources used in the development of the project are as follows: