Next Article in Journal
COVID-19 Data Analysis: The Impact of Missing Data Imputation on Supervised Learning Model Performance
Previous Article in Journal
Stochastic Up-Scaling of Discrete Fine-Scale Models Using Bayesian Updating
 
 
Article
Peer-Review Record

The Optimization of PID Controller and Color Filter Parameters with a Genetic Algorithm for Pineapple Tracking Using an ROS2 and MicroROS-Based Robotic Head

Computation 2025, 13(3), 69; https://doi.org/10.3390/computation13030069
by Carolina Maldonado-Mendez 1, Sergio Fabian Ruiz-Paz 1, Isaac Machorro-Cano 2, Antonio Marin-Hernandez 3 and Sergio Hernandez-Mendez 3,*
Reviewer 1: Anonymous
Reviewer 2:
Computation 2025, 13(3), 69; https://doi.org/10.3390/computation13030069
Submission received: 31 January 2025 / Revised: 25 February 2025 / Accepted: 4 March 2025 / Published: 7 March 2025

Round 1

Reviewer 1 Report

Comments and Suggestions for Authors

1. The introduction provides a broad overview of object tracking in robotics and its applications in agriculture. However, it does not sufficiently highlight the gap in existing research that this study aims to fill. While the manuscript discusses fruit detection, it should explicitly clarify how pineapple tracking differs from previous works on fruits with simpler textures and colors.  Please clearly state the problem with tracking pineapples compared to other fruits and why this work is needed in precision agriculture.

 

2. The research design is generally appropriate, utilizing a genetic algorithm (GA) to optimize a multivariate Gaussian filter (MGF) for color segmentation and a PID controller for object tracking. The use of ROS2 and MicroROS enhances the real-time processing capability of the system. Please provide a stronger justification for using GA over other optimization techniques like Particle Swarm Optimization (PSO) or Deep Reinforcement Learning.

 

3. The methodology is well detailed, including explanations of the GA-based optimization process. The hardware and software components are clearly defined. However, it lacks details on experimental conditions such as lighting variations, distance constraints, and potential environmental challenges.

Please include a discussion on how lighting conditions, object occlusion, and background complexity affect the system’s performance.

 

4. The results are well-structured and supported by tables and figures. However, statistical analysis (e.g., error margins, confidence intervals) is missing. Additionally, while tracking performance is demonstrated, it is unclear how it compares to a non-GA-optimized PID controller.

Authors  should provide a comparative analysis of tracking accuracy between a manually tuned PID and the GA-optimized PID.

 

5. The conclusions align with the findings, but they could be more detailed in terms of the study's contributions to agricultural robotics. Please emphasize how this system improves upon previous tracking methods and discuss potential real-world applications in automated fruit harvesting or monitoring.

Comments on the Quality of English Language

The language is understandable, but there are some grammatical errors and awkward phrasings. A professional language revision is recommended to improve clarity and fluency.

Author Response

Dear Reviewer,

The authors wish to thank the reviewers for their valuable comments. We have carefully reviewed the observations you kindly provided for the article titled "Optimizing PID Controller and Color Filter Parameters with a Genetic Algorithm for Pineapple Tracking Using a ROS2 and MicroROS-Based Robotic Head".We have addressed all your comments to improve the content quality and explain/describe some sections of this paper in a better way.

Below, you will find our responses to each of the observations.

 

  1. The introduction provides a broad overview of object tracking in robotics and its applications in agriculture. However, it does not sufficiently highlight the gap in existing research that this study aims to fill. While the manuscript discusses fruit detection, it should explicitly clarify how pineapple tracking differs from previous works on fruits with simpler textures and colors.  Please clearly state the problem with tracking pineapples compared to other fruits and why this work is needed in precision agriculture.

 

Response:

Thanks for your observation. In pages 3 and 4, lines 114-125, the following was added:

 

