Am-sam: إطار تعلم مدفوع بالوعي المكاني ومعايرة القناع للتقسيم الدلالي القليل اللقطات Am-sam: a spatially-aware prompt learning and mask calibration framework for few-shot semantic segmentation

شارك:
المجلة: International Journal of Machine Learning and Cybernetics، المجلد: 17، العدد: 1
DOI: https://doi.org/10.1007/s13042-025-02911-7
تاريخ النشر: 2026-01-01
المؤلف: Zhenyun Du وآخرون
الموضوع الرئيسي: تكييف المجال والتعلم من عدد قليل من الأمثلة

نظرة عامة

لقد أثبت نموذج تقسيم أي شيء (SAM) نفسه كأداة بارزة في تقسيم المعاني، ومع ذلك فإنه يعاني من قيود رئيسية: الاعتماد على مطالبات مفصلة تم إنشاؤها بواسطة البشر وتمثيل غير كافٍ للميزات في وحدة فك تشفير القناع، التي تستخدم بشكل أساسي عمليات ضرب النقاط. تتطلب هذه التحديات إعادة تدريب واسعة النطاق عند ضبط SAM، مما يستهلك وقتًا وموارد حسابية كبيرة. للتخفيف من هذه المشكلات، نقترح نموذج تقسيم القناع الآلي (AM-SAM)، الذي يستخدم إطار تحسين ثنائي المستوى لأتمتة توليد المطالبات، مما يقلل من تدخل البشر ويعزز أداء التدريب المبكر. بالإضافة إلى ذلك، نقوم بتنفيذ التكيف منخفض الرتبة (LoRA) لتعديل وحدة فك تشفير القناع، مما يحسن قدرتها على التقاط ارتباطات الميزات بما يتجاوز عمليات ضرب النقاط البسيطة.

تشير نتائجنا التجريبية إلى أن AM-SAM يحقق دقة تقسيم متفوقة، وغالبًا ما يتجاوز كل من المطالبات التي أنشأها البشر والتكوينات الافتراضية. على وجه التحديد، في مجموعة بيانات تقسيم الجسم، حقق AM-SAM درجة Dice أعلى بنسبة 5% مع مجموعة تدريب قليلة الأمثلة تتكون من أربعة أمثلة مقارنة بالطريقة الرائدة، مما يبرز فعاليته في مهام تقسيم المعاني. في الختام، من خلال دمج كاشف كائنات قائم على YOLO لتوليد المطالبات بشكل آلي واستخدام حاصل هادامارد لمعايرة القناع، لا يعزز AM-SAM أداء التقسيم فحسب، بل يسرع أيضًا من التقارب أثناء التدريب، مما يظهر تحسينات كبيرة في نتائج التقسيم.

مقدمة

تناقش مقدمة هذه الورقة البحثية أهمية تقسيم المعاني في رؤية الكمبيوتر، والذي يتضمن تقسيم الصور إلى مناطق ذات معنى دلالي من خلال تعيين تسميات لكل بكسل. هذه المهمة حاسمة لمجموعة متنوعة من التطبيقات، بما في ذلك القيادة الذاتية، وتحليل الصور الطبية، ورؤية الروبوتات، والواقع المعزز. لقد حققت الأساليب التقليدية، مثل الشبكات الالتفافية بالكامل (FCNs)، وU-Net، وSegNet، نجاحًا ملحوظًا ولكنها غالبًا ما تتطلب مجموعات بيانات موسومة واسعة للتدريب، مما يمكن أن يكون مكلفًا من حيث الموارد. لقد حول ظهور نماذج الأساس، وخاصة نموذج تقسيم أي شيء (SAM)، هذا المجال من خلال تمكين تقسيم فعال مع بيانات أقل من خلال التدريب المسبق على مجموعات بيانات متنوعة. ومع ذلك، فإن اعتماد SAM على المطالبات المقدمة من البشر وقيوده في مجالات معينة، مثل التصوير الطبي، يبرز الحاجة إلى طرق محسّنة.

