The present invention relates to a method for detecting illegal use of mobile phones, and belongs to the field of
information confidentiality protection technology. The present invention obtains pictures containing mobile phones in a
public environment, simulates a scene where the use of mobile phones is prohibited, and respectively shoots videos of making and receiving calls on mobile phones; the collected materials are first automatically labeled using the YOLOv5 official model, and the
data set is data enhanced; the enhanced
data set is used to
train the YOLOv7 target detection model and the VGG-16 classification model respectively; the camera video
stream is obtained, and according to the frame skipping setting, a
single frame image is obtained therein, and the image size is transformed to the YOLOv7 model input size. The position coordinates of the
mobile phone in the image are obtained by training the YOLOv7 model. An image of the
mobile phone area is obtained, and the image is classified using VGG-16 to determine whether the
mobile phone is currently held; and whether the behavior is illegal. The present invention determines whether there is a violation based on the requirements for mobile phone control in the
application site and combines detection and classification. The detection accuracy of the present invention is high.