Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

xGem Machine Learning


Published on

xGem Machine Learning

Published in: Technology
  • Be the first to comment

  • Be the first to like this

xGem Machine Learning

  1. 1. 2 Machine Learning
  2. 2. AGENDA - Machine Learning - Neural Networks - Types and Tasks – Practical Example - Classification - Tools Used - Data Preparation - Training - Neural Network Architecture
  4. 4. Machine learning is not just HYPE. It is much more, and currently is a technology that is being used more and more often. 5 MACHINE LEARNING In its most basic conception, it allows a generic algorithm to solve a problem where the input information is not exactly as expected. It gives a program the ability to interpret new information and understand its meaning.
  5. 5. 6 DIFFERENT WAYS TO LEARN Supervised The model is built upon previous data. This data, used for learning is already known. The computer works out the relationship between input - output. Task driven. Unsupervised There is no previous information in this model. The algorithm must be able to extract valid (useful) information from the data presented. Data driven. Reinforcement Interaction with a dynamic environment (constantly changing) provides information as feedback to the Machine Learning algorithm. The feedback takes the form of “rewards” and “punishments”.
  6. 6. SUPERVISED LEARNING APPLICATIONS • Database Marketing • Handwriting Recognition • Object Recognition • OCR • Spam Detection • Pattern Recognition • Speech Recognition 7
  7. 7. UNSUPERVISED LEARNING APPLICATIONS • Cluster Analysis • Anomaly Detection • Multivariate Analysis 8
  8. 8. REINFORCEMENT LEARNING APPLICATIONS • Game Theory and Multi-Agent Interaction • Robotics • Computer Networking • Vehicular Navigation • Industrial Logistic 9
  10. 10. NEURAL NETWORKS What is a Neural Network? A neural network is a set of connected nodes (grouped in one or more layers). Each node can take a set of inputs, applies weight to them and calculate an output value. These output values are the input for the next layer of nodes. What we call “nodes” are in reality large matrices being kept in memory. A layer is a collection of matrices. 11
  11. 11. DIFFERENT MODELS OF NETWORKS Stateless The algorithm has no memory, there is no effectivity to respond to patterns over time. Stateful The algorithm saves a set of the internal calculation, and this is re-used the next time as part of the input. It has memory. It can produce a result based not only on current data but also on previously computed data. 12
  12. 12. MACHINE LEARNING TASKS Classification The output is a classification (i.e. Spam or Not Spam). This is an example of Supervised learning, the classes are all known beforehand. Dimensionality Reduction Reduces the dimensions of the input data, in order to simplify a problem, and to filter out outliers and random variables (Variables that are not functional to the statistical solution of the problem). Regression The output is a continuous value, a probability value (0 to 1) for each input class. Naturally, the sum of all probabilities must amount to 1. 13 Clustering Grouping of information. Similar to Classification, but on an Unsupervised network. Information is grouped in classes, unknown at the start of the process.
  14. 14. 15 Sure, easy GIS lookup, give me a few hours! When a user takes a photo, the APP should check whether they are in a National Park … … and check whether the photo is of a bird. I will need a research team and five years. Ref:
  16. 16. 17 Example: COINS IDENTIFICATION 25 1 10 2 ? 50 2 1 50 2 25 2 10 10
  17. 17. TOOLS OpenCV Computer Vision. • Edge detection. • Image transformations (depth, size, shape, etc.) • Accessing camera feeds. • Filtering images (applying all types of filters) It has implementations for c++, Java, Python, Android and IOS. Also there is a component called Emgu, which is a port for .NET applications. Scipy Open Source python ecosystem of software for mathematics, science and engineering. Tensorflow Google Deep Learning library. It provides method for handling Data input / output, construct a ML model (with many different options) and adding all kinds of configurable layers. 18 TFLearn Python wrapper around Tensorflow. Exposes a simplified library allowing easier scripting and modeling of Neural Networks, handling data sets, etc. Python Powerful scripting Language. Supports multithreading, 64 bits, etc. Anaconda Anaconda provides work environment isolation and package management for Python. Multiple environments can be defined, each one with a different Python version and modules loaded. Tensorbox Java desktop application that enables monitoring training of the Neural Networks in real time.
  18. 18. MODEL SELECTED Learning Type : Supervised Learning Clear classification, known beforehand. The only result expected is a classification whithin a restricted universe (Just three classes). There are no other classes allowed. Learning Task : Regression Having a probability value allows for thresholding of the final result (fine tunning). The final user could decide to adjust the value for reducing either “false positives” or “true negatives”. 19
  19. 19. DATA PREPARATION Images of both sides of One Peso and Two Pesos current Arengentine coins (Most ordinary, not special editions). All images where converted to 128x128 size and also to 24 Bits Per Pixel (this is important, it will determine the dimensions of the matrices in the Tensorflow Vectors). So, ten classes (Two for each denomination, side A and B), with a total of 451 images. Each image is rotated every 15 degrees, and each resultant image is augmented in brightness 4 times (So each image, results in 96 images). Final data set, 43296 images. 30 % of this set is used for validation. 20
  20. 20. SUMMARY - Training 21
  21. 21. Neural Network Model Convolutional Neural Network Architecture • 1st Layer: Convolutional, Max Pooling, Relu • 2nd Layer: Convolutional, Max Pooling, Relu • 3rd Layer: Convolutional, Max Pooling, Relu • Layer Flattening • Fully Connected Layer • Fully Connected Layer (With Number of Nodes = Number of Classes) • Softmax 22
  22. 22. DETECTION APP 23 Circle detection is done using OpenCV HoughCircles function. 1 2 The image to compare to the trained model has to be as similar as those used to train the model in the first place. 1 2
  23. 23. REFERENCES LINKS: OpenCV : Tensorflow: TFLearn: Anaconda: Scipy: Emgu: 24
  24. 24. Thanks… @JuanCarniglia