Home Computer Science
Table of Contents:
For the implementation of a pretrained model, that is, MobileNet, this chapter uses various TensorFlow libraries. This application will help the user to identify skin disease using affected skin images along with home remedies and instantly connect with teledennatology. hi addition, it provides emergency and nearby pharmacy and hospitals. It involves two patient users and doctors, hi skin disease classification, the prior data set is required to make the system leam about its features and characteristics. When the data are available, the system has to preprocess it and apply filters such as color transformation, rotation, etc. Figure 5.2 shows the complete flowchart of ApnaDermato.
FIGURE 5.2 The complete flowchart of ApnaDermato.
18.104.22.168 CREATING THE DATASET
For this application, we downloaded images for each skin disease from Google images for training purposes. We also created a separate folder for each skin disease for classification. For each disease, we have maintained a dataset of 1000 training images.
22.214.171.124 ENFORCE STANDARD RESOLUTION
For ensuring consistency in the training process, we took all images in JPEG format and converted all images in 320 x 240 resolution.
5.5.13 TRAIN THE MODEL (MOBILENET')
The model used here is MobileNet. MobileNet is a small, efficient CNN, and it performs the same calculations at each location in the image. MobileNet takes input image in 128-, 160-, 192-, or 224-pixel resolution. We supply the infected skin images as input to the MobileNet model, and we will run the training using script retrain and pass parameters such as the number of training steps, outputgraph, output_labels, and image_dir.
126.96.36.199 CREATING BOTTLENECKS
When retraining begins, bottlenecks are created similar to the screenshot given below. The penultimate layer of the inception model classifies the images supplied during training. This penultimate layer is called bottleneck. After the bottleneck training is over, the final layer generated gives the validation accuracy. In the end, we find two files, retrained graph.pb and retrained_labels.txt, in the working directory. The file “retrained_graph.pb” is our final retrained model for our app that classifies diseases based on the image provided, and retrained_labels.txt is a text file that contains the labels, that is, the disease names from the dataset. For testing any input image, we use script label_image and pass the location of that image.
5.51.5 CONVERSION OF THE MODEL TO TFLITE FORMAT
TensorFlow Lite is TensorFlow lightweight solution for mobile and embedded devices. TensorFlow Lite comprises a runtime on which you can run preexisting models and a suite of tools that you can use to prepare your models for use on mobile and embedded devices. Using the TFLite flat buffer script, we convert our model to the TFLite file for use on mobile.
In Figure 5.3, skin image will be provided to the MobileNet model as input, and output will be in the form of disease label with the corresponding probability.
5.51.6 TESTING THE MODEL
For testing the model, we created a separate test set that contained images for each skin disease. The model produced good accuracy, over 80% on every image. Figure 5.3 contains a sample test case wherein the input image was ringworm. This particular test case produced 98.8% accuracy. We integrated this model into an android app since it is convenient for various users. The model ranks the result set as per the accuracy calculated. It returns a list of top three predictions, as shown in the figure. In this mobile application, we capture the best result, query the name in the database, and display the appropriate information.
FIGURE 5.3 Diagram of MobileNet model.
ApnaDermato bridges the communication gap between the doctor and the patient. Earlier, patients used to wait in long queues or cany their child for skin treatment; now, using ApnaDermato, patients can get the diagnosis for skin diseases from specialized doctors across the world.
For using this android mobile application, first, the patient has to agree to the terms and conditions; as it is a health-related application, the patient has to accept the ethics and responsibilities of the app. Once the user accepted all the terms and conditions, the user has three options: patient login, doctor login, and patient register. In Figure 5.4, disclaimer is shown because this is health-centric application.
In Figure 5.5, registration form is shown for patient to fill. The patient has to register itself before using the application. Once a user registered with our application, the patient can log in into our app. After login, the patient will see a dashboard where the patient can either fill a diagnosis form or can find a nearby pharmacy store and hospital based on its current location and many other features. Apart from nearby pharmacies, patients can also search for nearby hospitals and bum hospitals.
Figure 5.6 shows login screen for once registered users and Figure 5.7 displays dashboard for patient. A doctor can only log in to the application. Doctors are registered manually, and after verification of the required documents, the doctor is allowed to log in into the system. After login, the doctor can view patient queries on which he can provide the diagnosis and send it back to the patient. Figure 5.8 shows dashboard for doctors.
If a parent or a guardian wants to get a diagnosis of his or her child’s skin diseases, he or she has to fill the diagnosis form on the dashboard. The diagnosis form consists of some standard information such as an image of the
FIGURE 5.4 Terms and conditions.
FIGURE 5.6 Home screen.
affected area, the name of a child, age, and a description of the disease. After filling the form, parent has to answer specific intelligent questions such as: Is the affected area bleeding? Is child crying? etc. Figure 5.9 reveals patient submitting query to doctor and Figure 5.10 illustrates intelligent questioning with patient to know more about then condition.
FIGURE 5.8 Doctor login.
Based on the diagnosis form and intelligent questions, this application can classify the condition of the child as urgent or not urgent. Every time, we cannot disturb a doctor for some common problems that can be cured by some home remedies. Our application ApnaDermato can identify five skin diseases trained on 1000 images and can give an accuracy of more than 85%.
The primaiy purpose of intelligent questions is to improve the accuracy of the system and adequately classify the condition. If the system identifies the disease as not urgent, then specific home remedies will be suggested to the patient, and after some time, a notification will be forwarded to the patient asking the condition of the child. If a parent says a child is fine, then the case will be stored in a database for future reference, but if the child’s condition is serious, then the case is directly forwarded to the doctor. Figure 5.11 shows some remedies and FAQs and Figure 5.12 reveals reminder notification for patients.
FIGURE 5.9 Patient query.
FIGURE 5.11 Remedies for nonurgent conditions.
If the system identifies the condition as urgent, then it will directly be forwarded to the doctor for diagnosis, and the patient will not be suggested home remedies. Figure 5.13 shows identifying emergency cases.
FIGURE 5.13 Urgent case condition.
A doctor can see all the patient queries and can accept or reject the case based on his or her availability. If the doctor accepted the requested, then all the information of the patient will be shown along with the predicted skin disease. If the doctor thinks the disease is the same as predicted, he or she can provide the diagnosis on it, else if the doctor thinks the predicted disease is not the same, then he or she can uncheck the check and provide diagnosis along with disease name. Figure 5.14 shows doctor receiving patient request and Figure 5.15 reveals doctor writing prescription to patients.
A patient can see the diagnosis in the previous record section on the dashboard where all the previous requested cases are stored. The patient can also search the nearby pharmacy and hospital based on the current location. A patient can also contact the development team for any technical help by clicking on the help tab on the dashboard. Figure 5.16 shows patients’ records stored in application, Figure 5.17 showing nearby pharmacies to get medications, and Figure 5.18 reveals providing medications for common problems. Figure 5.19 displays giving patients an option to chat with doctor if they accepted their request.
FIGURE 5.14 Accept or reject.
FIGURE 5.16 Nearby pharmacies.
FIGURE 5.18 Common problems.
A patient can also ask diagnosis from liis teledennatology by scanning the quick response (QR) code of the doctor. A doctor will have a QR code generated based on the information provided; this information will be encrypted using some encryption methods. A patient has to personally visit the doctor once for scanning the QR code. Once the code is scanned, the chat interface is set up between the doctor and the patient. Doctors’ QR code is shown in Figure 5.20, which can be scanned and added by the patients and after scanned by the patient, doctor information is shown in patients’ app in Figure 5.21. Figure 5.22 shows patient chat with doctor and Figure 5.23 showing that doctor can consult to patients on chat.
FIGURE 5.20 Doctors QR code.
A doctor can view the statistics for a particular disease at a particular location. These statistics will be helpftil to know if there has been an epidemic in an area. The doctor also has all the history of the patient treated. Figure 5.24 reveals statistics can be given to doctor based on symptoms.
A patient can also see the home remedies and the do’s and don’ts for some common skin disease problems.
5.5.3 RESULT ANALYSIS
There are five types of diseases considered, ringworm, chickenpox, fifth disease, warts, and contact dermatitis, as shown in Table 5.2.
FIGURE 5.21 Scaimed QR code.
FIGURE 5.23 Chat between patient and doctor.
TABLE 5.2 Training Accuracy
Table 5.2 shows the accuracy achieved for each disease while training the dataset created from Google images. 3x3 depthwise separable convolutions are used by MobileNet, which uses around eight to nine times less computation than standard convolutions at only a minimal reduction inaccuracy. Considering the efficiency achieved in computation, this tradeoff with reduced accuracy is acceptable. The average accuracy for each disease is more than 85%.
Table 5.3 shows the accuracy achieved for each disease while testing the dataset created from Google images. The test set consisted of 150 images for each disease. The average accuracy obtained for each disease was more than 80%. Considering the computational limits of mobile devices, the performance of the MobileNet model is quite impressive. For mobile devices, a computationally inexpensive model is preferable. MobileNet satisfies these criteria in exchange for a small reduction of accuracy, which is tolerable.
TABLE 5.3 Testing Accuracy
PROS AND CONS OF THE PROPOSED METHOD
Pros of the proposed method
• Increased access, particularly in areas where geographic barriers prevent or limit a person’s ability to get dermatologic treatment.
Cons of the proposed method
In this chapter, we have implemented an automatic classification method to find skin diseases and provided diagnosis. This chapter is capable of classifying five skin diseases hi infants as well as adults. They are chickenpox, contact dermatitis, fifth disease, ringworm, and wart. This application gave us 85% accuracy having 5000 training images and 750 testing images. The app was able to classify 616 images out of 750 images correctly. The proposed system overcomes the drawback of existing applications, as mentioned in Chapter 4, with the remarkable idea of handling the less sensitive cases automatically without even disturbing the doctor for those. No other system can handle this scenario of less sensitive disease beforehand, but our system can. When the patient having a typical skin rash, then instead of approaching directly to the doctor, our system fust provides the home remedies; then, on no sign of cure, the case will be sent to the doctor. This application can give statistics to the users about the overall diseases in a region for better visualization of the world’s population. This application can help solve many daily issues of the common man. Even though the proposed method is not 100% effective and ready for public use, it is an effort to explore automation in healthcare for the benefit of society without any additional charges.
This chapter has a vast scope in the future because it revolutionizes the medical field and the procedure doctors are following today to cure existing diseases.