Click here to Skip to main content
15,884,537 members
Articles / Artificial Intelligence / Neural Networks

Multiple convolution neural networks approach for online handwriting recognition

Rate me:
Please Sign up or sign in to vote.
4.95/5 (37 votes)
9 Apr 2013CPOL8 min read 75.9K   25.1K   74  
The research focuses on the presentation of word recognition technique for an online handwriting recognition system which uses multiple component neural networks (MCNN) as the exchangeable parts of the classifier.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ANN.Perceptron.ArchiveSerialization;
using ANN.Perceptron.Common;
using ANN.Perceptron.Neurons;
using System.Drawing;
using System.Threading;
using System.Threading.Tasks;
namespace ANN.Perceptron.Layers
{
    public class InputLayer:CommonLayer
    {
        public InputLayer(String sLabel, Size inputSize)
        {
            label = sLabel;
            prevLayer = null;
            weights = null;
            featureMapSize = inputSize;
            nFeatureMaps = 1;
            weightCount = 0;
            floatingPointWarning = false;
            ParallelOption = new ParallelOptions();
            ParallelOption.TaskScheduler = null;
            _maxDegreeOfParallelism = Environment.ProcessorCount;
            ParallelOption.MaxDegreeOfParallelism = _maxDegreeOfParallelism;
            type = LayerTypes.Input;
        }
        public override void Initialize()
        {
            floatingPointWarning = false;
            CreateLayer();
        }
        protected override void CreateLayer()
        { 
            
            var rdm = new Random();
            if (neuronCount > 0 || neurons != null)
            { //clear neurons
                neurons = null;
                neuronCount = 0;
            }
            if (weightCount > 0 || weights != null)
            {
                //clear weights;
                weights = null;
                weightCount = 0;
            }
         
            #region input layer type
            //
            //  the input layer.
            // Create neurons: exactly the same number of neurons as the input
            // vector of 29x29=841 pixels, and no weights/connections
            prevLayer = null;
            neuronCount = nFeatureMaps * featureMapSize.Width * featureMapSize.Height;
            neurons = new Neuron[NeuronCount];
            weightCount = 0;
            weights = null;
            for (int ii = 0; ii < neuronCount; ii++)
            {
                String lb = String.Format("Layer {0}, Neuron {0}", label, ii);
                neurons[ii] = new Neuron(lb);
            }
            #endregion
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Vietnam Maritime University
Vietnam Vietnam
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions