Lloy Pinedo
Current Organizations / Institutes
The organizations/institutes from the scholar's latest article
Lloy Pinedo has a total of 123 co-authors. Here are the top co-authors by number of shared publications:
- Miguel Angel Valles-Coral
Facultad de Ingeniería de Sistemas e Informática, Universidad Nacional Mayor de San Marcos (UNMSM), Lima 15081, Peru
16 shared publications - Jorge Raul Navarro-Cabrera
Universidad Nacional de San Martin. Tarapoto, Perú
12 shared publications - Richard Injante
Universidad Nacional de San Martín
9 shared publications - José Seijas-Díaz
Universidad Nacional Autónoma de Alto Amazonas
3 shared publications - Luis Salazar-Ramírez
Universidad Nacional de San Martín. San Martín, Perú
3 shared publications - Pierre Vidaurre-Rojas
Universidad Nacional de San Martín
3 shared publications
Latest Publications
- Open Access
- 29 October 2026
- Published by Frontiers Media SA in Frontiers in Education
- Vol. 11, 1892057
Adoption of generative artificial intelligence by university marketing students
The growing adoption of Generative Artificial Intelligence (GenAI) is transforming marketing education and increasing the need to understand the factors that drive its academic use among university students. This study aimed to analyze the determinants of GenAI adoption among university marketing students using the Unified Theory of Acceptance and Use of Technology 2 (UTAUT2). A quantitative, explanatory, cross-sectional study was conducted with 310 marketing students from two Latin American universities in Peru and Costa Rica during the first academic semester of 2026. Participants were selected through non-probability purposive sampling. Data were collected using a structured questionnaire and analyzed through Partial Least Squares Structural Equation Modeling (PLS-SEM) with SmartPLS version 4.1.1.8. The findings indicate that habit is the main determinant of both behavioral intention and actual use of GenAI tools, while hedonic motivation, facilitating conditions, and price value also show significant positive effects. Conversely, performance expectancy, effort expectancy, and social influence do not significantly influence behavioral intention. It is concluded that the adoption of GenAI among university marketing students is increasingly driven by habitual academic use rather than by traditional technology acceptance factors. These findings provide evidence to support institutional strategies for the responsible integration of GenAI into higher education.
- 29 October 2026
- Published by Frontiers Media SA in Frontiers in Education
- Vol. 11, 1892057
Open AccessAdoption of generative artificial intelligence by university marketing students
The growing adoption of Generative Artificial Intelligence (GenAI) is transforming marketing education and increasing the need to understand the factors that drive its academic use among university students. This study aimed to analyze the determinants of GenAI adoption among university marketing students using the Unified Theory of Acceptance and Use of Technology 2 (UTAUT2). A quantitative, explanatory, cross-sectional study was conducted with 310 marketing students from two Latin American universities in Peru and Costa Rica during the first academic semester of 2026. Participants were selected through non-probability purposive sampling. Data were collected using a structured questionnaire and analyzed through Partial Least Squares Structural Equation Modeling (PLS-SEM) with SmartPLS version 4.1.1.8. The findings indicate that habit is the main determinant of both behavioral intention and actual use of GenAI tools, while hedonic motivation, facilitating conditions, and price value also show significant positive effects. Conversely, performance expectancy, effort expectancy, and social influence do not significantly influence behavioral intention. It is concluded that the adoption of GenAI among university marketing students is increasingly driven by habitual academic use rather than by traditional technology acceptance factors. These findings provide evidence to support institutional strategies for the responsible integration of GenAI into higher education.
- Open Access
- 13 October 2026
- Published by Taylor & Francis in Cogent Social Sciences
- Vol. 12 (1)
Digital communication in Peru’s public museums: a mixed analysis
- 13 October 2026
- Published by Taylor & Francis in Cogent Social Sciences
- Vol. 12 (1)
Open AccessDigital communication in Peru’s public museums: a mixed analysis
- Open Access
- 14 September 2026
- Published by Frontiers Media SA in Frontiers in Artificial Intelligence
- Vol. 9, 1876396
Evaluation of hybrid models based on image segmentation and inference for pig weight estimation
Introduction: Accurate weight estimation in pig production is essential for optimizing management, feeding, and commercialization decisions; however, traditional weighing methods are invasive, time-consuming, and prone to operational errors. This study proposes a non-invasive computer vision–based approach to estimate pig weight under real farm conditions in San Martín, Peru. Methods: A dataset of 3,800 lateral images paired with their corresponding ground-truth weights was collected. A computational pipeline was implemented, including geometric standardization, instance segmentation using YOLOv8n-seg, and feature extraction through EfficientNet-B0. The resulting embeddings were used as input for supervised regression models (SVR, XGBoost, and CatBoost), evaluated using repeated stratified cross-validation and an independent test set, with MAE, RMSE, and R² as performance metrics. Statistical comparisons were conducted using the Friedman test followed by Wilcoxon post hoc analysis with Holm correction. Results: The results demonstrated strong predictive performance, with the SVR model achieving the best results (RMSE = 2.68 kg, MAE = 1.81 kg, R 2 = 0.85), showing statistically significant differences compared to the other models. Discussion: These findings indicate that combining computer vision techniques with models capable of capturing non-linear relationships effectively models the relationship between animal morphology and body weight, providing a low-cost, non-invasive solution applicable to real-world production systems and supporting the advancement of precision livestock farming.
- 14 September 2026
- Published by Frontiers Media SA in Frontiers in Artificial Intelligence
- Vol. 9, 1876396
Open AccessEvaluation of hybrid models based on image segmentation and inference for pig weight estimation
Introduction: Accurate weight estimation in pig production is essential for optimizing management, feeding, and commercialization decisions; however, traditional weighing methods are invasive, time-consuming, and prone to operational errors. This study proposes a non-invasive computer vision–based approach to estimate pig weight under real farm conditions in San Martín, Peru. Methods: A dataset of 3,800 lateral images paired with their corresponding ground-truth weights was collected. A computational pipeline was implemented, including geometric standardization, instance segmentation using YOLOv8n-seg, and feature extraction through EfficientNet-B0. The resulting embeddings were used as input for supervised regression models (SVR, XGBoost, and CatBoost), evaluated using repeated stratified cross-validation and an independent test set, with MAE, RMSE, and R² as performance metrics. Statistical comparisons were conducted using the Friedman test followed by Wilcoxon post hoc analysis with Holm correction. Results: The results demonstrated strong predictive performance, with the SVR model achieving the best results (RMSE = 2.68 kg, MAE = 1.81 kg, R 2 = 0.85), showing statistically significant differences compared to the other models. Discussion: These findings indicate that combining computer vision techniques with models capable of capturing non-linear relationships effectively models the relationship between animal morphology and body weight, providing a low-cost, non-invasive solution applicable to real-world production systems and supporting the advancement of precision livestock farming.
- Open Access
- 30 July 2026
- Published by Frontiers Media SA in Frontiers in Sustainable Tourism
- Vol. 5, 1876343
Forecasting tourist flows in Peru's major destinations to support sustainable management through data-driven approaches
Forecasting tourist flows is essential for strengthening the sustainable management of destinations, especially in post-pandemic contexts characterized by high seasonality and uncertainty. This study projects tourist flows in Peru's main destinations using a data-driven framework integrating statistical models and machine learning techniques. A monthly database was constructed incorporating temporal, seasonal, and climatic variables, as well as events and digital behavior, which were evaluated using six models (Seasonal Naïve, SARIMA, SARIMAX, Random Forest, XGBoost, and LightGBM). The results show that the Seasonal Naïve model achieves the highest predictive accuracy (MAPE = 18.49% for national tourism and 12.06% for international tourism), confirming the predominance of seasonal patterns in the destinations analyzed. However, machine learning models offer greater explanatory power ( R 2 = 0.923), capturing non-linear relationships in tourism demand. Projections for 2026 show a sustained recovery in international tourism and peaks in demand between May and August, with levels exceeding 130,000 monthly visitors in key destinations. The results demonstrate that data-driven forecasting enables the anticipation of demand scenarios and supports decisions aimed at sustainable tourism management, optimizing operational capacity and reducing the risk of overcrowding.
- 30 July 2026
- Published by Frontiers Media SA in Frontiers in Sustainable Tourism
- Vol. 5, 1876343
Open AccessForecasting tourist flows in Peru's major destinations to support sustainable management through data-driven approaches
Forecasting tourist flows is essential for strengthening the sustainable management of destinations, especially in post-pandemic contexts characterized by high seasonality and uncertainty. This study projects tourist flows in Peru's main destinations using a data-driven framework integrating statistical models and machine learning techniques. A monthly database was constructed incorporating temporal, seasonal, and climatic variables, as well as events and digital behavior, which were evaluated using six models (Seasonal Naïve, SARIMA, SARIMAX, Random Forest, XGBoost, and LightGBM). The results show that the Seasonal Naïve model achieves the highest predictive accuracy (MAPE = 18.49% for national tourism and 12.06% for international tourism), confirming the predominance of seasonal patterns in the destinations analyzed. However, machine learning models offer greater explanatory power ( R 2 = 0.923), capturing non-linear relationships in tourism demand. Projections for 2026 show a sustained recovery in international tourism and peaks in demand between May and August, with levels exceeding 130,000 monthly visitors in key destinations. The results demonstrate that data-driven forecasting enables the anticipation of demand scenarios and supports decisions aimed at sustainable tourism management, optimizing operational capacity and reducing the risk of overcrowding.
- Open Access
Identification of Latent Profiles and Determining Factors of Academic Stress in University Students: An Integrated Unsupervised–Supervised Machine Learning Approach
Academic stress is one of the main challenges affecting the psychological well-being of university students due to its impact on mental health, academic performance, and quality of life. The aim of this study was to analyze and model the factors associated with academic stress by integrating unsupervised and supervised machine learning techniques. The study was conducted with a sample of 605 students from the Universidad Nacional de San Martín (Peru), who completed validated psychometric instruments, including the PSS-10, LASSI, MBI-SS, PSQI, and A-CEA. In the first stage, dimensionality reduction and clustering techniques were applied to identify latent profiles, resulting in four distinct groups reflecting different levels of adaptation and psychological vulnerability. In the second stage, eight supervised regression models were evaluated: Linear Regression, Ridge, Lasso, Elastic Net, Random Forest, Gradient Boosting, XGBoost, and CatBoost. Lasso and Elastic Net showed virtually equivalent performance, achieving coefficients of determination (R2) close to 0.61 on the independent test set. Variable importance analysis revealed that academic burnout, sleep quality, and coping strategies were the main factors associated with perceived stress, together with contextual variables with lower relative importance. Overall, the results confirm the multidimensional nature of academic stress and show that integrating unsupervised and supervised approaches provides a more comprehensive understanding of the phenomenon in university settings.
Open AccessIdentification of Latent Profiles and Determining Factors of Academic Stress in University Students: An Integrated Unsupervised–Supervised Machine Learning Approach
Academic stress is one of the main challenges affecting the psychological well-being of university students due to its impact on mental health, academic performance, and quality of life. The aim of this study was to analyze and model the factors associated with academic stress by integrating unsupervised and supervised machine learning techniques. The study was conducted with a sample of 605 students from the Universidad Nacional de San Martín (Peru), who completed validated psychometric instruments, including the PSS-10, LASSI, MBI-SS, PSQI, and A-CEA. In the first stage, dimensionality reduction and clustering techniques were applied to identify latent profiles, resulting in four distinct groups reflecting different levels of adaptation and psychological vulnerability. In the second stage, eight supervised regression models were evaluated: Linear Regression, Ridge, Lasso, Elastic Net, Random Forest, Gradient Boosting, XGBoost, and CatBoost. Lasso and Elastic Net showed virtually equivalent performance, achieving coefficients of determination (R2) close to 0.61 on the independent test set. Variable importance analysis revealed that academic burnout, sleep quality, and coping strategies were the main factors associated with perceived stress, together with contextual variables with lower relative importance. Overall, the results confirm the multidimensional nature of academic stress and show that integrating unsupervised and supervised approaches provides a more comprehensive understanding of the phenomenon in university settings.
- Open Access
- 15 May 2026
- Published by Firenze University Press in JLIS.it
- Vol. 17 (2) , 116-137
Publication times and costs in Open Access journals: A thematic analysis of the Scopus–DOAJ ecosystem
The expansion of open access has positioned Article Processing Charges (APCs) and publication times as key dimensions for understanding the functioning of the scholarly publishing system. This study aims to characterise both components in scientific journals that are simultaneously indexed in Scopus and listed in DOAJ, identifying patterns by subject area and quartile. Data from Scopus, the 2024 SJR and DOAJ were integrated, considering only active journals with available information on average time to publication and APCs. The analysis, descriptive in nature, examined the distribution of these indicators across subject areas and editorial levels. The results show that publication times are similar among journals within the same subject area but differ when comparing different subject areas, whereas publication costs display larger differences in the upper quartiles and tend to decrease in the lower ones, with parallel trajectories in Life Sciences, Physical Sciences and Health Sciences and a differentiated pattern in Social Sciences. The study provides an updated empirical characterisation of how temporal stability and economic stratification coexist within a broad segment of the open access ecosystem.
- 15 May 2026
- Published by Firenze University Press in JLIS.it
- Vol. 17 (2) , 116-137
Open AccessPublication times and costs in Open Access journals: A thematic analysis of the Scopus–DOAJ ecosystem
The expansion of open access has positioned Article Processing Charges (APCs) and publication times as key dimensions for understanding the functioning of the scholarly publishing system. This study aims to characterise both components in scientific journals that are simultaneously indexed in Scopus and listed in DOAJ, identifying patterns by subject area and quartile. Data from Scopus, the 2024 SJR and DOAJ were integrated, considering only active journals with available information on average time to publication and APCs. The analysis, descriptive in nature, examined the distribution of these indicators across subject areas and editorial levels. The results show that publication times are similar among journals within the same subject area but differ when comparing different subject areas, whereas publication costs display larger differences in the upper quartiles and tend to decrease in the lower ones, with parallel trajectories in Life Sciences, Physical Sciences and Health Sciences and a differentiated pattern in Social Sciences. The study provides an updated empirical characterisation of how temporal stability and economic stratification coexist within a broad segment of the open access ecosystem.
- Open Access
- 30 March 2026
- Published by Frontiers Media SA in Frontiers in Artificial Intelligence
- Vol. 9, 1794925
Hybrid expert system for lifestyle recommendations in hypertensive patients
Introduction: Hypertension management requires personalized lifestyle interventions, yet clinical decision-making often relies on manual assessment and limited decision-support tools. This study presents a hybrid clinical decision-support system that integrates unsupervised machine learning with rule-based expert reasoning to generate personalized lifestyle recommendations for hypertensive patients. Methods: A real-world dataset of 615 clinical records obtained from routine healthcare services was analyzed. A preprocessing pipeline including data imputation, normalization, and dimensionality reduction was applied prior to patient stratification. Principal Component Analysis (PCA) preserved the dominant latent structure of the dataset, followed by K-Means clustering to identify patient profiles. The resulting clusters were integrated into a rule-based inference engine structured across six lifestyle intervention domains: physical activity, stress management, nutrition, sleep patterns, therapeutic adherence, and general health behaviors. Recommendations were generated using a dual-weighting strategy that prioritizes individual patient attributes while incorporating cluster-level contextual information. System performance was evaluated through blind expert validation involving cardiologists and clinical nutritionists. Results: K-Means clustering identified three clinically interpretable patient profiles with a Silhouette coefficient of 0.5608. Agreement between automated recommendations and expert clinical consensus reached 78.3%, with a Cohen’s Kappa coefficient of 0.742, indicating substantial concordance. No statistically significant differences were observed between system outputs and expert judgments ( χ 2 = 8.347, p = 0.908). Discussion: The findings demonstrate that combining unsupervised patient stratification with explicit clinical reasoning enables interpretable and scalable decision support for non-pharmacological hypertension management. This approach may be particularly valuable in healthcare environments with limited labeled data and constrained clinical resources.
- 30 March 2026
- Published by Frontiers Media SA in Frontiers in Artificial Intelligence
- Vol. 9, 1794925
Open AccessHybrid expert system for lifestyle recommendations in hypertensive patients
Introduction: Hypertension management requires personalized lifestyle interventions, yet clinical decision-making often relies on manual assessment and limited decision-support tools. This study presents a hybrid clinical decision-support system that integrates unsupervised machine learning with rule-based expert reasoning to generate personalized lifestyle recommendations for hypertensive patients. Methods: A real-world dataset of 615 clinical records obtained from routine healthcare services was analyzed. A preprocessing pipeline including data imputation, normalization, and dimensionality reduction was applied prior to patient stratification. Principal Component Analysis (PCA) preserved the dominant latent structure of the dataset, followed by K-Means clustering to identify patient profiles. The resulting clusters were integrated into a rule-based inference engine structured across six lifestyle intervention domains: physical activity, stress management, nutrition, sleep patterns, therapeutic adherence, and general health behaviors. Recommendations were generated using a dual-weighting strategy that prioritizes individual patient attributes while incorporating cluster-level contextual information. System performance was evaluated through blind expert validation involving cardiologists and clinical nutritionists. Results: K-Means clustering identified three clinically interpretable patient profiles with a Silhouette coefficient of 0.5608. Agreement between automated recommendations and expert clinical consensus reached 78.3%, with a Cohen’s Kappa coefficient of 0.742, indicating substantial concordance. No statistically significant differences were observed between system outputs and expert judgments ( χ 2 = 8.347, p = 0.908). Discussion: The findings demonstrate that combining unsupervised patient stratification with explicit clinical reasoning enables interpretable and scalable decision support for non-pharmacological hypertension management. This approach may be particularly valuable in healthcare environments with limited labeled data and constrained clinical resources.
- Open Access
- 28 March 2026
- Published by MDPI AG in Mathematics
- Vol. 14 (7) , 1139
Mathematical Modeling and Statistical Evaluation of Hybrid Deep Learning Architectures for Multiclass Classification of Cervical Cells in Digital Papanicolaou Images
Cervical cytology screening remains dependent on manual analysis, which is time-consuming and subject to variability. This study proposes a leakage-free hybrid deep learning framework for multiclass classification of cervical cells extracted from whole-slide Papanicolaou images. A fine-tuned DenseNet121 feature extractor was combined with three classifiers: Support Vector Machine (SVM), Stacked Extreme Learning Machine (SELM), and Cascaded Deep Forest (CDF). Experiments were conducted on the CRIC Cervix Collection dataset using slide-level data partitioning and group-aware stratified 7-fold cross-validation. Model comparison followed a paired non-parametric protocol (Friedman test with Wilcoxon post hoc and Holm correction). DenseNet121 + CDF achieved the highest cross-validation Accuracy (0.7370 ± 0.0357), significantly outperforming SVM (0.6644 ± 0.0287) and SELM (0.6431 ± 0.0471) (χ2(2) = 11.14, p = 0.0038; Kendall’s W = 0.79). Independent testing showed competitive generalization across models. These results support the statistical robustness of the Cascaded Deep Forest-based hybrid architecture for multiclass cervical cytology classification under realistic slide-level conditions.
- 28 March 2026
- Published by MDPI AG in Mathematics
- Vol. 14 (7) , 1139
Open AccessMathematical Modeling and Statistical Evaluation of Hybrid Deep Learning Architectures for Multiclass Classification of Cervical Cells in Digital Papanicolaou Images
Cervical cytology screening remains dependent on manual analysis, which is time-consuming and subject to variability. This study proposes a leakage-free hybrid deep learning framework for multiclass classification of cervical cells extracted from whole-slide Papanicolaou images. A fine-tuned DenseNet121 feature extractor was combined with three classifiers: Support Vector Machine (SVM), Stacked Extreme Learning Machine (SELM), and Cascaded Deep Forest (CDF). Experiments were conducted on the CRIC Cervix Collection dataset using slide-level data partitioning and group-aware stratified 7-fold cross-validation. Model comparison followed a paired non-parametric protocol (Friedman test with Wilcoxon post hoc and Holm correction). DenseNet121 + CDF achieved the highest cross-validation Accuracy (0.7370 ± 0.0357), significantly outperforming SVM (0.6644 ± 0.0287) and SELM (0.6431 ± 0.0471) (χ2(2) = 11.14, p = 0.0038; Kendall’s W = 0.79). Independent testing showed competitive generalization across models. These results support the statistical robustness of the Cascaded Deep Forest-based hybrid architecture for multiclass cervical cytology classification under realistic slide-level conditions.
- Top Cited PapersOpen Access
- 2 January 2026
- Published by Frontiers Media SA in Frontiers in Big Data
- Vol. 8, 1678863
Application of artificial intelligence in cervical cytology: a systematic review of deep learning models, datasets, and reported metrics
Introduction: The use of artificial intelligence (AI) in cervical cytology has increased substantially due to the need for automated tools that support the early detection of precancerous lesions. Methods: This systematic review examined deep learning models applied to cervical cytology images, focusing on the architectures used, the datasets employed, and the performance metrics reported. Articles published between 2022 and 2025 were retrieved from Scopus using PRISMA methodology. After applying inclusion criteria and full-text screening, 77 studies were included for RQ1 (models), 75 for RQ2 (datasets), and 71 for RQ3 (metrics). Results: Hybrid models were the most prevalent (56%), followed by convolutional neural networks (CNNs) and a growing number of Vision Transformer (ViT)-based approaches. SIPaKMeD and Herlev were the most frequently used datasets, although the use of private datasets is increasing. Accuracy was the most commonly reported metric (mean 87.76%), followed by precision, recall, and F1-score. Several hybrid and ViT-based models exceeded 92% accuracy. Identified limitations included limited cross-validation, reduced clinical representativeness of datasets, and inconsistent diagnostic criteria. Discussion: This review synthesizes current trends in AI-based cervical cytology, highlights common methodological limitations, and proposes directions for future research to enhance clinical applicability and standardization.
- 2 January 2026
- Published by Frontiers Media SA in Frontiers in Big Data
- Vol. 8, 1678863
Top Cited PapersOpen AccessApplication of artificial intelligence in cervical cytology: a systematic review of deep learning models, datasets, and reported metrics
Introduction: The use of artificial intelligence (AI) in cervical cytology has increased substantially due to the need for automated tools that support the early detection of precancerous lesions. Methods: This systematic review examined deep learning models applied to cervical cytology images, focusing on the architectures used, the datasets employed, and the performance metrics reported. Articles published between 2022 and 2025 were retrieved from Scopus using PRISMA methodology. After applying inclusion criteria and full-text screening, 77 studies were included for RQ1 (models), 75 for RQ2 (datasets), and 71 for RQ3 (metrics). Results: Hybrid models were the most prevalent (56%), followed by convolutional neural networks (CNNs) and a growing number of Vision Transformer (ViT)-based approaches. SIPaKMeD and Herlev were the most frequently used datasets, although the use of private datasets is increasing. Accuracy was the most commonly reported metric (mean 87.76%), followed by precision, recall, and F1-score. Several hybrid and ViT-based models exceeded 92% accuracy. Identified limitations included limited cross-validation, reduced clinical representativeness of datasets, and inconsistent diagnostic criteria. Discussion: This review synthesizes current trends in AI-based cervical cytology, highlights common methodological limitations, and proposes directions for future research to enhance clinical applicability and standardization.
- Open Access
- 20 November 2025
- Published by MDPI AG in Informatics
- Vol. 12 (4) , 126
Automated Hyperparameter Optimization for Cyberattack Detection Based on Machine Learning in IoT Systems
The growing sophistication of cyberattacks in Internet of Things (IoT) environments demands proactive and efficient solutions. We present an automated hyperparameter optimization (HPO) method for detecting cyberattacks in IoT that explicitly addresses class imbalance. The approach combines a Random Forest surrogate, a UCB acquisition function with controlled exploration, and an objective function that maximizes weighted F1 and MCC; it also integrates stratified validation and a compact selection of descriptors by metaheuristic consensus. Five models (RandomForest, AdaBoost, DecisionTree, XGBoost, and MLP) were evaluated on CICIoT2023 and CIC-DDoS2019. The results show systematic improvements over default configurations and competitiveness compared to Hyperopt and GridSearch. For RandomForest, marked increases were observed in CIC-DDoS2019 (F1-Score from 0.9469 to 0.9995; MCC from 0.9284 to 0.9986) and consistent improvements in CICIoT2023 (F1-Score from 0.9947 to 0.9954; MCC from 0.9885 to 0.9896), while maintaining low inference times. These results demonstrate that the proposed HPO offers a solid balance between performance, computational cost, and traceability, and constitutes a reproducible alternative for strengthening cybersecurity mechanisms in IoT environments with limited resources.
- 20 November 2025
- Published by MDPI AG in Informatics
- Vol. 12 (4) , 126
Open AccessAutomated Hyperparameter Optimization for Cyberattack Detection Based on Machine Learning in IoT Systems
The growing sophistication of cyberattacks in Internet of Things (IoT) environments demands proactive and efficient solutions. We present an automated hyperparameter optimization (HPO) method for detecting cyberattacks in IoT that explicitly addresses class imbalance. The approach combines a Random Forest surrogate, a UCB acquisition function with controlled exploration, and an objective function that maximizes weighted F1 and MCC; it also integrates stratified validation and a compact selection of descriptors by metaheuristic consensus. Five models (RandomForest, AdaBoost, DecisionTree, XGBoost, and MLP) were evaluated on CICIoT2023 and CIC-DDoS2019. The results show systematic improvements over default configurations and competitiveness compared to Hyperopt and GridSearch. For RandomForest, marked increases were observed in CIC-DDoS2019 (F1-Score from 0.9469 to 0.9995; MCC from 0.9284 to 0.9986) and consistent improvements in CICIoT2023 (F1-Score from 0.9947 to 0.9954; MCC from 0.9885 to 0.9896), while maintaining low inference times. These results demonstrate that the proposed HPO offers a solid balance between performance, computational cost, and traceability, and constitutes a reproducible alternative for strengthening cybersecurity mechanisms in IoT environments with limited resources.