لمعالجة هذه التحديات، يقترح المؤلفون AM-SAM (التوليد الآلي للمطالبات ومعايرة القناع لـ SAM)، الذي يدمج كاشف كائنات لأتمتة توليد المطالبات، مما يقلل من الإدخال اليدوي. تعزز هذه الطريقة تمثيل ميزات وحدة فك تشفير القناع من خلال دمج الضرب العنصري جنبًا إلى جنب مع عمليات ضرب النقاط التقليدية، مما يسمح بالتقاط أفضل للارتباطات المعقدة للميزات. لا يقوم الإطار المقترح بأتمتة توليد المطالبات الأولية فحسب، بل يحسن أيضًا دقة التقسيم، محققًا نتائج تتجاوز الطرق الحالية عبر مجموعات بيانات عامة وطبية. تشمل مساهمات AM-SAM التوليد الآلي للمطالبات، وتقنيات معايرة القناع المتقدمة، والأداء المتفوق المثبت، مع تحسينات كبيرة في دقة التقسيم مقارنة بالطرق الرائدة.

طرق

في هذا القسم، يحدد المؤلفون الإعدادات التجريبية، والمعايير الأساسية، والمقاييس المستخدمة لتقييم طريقتهم المقترحة. لقد قارنوا نهجهم ضد معايير أساسية مختلفة، بما في ذلك الطرق الخاضعة للإشراف مثل DeepLabV3 وSwinUnet، وتقنيات التعلم القليل مثل HSNet وSSP، وطرق قائمة على SAM بما في ذلك SAM العادي، وMed-SA، وSAMed، الأخيرة تستخدم LoRA للتعديل. كانت المقياس الرئيسي للتقييم هو درجة Dice، المحددة على أنها

\[
\text{درجة Dice} = \frac{2 \cdot |A \cap B|}{|A| + |B|},
\]

التي تقيس التشابه بين القناع المتوقع \(A\) وقناع الحقيقة الأرضية \(B\).

حدد المؤلفون المعلمات الفائقة الرئيسية لطريقتهم، مع الحفاظ على معامل التوازن \(\lambda\) عند 0.8 وعامل الوزن \(\alpha\) عند 0.7 في وحدة فك تشفير القناع. استخدموا مُحسِّن AdamW لتحسين طبقات LoRA والمكونات الأخرى غير المجمدة، مع معدل تعلم ابتدائي قدره \(5 \times 10^{-3}\) وانخفاض وزن قدره 0.1. تم تعديل معدل التعلم وفقًا للصيغة من SAMed، بينما استخدم التحسين على المستوى الأعلى معدل تعلم ابتدائي معدل قدره \(1 \times 10^{-3}\). تم إجراء التدريب على مدى 100 حقبة، مع اختيار أفضل نقطة تفتيش للنموذج بناءً على أداء التقسيم على مجموعة بيانات D2 الفرعية.

نتائج

في هذا القسم، يقدم المؤلفون نتائج تجاربهم باستخدام AM-SAM، مع BLO-SAM (Zhang et al. 2024a) كطريقة أساسية. تشير النتائج إلى أن AM-SAM يعمل بشكل فعال في السيناريوهات الطبية، كما يتضح من التصورات النوعية في الشكل 4. اختار المؤلفون توليد مطالبات الصندوق فقط للتدريب، حيث أن استخدام نقاط المركز أدى إلى تحسينات طفيفة، مما أدى إلى تحسين وقت التدريب.

تظهر النتائج أن AM-SAM يظهر تقاربًا سريعًا، خاصة مع عدد محدود من عينات التدريب. على وجه التحديد، عند تدريبه مع 8 أمثلة فقط، يحقق النموذج أداءً كبيرًا بعد 5 حقب ويستقر بحلول الحقبة العاشرة، كما هو موضح في الشكل 5. يبرز هذا التقارب السريع كفاءة الطريقة وتفوقها في سياقات التعلم القليل، متفوقة على BLO-SAM، الذي يتطلب المزيد من الحقبات لتحقيق أداء مماثل. تؤكد النتائج على مزايا AM-SAM من حيث سرعة التدريب وكفاءة الموارد، خاصة في السيناريوهات التي تحتوي على بيانات تدريب نادرة.