The pineapple has been selected as the object of interest due to its significant economic importance as a fruit crop in tropical regions. Major pineapple-producing countries include Thailand, the Philippines, Mexico, Costa Rica, Chile, Brazil, China, Indonesia, Hawaii, India, Bangladesh, Nigeria, Kenya, the Democratic Republic of the Congo, Ivory Coast, Guinea, the Dominican Republic, and South Africa. In 2012, global pineapple production reached 23.33 million metric tons, reflecting a steady increase from 2002 to 2012. Over the past two decades, the global pineapple market has expanded rapidly. Given this growth, assessing the status of pineapples through advanced image processing techniques is essential. These methods play a crucial role in agricultural management by enabling precise monitoring, measurement, and response to crop variability [31]. The application of advanced vision and artificial intelligence techniques in pineapple identification and harvesting can significantly enhance efficiency and facilitate harvesting tasks for farmers.

 

 

 

In page 4, in lines 127-131, the following was added:

 

To track an object of interest, it must first be segmented. While a color filter may be sufficient for segmenting the fruits reviewed in the state-of-the-art (oranges, apples, bananas, among others), this approach was inadequate for pineapples due to the complex color composition and rough texture.

 

The following reference was added:

  1. Hossain, M. World pineapple production: An overview. African Journal of Food, Agriculture, Nutrition and Development 2016, 16, 11443–11456.

 

  1. The research design is generally appropriate, utilizing a genetic algorithm (GA) to optimize a multivariate Gaussian filter (MGF) for color segmentation and a PID controller for object tracking. The use of ROS2 and MicroROS enhances the real-time processing capability of the system. Please provide a stronger justification for using GA over other optimization techniques like Particle Swarm Optimization (PSO) or Deep Reinforcement Learning.

 

Response:

Thanks for your comment. We reviewed the techniques you suggested and do not believe that the Genetic Algorithm (GA) is superior; however, we did observe that its implementation is simpler, and we have achieved good results both in a previous study and in the current one.

 

In pages 2 and 3, in lines 77-102, the following was added:

 

Other optimization strategies include Particle Swarm Optimization (PSO) and Deep Reinforcement Learning (DRL). PSO [24] is inspired by the collective behavior of social animals. In this approach, a set of candidate solutions, referred to as a swarm of particles, flows through the search space, defining trajectories driven by their own performance as well as that of their neighbors. This technique requires defining the speed and inertia of particles, incorporating a cognitive component that allows particles to revert to previously discovered superior solutions, and including a social component that encourages collective movement toward optimal solutions. DRL [25] is based on reinforcement learning principles, utilizing agents and deep neural networks to learn optimal policies. The algorithm operates on a reward-based system, where agents transition between states while maximizing cumulative rewards through iterative learning processes.

The Genetic Algorithm [26] is an adaptive search heuristic inspired by natural selection. It simulates evolutionary processes in which individuals compete for resources, with the fittest solutions prevailing over weaker ones. Similar to biological evolution, GA employs selection mechanisms for mating, recombination, and mutation of genetic material to iteratively refine candidate solutions. This approach is particularly effective when the search space is large and conventional optimization techniques fail to yield competitive results.

In this work, a GA was chosen as the optimization strategy due to its independence from prior knowledge of the plant's mathematical model, its relatively simple implementation, and its proven effectiveness across various applications [27]. Furthermore, in a previous work [28] a PID controller was tuned to track people and detect falls using a vision system. The controller parameters were optimized both manually and through a Genetic Algorithm (GA). A comparative analysis of tracking performance for posture detection revealed that the controller exhibited fewer oscillations when using the parameters obtained through GA, demonstrating its effectiveness in improving system stability and accuracy. This prior success further supports its suitability for the present work.

 

The following references were added:

 

  1. Wang, D.; Tan, D.; Liu, L. Particle swarm optimization algorithm: an overview. Soft computing 2018, 22, 387–408.

 

  1. Arulkumaran, K.; Deisenroth, M.P.; Brundage, M.; Bharath, A.A. Deep reinforcement learning: A brief survey. IEEE Signal Processing Magazine 2017, 34, 26–38.

 

  1. Lambora, A.; Gupta, K.; Chopra, K. Genetic algorithm-A literature review. In Proceedings of the 2019 international conference on machine learning, big data, cloud and parallel computing (COMITCon). IEEE, 2019, pp. 380–384.

 

  1. The methodology is well detailed, including explanations of the GA-based optimization process. The hardware and software components are clearly defined. However, it lacks details on experimental conditions such as lighting variations, distance constraints, and potential environmental challenges. Please include a discussion on how lighting conditions, object occlusion, and background complexity affect the system’s performance.

 

Response:

