We formulate an error function for the supervised learning of image search/detection tasks when the positions of the objects to be found are uncertain or ill-defined. The need for this uncertain object position (UOP) error function arises in at least two ways. First, point-like objects frequently have positions that are inaccurately specified. We illustrate this with the problem of detecting microcalcifications in mammograms. The second type of position uncertainty occurs with extended objects whose boundaries are not accurately defined. In this case we usually only need the detector to respond at one pixel within each object. As an example of this, we present results for neural networks trained to detect clusters of buildings in aerial photographs. We are currently applying the UOP error function to the detection of masses in mammograms, which also have poorly-defined boundaries. In all of these examples, neural networks trained with the UOP error function perform much better than networks trained with the conventional cross-entropy error function.