Current Organizations / Institutes

The organizations/institutes from the scholar's latest article


Asmaa Mourhir has a total of 46 co-authors. Here are the top co-authors by number of shared publications:


Latest Publications

  • Open Access

    An Attention-Driven Feature Fusion Approach for Multimodal Aspect-Based Sentiment Analysis

    by Ismail Ifakir, El Habib Nfaoui, Abderrahim Zannou, Asmaa Mourhir

    Aspect-Based Sentiment Analysis explores sentiment trends related to specific opinion aspects and holds significant commercial potential for monitoring brand reputation, understanding customer satisfaction, and personalizing recommendations. However, traditional methods rely exclusively on textual input and often struggle when the target aspect is not mentioned in the sentence. Multimodal Aspect-Based Sentiment Analysis addresses this limitation by incorporating both textual and visual modalities to enable more comprehensive sentiment understanding. Despite advancements in deep learning and transformer-based architectures, existing models often suffer from suboptimal modality fusion and weak aspect grounding, limiting their classification accuracy. To overcome these challenges, we propose an Attention-Driven Feature Fusion (ADFF) approach based on a three-stage hierarchical attention mechanism. First, it only fuses text and image embeddings. Second, it incorporates aspect-level features. Third, a multi-head attention layer further enhances cross-modal dependencies. The resulting representation is passed to a Long Short-Term Memory (LSTM) classifier for sentiment polarity prediction. We evaluate our model on three benchmark datasets, namely Twitter-2015, Twitter-2017, and MASAD. The experimental results demonstrate that the proposed model substantially outperforms state-of-the-art multimodal and unimodal baselines, improves both accuracy and F1-score, achieving 82.55% accuracy and 81.05% F1-score on Twitter-2015, 77.07% accuracy and 77.15% F1-score on Twitter-2017, and up to 99.67% accuracy and F1-score in the Plant domain of MASAD, where we observe consistent improvements across all seven domains. These results highlight the effectiveness and scalability of the hierarchical attention-based fusion strategy for real-world aspect-based sentiment analysis tasks.


  • Open Access

    A Retrieval-Augmented Large Language Model Framework for Functionally Grounded Ingredient Substitution in Recipes

    by Khadija Salih Alj, Asmaa Mourhir, Raifa Akkaoui, Yassine Salih Alj

    Ingredient substitution in recipes is a complex problem that requires preserving functional properties such as binding, thickening, or leavening while adapting to recipe-specific context and dietary constraints. Standalone Large Language Models often produce impractical recommendations, exhibiting domain misalignment by favoring industrial or biochemical additives over accessible culinary ingredients due to insufficient grounding. This article introduces a retrieval-augmented Large Language Model (LLM) framework for functionally grounded ingredient substitution, extending prior work that focused exclusively on standalone model evaluation. The task is formalized as a modular four-stage pipeline: (1) contextual role inference, where an LLM identifies the functional role of a target ingredient among 25 categories; (2) ingredient-level semantic retrieval over a curated knowledge base comprising 1,758 unique ingredients represented as role-enriched embeddings, producing a broad candidate neighborhood; (3) reasoning-based selection, in which the LLM filters and ranks retrieved candidates based on recipe context, structural requirements, and functional suitability; and (4) constraint-aware filtering to enforce dietary and allergen requirements. Experimental results demonstrate consistent improvements over standalone generation, with GPT-4o achieving a peak Hit@1 of 76.45%, while smaller open-source models exhibit substantial gains under the retrieval-augmented setting. Additionally, the Gemini 2.5 Flash model reaches a peak Hit@1 of 82.15% within the proposed framework. These findings indicate that embedding-based ingredient retrieval coupled with role-aware LLM reranking significantly enhances substitution quality without relying on direct lookup, providing a scalable and safety-conscious foundation for intelligent cooking assistants and AI-driven nutrition systems.

  • AI-Powered Advisory System for Moroccan Agriculture

    by Adnane El Amrani, Asmaa Mourhir, Hassan Qorchi

  • Open Access

    Adversarial Evaluation of Large Language Models for Building Robust Offensive Language Detection in Moroccan Arabic

    by Soufiyan Ouali, Kanza Raisi, Asmaa Mourhir, El Habib Nfaoui, Said El Garouani

    Offensive language detection is crucial for ensuring safe and inclusive digital environments. Identifying harmful content protects users and supports healthier online interactions. Despite advances in transformer-based models, particularly Large Language Models (LLMs), their application to this task remains underexplored for low-resource languages such as Moroccan Arabic, especially compared with high-resource languages. This study evaluates the performance of various open- and closed-source LLMs for offensive language detection in Moroccan Darija. The evaluated models include general-purpose LLMs such as LLaMA, Mistral, and Gemma, as well as Arabic-focused models such as ArabianGPT, Falcon Arabic, and Atlas-Chat. We also experiment with reasoning models such as DeepSeek and GPT-4. Beyond traditional evaluation metrics, we investigate the robustness of these LLMs and examine the impact of adversarial training on their performance. Moreover, we contribute to the field by creating a large, high-quality dataset. Our evaluation revealed that GPT-4o Mini achieved the best overall performance, reaching an F1-score of 88%. However, robustness testing under black-box and white-box adversarial attacks exposed notable vulnerabilities, with attack success rates reaching 30%, thereby highlighting the need for enhancement. Despite the complex morphology and linguistic variability of Moroccan Darija, adversarial training resulted in a notable improvement in both overall model performance and robustness against adversarial attacks, yielding an average increase of 20.89% in resistance to attacks. Furthermore, this approach enabled GPT-4o Mini to achieve an F1-score of 91%, surpassing the current state-of-the-art performance by 6%. These results highlight the importance of incorporating adversarial approaches in low-resource dialectal settings to effectively address linguistic variability and data scarcity.


  • Waste Detection on Sorting Belts Using YOLO Models

    by Yassir Benabdellah, Asmaa Mourhir, Sahdi Saleh

  • Moroccan Darija Text-to-Speech Synthesis

    by Saad Driouech, Asmaa Mourhir

  • Open Access

    Investigating Offensive Language Detection in a Low-Resource Setting with a Robustness Perspective

    by Israe Abdellaoui, Anass Ibrahimi, Mohamed Amine El Bouni, Asmaa Mourhir, Saad Driouech, Mohamed Aghzal

    Moroccan Darija, a dialect of Arabic, presents unique challenges for natural language processing due to its lack of standardized orthographies, frequent code switching, and status as a low-resource language. In this work, we focus on detecting offensive language in Darija, addressing these complexities. We present three key contributions that advance the field. First, we introduce a human-labeled dataset of Darija text collected from social media platforms. Second, we explore and fine-tune various language models on the created dataset. This investigation identifies a Darija RoBERTa-based model as the most effective approach, with an accuracy of 90% and F1 score of 85%. Third, we evaluate the best model beyond accuracy by assessing properties such as correctness, robustness and fairness using metamorphic testing and adversarial attacks. The results highlight potential vulnerabilities in the model’s robustness, with the model being susceptible to attacks such as inserting dots (29.4% success rate), inserting spaces (24.5%), and modifying characters in words (18.3%). Fairness assessments show that while the model is generally fair, it still exhibits bias in specific cases, with a 7% success rate for attacks targeting entities typically subject to discrimination. The key finding is that relying solely on offline metrics such as the F1 score and accuracy in evaluating machine learning systems is insufficient. For low-resource languages, the recommendation is to focus on identifying and addressing domain-specific biases and enhancing pre-trained monolingual language models with diverse and noisier data to improve their robustness and generalization capabilities in diverse linguistic scenarios.


  • Open Access

    Smart Buildings: Water Leakage Detection Using TinyML

    by Othmane Atanane, Asmaa Mourhir, Nabil Benamar, Marco Zennaro

    The escalating global water usage and the increasing strain on major cities due to water shortages highlights the critical need for efficient water management practices. In water-stressed regions worldwide, significant water wastage is primarily attributed to leakages, inefficient use, and aging infrastructure. Undetected water leakages in buildings’ pipelines contribute to the water waste problem. To address this issue, an effective water leak detection method is required. In this paper, we explore the application of edge computing in smart buildings to enhance water management. By integrating sensors and embedded Machine Learning models, known as TinyML, smart water management systems can collect real-time data, analyze it, and make accurate decisions for efficient water utilization. The transition to TinyML enables faster and more cost-effective local decision-making, reducing the dependence on centralized entities. In this work, we propose a solution that can be adapted for effective leakage detection in real-world scenarios with minimum human intervention using TinyML. We follow an approach that is similar to a typical machine learning lifecycle in production, spanning stages including data collection, training, hyperparameter tuning, offline evaluation and model optimization for on-device resource efficiency before deployment. In this work, we considered an existing water leakage acoustic dataset for polyvinyl chloride pipelines. To prepare the acoustic data for analysis, we performed preprocessing to transform it into scalograms. We devised a water leak detection method by applying transfer learning to five distinct Convolutional Neural Network (CNN) variants, which are namely EfficientNet, ResNet, AlexNet, MobileNet V1, and MobileNet V2. The CNN models were found to be able to detect leakages where a maximum testing accuracy, recall, precision, and F1 score of 97.45%, 98.57%, 96.70%, and 97.63%, respectively, were observed using the EfficientNet model. To enable seamless deployment on the Arduino Nano 33 BLE edge device, the EfficientNet model is compressed using quantization resulting in a low inference time of 1932 ms, a peak RAM usage of 255.3 kilobytes, and a flash usage requirement of merely 48.7 kilobytes.


  • DarSpeech: An Automatic Speech Recognition System for the Moroccan Dialect

    by Omar Aitoulghazi, Ahmed Jaafari, Asmaa Mourhir

    Due to the continuous increase of information and data, it has been proven that Automatic Speech Recognition (ASR) systems are more efficient and less expensive when it comes to a variety of important tasks, such as customer relationship management. However, the most complex and accurate speech recognition models are developed and implemented for languages in which data is highly available, such as English and French. This document proposes an automatic speech recognition system for the Moroccan dialect, a very low-resource language, that is spoken by almost every Moroccan citizen and adopted in many organizations that are both public and private. The proposed solution is based on a state-of-the-art architecture, named Deep Speech 2 by Baidu. We tested the model on 24 hours of speech and obtained 22.7% word error rate and 6.03% character error rate.