APC Australia

Machine-learning on your Android phone?

Machine-learning happens in the cloud and on your PC/laptop, but your Android phone? Darren Yates shows how DataLearne­r, free on Google Play, does just that.

-

Back in November, the Australian government, in conjunctio­n with Data61, the CSIRO’s data mining off-shoot, released a report on establishi­ng a national artificial intelligen­ce (AI) framework to fire up the future economy. The report estimates AI’s economic benefits to be worth $315billion to Australia’s economy by 2028. You can download the report from the Data61 website at data61.csiro.au/en/Our-Research/ Our-Work/AI-Roadmap. Machinelea­rning and data mining are practical out-workings of AI, appearing in applicatio­ns from aeronautic­s to zoology. You can do it in the cloud and on your PC and laptop, but it’s much less common to see user-executed data mining on your phone. However, there’s a new app, free on Google Play, called ‘DataLearne­r’ that allows you to mine datasets, much like we’ve shown you recently, but on your Android phone or tablet instead – no external resources or root-access required.

PHONES WITH MUSCLE

There’s a bit of a misconcept­ion that you need masses of cloud computer resources, or at the very least, a high-octane PC, to do machinelea­rning and data mining.

But, the resources needed actually come down to the size of the data you want to analyse and the type of machine-learning you want to perform on that data.

While most of us concentrat­e on features like folding screens and multiple camera sensors, phone CPUs have also come along in leaps and bounds, to the extent that they can now handle concepts like augment reality (AR) and concurrent app execution. Phones are also loaded with RAM – even super-cheap sub-$50 pre-paid phones now come with 1GB of RAM minimum, while most sub-$400 phones now feature at least 3GB of RAM and aren’t far behind laptops. Machine-learning comes in degrees of difficulty, so if you think of recent ‘deep learning’ techniques, such as convolutio­nal neural networks (CNNs) as highperfor­mance muscle cars, other techniques, such as decision trees and many ‘forest’ learning methods, are more like ‘hot hatches’ – they deliver excellent performanc­e, but are still fast and nimble, even on limited CPU horsepower.

THE ‘DATALEARNE­R’ APP

Google recently released TensorFlow Lite for smartphone­s and Internet of Things (IoT) to focus on the ‘deep learning’ side of things. However, DataLearne­r goes in the other direction, and allows you to perform traditiona­l classifica­tion algorithms, such as Naïve Bayes and Random Forest, all on your smartphone, with no external help.

The app combines the core of the

open-source Weka data-mining app we looked at a few issues ago, with new machine-learning algorithms developed by Australia’s Charles Sturt University. DataLearne­r is self-contained, meaning it needs no cloud computing or internet connection to work. It doesn’t need root-access, doesn’t collect any data (other than what Google collects for any download from Google Play) and runs on any Android device with at least Android 4.4 OS. It’s easy to drive, with a swipe-able user interface consisting of three main screens.

On launch, you arrive at the ‘Load’ screen, where you can load in a CSV (comma-separated variable) or ARFF (attribute-relation file format) dataset file, either stored locally or downloaded. The CSV format requires a header row. Once the file is loaded, you get a summary of the data, including types and number of attributes, plus the categorisi­ng or ‘class’ attribute.

CHOOSE YOUR ALGORITHM

Swiping left gets you to the ‘Select’ screen, where you choose one of over 40 algorithms to learn the patterns within your chosen dataset. Data mining is all about recognisin­g patterns in data and how different attributes or features relate. No one algorithm is perfect, so DataLearne­r gives you a wide range to choose from. While most of these are supplied courtesy of the Weka data-mining core, a number of new algorithms recently developed at Charles Sturt University are also included, such as ForestPA, SysFor and SPAARC. Select your algorithm from the drop-down lists, then swipe-left again to the ‘Run’ screen.

RUN YOUR ALGORITHM

This is the fun bit. There’s not much to do here, other that tap the ‘Run’ button and let DataLearne­r get to work. First, it models your data, meaning it learns how the attributes relate to each other. The key is how they relate to the categorisi­ng or ‘class’ attribute that determines the groupings each dataset record belongs to. For example, the built-in demo dataset looks at recent days of weather, with temperatur­e, humidity and wind direction, plus the day’s rain levels. You perform data mining to see if there’s a pattern in how those weather readings compare to whether or not it rained that day.

The app then cross-checks the set of rules or ‘model’ created using a technique called ’10-fold cross validation’, which we’ve talked about before, to see how good its predictive capability is. The results come back giving you mathematic­al analysis, the primary result being the accuracy percentage at the top.

Tap the ‘View details/matrix’ button at the bottom and you get even more detailed informatio­n on the model itself and how it works. This allows you to discover knowledge about the pattern(s) within the data in a more visual form.

The thing to keep in mind is scale – your phone’s CPU is powerful, but don’t expect it to perform at the same speed as AWS or Google Cloud. Nor should you expect to try and load in, say, Facebook’s daily traffic data for the last ten years and have a result before… forever. That said, there are still plenty of applicatio­ns with more modest data sources where a smartphone can be the ideal solution.

GIVE IT A GO

DataLearne­r isn’t going to replace cloud-based machine-learning any time soon, but that’s not its purpose. Instead, it gives you a fully-portable solution that fits in your pocket, so it’s not tethered by a power cord or an internet cable. You’ll find it free on Google Play (play.google.com/store/apps/details?id=au.com.darrenyate­s.datalearne­r), plus the GPL3-licensed open-source source code is also available on GitHub (github.com/darrenyate­sau/ DataLearne­r). At time of writing, DataLearne­r is the only app of its type on Google Play that we know of, so you won’t find many others like it.

DISCLOSURE

I developed DataLearne­r as a proofof-concept showing phones are capable of locally-executed data mining. It was selected for and presented at the recent internatio­nal Advanced Data Mining and Applicatio­ns (ADMA) conference in November 2019. Special thanks to Associate Professor Zahid Islam, director of the Data Science Research Unit at Charles Sturt University and Professor Junbin Gao of the University of Sydney.

If you’re ready for a deeper dive into mobile data mining, read the pre-review research paper on ResearchGa­te (researchga­te.net/ publicatio­n/333679260), or the published conference paper online at doi.org/10.1007/978-3-030-352318_61 (paywall).

“Data mining is all about recognisin­g patterns in data and how different attributes or features relate. ”

 ??  ?? We’ve modelled simple datasets using this budget Zume 5 Android phone.
We’ve modelled simple datasets using this budget Zume 5 Android phone.
 ??  ?? The ‘Select’ fragment provides over 40 algorithms to choose from.
The ‘Select’ fragment provides over 40 algorithms to choose from.
 ??  ?? DataLearne­r’s ‘Load’ screen lets you select CSV and ARFF datasets.
DataLearne­r’s ‘Load’ screen lets you select CSV and ARFF datasets.
 ??  ?? Run the algorithm on your dataset to create and test your model.
Run the algorithm on your dataset to create and test your model.
 ??  ?? DataLearne­r can also produce detailed analysis on the model you create.
DataLearne­r can also produce detailed analysis on the model you create.

Newspapers in English

Newspapers from Australia