The rapid development of the Internet and the intelligent information age have provided more possibilities for data leakage, network attacks and other behaviors of malicious persons. The network security of party building in colleges and universities faces severe challenges. Intrusion detection is a new information security technology used to detect intrusions in computer network systems. Intrusion detection methods based on machine learning can better identify unknown anomalies than rule-based methods. The essence of the intrusion detection problem is a classification problem. There are many classification methods in machine learning, including convolutional neural networks, naive Bayes, SVM, etc. These algorithms have good classification performance on balanced data sets. How to extract more representative attribute features from complex data sets to more accurately describe normal behavior and intrusion behavior has become an important breakthrough point in current intrusion detection solutions based on machine learning. In order to solve the problem of network intrusion for party building in universities, this paper proposes to apply the convolutional neural network algorithm and random forest algorithm in machine learning to the intrusion detection model of party building network in universities, which effectively improves the overall classification accuracy of the model and the recognition rate of minority classes.