Thanks for your review. In pages 16, in lines 348-360 the following was added:

The images were captured in an indoor setting, with the distance between the pineapple and the camera varying approximately between 0.30 and 1.5 meters. Each image ensures that the entire pineapple remains visible without occlusions, while the background consists of different colors and textures. In addition, the table used in the setup was chosen to have a color similar to that of the body of the pineapple to improve the robustness of the filtering process. Pineapple tracking experiments with the robot were conducted in a classroom environment with higher illumination levels. The results demonstrated that the system was capable of successfully tracking the pineapple. Regarding occlusions, even if the pineapple body is only partially detected, it is sufficient to place it in the center of the image plane, and the vision system will continue tracking the object. No tests were conducted outdoors to validate whether changes in lighting affect the performance of the MGF. In such cases, the parameters should be optimized using images of pineapples in outdoor settings to enhance the robustness of the segmentation process.

  1. The results are well-structured and supported by tables and figures. However, statistical analysis (e.g., error margins, confidence intervals) is missing. Additionally, while tracking performance is demonstrated, it is unclear how it compares to a non-GA-optimized PID controller.

 

Response:

Thanks for your observation. In page 3, in lines 96-102, the following was added:

Furthermore, in a previous work [28] a PID controller was tuned to track people and detect falls using a vision system. The controller parameters were optimized both manually and through a Genetic Algorithm (GA). A comparative analysis of tracking performance for posture detection revealed that the controller exhibited fewer oscillations when using the parameters obtained through GA, demonstrating its effectiveness in improving system stability and accuracy. This prior success further supports its suitability for the present work.

  1. The conclusions align with the findings, but they could be more detailed in terms of the study's contributions to agricultural robotics. Please emphasize how this system improves upon previous tracking methods and discuss potential real-world applications in automated fruit harvesting or monitoring.

Response:

Thanks for your observation. In page 16, in lines 372-383, the following was added:

Previous studies have not addressed the segmentation of fruits with complex color patterns or rough textures. The results obtained in this work allow a robot to approach pineapples, assess their condition, and make decisions regarding the supply of fertilizers, water, and other agricultural factors. Additionally, the system can determine the optimal harvest time. The multivariate Gaussian filter can be trained and optimized to detect other rough fruits such as soursop or melon. Future work will focus on an omnidirectional robot (Fig. 1) that captures images of different pineapples to assess their health status based on their color and texture. This supports decision-making for harvesting, insecticide application, and other agricultural tasks. It is also planned to integrate a 3D vision sensor to combine depth information with 2D information, in order to have a more robust system that can better handle environmental variations.

 

  1. The language is understandable, but there are some grammatical errors and awkward phrasings. A professional language revision is recommended to improve clarity and fluency

Response:

Thanks for your review. We have carefully checked the spelling and grammar throughout the document and it now contains no such errors

Reviewer 2 Report

Comments and Suggestions for Authors

The authors presented their research studies to optimize the PID controller and Color Filter parameters with a Genetic Algorithm for Pineapple tracking Using a ROS2 and MicroROS-Based Robotic Head.  

Review and suggestions:

1. The novel aspects of the research should be highlighted in the opening section.

2. Although Figure 3 depicts the hardware implementation of ROS, it lacks a thorough explanation.

3. A flowchart or pseudocode illustrating the Genetic Algorithm and its application in the proposed studies should be incorporated into Section 3.

4. The title and specific lines (125 and 161) mention the use of a genetic algorithm to optimize MGF parameters (µ and Σ). Provide a clear explanation of which exact parameters undergo optimization, describe the GA optimization method, and justify this approach.

5. Following from point 4, Table 1 needs more extensive details. Present an in-depth qualitative and quantitative comparative analysis of the GA-optimized parameters.

6. The analogy presented in Figure 9 is effective. Establish a connection between this and the embedded device that utilizes a microcontroller.

7. Discuss potential areas for future investigation that other researchers could pursue based on the outcomes of this study.

Author Response

Dear Reviewer,

The authors wish to thank the reviewers for their valuable comments. We have carefully reviewed the observations you kindly provided for the article titled "Optimizing PID Controller and Color Filter Parameters with a Genetic Algorithm for Pineapple Tracking Using a ROS2 and MicroROS-Based Robotic Head". We have addressed all your comments to improve the content quality and explain/describe some sections of this paper in a better way.

  1. The novel aspects of the research should be highlighted in the opening section.

