Image has become an essential medium for expressing meaning and disseminating information. Many images are uploaded to the Internet, among which some are pornographic, causing adverse effects on public psychological health. To create a clean and positive Internet environment, network enforcement agencies need an automatic and efficient pornographic image recognition tool. Previous studies on pornographic images mainly rely on convolutional neural networks (CNN). Because of CNN’s many parameters, they must rely on a large labeled training dataset, which takes work to build. To reduce the effect of the database on the recognition performance of pornographic images, many researchers view pornographic image recognition as a binary classification task. In actual application, when faced with pornographic images of various features, the performance and recognition accuracy of the network model often decrease. In addition, the pornographic content in images usually lies in several small-sized local regions, which are not a large proportion of the image. CNN, this kind of strong supervised learning method, usually cannot automatically focus on the pornographic area of the image, thus affecting the recognition accuracy of pornographic images. This paper established an image dataset with seven classes by crawling pornographic websites and Baidu Image Library. A weakly supervised pornographic image recognition method based on multiple instance learning (MIL) is proposed. The Squeeze and Extraction (SE) module is introduced in the feature extraction to strengthen the critical information and weaken the influence of non-key and useless information on the result of pornographic image recognition. To meet the requirements of the pooling layer operation in Multiple Instance Learning, we introduced the idea of an attention mechanism to weight and average instances. The experimental results show that the proposed method has better accuracy and F1 scores than other methods.