Accurate and rapid detection of foodborne bacterial pathogens is critical for food quality control. Nowadays, tracking morphological bacterial properties using microscope is still a priority at the grass-roots food supervision department due to its simplicity and low cost. However, the method requires highly professional personnel and there are certain misjudgments in the process of analysis. Automatically recognizing foodborne pathogen using deep learning algorithm to replace manual microscopy will not only reduce expert cost, artificial misjudgment, and operation time in detection, but also provide more objective and accurate identification. Here, we firstly constructed a high-quality and large-scale dataset of foodborne pathogenic bacteria, allowing the deep learning-based model to be efficiently trained and achieve accurate identification. The deep convolutional neural network-based model is capable of identifying six common foodborne pathogens, including Escherichia coli (O157:H7), Vibrio parahaemolyticus, Staphylococcus aureus, Bacillus cereus, Salmonella typhi, and Streptococcus hemolyticus, with accuracy rates of 90%–100%. This method can assist or replace the manual microscopic inspection step in traditional detection methods, and is promising to break through the traditional approach that heavily relies on manual judgment, greatly reduce the cost of experts and human errors, and provide rapid, accurate, and powerful discriminatory results in large quantities for detection.