The invention provides a text-guided weak-
annotation flotation froth segmentation and counting method and
system, and relates to the technical field of
artificial intelligence and
computer vision. The method comprises the steps that an image of foam in a flotation tank is collected, preprocessing and point level labeling are carried out, and text description of flotation foam is collected and preprocessed; inputting the preprocessed image into a point
heat map generation module, identifying a key point in the image, and forming a bounding box with a preset size by taking the key point as a center; inputting the key points and the bounding boxes into a hierarchical
mask generation module based on weak
annotation, and guiding the hierarchical
mask generation module to generate integral, partial and subpart hierarchical masks; inputting the text description and the few-sample example image into a vision-language
feature mapping module, and mapping the text description and the few-sample example image into the same embedding space for feature splicing to obtain classification guidance features; and extracting regional features by using a hierarchical
mask, and carrying out similarity alignment on the regional features and classification guidance features, so that
accurate segmentation and counting of specific types of foams in the image are realized.