MACHINE LEARNING BASED CLOUD MUSIC APPLICATION WITH FACIAL RECOGNITION USING ANDROID STUDIO (MUSYNC)

This paper output is a music player application but when it comes to its features it will be way more than a simple music player. It is developed on Android Studio and other tools like: Firebase is used as database, Android phone camera, Music library of Android Phone are used in the development of application. When user changes his phone or reset his phone then all of his data is lost or user has to put all the data in his computer and then back to his mobile phone except data that is backed up online. Message data, photos and contacts are that things that users backed up online. But music files normally don’t get backed up and user troubles in re downloading the files or moving files in computer and back to phone. In this purposed work the targeted problem is resolved as MUSYNC application is be able to automatically backup all the mp3 data from the phone and user will get all of his data by just signing in the application in his new phone. The purposed application has a feature of sync music. Users can sync music with another one and that person will able to listen to same music instantly. Application also provides a unique feature of mood detection using digital image processing DIP. This feature is able to check your face emotion and play music according to it. User just has to take a picture and that is it, this music player plays the music according to your mood. This feature is useful when user having tough time what to listen.


INTRODUCTION
In other music player applications, as it takes a lot of time to remember name of each and every song when you lost the music data, Chiu and Ko (2017).This application back up the music files that you want to back up on cloud and you don't need to re-download them.This application is able to solve a problem of backing up and restoring your data automatically, that you do manually, Nathan and Kannan (2017).When it comes to music and friends, another problem also rises i.e., when two persons want to listen to same music at the same time on hands-frees.Normally you have to share one hand-free or buy small hardware that connect two headphones with a device and it's a drawback, Shanthamallu et al. (2017).
With the following scope I have finalized the idea and the functionalities of my proposed work that is going to make it unique and different from the other existing systems and will remove the deficiencies already present in the available and current systems, Marr (2019).

OBJECTIVE OF THE STUDY
In smart phones, the music player application wasn't able to back up the music.It means whenever you change your device, the user has to re-download the music and it takes a lot of time and you don't even remember each and every song.It can also be a problem whenever you reset your phone, your data is deleted and your whole data is gone including your music files, so you don't have backup for those files.There can also be a probability that you lost your phone or it is stolen then you lost all of your files, few of them are backed up, like your messages, your photos, WhatsApp data, Contacts and many more but there's no music player that provides you this service of cloud computing and backups your MP3 files, Xu et al. (2015).So, gathering all of the music files back that you loved is almost impossible.
 In order to solve these problems, objective of the proposed application is to provide the facilities that can deal with all these problems and will provides a smooth experience at the user-end.LITERATURE REVIEW Development of an application which is an android Music Player, Anusooya et al. (2020) and Gopalakrishnan and Venkateswarlu (2018).that is mainly designed and build to overcome the problem that is stated as, no music player is able to back up your music files on a cloud, Janssen et al. (2012), that can be restored to your device whenever you lost your phone, you lost your data or you have changed you phone.Another major problem is if more than one person is willing to listen to same music or any MP3 file, Van Den Broek et al. (2012), there are two possibilities, if they are sitting together, they need to share their earphones which will affect your music quality or they have to buy a special hardware to attach more than one earphone to one device, Lima et al. (2017).Other possibility is that the users are in some different places they want to listen to same music, Xu et al. (2015), but there's no Music player application that runs same music file on more than one android device, Chen et al. (2016).This application will back up the music files that you want to back up on cloud and you don't need to re-download them, as it takes a lot of time to remember name of each and every song when you lost the music data, Ahmed (2020).So, this application solves a problem of backing up and restoring your data automatically, that you do manually.This application also helps the user to sync to the other friend and they can also listen to same music on the same time.The purposed application will also help the user to sync even if the friends are at distant place (Akmandor et al., 2020).Traore et al. (2018).CNNs use a variation of multilayer perceptron's designed to require minimal preprocessing.They are also known as shift invariant or space invariant artificial neural networks (SIANN), based on their shared-weights architecture and translation invariance characteristics, Ashqar et al. (2019).Convolutional networks were inspired by biological processes in that the connectivity pattern between neurons resembles the organization of the animal visual cortex, Zeiler and Fergus (2014).Individual cortical neurons respond to stimuli only in a restricted region of the visual field known as the receptive field.The receptive fields of different neurons partially overlap such that they cover the entire visual field, Takabi et al. (2016).

