Fall Detection – From Phone to Cloudhn12/thesis/Manvick.pdfIntroduction • This Independent Study...
Transcript of Fall Detection – From Phone to Cloudhn12/thesis/Manvick.pdfIntroduction • This Independent Study...
Fall Detection – From Phone to Cloud
-ArchivingPhoneDataonCloudServer
Student:ManvickPaliwal Advisor:Dr.AnneHeeHiongNgu
What Fall Detection is all about?
Introduction
• ThisIndependentStudyisaboutaFallDetectionSensorApplicationwhichwillhelpdetectifsomeonehasfallendown.Thisapplicationisspeciallydesignedforelderlypeople,butanyonecanuseit.Thewaythisworksiswecollectstreamingsensordatafromasmartwatch.Thesensordatacollectedisthemprocessedtoextractkeyfeaturesrelatedtofallingonasmartphone.ThisprocesseddataisthenfedintoaNaiveBayesmachinelearningalgorithmwhichanalyzesandoutputfallornotfallastheoutcome.
Objective
• Archivingofsensordatatothecloudrobustly.• Improvingtheaccuracyofthefalldetectionmodelbyretrainingusingarchivedfalsepositivedata.
Raw Data
• Rawdataisstreamedfromthesmartwatchatasamplingfrequencyof32milliseconds.• Westorethisdatainsideafoldernamed“RawData”.• Wewriterawdatatoafilenamecur_timestampunder“RawData”folder• Afterevery5minuteswerenamethisfiletoupload_timestampandcreateanewcur_timestampfileandstartwritingtothatfile.• Upload_timestamparethefileswhicharereadytobeuploaded.
False Positive data
Twowaysinwhichfalsepositivedatacanbestored.• Storingalltheprocesseddata(Notefficient)• StoringTimeStamps(MoreEfficient)
False Positive data Continued…
• Westorefalsepositivedatainsideaseparatefoldername“ProcessedData”.• Filename:TimeStamps.csv• TimeStampsatthetimefallhappenedislogged
Uploading
• Readingfromalltheupload_timestampfilesandsendingpostrequesttoserver.• Ifallthedataofaspecificfileisuploadedsuccessfullyasuccesscallbackissentfromtheserver.• Onlyaftersuccesscallbackisreceivedfromtheserverwedeletethespecificfilefromthephone.
Chunking
• Challenges:Ifallsensordataiswrittentosamefileanduploadperiodically,Thefilegetsbiggerandbiggeranditisnotagoodpracticetouploadahugeamountofdataoverhttppostrequest.• AbettersolutionisbasedonuploadingChunks.• Thesizeofeachchunkisapproximately512kbandeachfilechunkiscreatedevery5minutes(300seconds).
Robustness with 2 phones
• AllthedataisuploadedcorrectlyandinarobustwaywithTwomobilesuploadingdatasimultaneously.• IfProgramisclosedin-betweenoftheuploadingprocessnoneofthedataislost.• IftheInternetconnectionislostintheprocessofuploadingofdatathedatawhichisarchivedisdeletedandthedatawhichisnotarchivedissavedsecurelyonclientdevice.• Eachfileisapproximatelyof512kb.
Processed data
Time Stamp
Processed data script
• Thisscriptcreatesfalsepositiverawdataonserverusingtimestampsandrawdata• ThisrawdataisthenpushedtoRscripttocreateprocesseddata.• Theprocesseddataisthenfinallymergedwithexistingtrainingdatatoretrainthemodel.
Algorithm
• GetfalsepositiveTimeStamp(byqueryingFalsePositivetable)• GetSampleIDofeachTimeStampfromSampleMetaDatatable• Retrieve50sampleIdlessthanthecurrentsampleIdfromSampleMetatData• Foreachofthe50sampleid,matchthecorrespodingsampleIDtogetalltheaccelermeterdata(Ax,Ay,Az)• Storethedatainfalse_positive_timestamp.csv• GobacktoStep2asandrepeatuntillallthefalsepositiveTimeStampisqueried.
Cloud Server
• WehaveaphpserverwithMySQLasthebackend.TherearetwophpscriptswhicharereadytoacceptthedatainJSONformatandinsertitintoMySQLdatabase.• insertRawData.php• insertTimeStamps.php
Open Problems
• SQLite• TimeStampisnotaccurate.• Useofclientsidedatabasewillhelpcollectmoreaccuratefalsepositivedata.
• Systemgetsslow• Clearprocesseddatafile.• Circularqueuedatastructurecanbeused.
• SystemshouldbeRetrainedwithallthetruepositiveandfalsepositivedata• Wehaven’tretrainedthemodelwithsufficientdata• Ifuserdon’twanttouploadthedatathesystemwillcrasheventually
Conclusion
• Chunking• Developedprotocoltouploadandarchivedatasensordatafromphonetocloudrobustly.• Dataisdividedintochunksandthenuploaded.
• TimeStamps• Presentedamethodtoreducetheamountofdatatobeuploaded.• Insteadofuploadingalltheprocesseddataonlytimestampscanbeuploaded.
Thank you -Manvick