-
Notifications
You must be signed in to change notification settings - Fork 1
Hand recognition
The structure of the repository is as shown below:
Topic | Description |
---|---|
Accuray Calculator | Validating model performance |
Convolution | Mathematical matrix to manipulate pixels |
CNN | Network of convolution |
Edge detection | Detecting edges of the data |
LenetMnist | Simple CNN on Mnist data |
Neural network | Training all the incoming data |
Run | Project entry point |
POM | Project configuration details |
Libraries | Dependent libraries |
The following project demonstrates HAND RECOGNITION using Kotlin as primary language. Project is developed and managed at IntellJ platform. References for the projects are detailed at end of this wiki.
Accuracy is a metric that generally describes how the model performs across all classes. It is useful when all classes are of equal importance. It is calculated as the ratio between the number of correct predictions to the total number of predictions.
This section handles the overall accuracy of the Handwritten recognizer project by making use of libraries like MnistDataSetIterator for digit classifications. ScoreCalculator for ScoreCalculator interface is used to calculate a score for a neural network. MultiLayerNetwork is a neural network with multiple layers in a stack, and usually an output layer. The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for log4j, logback and JDK 1.4 logging.
A convolution converts all the pixels in its receptive field into a single value and that is exactly what we need.
Here we are dealing with convolutional for applying the convolution operator. The libraries that are involved are Java Abstract Window Toolkit for color and a thread of execution in a program which Applies the convolution2D algorithm to the input array as many iterations. We have taken two types of convolutions for the iteration of the images with the use of parameters like Input(2d array of image) , width, height, kernel(2d array for kernel), kernel Width, kernelHeight, iterations for convolution.
Further it Takes an image (gray-levels) and a kernel and a position, applies the convolution at that position and returns the new pixel value. Similarly we process for different convolution functions like convolutionsinglePixel, convolution2D, convolution2DPadded, convolutionDouble, ConvolutionDoublePadded. After completing it we convert the double to valid pixels. Finally putting all the pieces together we make a function convolution_image
A Convolutional Neural Network is a Deep Learning algorithm which can take in an input image, assign importance to various aspects/objects in the image and be able to differentiate one from the other. The pre-processing required in a ConvNet is much lower as compared to other classification algorithms. While in primitive methods filters are hand-engineered, with enough training, ConvNets have the ability to learn these characteristics.
We are using a pre-trained model for our CNN to detect images. This is the main core of our project. When we execute the module all the trained images are being analyzed with the mathematical function and the libraries to further make our module ready to analyze the digit drawn. We have used couple of parameters for training purpose nChannels shows Number of input channels val outputNum tells number of possible outcomes val batchSize for Test batch size val nEpochs for Number of training epochs val iterations for Number of training iterations This trained set of data helps our module to achieve the accuracy at the end.
By observing a significant change in the gray level, users can detect the edges of an image. Using this texture, you can tell where one region ends and another begins in the image. In addition to reducing data, it preserves the structural properties of the image
How edge detection is contributing to our projects? Initially for any data or image or live image!!! It goes through vertical edge detection and following horizontal and sobel edge detection. Edge detection is done on pixel of images which is a dense matrix, to pass or apply convolution, we convert dense matrix to array of sparse matrix.
There are seven layers in the LeNet CNN architecture. 3 convolutional layers, 2 sub-sampling layers, and 2 fully connected layers make up the layer composition. In LeNet, convolutional layers and subsampling layers are both significant layer constructs
A wide range of mediums are using this ability of machines to solve such complex problems in order to accomplish specific tasks. Here are some examples, Image processing, Weather forecasting, Music Composition and many more. ANNs are performing operations today that were unimaginable a few years ago. This illustrates how unpredictable ANNs can be in the future, but one thing is sure, the future applications for ANNs will be spectacular and will simplify much more complex processes in a way that will have an immense impact on time and performance.
Model we will be using MultilayerPerceptronClassificationModel Using IDX reader we will load the data asking spark session to create the dataframe having iteration of 100. We will use multi classification evaluator to evalute on test data, Finally using Predict function to predict the data or handwritten digit
Software required: IntelJ Steps to follow:
-
Clone this repository
-
pen Intellj and file >> open project >> select the cloned project
-
Setup Project SDK to
-
POM file have all the dependencies that are required to run the project, once project is opened it will show a pop up to install dependencies from POM file and build the project
-
Once dependencies are install, Run the Run.kt which is entry to the program.