Models (Transferring)
The model is generated on a desktop machine because of high processing power needed to train the model and model is converted to Tensor Flow lite format for using on android using Linux TOCO converter which is not currently working for Windows, Guo et al. (2019).

Analysis from Literature Review
By using those apps there were few problems in every project application that are discussed above, Masri and Erdal (2019).And I have created an application which was solution to every proposed problem.For example, from amp.me we got to know that Music Application wasn't able to backup and restore music.According to the above given concepts my project uses a trained model that is trained on a dataset of 35000+ images.The data set is taken from kaggle which was used for the facial expression recognition competition, Kaggle.com, (2018).The dataset is divided in to 2 files training and testing made up of 48*48 gray scale images.Then the model is changed and deployed to android using tensor flow lite.The Application then uses the model to extract emotion from a given image that is taken live from an android phone and then transferred to the model to get the emotion and based on that emotion the user can use select to listen to the songs present in his own device or to Stream music over the internet, Sommerville (2006).
 I have an accuracy of 60-70% to further improve it.I am getting feedback of the user if the emotion detected is not correct in which the image of the user is converted to byte array and uploaded to GCS (Google Cloud Service) where the image is saved and a collection is made in order to further train the model manually. The accuracy is observed to be lesser than usual because human expressions are more likely to differ from person to person, Ni et al. (2020). Also, the model is observed to give better results on European faces relative to Asian.The application takes user feedback with the image that is used for collection of data and model can be trained further for variety of people thus making the model more efficient and accurate, Ofni Systems (2018).

Current System
A brief description of an existing system.
Table 2. Related System Analysis, proposed project solution, Chuttergoon and Nagowah (2020) The related system information for proposed system is as follows: Application Name Weakness Targeted Project Solution The name of related application(s).
Weaknesses may include limited features, low quality functionality and processes.
The way the proposed project mitigates the weaknesses.

Emotion Detection from Text It uses text to categorize
emotion which means user has to spend time in typing.
The text will be replaced with image of the user.

Xam Cognitive It just tells the percentage of all emotions by using image of the user
The app will be able to suggest music based on emotions.

FACE-e App
It computes the expressions and emotions of tiny toddlers who can't express it all through their words.
The emotion detection can also be applied to adults.

RESEARCH METHODOLOGY
Incremental model is a kind of model in which the project scope is divided into multiple segments and modules and each module will be developed separately in the form of small increments.The reason to use incremental model for the proposed system is that system consist of small modules or functionalities.The modules requirements might change during the development phase so it provides freedom and options more than rigidly developing using sequential way.

Designed Methodology
The designed methodology that I am going to use is MVC which is very clear as it is an android mobile application.VC Pattern stands for Model-View-Controller Pattern.This pattern is used to separate application's concerns.

Methodology and Software Lifecycle for This Project
The software process model used for the proposed system is agile model.Incremental model is a kind of model in which the project scope is divided into multiple segments and modules and each module is developed separately in the form of small increments.The reason to use incremental model for the proposed system is that system consist of small modules or functionalities.The modules requirements might change during the development phase so it provides freedom and options more than rigidly developing using sequential way, García et al. (2017).

Rationale behind Selected Methodology
The reason to use incremental model for the proposed system is that system consist of small modules or functionalities.The modules requirements might change during the development phase so it provides freedom and options more than rigidly developing using sequential way.So, it can independently work on parts of modules and then combine them together.Giving us a bit of freedom and this helped solve many integration problems, Martikainen and Said (2018).

System Architecture
The architectural style used is object-oriented architecture.The data is passed between different components through message passing.There are mainly three subsystems which are as follows: • Face detection: The face of the user is detected and a rectangular box is drawn for the detected face.

•
Emotion detection: This subsystem is responsible for detecting emotion from the camera using CNN based trained model.

•
Media player: The audio controls like playing song, moving to other songs etc.

•
Sync Music: The multiple android devices will be connected, and music will be played on all the connected devices, Huang et al. (2010).

•
Backup and Restore: The song will be backed up and will be restored when needed.

Getting and displaying songs from the phone
• Get path of the audio files in phone.

•
Declare a cursor object for moving through all files.

•
For (Cursor points to the first file and cursor is not null and move cursor to next)

Sync Music
• Friends are added and a connection is built.
• When connection is built both devices share a same node of Real Time Database.

