Small object detection is an unresolved problem for image processing, especially for medical image processing. Microaneurysm (MA) is a kind of small objects in retinal images. It has small size, low local contrast, and more noise interference, so it is difficult to be detected.Traditional detection methods require manual extraction of features, making it difficult to accurately detect MA.The detection based on deep learning requires a large amount of complex preparatory work, and it is difficult to solve the imbalance problem between positive and negative samples, which is easy to cause over-fitting.Sparse autoencoder (SAE) is an unsupervised machine learning algorithm that efficiently extracts the features of samples in an environment with unbalanced sample data.Therefore, an unsupervised learning method based on SAE is proposed to detect MA. The weights and offsets of SAE are updated by backpropagation to extract the features of the samples, and the extracted features are used to train softmax to achieve accurate detection of MA.In order to evaluate the performance of the method, three databases (Retinopathy Online Challenge, DIARETDB1 and E-ophtha-MA) are used to carry out experiments.Experimental results show that the method can accurately detect MA in retinal image and obtain higher accuracy and sensitivity. The accuracy rates are 98.5%, 87.2%, and 92.6% respectively, and the sensitivity are 99.9%, 99.8%, and 98.7% respectively.