Detection of defective pixels in solid-state detectors/sensor arrays has received limited research attention. Few approaches currently exist for detecting the defective pixels using real images captured with cameras equipped with such detectors, and they are ad hoc and limited in their applicability. In this paper, we present a probabilistic novel integrated technique for autonomously detecting the defective pixels in image sensor arrays. It can be applied to images containing rich scene information, captured with any digital camera equipped with a solid-state detector, to detect different kinds of defective pixels in the detector. We apply our technique to the detection of various defective pixels in an experimental camera equipped with a charge coupled device (CCD) array and two out of the four HgCdTe detectors of the UKIRT's wide field camera (WFCAM) used for infrared (IR) astronomy [Astron. Astrophys.467, 777-784 (2007)].