New algorithm for neural network data discrimination applied to Markarian 421 high energy gamma rays