Unfortunately, there is no guaranteed way to eliminate all false detections. However, you may be able to tweak some parameters to make the face detection work better on your particular image.
The first thing I would do is look at your false detections. If they tend to be larger or smaller than a typical face in your image, then you can try to adjust the MinSize and MaxSize parameters to get rid of them.
You can also try to use a different model, i. e. 'FrontalFaceLBP' instead of 'FrontalFaceCART'.
If that doesn't work, you can try a more clever trick. First detect the upper bodies of people using the 'UpperBody' classification model. Then detect the faces, and only keep the faces that are contained within upper bodies. This is likely to cut down on false detections, but you are also running a risk of missing real faces.
Finally, you can train your own face detector using the trainCascadeObjectDetector
function. But that is definitely beyond the scope of your project.