Among the numerous methods found in the literature that researchers used to develop intrusion detection systems, Artificial Neural Networks (ANN) were the most used machine learning techniques, which is why they were chosen as the main focus in this study, which we relied on to develop a new model that can detect network anomalies. The training stage of ANN is considered the main step of building a predictive model for computer worms to attack, there are different algorithms in the literature to get that done, and including deterministic methods and stochastic ones, each has its pros and cons. to train our proposed model, we relied, within this study, on the improved 'tree-seed algorithm' which is a nature-inspired algorithm. The proposed model was trained with an improved dataset from its predecessor that was extracted from a simulation of the US Air Force network, and it was evaluated based on the test part, which contains types of attacks that the model has not previously trained on, the results obtained indicate good learning capabilities of the proposed model comparing to the results of two other models based on two stochastic algorithms, namely the 'genetic algorithm' and 'particle swarm optimization. The experimental results obtained on, NSL-KDD database show that the proposed scheme achieves interesting performances.