# ENSeg: A Novel Dataset and Method for the Segmentation of Enteric Neuron Cells on Microscopy Images
## 4 Proposed Approach
### Prompt-Guided Cell Segmentation  
As aforementioned, it is of great importance that the developed method allows the final users to guide the final segmentation masks. Having a method with this capability, will increase the overall precision of their final analyses and reduce machine-induced errors, while still drastically reducing the required manual labor.  
Keeping that in mind, we find it quite opportune to apply the usage of SAM-based architectures to perform such prompt-guided segmentation. Such a choice is based on recent works in the literature [67]. Therefore, in this work, we approach the usage of all 3 available versions of SAM (i.e., SAM-[b,l,h)] [15], all 4 versions of SAM 2 (i.e., SAM2-[t,s,b+l]) [16], and a fine-tuned SAM focused on medical data. The chosen variation of SAM was SAM-Med2D [57]. This choice is based on the fact that it is one of the most diverse SAM models available for medical imaging. Different from similar models (like SAMed and MedSAM), SAM-Med2D's adaptation of the prompt encoder enables us to experiment with different prompt configurations. Also, considering that it was trained on SA-Med2D-20M, it is expected that it is more susceptible to microscopy images (considering that they compose 7.22% of the dataset).  
To evaluate the performance of these architectures, we propose two distinct prompt sampling modes. The first, referred to as \"oracle\", represents the upper bound of the method. In this mode, points are sampled from the center-most point of the label image, and bounding boxes are perfectly fitted to the segmentation object. This prompt schema allows us to assess the maximum potential of our developed method. This conclusion is based on the assumption that the sampled points represent an ideally positioned prompt, i.e., an optimal input for the segmentation process. Furthermore, this approach enables a fair comparison of the performance across different SAM architectures.  
The second sampling mode, referred to here as \"random\", aims to simulate human behavior when providing prompt inputs. In real-world scenarios, humans are more likely to input suboptimal points as prompts to the architecture. In this schema, points are randomly sampled from the objects' label masks. This ensures that at least one point per ENC is selected inside the cell boundaries. By adopting this approach, we aim to obtain metrics that better reflect real-world applications. Since users do not directly input bounding boxes, as mentioned in previous sections, this sampling mode is applied exclusively to input prompts. Its purpose is to evaluate the proposed approach and compare it to the upper boundary results achieved using the \"oracle\" sampling mode.  
It is important to note that each neuron cell is associated with a single point prompt provided by the user. This approach was chosen due to the small size of the neuron cells in the images and to enhance the usability of the final method. While the number of point prompts can influence the segmentation masks generated by SAM, in this study, the point prompt primarily serves as a selection mechanism for the generated candidates. Consequently, most of the input prompts for the SAM architectures are represented by bounding boxes derived during the candidate generation step. Thus, the point prompt is only utilized by the architecture if a target ENC cannot be identified during the candidate generation process.