Discovering objects and knowing their number has been discussed in many works. Face detection technology is important for the visual scene, Deep learning theory using computer technology to discover the face, which is a wide field in marketing, traffic and security system control systems, in addition to photography. Facial recognition algorithms or face detection Include steps for the facial image to extract features to match them with a database. The face has a biometric feature. The facial feature consists of prominent and easily identifiable information that is responsible for distinguishing the objects that distinguish the face, the distance between the eyes, the shape of the nose, and The mouth for the device to perform a training group and record the data. Matlab program helps to dispense with training because MATLAB provides the instruction (CascadeObjectDetector) for facial recognition and the Viola-Jones algorithm with the result of separating the detection results in the form of subsets. In this work, a new algorithm is created for a group of elements in the unit picture And run a face detection code to highlight the background to store the information of each image in a specified folder and the face detection techniques by proposing a new algorithm to detect a face from among a group of faces, distinguish it and make it a file of its own, all of that using the Matlab program to train the neural network for face recognition.