The detection of object boundary is an interesting and challenging task in computer vision and medical image processing. The active contour model (snake model) has attracted much attention for object boundary detection in the past decade. However, due to the lack of understanding on the effect of different energy terms to the behavior of related objective functions for an image, the assignment of weights for different energy terms in this model is usually fulfilled empirically. Few discussions have been brought out specifically for assigning these weights automatically. In this paper, a novel self-learning segmentation framework, based on the snake model is proposed and applied to the detection of cardiac boundaries from ultrasonic images. The framework consists of a learning section and a detection section, and provides a training mechanism to obtain the weights from a desired object contour given manually. This mechanism first employs Taguchi's method to determine the weight ratios among distinct energy terms, followed by a weight refinement step with a genetic algorithm. The refined weights can be treated as the a priori knowledge embedded in the manually defined contour and be used for subsequent contour detection. Experiments with both synthetic and real echocardiac images were conducted with satisfactory outcomes. Results also show that the present method can be used to analyze successive images of the same object with only one training contour. Finally, the validity of the weight determining process was verified by the analysis of variance method (ANOVA). (C) 2000 Elsevier Science Ltd. All rights reserved.