## 7 Conclusions  
This research investigates the application of advanced semantic image segmentation techniques, using both convolutional neural networks (CNNs) with the UNET architecture and Transformer-based models with UNETR, to accurately analyze and measure the dimensions of rainbow trout reared in aquaculture facilities in Puno, Peru. Three experiments were conducted to evaluate the performance of these models under varying conditions, including image resolution, loss function configurations, optimizer settings, and training epochs. A key finding of this study is the significant influence of image resolution on segmentation accuracy. The increase in resolution in the second experiment, using the UNET architecture, demonstrated a clear improvement in the capture of finer details of the fish, leading to more precise size estimations. However, it was also observed that the number of training epochs exerts a considerable impact on segmentation quality, and a higher number of epochs generally leads to improved results. The integration of UNETR, a Transformer-based model, into the third experiment provided valuable information on the application of this novel architecture to aquaculture image analysis. Although UNETR showed promise, its initial performance in this dataset may have been limited by the relatively small sample size. Transformer models typically require larger datasets to fully exploit their potential for learning robust and generalizable representations. To comprehensively assess the robustness and adaptability of the models, four distinct loss functions (MSELoss, L1 Loss, CrossEntropyLoss, and DiceLoss) were employed across the experiments. This methodological choice allowed for a thorough understanding of how different loss functions influence segmentation accuracy under varying experimental conditions. By evaluating performance across these diverse metrics, we gained insights into the strengths and weaknesses of the models, enabling a more nuanced understanding of their suitability for real-world aquaculture applications. This comparative analysis not only enhances the reliability of our findings, but also provides a framework for future studies seeking to optimize model performance through targeted loss function selection. A crucial aspect of this study was the incorporation of a coin as a scale reference, allowing precise and accurate measurements of fish dimensions. This non-invasive approach significantly improves the value of semantic segmentation as a tool to monitor and manage fish farms. By automating the measurement process, this technology can significantly reduce reliance on manual methods, optimize the evaluation of fish growth and development, and ultimately improve operational efficiency and sustainability within the aquaculture sector. Future studies should explore the performance of UNETR with larger datasets, investigate the impact of data augmentation techniques on model performance, and evaluate the effectiveness of other Transformer-based architectures and hybrid models that combine the strengths of CNNs and Transformers. Furthermore, the application of these techniques to other species and environments of aquaculture can further broaden the impact of image segmentation in advancing sustainable aquaculture practices. **Author Contributions:** J.C., C.R. and F.P. ; methodology, L.B., R.C. and E.A. ; software, C.R. R.C. and F.P. ; validation, J.C., L.B., and E.A. ; formal analysis, E.A., C.R. and F.P. ; investigation, J.C., C.R. and F.P. ; resources, L.B., R.C., E.A. and C.R. ; data curation, J.C., L.B. and F.P. ; writing--original draft preparation, J.C., R.C. and F.P. ; writing--review and editing, J.C., L.B. and F.P. ; visualization, J.C., R.C. and F.P. ; supervision, J.C., R.C. and F.P. ; project administration, J.C., E.A. and F.P. ; funding acquisition, E.A. and L.B. All authors have read and agreed to the published version of the manuscript. **Funding:** This research was funded by Universidad Nacional del Altiplano--FEDU.