{"id":{"repo_id":"catalunya","oai_identifier":"oai:openaccess.uoc.edu:10609/152801"},"canonical_url":"https://search.ndltd.org/etd/catalunya/oai:openaccess.uoc.edu:10609/152801","repository":{"repo_id":"catalunya","name":"Universitat Oberta de Catalunya","base_url":"https://openaccess.uoc.edu/server/oai/request"},"display":{"title":"AI Agent for brain tumor detection and classification through MRI imaging","abstract":"This Final Master’s Thesis presents the development of an agentic application capable of classifying brain tumors into gliomas, meningiomas, pituitary tumors or no tumors through MRI images by using trained machine learning (ML) models. The project involved three main phases: training ML models, developing an Artificial Intelligence agent, and building the agentic application. At first, various ML models, including Support Vector Machines, Random Forests and convolutional neural networks (CNN), were trained and evaluated on a brain tumor MRI dataset. CNNbased models achieved a better performance in the classification task in comparison to classical ML models. In particular, the ResNet50- and ResNet101-based CNNs obtained accuracies of > 98%. Then, a ReAct AI agent was created using the Autogen framework, enabling it with short-term memory usage and with tool calling to invoke the trained ML models for brain tumor classification. This allowed the integration between non-deterministic large language models (LLMs) and deterministic ML-based tools. Finally, a user-friendly GUI was implemented, together with the integration of an MCP server for tool calling and LiteLLM, for LLMs routing. The resulting agentic application showed great performance in both answering to general requests of the user and classifying MRI images from the testing dataset. However, limitations emerged when the system was validated with external images due to the training dataset composition: only T1-weighted images were available for tumor classes while the no tumor class included both T1- and T2-weighted images. Consequently, the AI agent, using the trained models as tools, misclassified T2-weighted images, reducing the performance in those cases. Despite these limitations, the project successfully showcased the feasibility and potential of combining large language models with ML-based tools into AI agents for medical image classification.","abstract_html":"This Final Master’s Thesis presents the development of an agentic application capable of classifying brain tumors into gliomas, meningiomas, pituitary tumors or no tumors through MRI images by using trained machine learning (ML) models. The project involved three main phases: training ML models, developing an Artificial Intelligence agent, and building the agentic application. At first, various ML models, including Support Vector Machines, Random Forests and convolutional neural networks (CNN), were trained and evaluated on a brain tumor MRI dataset. CNNbased models achieved a better performance in the classification task in comparison to classical ML models. In particular, the ResNet50- and ResNet101-based CNNs obtained accuracies of &gt; 98%. Then, a ReAct AI agent was created using the Autogen framework, enabling it with short-term memory usage and with tool calling to invoke the trained ML models for brain tumor classification. This allowed the integration between non-deterministic large language models (LLMs) and deterministic ML-based tools. Finally, a user-friendly GUI was implemented, together with the integration of an MCP server for tool calling and LiteLLM, for LLMs routing. The resulting agentic application showed great performance in both answering to general requests of the user and classifying MRI images from the testing dataset. However, limitations emerged when the system was validated with external images due to the training dataset composition: only T1-weighted images were available for tumor classes while the no tumor class included both T1- and T2-weighted images. Consequently, the AI agent, using the trained models as tools, misclassified T2-weighted images, reducing the performance in those cases. Despite these limitations, the project successfully showcased the feasibility and potential of combining large language models with ML-based tools into AI agents for medical image classification.","abstract_has_math":false,"creators":["Datzira Llimargas, Oriol"],"institution":"Universitat Oberta de Catalunya (UOC)","degree_name":null,"degree_level":null,"degree_discipline":null,"degree_department":null,"school":null,"contributors":[],"advisors":[],"committee_chairs":[],"committee_members":[],"year":2025,"date_issued":"2025-06-11","date_published":"2025-06-11","updated_at":"2026-11-26T14:18:42Z","subjects":["AI agents","machine learning","neural networks","generative AI","brain tumor detection","MRI imaging","healthcare AI implementation","pattern recognition","computer-aided diagnosis","AI based graphical user interface","Artificial intelligence -- TFM"],"languages":["eng"],"rights":["info:eu-repo/semantics/openAccess","CC BY-NC"],"rights_urls":["https://creativecommons.org/licenses/by-nc/4.0/"],"identifier_entries":[],"person_identifier_entries":[]},"links":{"outbound_url":"https://hdl.handle.net/10609/152801","outbound_label":"Handle","outbound_source":"dc:identifier.uri","record_url":"https://hdl.handle.net/10609/152801","record_label":"Repository record","record_kind":"handle","record_source":"dc:identifier.uri","access_status":"open","embargo_until":null,"access_note":null},"oai_pmh_record":{"url":"https://union.ndltd.org/oai-pmh/?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai%3Aunion.ndltd.org%3Arepo%3Acatalunya%3Aoai%3Aopenaccess.uoc.edu%3A10609%2F152801","prefix":"oai_dc"},"source_record":{"url":"https://openaccess.uoc.edu/server/oai/request?verb=GetRecord&metadataPrefix=dim&identifier=oai%3Aopenaccess.uoc.edu%3A10609%2F152801","prefix":"dim"},"metadata_groups":[{"id":"people","label":"People","entries":[{"key":"dc:contributor.other","label":"Dc Contributor Other","values":["Nunez do Rio, Joan M"]},{"key":"dc:contributor.tutor","label":"Dc Contributor Tutor","values":["Sarasa Cabezuelo, Antonio"]},{"key":"dc:creator","label":"Author","values":["Datzira Llimargas, Oriol"]}]},{"id":"academic_context","label":"Academic Context","entries":[{"key":"dc:coverage.spatial","label":"Dc Coverage Spatial","values":["La Garriga"]},{"key":"dc:date.accessioned","label":"Dc Date Accessioned","values":["2025-07-02T05:49:08Z"]},{"key":"dc:date.available","label":"Dc Date Available","values":["2025-07-02T05:49:08Z"]},{"key":"dc:date.issued","label":"Date","values":["2025-06-11"]},{"key":"dc:publisher","label":"Institution","values":["Universitat Oberta de Catalunya (UOC)"]},{"key":"dc:type","label":"Dc Type","values":["info:eu-repo/semantics/masterThesis"]}]},{"id":"subjects_keywords","label":"Subjects and Keywords","entries":[{"key":"dc:subject","label":"Dc Subject","values":["AI agents","machine learning","neural networks","generative AI","brain tumor detection","MRI imaging","healthcare AI implementation","pattern recognition","computer-aided diagnosis","AI based graphical user interface"]},{"key":"dc:subject.lcsh","label":"Dc Subject Lcsh","values":["Artificial intelligence -- TFM"]},{"key":"dc:subject.lemac","label":"Dc Subject Lemac","values":["Intel·ligència artificial -- TFM"]}]},{"id":"language_rights","label":"Language and Rights","entries":[{"key":"dc:language.iso","label":"Language (ISO)","values":["eng"]},{"key":"dc:rights","label":"Dc Rights","values":["CC BY-NC"]},{"key":"dc:rights.accessrights","label":"Access Rights","values":["info:eu-repo/semantics/openAccess"]},{"key":"dc:rights.uri","label":"Rights URI","values":["https://creativecommons.org/licenses/by-nc/4.0/"]}]},{"id":"identifiers","label":"Identifiers","entries":[{"key":"dc:identifier.uri","label":"Identifier URI","values":["https://hdl.handle.net/10609/152801"]}]},{"id":"additional","label":"Additional Metadata","entries":[{"key":"dc:audience","label":"Dc Audience","values":["Estudis de Màster","Estudios de Máster","Master's degrees"]},{"key":"dc:description.abstract","label":"Abstract","values":["This Final Master’s Thesis presents the development of an agentic application capable of classifying brain tumors into gliomas, meningiomas, pituitary tumors or no tumors through MRI images by using trained machine learning (ML) models. The project involved three main phases: training ML models, developing an Artificial Intelligence agent, and building the agentic application. At first, various ML models, including Support Vector Machines, Random Forests and convolutional neural networks (CNN), were trained and evaluated on a brain tumor MRI dataset. CNNbased models achieved a better performance in the classification task in comparison to classical ML models. In particular, the ResNet50- and ResNet101-based CNNs obtained accuracies of > 98%. Then, a ReAct AI agent was created using the Autogen framework, enabling it with short-term memory usage and with tool calling to invoke the trained ML models for brain tumor classification. This allowed the integration between non-deterministic large language models (LLMs) and deterministic ML-based tools. Finally, a user-friendly GUI was implemented, together with the integration of an MCP server for tool calling and LiteLLM, for LLMs routing. The resulting agentic application showed great performance in both answering to general requests of the user and classifying MRI images from the testing dataset. However, limitations emerged when the system was validated with external images due to the training dataset composition: only T1-weighted images were available for tumor classes while the no tumor class included both T1- and T2-weighted images. Consequently, the AI agent, using the trained models as tools, misclassified T2-weighted images, reducing the performance in those cases. Despite these limitations, the project successfully showcased the feasibility and potential of combining large language models with ML-based tools into AI agents for medical image classification.","Este Trabajo Final de Máster presenta el desarrollo de una aplicación agéntica capaz de clasificar tumores cerebrales a partir de imágenes de resonancia magnéticas (MRI) como gliomas, meningiomas, hipofisarios o como no tumores utilizando modelos de aprendizaje automático (ML). El proyecto constó de tres fases principales: el entrenamiento de modelos de ML, el desarrollo de un agente de Inteligencia Artificial (IA) y la construcción de la aplicación agéntica. Primero se entrenaron y evaluaron varios modelos de ML, incluyendo máquinas de vectores de soporte (SVM), bosques aleatorios (RF) y redes neuronales convolucionales (CNN), a partir de un conjunto de datos de imágenes MRI de cerebros. Los modelos basados en CNN obtuvieron mejores resultados en la clasificación que los modelos clásicos de ML. En particular, CNN basadas en ResNet50 y ResNet101 obtuvieron precisiones >98%. Posteriormente, se creó un Agente de IA siguiendo el patrón ReAct, utilizando el framework Autogen. El Agente de IA fue dotado con uso de memoria a corto plazo y con la opción de hacer llamadas a herramientas externas para invocar los modelos de ML entrenados con la finalidad de poder clasificar tumores cerebrales. Esto permitió la integración entre modelos extensos de lenguaje (LLM) no deterministas y herramientas deterministas basadas en modelos de aprendizaje automático. Por último, se implementó una interfaz gráfica para mejorar la experiencia del usuario al interaccionar con el agente de IA, junto con la integración de un servidor MCP para la llamada a herramientas y LiteLLM, para el enrutamiento a diferentes LLM. La aplicación agéntica resultante ha demostrado un gran rendimiento tanto al responder a peticiones generales del usuario como al clasificar imágenes de resonancia magnética del conjunto de datos de prueba, utilizando como herramientas las CNN entrenadas previamente. Sin embargo, surgieron limitaciones cuando el sistema fue validado con imágenes externas debido a la composición del conjunto de datos de entrenamiento: sólo se disponía de imágenes con contraste en T1 para las clases tumorales, mientras que la clase no tumoral incluía tanto imágenes en contraste T1 como en T2. En consecuencia, el agente de IA, utilizando los modelos entrenados, clasificó erróneamente las imágenes ponderadas en T2, reduciendo el rendimiento en dichos casos. A pesar de estas limitaciones, el proyecto demostró con éxito la viabilidad y el potencial de combinar modelos extensos de lenguaje con herramientas basadas en aprendizaje automático en Agentes de IA para la clasificación de imágenes médicas."]},{"key":"dc:format.mimetype","label":"Dc Format Mimetype","values":["application/pdf"]},{"key":"dc:title","label":"Title","values":["AI Agent for brain tumor detection and classification through MRI imaging"]},{"key":"others:access_status","label":"Others Access Status","values":["open.access"]}]}],"canonical_facts":{"dc:audience":["Estudis de Màster","Estudios de Máster","Master's degrees"],"dc:contributor.other":["Nunez do Rio, Joan M"],"dc:contributor.tutor":["Sarasa Cabezuelo, Antonio"],"dc:coverage.spatial":["La Garriga"],"dc:creator":["Datzira Llimargas, Oriol"],"dc:date.accessioned":["2025-07-02T05:49:08Z"],"dc:date.available":["2025-07-02T05:49:08Z"],"dc:date.issued":["2025-06-11"],"dc:description.abstract":["This Final Master’s Thesis presents the development of an agentic application capable of classifying brain tumors into gliomas, meningiomas, pituitary tumors or no tumors through MRI images by using trained machine learning (ML) models. The project involved three main phases: training ML models, developing an Artificial Intelligence agent, and building the agentic application. At first, various ML models, including Support Vector Machines, Random Forests and convolutional neural networks (CNN), were trained and evaluated on a brain tumor MRI dataset. CNNbased models achieved a better performance in the classification task in comparison to classical ML models. In particular, the ResNet50- and ResNet101-based CNNs obtained accuracies of > 98%. Then, a ReAct AI agent was created using the Autogen framework, enabling it with short-term memory usage and with tool calling to invoke the trained ML models for brain tumor classification. This allowed the integration between non-deterministic large language models (LLMs) and deterministic ML-based tools. Finally, a user-friendly GUI was implemented, together with the integration of an MCP server for tool calling and LiteLLM, for LLMs routing. The resulting agentic application showed great performance in both answering to general requests of the user and classifying MRI images from the testing dataset. However, limitations emerged when the system was validated with external images due to the training dataset composition: only T1-weighted images were available for tumor classes while the no tumor class included both T1- and T2-weighted images. Consequently, the AI agent, using the trained models as tools, misclassified T2-weighted images, reducing the performance in those cases. Despite these limitations, the project successfully showcased the feasibility and potential of combining large language models with ML-based tools into AI agents for medical image classification.","Este Trabajo Final de Máster presenta el desarrollo de una aplicación agéntica capaz de clasificar tumores cerebrales a partir de imágenes de resonancia magnéticas (MRI) como gliomas, meningiomas, hipofisarios o como no tumores utilizando modelos de aprendizaje automático (ML). El proyecto constó de tres fases principales: el entrenamiento de modelos de ML, el desarrollo de un agente de Inteligencia Artificial (IA) y la construcción de la aplicación agéntica. Primero se entrenaron y evaluaron varios modelos de ML, incluyendo máquinas de vectores de soporte (SVM), bosques aleatorios (RF) y redes neuronales convolucionales (CNN), a partir de un conjunto de datos de imágenes MRI de cerebros. Los modelos basados en CNN obtuvieron mejores resultados en la clasificación que los modelos clásicos de ML. En particular, CNN basadas en ResNet50 y ResNet101 obtuvieron precisiones >98%. Posteriormente, se creó un Agente de IA siguiendo el patrón ReAct, utilizando el framework Autogen. El Agente de IA fue dotado con uso de memoria a corto plazo y con la opción de hacer llamadas a herramientas externas para invocar los modelos de ML entrenados con la finalidad de poder clasificar tumores cerebrales. Esto permitió la integración entre modelos extensos de lenguaje (LLM) no deterministas y herramientas deterministas basadas en modelos de aprendizaje automático. Por último, se implementó una interfaz gráfica para mejorar la experiencia del usuario al interaccionar con el agente de IA, junto con la integración de un servidor MCP para la llamada a herramientas y LiteLLM, para el enrutamiento a diferentes LLM. La aplicación agéntica resultante ha demostrado un gran rendimiento tanto al responder a peticiones generales del usuario como al clasificar imágenes de resonancia magnética del conjunto de datos de prueba, utilizando como herramientas las CNN entrenadas previamente. Sin embargo, surgieron limitaciones cuando el sistema fue validado con imágenes externas debido a la composición del conjunto de datos de entrenamiento: sólo se disponía de imágenes con contraste en T1 para las clases tumorales, mientras que la clase no tumoral incluía tanto imágenes en contraste T1 como en T2. En consecuencia, el agente de IA, utilizando los modelos entrenados, clasificó erróneamente las imágenes ponderadas en T2, reduciendo el rendimiento en dichos casos. A pesar de estas limitaciones, el proyecto demostró con éxito la viabilidad y el potencial de combinar modelos extensos de lenguaje con herramientas basadas en aprendizaje automático en Agentes de IA para la clasificación de imágenes médicas."],"dc:format.mimetype":["application/pdf"],"dc:identifier.uri":["https://hdl.handle.net/10609/152801"],"dc:language.iso":["eng"],"dc:publisher":["Universitat Oberta de Catalunya (UOC)"],"dc:rights":["CC BY-NC"],"dc:rights.accessrights":["info:eu-repo/semantics/openAccess"],"dc:rights.uri":["https://creativecommons.org/licenses/by-nc/4.0/"],"dc:subject":["AI agents","machine learning","neural networks","generative AI","brain tumor detection","MRI imaging","healthcare AI implementation","pattern recognition","computer-aided diagnosis","AI based graphical user interface"],"dc:subject.lcsh":["Artificial intelligence -- TFM"],"dc:subject.lemac":["Intel·ligència artificial -- TFM"],"dc:title":["AI Agent for brain tumor detection and classification through MRI imaging"],"dc:type":["info:eu-repo/semantics/masterThesis"],"others:access_status":["open.access"]},"updated_at":"2026-11-26T14:18:42Z"}