What is an artificial neural network and how does it work?

Artificial neural networks are computational models inspired by an animal's central nervous systems (in particular the brain) which is capable of machine learning as well as pattern recognition. They work by neurons continuously evaluating their output by looking at their inputs, calculating the weighted sum and comparing to a threshold to decide if they should fire.