Based on the existing crime data, the artificial crime and machine learning are used to construct the re-criminal prediction model of the criminals, so as to improve the accuracy of crime prediction and provide a scientific reference for the prevention and control of crimes. Collect basic attribute information, inferior information, activity trajectory and other data of the former staff, and construct a scientific and reasonable perceptual early warning analysis model through data cleaning, feature structure, model establishment, model evaluation and optimization,and select the random forest algorithm as the model training algorithm. The positive sample has an accuracy of 0.85 and a recall rate of 0.86. Crime early warning research is a useful exploration of the implementation of data policing by public security organs in the era of big data. It is the application of data mining and artificial intelligence technology in the field of public security, which is of great significance to the public security organs to implement the feed control of crime. Research shows that crime data can be used to prevent crime, and it can help us understand the causes of crime from a higher perspective.