A dishwasher includes an image-based detergent sensor that in some instances is configured to sense a type of detergent for use in optimizing a wash cycle based upon the type of detergent, and that in some instances is configured to direct one or more controllable sprayers to facilitate dissolution or mixing of detergent into a wash fluid during a wash cycle.