A two-layer neural network is trained on a dataset of 10,000 photos to classify images as dogs or cats. The input layer contains 16x16x3=576 neurons to represent each pixel. With 10 hidden neurons, there are 576 input weights, 10 hidden weights, and 2 output weights and biases. The preferred activation for the output layer is sigmoid to perform binary classification of dog vs cat.