Design and analysis of neural networks for pattern recognition