Pattern recognition based on neural network