This paper deals with a generalized automatic method used for designing artificial neural network (ANN) structures. One of the most important problems is designing the optimal ANN for many real applications. In this paper, two techniques for automatic finding an optimal ANN structure are proposed. They can be applied in real-time applications as well as in fast nonlinear processes. Both techniques proposed in this paper use the genetic algorithms (GA). The first proposed method deals with designing a structure with one hidden layer. The optimal structure has been verified on a nonlinear model of an isothermal reactor. The second algorithm allows designing ANN with an unlimited number of hidden layers each of which containing one neuron. This structure has been verified on a highly nonlinear model of a polymerization reactor. The obtained results have been compared with the results yielded by a fully connected ANN.