Image Compression Using An Adaptation of the ART Algorithm Craig Weidert December 12, 2006 CS152 - Neural Networks
Background I would like to use neural networks to compress images. Used 48 by 48 pixel 8-bit grayscale bitmaps Implemented in Python I tried two methods
Attempt #1 (Failure) Standard NN w/ Backprop Gameplan: Train network on image Save weights of network Restore network, run through co-ordinates to restore image Inputs: x and y co-ordinates of pixels Desired Output: grayscale value of pixels Used two hidden 10 wide logsig layers
Results / Problems Difficulty in training Not very faithful Took a long time Grayout problem Inconsistent Not very faithful Lower right hand corner
Attempt #2 (Relative Success) Use scheme similar to k-means and adaptive resonance theory Gameplan: Use network to cluster pixels into “prototypes” based on position, color Save prototypes Load prototypes, for each pixel find closest prototype and use that color
Algorithm For each pixel in the image, create sample (x, y, c) Iterate through samples If there are no prototypes, make one If there is a prototype within a tolerable distance of the sample, lump in w/ closest If all prototypes are far away, make new prototype Save the prototypes, truncating as necessary
Results Ran much faster At the point where you could tolerate the error, often no longer compression However, achieved a very cool mosaic effect
Future Work Differing image sizes Scalability questions Different comparisons for samples, prototypes Different weightings Different metrics (MSE)? Changing Algorithm entirely