The neural network system with terminal attractors is proposed for pattern recognition. By the introduction of the terminal attractors, the spurious states of the energy function in the Hopfield neural networks can be avoided and a unique solution with global minimum is obtained. The computer simulations show the usefulness of the method for pattern recognition. Based on the terminal attractor neural network, we proposed the optical neural network with the terminal attractor model. The results show that the recognition rate is considerably enhanced by the introduction of the terminal attractors.