نقاش

في مناقشة تقسيم المعاني، يبرز البحث تطور التقنيات من الشبكات الالتفافية بالكامل (FCNs) إلى الهياكل المتقدمة مثل U-Net والنماذج القائمة على المحولات، مع التركيز على التأثير الكبير للنماذج المدربة مسبقًا على نطاق واسع مثل CLIP وSAM (نموذج تقسيم أي شيء). يُظهر SAM، على وجه الخصوص، القدرة على تقسيم الكائنات باستخدام مجموعة متنوعة من المطالبات المقدمة من البشر، على الرغم من أنه لا يزال يواجه تحديات من حيث الاعتماد على الإدخال اليدوي والأداء في التطبيقات الطبية. تهدف التعديلات الأخيرة على SAM، بما في ذلك Fast SAM وBLO-SAM، إلى تعزيز الكفاءة والدقة من خلال طرق مثل التكيف منخفض الرتبة (LoRA) والتحسين الثنائي المستوى، التي تعمل على تحسين معلمات النموذج وتضمينات المطالبات بشكل مشترك.

يبني نموذج AM-SAM المقترح على هذه التقدمات من خلال دمج كاشف كائنات YOLOv8 لتوليد المطالبات بشكل آلي واستخدام عملية معايرة القناع باستخدام حاصل هادامارد. لا يحسن هذا النهج دقة أقنعة التقسيم فحسب، بل يسرع أيضًا من تقارب التدريب، خاصة في سيناريوهات التعلم القليل. تظهر النتائج التجريبية أن الجمع بين المطالبات التي تم إنشاؤها بواسطة YOLO ومعايرة القناع يعزز الأداء بشكل كبير، محققًا درجة Dice قدرها 86.7% عند استخدام كلا العنصرين. بشكل عام، يمثل AM-SAM تحسينًا كبيرًا في مهام تقسيم المعاني، خاصة في السياقات التي تحتوي على بيانات تدريب محدودة.

Journal: International Journal of Machine Learning and Cybernetics, Volume: 17, Issue: 1
DOI: https://doi.org/10.1007/s13042-025-02911-7
Publication Date: 2026-01-01
Author(s): Zhenyun Du et al.
Primary Topic: Domain Adaptation and Few-Shot Learning

Overview

The Segment Anything Model (SAM) has established itself as a prominent tool in semantic segmentation, yet it is hindered by two main limitations: a reliance on detailed human-generated prompts and an inadequate feature representation in the mask decoder, which primarily uses dot product operations. These challenges necessitate extensive retraining when fine-tuning SAM, consuming significant time and computational resources. To mitigate these issues, we propose the Automated Mask Segmentation Model (AM-SAM), which employs a bi-level optimization framework to automate prompt generation, thereby reducing human intervention and enhancing early training performance. Additionally, we implement Low-Rank Adaptation (LoRA) to modify the mask decoder, improving its ability to capture feature correlations beyond simple dot products.

Our experimental results indicate that AM-SAM achieves superior segmentation accuracy, often surpassing both human-generated prompts and default configurations. Specifically, on a body segmentation dataset, AM-SAM attained a 5% higher Dice score with a four-example few-shot training set compared to the state-of-the-art method, highlighting its effectiveness in semantic segmentation tasks. In conclusion, by integrating a YOLO-based object detector for automated prompting and utilizing the Hadamard Product for mask calibration, AM-SAM not only enhances segmentation performance but also accelerates convergence during training, demonstrating significant improvements in segmentation outcomes.

Introduction

The introduction of this research paper discusses the significance of semantic segmentation in computer vision, which involves dividing images into semantically meaningful regions by assigning labels to each pixel. This task is crucial for various applications, including autonomous driving, medical image analysis, robotic vision, and augmented reality. Traditional approaches, such as Fully Convolutional Networks (FCNs), U-Net, and SegNet, have achieved notable success but often require extensive labeled datasets for training, which can be resource-intensive. The emergence of foundation models, particularly the Segment Anything Model (SAM), has transformed the field by enabling effective segmentation with less data through pre-training on diverse datasets. However, SAM’s reliance on human-provided prompts and its limitations in specific domains, such as medical imaging, highlight the need for improved methods.

