An electronic device includes a camera to capture an image, and a processor to input an image acquired by photographing a detergent container into a trained model to acquire detergent information corresponding to the detergent container, and to guide an amount of detergent dispensed based on washing information corresponding to the detergent information. The trained model is a neural network trained using images of a plurality of detergent containers.