Artificial neural networks are computer programs that can recognize patterns in data and produce models to represent that data. They are inspired by the human brain in how knowledge is acquired through learning and stored in the connections between neurons. Neural networks learn by adjusting the strengths of connections between neurons based on examples provided during training. They are able to model and learn both linear and nonlinear relationships in data.