Response:

Thanks for your observation. In page 4, in lines 127-131, the following was added:

 

To track an object of interest, it must first be segmented. While a color filter may be sufficient for segmenting the fruits reviewed in the state-of-the-art (oranges, apples, bananas, among others), this approach was inadequate for pineapples due to the complex color composition and rough texture.

 

 

  1. Although Figure 3 depicts the hardware implementation of ROS, it lacks a thorough explanation.

Response:

Thanks for your observation. In page 5, in the Figure 3, the caption was changed:

The architecture implemented in ROS 2 consists of both hardware and software components. (1) Hardware: This includes input and output devices such as a servo motor, a webcam, and an Arduino Due board with microROS to control the servo motors responsible for moving the pan-tilt unit (PTU). (2) Software: The system is structured into modules with specific functionalities, including object segmentation, centroid calculation, and tracking using two PID controllers. The servomotors are powered by lithium batteries. ROS 2 manages the communication between the software and hardware layers.

  1. A flowchart or pseudocode illustrating the Genetic Algorithm and its application in the proposed studies should be incorporated into Section 3.

Response:

Thanks for your observation. In page 6, in lines 185-186, the following was added:

  • Algorithm 1 Genetic Algorithm

1: Initialize population P with random values

2: for G generations do

3: Evaluate fitness of each individual in P

4: Select parents from P in random order

5: Apply crossover to produce offspring

6: Apply mutation to offspring

7: Form new population P from offspring

8: Apply elitism

9: end for

10: Return best solution found

  1. The title and specific lines (125 and 161) mention the use of a genetic algorithm to optimize MGF parameters (µ and Σ). Provide a clear explanation of which exact parameters undergo optimization, describe the GA optimization method, and justify this approach.

Response:

Thanks for your observation. In page 7, in line 205 the following was added:

The elements of μ and Σ, as shown in (3) and (4) respectively, are optimized using a GA.

In page 3, in lines 87-102 the following was added:

 

The Genetic Algorithm [26] is an adaptive search heuristic inspired by natural selection. It simulates evolutionary processes in which individuals compete for resources, with the fittest solutions prevailing over weaker ones. Similar to biological evolution, GA employs selection mechanisms for mating, recombination, and mutation of genetic material to iteratively refine candidate solutions. This approach is particularly effective when the search space is large and conventional optimization techniques fail to yield competitive results.

In this work, a GA was chosen as the optimization strategy due to its independence from prior knowledge of the plant's mathematical model, its relatively simple implementation, and its proven effectiveness across various applications [27]. Furthermore, in a previous work [28] a PID controller was tuned to track people and detect falls using a vision system. The controller parameters were optimized both manually and through a Genetic Algorithm (GA). A comparative analysis of tracking performance for posture detection revealed that the controller exhibited fewer oscillations when using the parameters obtained through GA, demonstrating its effectiveness in improving system stability and accuracy. This prior success further supports its suitability for the present work.

 

The following reference was added:

  1. Lambora, A.; Gupta, K.; Chopra, K. Genetic algorithm-A literature review. In Proceedings of the 2019 international conference on machine learning, big data, cloud and parallel computing (COMITCon). IEEE, 2019, pp. 380–384..

 

  1. Following from point 4, Table 1 needs more extensive details. Present an in-depth qualitative and quantitative comparative analysis of the GA-optimized parameters.

Response

Thanks for your observation. In pages 8 and 9, in lines 231-244 the following was added:

Table 1 shows the statistical results. The performance of segmenting pineapples using 100 individuals, with a two-point crossover at 90% and a mutation rate of 10%. This configuration resulted in an average fitness of 73.12%, representing the overall performance. The mean fitness is slightly lower than the median, suggesting that some solutions performed exceptionally well, raising the average fitness. The standard deviation, which reflects the degree of dispersion in the fitness values relative to the mean, is 14.7. The worst-performing individual achieved a fitness of 53%, indicating some variability in the solutions generated during the optimization process.