•
One device sends the information, and simultaneously it is sent to the receiver phone.

•
Music on both devices run on the same time, Julin et al. (2020).

Backup Music
• Music files from the memory are shown in an adapter view.

•
There's a button on adapter view • By clicking that button, the name of file is saved in cloud, and file is stored in Firebase Storage, Julin et al. (2020).

Restore Music
• By clicking on download button, the names of all the songs are fetched from cloud storage.

•
Names are split by using tokenizer, and each name is sent simultaneously and every song is fetched from the Firebase Storage, Parekh et al. ( 2020).

External APIs
Describe the APIs used in the following table.

Media Player
This class is the primary API for playing sound and video.
The purpose of API is to play music from the list and to start and stop the player with built in functions.

Firebase
The google engine is used to store files from user as backup of their music files, also helped me in Syncing.
The user can save his fav music files and can get in any phone anywhere he likes.and also, can sync phones and play music simultaneously.

DATA TESTING AND EVALUATION Manual Testing 1. Allow Permissions
To ensure that user gives access to all required permission in the device.

Play Song from The Playlist
The User Selects the desired song from the playlist.

Pause Song
The user can view the playing song and can pause any playing song.

Resume Song
The User Clicks the play button.
Music plays and icon is changed PASS

Play Next Song
The user can view the playing song and can select next song to play. No.

Show Emotion detected
User captures the face image The user is shown the emotion detected by the system and playlists to choose from.

Show emotion detected User captures a non-face image
No emotion is detected FAIL

Choosing Play Mode
The user is requested to choose from the playlists of offline or online.

No. Test case/Test script Attribute and value Expected result Result
13. Choose Play Mode User chooses "OFFLINE" mode.
The custom playlist is opened for the respective emotion.

14.
Add Songs to the playlist The user can add songs to the playlist that are to be generated by user and are custom generated playlists.User clicks on "accept request" button and the sender will be added as your friend.

No
The user will be able to see the profile and will be able to perform various function.

View Friends Timeline
The user can accept friend's request.
No. The user will be able to see the lists of songs he have already uploaded.

Unit Testing
We have tested each module and the functionality thoroughly for bugs and errors.We have identified most of them.We have removed almost all the bugs found and still working to find more bugs to solve.

Acceptance Testing
For all the functionality flow of the system, the final acceptance test is done by the supervisor.

Functional Testing
The functional testing will take place after the unit testing.In this functional testing, the functionality of each of the module is tested.This is to ensure that the system produced meets the specifications and requirements (Giannakos et al., 2020).

CONCLUSION
MUSYNC is a great android-based application and has excessive scope.This proposed cloud music player application plays music according to user moods with the help of machine learning and facial recognition which is based on different mood also stated by, Kumar (2018), and Jain, et al. (2017), states of the stimuli that is being clicked by android phone camera and also it has a variety of other features too.Like, create account, backup and restore option, update user bio, send friend request, add friends, search friends via user id or by authorize Gmail account, update user profile, Glover (2018), provide local storage, music library of phone including audio and video songs, which is not provided by any other applications.Also, there's a Party Mode, which sync your phone with someone else's phone and you can play music together at the same time within the same place.For all the cloud storages by means of keeping the track and record of everything, Firebase is used as database that is provided by Google platform, Kundinger (2021).This is quite an expensive application and people pay thousands of rupees for its purchases.

FUTURE WORK
For future we have thought on three different features, and we'll surely work on it as well.Like, sharing music, from which users can share music using this application.Secondly, we'll also thinking about making it a kind of social application.By which people will be able to tell their views about some great music and will able to post statuses of their timelines.Final work that can be done is giving this syncing module an offline mode.So that people can also syncing their phones without internet.Using Wi-Fi-Direct of some other mean.That'll make it a huge progress and we believe that it'll get a lot of attention from general public.

Table 1 .
Related Application analysis with proposed project Model-Model represents an object or JAVA POJO carrying data.It can also have logic to update controller if its data changes. View-View represents the visualization of the data that model contains. Controller-Controller acts on both model and view.It controls the data flow into model object and updates the view whenever data changes.It keeps view and model separate

. Test case/Test script Attribute and value Expected result Result
The user can view the playlist generated and play any song.

Test case/Test script Attribute and value Expected result Result
The user can view the playing song and can select previous song to play.