Endogenous noise has been shown to play a central role in the detection of an electromagnetic signal in the nervous system. In this work, following a biomedical perspective, an exogenous noise applied to a realistic feedforward network model has been considered. It will be shown that, if the exogenous noise is properly filtered and its level is adjusted, a clear optimization of network encoding of an electromagnetic signal, representative of an external stimulation, is obtained through the stochastic resonance paradigm.