To address these challenges, the authors propose AM-SAM (Automated Prompting and Mask Calibration for SAM), which integrates an object detector to automate prompt generation, thereby reducing manual input. This method enhances the mask decoder’s feature representation by incorporating element-wise multiplication alongside traditional dot product operations, allowing for better capture of complex feature correlations. The proposed framework not only automates the initial prompt generation but also improves segmentation accuracy, achieving results that surpass existing methods across general and medical datasets. The contributions of AM-SAM include automated prompting, advanced mask calibration techniques, and demonstrated superior performance, with significant improvements in segmentation accuracy compared to state-of-the-art methods.

Methods

In this section, the authors outline the experimental settings, baselines, and metrics used to evaluate their proposed method. They compared their approach against various baselines, including supervised methods such as DeepLabV3 and SwinUnet, few-shot learning techniques like HSNet and SSP, and SAM-based methods including vanilla SAM, Med-SA, and SAMed, the latter utilizing LoRA for fine-tuning. The primary metric for evaluation was the Dice score, defined as

\[
\text{Dice score} = \frac{2 \cdot |A \cap B|}{|A| + |B|},
\]

which quantifies the similarity between the predicted mask \(A\) and the ground truth mask \(B\).

The authors specified key hyper-parameters for their method, maintaining a trade-off parameter \(\lambda\) at 0.8 and a weighting factor \(\alpha\) at 0.7 in the mask decoder. They employed the AdamW optimizer for the optimization of LoRA layers and other non-frozen components, with an initial learning rate of \(5 \times 10^{-3}\) and a weight decay of 0.1. The learning rate was adjusted according to the formula from SAMed, while the upper-level optimization used a modified initial learning rate of \(1 \times 10^{-3}\). The training was conducted over 100 epochs, with the best model checkpoint selected based on segmentation performance on the D2 sub-dataset.

Results

In this section, the authors present the results of their experiments using AM-SAM, with BLO-SAM (Zhang et al. 2024a) as the baseline method. The findings indicate that AM-SAM performs effectively in medical scenarios, as evidenced by qualitative visualizations in Figure 4. The authors opted to generate only box prompts for training, as using center points yielded minimal improvements, thereby optimizing training time.

The results demonstrate that AM-SAM exhibits rapid convergence, particularly with a limited number of training samples. Specifically, when trained with just 8 examples, the model achieves substantial performance after 5 epochs and stabilizes by the 10th epoch, as shown in Figure 5. This rapid convergence highlights the method’s efficiency and superiority in few-shot learning contexts, outperforming BLO-SAM, which requires more epochs to achieve comparable performance. The findings underscore the advantages of AM-SAM in terms of training speed and resource efficiency, especially in scenarios with scarce training data.

Discussion

In the discussion of semantic segmentation, the paper highlights the evolution of techniques from Fully Convolutional Networks (FCNs) to advanced architectures like U-Net and Transformer-based models, emphasizing the significant impact of large-scale pre-trained models such as CLIP and SAM (Segment Anything Model). SAM, in particular, showcases the ability to segment objects using various human-provided prompts, although it still faces challenges in terms of reliance on manual input and performance in medical applications. Recent adaptations of SAM, including Fast SAM and BLO-SAM, aim to enhance efficiency and accuracy through methods like Low-Rank Adaptation (LoRA) and bi-level optimization, which jointly optimize model parameters and prompt embeddings.

The proposed AM-SAM method builds on these advancements by integrating a YOLOv8 object detector for automated prompt generation and employing a mask calibration process using the Hadamard Product. This approach not only improves the accuracy of segmentation masks but also accelerates the training convergence, particularly in few-shot learning scenarios. Experimental results demonstrate that the combination of YOLO-generated prompts and mask calibration significantly enhances performance, achieving a Dice score of 86.7% when both components are utilized. Overall, AM-SAM represents a substantial improvement in semantic segmentation tasks, particularly in contexts with limited training data.