Whether you are brand new to machine learning or have some experience, the following document is designed to give you an in depth understanding of what machine learning is, why machine learning excels in our world, and how it can be applied in an ATAK environment. We recommend you fully read this document from start to finish if you have little to no background in machine learning as this is a field that is known to have steep barriers to get into.

What is Machine Learning?

Machine learning (ML) is a branch of artificial intelligence (AI) and computer science which focuses on the use of data and algorithms to “learn” and make predictions and inferences on data. It is important to note that machine learning is actually a very broad term that encompasses a large area of algorithms and techniques, some significantly more complex than others; thus we often see machine learning as a very elusive and difficult topic for students. Despite this being true in some cases, machine learning is built on very simple mathematics and logic at its core, and with the proper foundations laid ahead, anyone can learn it.

How is Machine Learning Being Used

In today’s world, you will run into some sort of machine learning in almost every aspect of your life. The most apparent applications of ML you have likely heard of are Tesla’s self driving cars, OpenAI’s chatGPT, and voice assistants like Siri or Alexa. You may not be aware of this, but recommendations in search bars or on social media feeds, image recognition on Apple Photos, and product labeling on Amazon are all generated using ML techniques. In the healthcare industry, X-rays, MRIs, and CT scans are often run through computer vision algorithms to help doctors accurately predict the presence of medical conditions. Essentially, the applications of ML are endless.

How it Works

Before getting into the types of machine learning, it is important to understand how machine learning works. In the simplest of terms, scientists use machine learning to provide some sort of insights or predictions on a specific set of data. A very simple example of this is the weather app. In order to anticipate what the weather will be like in a particular city on a particular date, scientists use all sorts of weather data from nearby locations and from previous months and years to make a prediction on the conditions for that day. For example, if you know that the temperature in Los Angeles on July 4th has been around 80 degrees Fahrenheit for the past 5 years, a human would be able to predict (with some level of confidence) that this July 4th, it will also be around 80 degrees. In fact, machine learning algorithms actually aim to imitate the way humans learn and predict in order to create mass predictions on tasks that are infeasible for the average human, especially since a computer can read through thousands of data points in a few milliseconds.

Training and Testing

In order for a machine learning model to produce accurate predictions, it needs to undergo training. For now, we will treat this “model” as a black-boxed component, where all you need to understand is that it takes data as inputs and produces data (in the form of predictions) as an output. Just as a student needs to learn about numbers and addition before it can start solving problems, the model needs to learn about the data, categories, and trends before it can start producing accurate predictions. To do this, we create what is called a training dataset, which we run through the model in order to allow the model to infer those trends and get ready to make predictions. For now don’t worry about the black-box, but just know that the model has internal parameters which adjust over time with each training cycle to slowly create more accurate predictions. Once the model is done training, we give it a testing dataset, which is the model has never seen in training, to assess the accuracy of the model’s output (similar to taking a test in school). Based on the resulting accuracy, scientists can try to improve the model or training data to further improve the predictions. It is important to note that once a model has been trained on a specific set of data, it can only create predictions on similar data points. For example, if you train a model to classify cars and planes, it won’t classify cats and dogs accurately (models are data dependent). Another thing to note is that machine learning in general requires large amounts of data. Small models with few parameters can be adequately trained with 50-1000 data points where as Large Language Models (LLMs) such as chatGPT which had 100s of trillions of parameters required upwards of 500 GB of training datasets comprised of roughly 300 billion words (which to put into perspective, is more words than a human will say in 300 lifetimes).

Supervised, Unsupervised, and Reinforcement Learning

The idea of supervision in machine learning sounds odd, but supervised learning essentially means that a training dataset has labels where as unsupervised learning means there aren’t. What is a label? In ML, we define a label as a classification of which we know is true on a data point. For example, let’s say we are trying to create a machine learning algorithm that when given a picture of a cat versus a dog, will tell us which animal it is. Our training dataset is comprised of many labeled pictures of dogs and cats, so that our model can properly associate the pixels of dogs to a label of a dog and similarly for a cat. Supervised learning is the most common type of machine learning and is what you will be focusing on within the ML example ATAK plugins. Common supervised learning techniques include Logarithmic Regressions, Random Forest Regressions, and Deep Neural Networks.

Unsupervised learning on the other hand is an approach to ML that focuses on pattern recognition. Since there are no labels to attempt to classify or map to, unsupervised learning algorithms attempt to find similarities and gain insights on data without “supervision.” Since unsupervised learning can be more irregular we won’t provide examples in this repository at this time, but it is worth noting that it often allows users to perform more advanced processing jobs. Common unsupervised learning algorithms include K-means Clustering and Anomaly Detection.

Reinforcement Learning (RL), which also won’t be covered in depth, is an approach to machine learning that works on feedback. Our model essentially works as an “agent” and learns how its own decisions affect the current state of its environment. Good decisions and bad decisions are determined by the state space after a decision is made, and the agent will decide its next action by attempting to maximize the reward in the future, based on previous actions. This reward feedback is called the reinforcement signal. Learning about Markov Decision Processes (MDP) is an excellent place to start if you are interested in RL.

Deep Learning

The machine learning models that you will use in ATAK are TensorFlow lite models, which are built on TensorFlow, an open-source library developed by Google primarily for deep learning applications. While it is not necessary for you to fully understand what deep learning is before you begin applying the TFLite modules in Android Studio, we strongly recommend gaining an understanding of this powerful tool before you utilize it.

Deep learning (DL) is a complex subset of machine learning that utilizes artificial neural networks (ANNs) to extract progressively higher level features from data in a way that is inspired by the human brain. The term “artificial neural network” describes the actual architecture that is created in order to perform deep learning inferences, and as the name suggests, it is literally based off the principles of neuronal organization discovered by the connectionism in the biological neural networks of human brains.

Artificial neural networks are comprised of several nodes, each performing very elementary math to send numbers to another node. Yet despite seeming so rudimentary, it is this passing of signals forward and backward through a neural network that allows ANNs to create powerful predictions with up to nearly 100% accuracy. Once again, in order to be so powerful it is important to note that these deep neural networks (DNNs) can have trillions of parameters and at the highest end can take days of continuous computing and a ridiculous amount of processing power to fully train the network.

However, with this effort, DNNs give us access to endless possibilities such as chatbots, filtering systems, autonomous vehicles, generative AI, language translations, and most pertinent to you, image classifications. The introduction of utilizing machine learning and specifically TensorFlow Lite modules in ATAK focuses on neural networks that have already been trained to classify a certain category such as plants. These models have already been trained and tested to have high accuracy, meaning that in order to implement it, you do not need to use or apply any math or knowledge previously mentioned. However, we find it crucial to know in order to understand how inference works.

Model Inference

The term model inference means to use a pretrained neural network and produce predictions on it with new data. Inference is the correct term when referring to all interactions of machine learning an individual will have on a daily basis. Looking at the weather two weeks in advance is actually just running model inference on a complicated weather model. Asking chatGPT a question about the stock market is simply just querying inferences on the LLM. In order to use inference, all TFLite modules have been pretrained, and can be treated as a black-box. You simply put in an input and it will output a classification and a confidence metric. Thus, model inference opens the gates for using and implementing powerful deep learning algorithms without needing the actual knowledge behind the math and science.