The difference between the best and worst individual is 45%, indicating a significant variation in performance. This variation could potentially be reduced by adjusting the parameters of the genetic operators (crossover and mutation) and the number of generations. However, the presence of poorer solutions does not necessarily imply that the genetic algorithm (GA) is an ineffective strategy. In fact, the GA remains a robust strategy, as it is capable of exploring a diverse solution space, with the best individuals being able to achieve good results despite the presence of suboptimal ones.

  1. The analogy presented in Figure 9 is effective. Establish a connection between this and the embedded device that utilizes a microcontroller.

Response

Thanks for your observation. In page 10, in lines 260-261, the following was added:

In the system proposed (Fig. 3), the Arduino Due board is used to control the servo motors that move the PTU (Fig. 3}

  1. Discuss potential areas for future investigation that other researchers could pursue based on the outcomes of this study.

Response:

Thanks for your observation. In page 16, in lines 372-383, the following was added:

Previous studies have not addressed the segmentation of fruits with complex color patterns or rough textures. The results obtained in this work allow a robot to approach pineapples, assess their condition, and make decisions regarding the supply of fertilizers, water, and other agricultural factors. Additionally, the system can determine the optimal harvest time. The multivariate Gaussian filter can be trained and optimized to detect other rough fruits such as soursop or melon. Future work will focus on an omnidirectional robot (Fig. 1) that captures images of different pineapples to assess their health status based on their color and texture. This supports decision-making for harvesting, insecticide application, and other agricultural tasks. It is also planned to integrate a 3D vision sensor to combine depth information with 2D information, in order to have a more robust system that can better handle environmental variations.

 

Round 2

Reviewer 1 Report

Comments and Suggestions for Authors

1. Discuss Future Application of ADRC: In the Discussion section, explore the potential for integrating Active Disturbance Rejection Control (ADRC) to improve the stability and adaptability of the system in complex environments. ADRC could be particularly beneficial in real-time adjustments in the presence of disturbances such as varying object textures or movement dynamics. (https://www.mdpi.com/2075-1702/13/2/111#:~:text=This%20review%20focuses%20on%20the%20fundamental%20principles%20of,and%20achievements%20in%20precision%20agriculture%20management%2C%20intelligent%20agricult)

 

2. Provide Real-World Validation: Test the system under outdoor conditions, varying light sources, and dynamic environments, and discuss these findings in the Discussion. This will help showcase the robustness of the system in practical agricultural settings.

 

3. Compare with Other Optimization Methods: In the Results section, compare the GA optimization with alternative techniques like Particle Swarm Optimization (PSO) or manual PID tuning. A comparison with other established methods will help solidify the advantages of the chosen approach.

 

4. I recommend referencing the following two articles to provide additional theoretical support and context to the proposed vision system for pineapple tracking in this study:

1). "The strong connectivity of bubble-sort star graphs"
   Although primarily focused on graph theory, this article can contribute valuable insights into connectivity and optimization, which may be relevant to the underlying algorithms used in the robotic vision system. Specifically, the study's discussion on connectivity can provide a theoretical foundation for improving the system's ability to handle multiple objects or complex environmental settings, which could enhance the robustness of the tracking system.

2). "HybridGNN: A Self-Supervised Graph Neural Network for Efficient Maximum Matching in Bipartite Graphs"
   This paper is highly relevant to the study, as it explores the application of self-supervised graph neural networks (GNNs) for efficient matching in bipartite graphs. Given that the proposed vision system involves optimizing PID controller parameters and image segmentation for object tracking, the graph-based optimization methods discussed in this paper could be applied to improve the system’s ability to match and track objects with complex color patterns, such as pineapples. Citing this article would strengthen the argument for applying advanced machine learning techniques to the optimization process in robotic vision systems.

Author Response

Dear Reviewer,

The authors wish to thank the reviewers for their valuable comments. We have carefully reviewed the observations you kindly provided for the article titled "Optimizing PID Controller and Color Filter Parameters with a Genetic Algorithm for Pineapple Tracking Using a ROS2 and MicroROS-Based Robotic Head".We have addressed all your comments to improve the content quality and explain/describe some sections of this paper in a better way.

In the attached file R1.pdf you will find the response to each of the observations.

Best regards

Author Response File: Author Response.pdf

Reviewer 2 Report

Comments and Suggestions for Authors

Thank you for response

Author Response

The authors wish to thank the reviewer for their valuable comments.

Best regards

Back to TopTop