One embodiment can provide a system for detecting outlines of objects in images. During operation, the system receives an image that includes at least one object, generates a random noise signal, and provides the received image and the random noise signal to a shape-regressor module, which applies a shape-regression model to predict a shape outline of an object within the received image.