A real-time approach for failure detection in material extrusion process based on artificial neural network