Modelling the dusty universe - I. Introducing the artificial neural network and first applications to luminosity and colour distributions