A neural netowrk approach to event-by-event cosmic ray primary mass identification