Abstract :According to statistics, every fifth married couple is faced with the inability to conceive a child. Male germ cells are very vulnerable, and the growing number of cases of male infertility confirms that in todays world there are many factors that affect the activity of spermatozoa and their number. But the important thing is not so much their quantity, but quality. The spermogram is an objective method of laboratory diagnosis, which allows to accurately assess the mans ability to fertilize by analyzing ejaculate for a number of key parameters. Only a spermogram can answer the question of a possible male infertility and the presence of urological diseases. When constructing spermograms, it is important to determine not only the number of good spermatozoa, but also their morphology and mobility. Therefore, research and improvement of some stages of spermogramm is the purpose of the study. This article addresses the problem of classification of spermatozoa in good and bad ones, taking into account their mobility and morphology, using methods of machine learning. In order to implement the first stage of machine learning (with a teacher) in the graphic editor, educational specimens (training sample) were created. The training was implemented by three methods: the method of support vector machine, the logistic regression and the method of K - the nearest neighbors. As a result of testing, the method K - the nearest neighbors is chosen. At the testing stage, a sample of 15 different spermatozoa was used in different variations of rotation around their axis. The test sample did not contain specimens from the training sample and was formed taking into account the morphological characteristics of the spermatozoa, but did not copy them from the training sample. At the final stage of study, the programs functioning was tested on real data.