<commit_before># MLP character recognition

Trains a multi-layer perceptron (MLP) neural network to perform optical character recognition (OCR). The training set is automatically generated using a modified version of the captcha-generator [node-captcha](http://npmjs.com/package/node-captcha).

The script moves each character to the center of the 400-bit (20x20) network input to maximize success rate.

Below are examples of input images from training sets generated for recognition of numbers ```0-9``` and letters ```a-z``` respectively.

## Performance

* **```abcdefghijklmnopqrstuvwxyz```**
    * **Font:** Arial, Helvetica, sans-serif
    * **MLP specification:**
      * **Neurons:** (```400``` input, ```40``` hidden, ```8``` output)
      * **Learning rate:** ```0.1```
      * **Training set:** ```52000``` characters (e.g: ![abcdefghijklmnopqrstuvwxyz](https://raw.github.com/mateogianolio/mlp-character-recognition/master/examples/abcdefghijklmnopqrstuvwxyz.png))
    * **Success rate:** ```98.52%```
* **```0123456789```**
    * **Font:** Arial, Helvetica, sans-serif
    * **MLP specification:**
      * **Neurons:** (```400``` input, ```40``` hidden, ```8``` output)
      * **Learning rate:** ```0.1```
      * **Training set:** ```20000``` characters (e.g: ![0123456789](https://raw.github.com/mateogianolio/mlp-character-recognition/master/examples/0123456789.png))
    * **Success rate:** ```99.79%```

## Usage

Clone this repository and make sure the ```input``` folder exists before running
<commit_msg>update layout<commit_after># MLP character recognition

Trains a multi-layer perceptron (MLP) neural network to perform optical character recognition (OCR). The training set is automatically generated using a modified version of the captcha-generator [node-captcha](http://npmjs.com/package/node-captcha).

The script moves each character to the center of the 400-bit (20x20) network input to maximize success rate.

Below are examples of input images from training sets generated for recognition of numbers ```0-9``` and letters ```a-z``` respectively.

## Performance

* **abcdefghijklmnopqrstuvwxyz**
    * **Font:** Arial, Helvetica, sans-serif
    * **MLP specification:**
      * **Neurons:** (```400``` input, ```40``` hidden, ```8``` output)
      * **Learning rate:** ```0.1```
      * **Training set:**
        * **Size:** ```52000``` characters
        * **Sample:** ![abcdefghijklmnopqrstuvwxyz](https://raw.github.com/mateogianolio/mlp-character-recognition/master/examples/abcdefghijklmnopqrstuvwxyz.png)
    * **Success rate:** ```98.52%```
* **0123456789**
    * **Font:** Arial, Helvetica, sans-serif
    * **MLP specification:**
      * **Neurons:** (```400``` input, ```40``` hidden, ```8``` output)
      * **Learning rate:** ```0.1```
      * **Training set:**
        * **Size:** ```20000``` characters
        * **Sample:** ![0123456789](https://raw.github.com/mateogianolio/mlp-character-recognition/master/examples/0123456789.png)
    * **Success rate:** ```99.79%```

## Usage

Clone this repository and make sure the ```input``` folder exists before running

{'fraction_non_alphanumeric': 0.18316195372750643, 'fraction_numerical': 0.04691516709511568, 'mean_word_length': 4.480633802816901, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2905474', 'n_tokens_mistral': 1102, 'n_tokens_neox': 951, 'n_words': 271}