Skip to content

davidleejy/Self-Organizing-Map

Repository files navigation

Self-Organizing Map (SOM)

Introduction

This SOM classifies the handwritten characters 'N', 'E', 'U', 'R', 'A', 'L', 'S', 'O', and 'M' into a 10x10 lattice. Handwritten characters are provided as 20x16 pixel images.

This repository provides training data, test data, MATLAB codes for training a SOM, testing a SOM, and visualizing a SOM's lattice.

There are no additional/third-party/external dependencies. MATLAB's Neural Network toolbox is not required. MATLAB alone will suffice.

Contents

  • SOM_database.mat contains the test and training data sets. train data images test data images

  • som_wts_1.mat and som_labels_1.mat are the weights and neuron labels for an SOM I had trained using train_SOM.m.

![trained SOM lattice](./res_for_readme/trained_som_lattice.jpg)

- **train\_SOM.m** trains an SOM. An SOM is trained with images from SOM\_database.mat by default.

  • test_SOM.m tests an SOM. My saved SOM is tested by default. The following screenshot shows the output of test_SOM.m. Output from testing an SOM

- **visualize\_SOM\_lattice.m** visualizes a SOM's lattice like in the picture above. My saved SOM's lattice is visualized by default.

  • visualize_dataset.m visualizes the images in SOM_database.mat like in the pictures above.

Running

Run these .m files like how you would regular MATLAB .m files. These .m files were developed on MATLAB R2012a except SOM_database.mat which was likely developed on an older version of MATLAB.

Design Parameters

Design Parameters

Keywords

Self Organizing Map, Self-organizing Map, SOM, Self-organizing Feature Map, SOFM, Artificial Neural Network, ANN, unsupervised learning, Kohonen map, Kohonen network, handwriting recognition, MATLAB

Acknowledgments

These codes were implemented in fulfilment of an assignment (EE5904R Neural Networks Homework #3) from the National University of Singapore (NUS). I do not take credit for the creation of this assignment. I wrote these codes, not the assignment.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages