A method for performing automatic contouring in a medical image. The method may include receiving an image containing a region of interest and determining a first contour of the region of interest using a boundary detector. The method may include refining the first contour based on a shape dictionary to generate a second contour of the region of interest and updating at least one of the boundary detector or the shape dictionary based on the second contour.