What was once considered science fiction is now becoming reality as developers have the resources and the tools to build artificial intelligence programs. Increased computing power in hardware, massive amounts of data and the wide availability of dedicated frameworks – all those are propelling the development of machine learning.Still, artificial intelligence and machine learning are both a challenge and an opportunity for business and developers alike. While they can secure a competitive advantage for companies, developing such applications is largely uncharted territory.As we constantly invest in research, we’ve started experimenting with these technologies ourselves. Here’s what we learned from it.
All these are relatively new concepts, both for business and for technology. So let’s clear things before we dive in.Artificial intelligence is a branch of computer science that deals with the simulation of intelligent behavior in computers. Artificial intelligence is also referred to when a machine mimics cognitive functions associated with human behavior such as learning and problem-solving.Machine learning is an application of artificial intelligence that provides systems the ability to automatically learn and improve from experience. It focuses on developing programs that can access data and use it to learn in order to make better decisions (source)Big Data refers to large amounts of structured, semistructured and unstructured data that can be mined for information. It includes capturing, storing and analyzing data. Big Data has made machine learning possible as it provides the data needed to build machine learning programs.
Machine learning has two basic approaches:
Teaching machines involves a process in which each stage builds a better version of the machine. The process can be broken down into 3 parts, as seen below.Largely, machine learning projects have 3 major steps:
Machine learning algorithms can be classified into:
While developing Big Data solutions, we worked with tools and frameworks that could scale on thousands of systems. Also, in order to get value from collected data, companies need more than traditional data analysis solutions. This is where machine learning comes in and that’s how we started researching this topic.We have worked on two projects involving machine learning.Project 1: This project was more about natural language processing, the part of artificial intelligence that deals with speech recognition and understanding human language. The available data set was recorded customer support conversations. The challenge here was two-fold. First, we had to transcript the audio conversations without having someone to do this manually, a process referred to as speech to text. The next step was to perform sentiment analysis and entity detection to understand what the sentence was about and what feelings it generated.Project 2: Object recognition and computer vision are one of the oldest problems in artificial intelligence. Our goal was to build a program that could detect and localize a small object on a given image. We collected the data ourselves and started experimenting. The first machine library frameworks we experimented with was OpenCV as it’s a mature solution, with lots of resources, available across multiple devices. Also, it didn’t require a lot of resources to run.Since the object we wanted to detect was rather small, OpenCV with Haar features didn’t return the appropriate results. Tensor Flow has a module dedicated to object detection, so we tried it next, selecting a pre-trained model from a larger dataset. We retrained it with the same data we input to OpenCV and got better results. As we increased the data for the training set, the quality of results improved considerably. We’re now experimenting with other frameworks: Caffe, Digits, and CNTK.
Currently, supervised deep learning algorithms provide the best results. However, these need a lot of data to generate good results. We knew this beforehand, but it’s something different to see it in practice. In the computer vision project, when we increased the amount of data in the training set, the algorithm accuracy improved considerably. We started with a set of 4000 images, going up to 10000 images with 20000 objects. To build a machine learning algorithm, you need huge amounts of high-quality data, it can provide the competitive advantage. There are models that don’t require a lot of data, but these don’t deliver results.
Collecting and cleaning data takes up a lot of time. Still, the output depends on the data you input into the model during the training phase. From our experience, collecting and cleaning data took up about 70% of the time allocated to the project. Only 30% of the time was spent actually solving the problem.
We learned this while working on the first project. While researching and drilling through articles on the subject, we found a lot of articles about machine learning and a lot of similar tutorials. However, at some point, we started running into problems that are not covered in those tutorials. In these cases, we had to dig a little deeper and search forums for potential answers.
For the first project, running a simple test would require a machine with a considerable amount of GPU for days to weeks. Also, one of the reasons why we chose OpenCV for object detection was the fact that it didn’t need a lot of resources.
For the computer vision project, we tested different libraries. There was no way to tell which one solved our particular problem better beforehand. OpenCV, Tensor Flow, Caffe, Digit, CNTK – we tested all of them to see which one provides the best result. Also, there is no “best machine learning framework” – don’t get into that debate. Each framework has its advantages and disadvantages. Experiment various algorithms, libraries and frameworks to see which one is best for you.
One of the things we liked about OpenCV was the fact that it is a mature solution. It has a large community, lots of examples and solid documentation. Compared to that, Tensor Flow object detection API is still in beta. Sometimes we would run into bugs that were being solved the same day. Also, we would run into problems we didn’t even know they existed. Still, it’s challenging, interesting work.