Currently in Peru, there is a per capita milk consumption of 87 kg per year; however, the Food and Agriculture Organization of the United Nations (FAO) recommends a consumption of 120 kg per person; the industry, when the milk is acquired from small livestock suppliers, does not analyze the milk before buying it, which there is a high risk that the milk is adulterated with water, in this sense, it proposes an alternative way of preliminary detection of the presence of water in milk, only through a laser a photograph, which greatly reduces the costs of milk analysis. Milk contains different nutrients, vitamins and minerals, which are beneficial for people, so it is very known if it is adulterated or not, that way to prevent diseases. In this document, the reader will read an alternative to the existing methods for the analysis of milk, for the presented method the application of Matlab Classification Learner and the fine K-Nearest Neighbors (KNN) algorithm were used, in which a success rate of 95.4% was obtained.