IoT-based Closed Algal Cultivation System with Vision System for Cell Count through ImageJ via Raspberry Pi

Spirulina platensis and other microalgae are now being considered in the different fields of research. It is due to the former’s endless potential let alone, its high protein content. That is why, a stable demand of microalga production is now necessary. To achieve a high-protein spirulina, its cultivation using closed algal cultivation requires monitoring and maintenance of the bio-environmental factors and parameters affecting its growth to provide a stable and efficient production of microalgae. Meanwhile, laboratories that culture spirulina determine its cell count through manually counting the cells under a microscope – a tedious work. This establishes the need to construct a device that cultivates spirulina with maintaining and cell counting capabilities. Thus, the proponents developed a culturing device that has three main systems. The first system is tasked to maintain the bio-environmental parameters, such as the pH level, temperature, and light. The second system on the other hand speaks of the cell counting system through ImageJ’s Image Processing. This system verifies the cell count and growth through counting the filaments of the spirulina. Lastly, a corresponding Android application, which was developed using Firebase and Android Studio, displays real-time values of the culture’s parameter. Results show that the device was able to stabilize its parameters. Also, red LEDs exhibited 28.43% higher approximate cell count than red-blue LEDs. With this, the quality of the Spirulina that was produced throughout the study was improved. Lastly, the use of ImageJ’s image processing feature showed no significant difference with manual counting. It also releases the results multiple times faster than the manual counting. Thus, being a better alternative to manual cell counting. Keywords—Spirulina platensis; ImageJ; image processing; closed algal cultivation; parameter monitoring; firebase


I. INTRODUCTION
Spirulina is a blue-green microalga that grows in alkaline lakes. Because of its high protein content, this microalga can be widely used in pharmaceutical, aquaculture as feed, and as a source of biofuel. That is why, it is currently in great interest [1]- [2]. Spirulina is now produced in large batches and is cultured in either open or closed systems. Open systems usually use ponds, while closed systems are in any container that has controlled parameters. Major disadvantages of open ponds are the contamination of the culture and the changing condition of the environment. Closed systems, on the other hand, has the defense for contamination. Essential parameters such as temperature, pH level, and oxygen level can also be monitored using closed systems [3]- [6]. Insufficient monitoring of the culture results to lower production of the aquaculture, technological solutions such as data monitoring using Internet of Things (IoT) devices and platform provides real-time tracking of the essential parameters [7]. Aeration is necessary for the maintenance of these parameters especially to the homogeneity of the light absorption of the culture. Also, aeration ensures that the nutrients are scattered all throughout the culture. As for the temperature, it is maintained by submerging the container to a pool of water, by using heat exchanger, or by spraying the outside of the container with water. Light is the most important parameter in culturing spirulina [8]. Since Spirulina platensis is under the phylum cyanobacteria, it is photoautotrophic. It utilizes the process photosynthesis in making own food [9].
Spirulina platensis cell counting is usually done in laboratories through a "cell counting chamber" called Hemocytometer [10]. It is simple, direct, and cheap but it is also laborious and time consuming because of Spirulina platensis unusual cell shape and cell suspension making this method susceptible for human errors.
The amount of the spirulina obtained after the farming is important. It is desired to have great amount of spirulina produced in one cycle of culturing. It is also settled that the counting and the detection of Spirulina cells are extremely tedious to be done manually. From these, the implementation of image processing is considered since image processing as a means for cell counting proved its effectivity in numerous studies [11]. One of the main applications of digital image processing is estimating the total number of a specific object in each image.
The study investigates the contribution made by the microscopic vision system and the light of the closed cultivation system in the measurement of the cell density of www.ijacsa.thesai.org Spirulina platensis. It also identifies the extent of the proposed vision system in capturing the microscopic image of the spirulina and determining its cell count. Specifically, it aims to (1) build a device with maintenance and correcting system; (2) create a vision system that captures images of samples then counting the cells; and (3) create an Android application for the real-time monitoring of the parameters using IoT platform. Lastly, this device that counts the filaments is a great help for the spirulina farmers to save time and to have accurate cell counts is what the research is aimed at.

II. RELATED WORK
A study by Aquino et al. [12]- [13] also measured, monitored, and corrected parameters essential in culturing Spirulina platensis. Their system also has a vision system that comprises of a camera and a sampling cube. Artificial neural network was trained and then used as an algorithm in analyzing the algal concentration. The detection and correction system in [13] were adapted in this past study [12], except for the dissolved oxygen parameter, vision system and the algorithm that were used in their image processing. Thus, said vision system was improved and the algorithm was also changed. Additional one difference between the past study [12] and this one [13] is the visualization of data. This study made use of an Android application that displays the data and their graphical representation for each parameter.
In [14], this study incorporates temperature, UV intensity, and water turbidity sensors, microcontroller, and cloud services for their spirulina culturing system. It also made use of the IoT platform and the Android app to acquire, visualize, and monitor data gathered within the smart micro farm. This study used ThingSpeak as database and MIT Appinventor to create their application. It also focused on the implementation of IoT and Android application. Parameters were only measured, not corrected.
A study in [15] uses an optical sensor unit that is responsible for measuring cell concentration and changes of the physiological status in the culturing system in real-time. This optical sensor was made up of three laser diodes different wavelengths. This study also developed a graphical user interface (GUI) in their control station. Environmental conditions, such as temperature, were controlled using this control station. The real-time data sent to the control station using Ethernet. The optical sensor unit in [14] utilizes flow cytometry, so air pump was used to acquire culture to pass through the unit. Culture passing through the pump might not get enough light and it might get stuck on the surface of the tube, affecting the flow rate. Their GUI and control system are not portable because they are attached to the system. Lastly, a study by Niangoran et al. [16] concludes that using red light in the culture produced more biomass than any other color of light.
To obtain a high protein alga, three key parameters such as pH level, temperature, as well as light should be considered. Previous works only took one or two parameters into account. Thus, in this paper, monitoring the said three key parameters were considered to prove that the said parameters were necessary in producing a greater growth of the microalgae. Moreover, a device that can ease the cell counting system was developed in this study. Through an algorithm which is purposely designed for scientific image processing. This image processing technique was made with ImageJ; furthermore, implementing the IoT concept with Firebase and Android Studio made monitoring and data acquisition easier. Because both is in real-time and can be done remotely.

III. CHALLENGES AND LIMITATIONS OF EXISTING APPROACHES
The prior works of Spirulina culturing system [12]- [13] had a monitoring, measuring, and correcting features. However, they were not IoT-enabled. Thus, they cannot be monitored nor controlled via the Internet. Meanwhile, the two different culturing system"s parameters [14], [17] can be measured and monitored through the Internet but not corrected. An IoTbased Spirulina [18] and microalgae [19]- [20] culturing system where its parameters can be monitored and corrected through the Internet were developed but the growth of the algae was measured using turbidity value [18] and microalgae biomass [19]- [20], respectively. The said limitations are summarized and listed as shown in Table I.  Fig. 1 shows the block diagram of the entire system. The culturing device has three main parts: the culturing system, the vision system, and the android application. The culturing system is responsible for the monitoring and maintenance of the parameters. Monitoring includes temperature and pH sensors. Data from the measured parameters will be sent to the Arduino and if the values of the parameters are out of the desired range, maintenance takes place by correcting the parameters. The Arduino opens or closes maintenance through a relay. The Arduino is also connected to the Raspberry pi which is responsible for sending data to the cloud. The Raspberry pi and cloud were also included in the android application as well as its interface. The application displays the data from the parameters and their graphs, including the cell counted from the vision system for the real-time monitoring. Finally, the vision system where the cell counting occurs is fitted in a small black box where the extracted 0.1 ml sample using a sterile syringe is transferred in a petri dish and is placed inside the platform of the vision system. After three images are taken per sample using a fixed hand-held microscope camera, the images are then processed, and cells are counted using ImageJ"s morphological processes. Fig. 2 on the other hand, shows the process of maintaining the parameters. Maintenance system starts off with the sensors simultaneously reading the pH level and temperature of the www.ijacsa.thesai.org culture. The data gathered will be verified if it is in the ideal range. If the parameters, either pH or temperature were in the ideal range, the current data is sustained. However, if it is not in the ideal range, certain amount of chemical needed to maintain the system will automatically be added to the culture. If the pH level read is higher than the ideal range, Phosphoric acid will be added to the system. If it is lower, sodium hydroxide will be added. Likewise, if the temperature read is higher than the ideal range, the maintenance system will run the cooling fan. And if it is lower, the maintenance system will run the heater. This process will repeat unless the ideal range is maintained.  (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 12, No. 7, 2021 290 | P a g e www.ijacsa.thesai.org Counting of Detected Filaments. Fig. 3 shows the functions done in the images and the counting of the filaments by the ImageJ"s image processing. The images are initially evaluated by ImageJ"s edge detection. This was done to effectively determine the location of the filaments present in the sample image with minimal error rate. Furthermore, the method used was Particle Analysis. This was utilized because it detects the edges with precision. The process began by converting the acquired image to binary. The thresholding is done twice to clearly detect the filament edges. The image should also pass through Gaussian blur. In this case, the sigma is set to 2. Then, run the Canny edge function. Lastly, through the output image of the Canny edge wherein it detected the cells in the image, is the analysis of the image by counting the identified particles. Fig. 4 shows the isometric view of the device. It is made from a half-inch thick marine plywood and the edges were finished with aluminum angle bar. The wood box is C-shaped, and the aquarium is placed in the middle. At the top part of the box, above the aquarium, is where the electronic circuits, air pump, peristaltic pumps, and the power supply lie. They are fixed in a piece of acrylic so that they do not move easily. There is also a small hole that acts as a passage of wires. The back part houses the vision system and the two wash bottles. This part is for the tall components. The bottom part is a drawer. This drawer serves as a storage for the essential tools in culturing Spirulina, such as the syringe, the sampling dishes, and the plankton net. Moreover, Fig. 5 shows the actual device.  Furthermore, the results obtained in this study were statistically evaluated. T-test was applied to determine if there is a significant difference in using a different color of LED as artificial light in culturing Spirulina platensis.
At the same time, regression analysis was utilized to determine the growth rate of Spirulina under different artificial lighting treatment over time. The culture prepared for this study was composed of 80% culture medium and 20% inoculum of pure Spirulina platensis. Three parameters were assessed for the constructed cultivation system. These are the temperature, the pH level, and the lighting. The constructed closed cultivation system underwent a 7-day test run to evaluate the parameter"s functionality. The plotted graphs below would show the measured temperature and pH level obtained from the cultivating system for 7 days. Fig. 6 shows the obtained temperature of the microalgae during the 7-day run. The system maintained the temperature within the specified target range of 29 to 32 degree Celsius. The starting temperature of the culture was 25.5°C and it progressively reached the specified range for the parameter"s maintenance optimal range. The monitored temperature contains numerous changes but is still at the applicable set of temperature. Fig. 7 proves that the device maintained the pH level of the culture during the test run. The culture began with a pH level of 7.28 because the water that was used for the culture was distilled. As it progresses, the culture"s pH level immediately rose to the parameter"s target optimal range which was between 8.5 and 9.5. Since then, the said parameter has been maintained. It also showed stability and it did not exceed the desired alkalinity for the microalgae.
Moreover, the vision system was programmed to automatically capture images of the sample using the Raspberry Pi, which will then be followed by detecting and counting the filaments on the captured image, as seen in Fig. 3. Furthermore, to determine its acceptability, 31 microscopic Spirulina images were assessed as the initial samples evaluated using ImageJ"s particle analysis to effectively determine the location of the filaments present in the sample image. The samples were obtained using a sterile syringe and were placed in a sampling dish.
The obtained data from the vision system that uses ImageJ"s Image Processing techniques were compared with manual counting of the filaments. T-test of two samples assuming equal variances was used for the statistical analysis of the system as shown in Table II. This was utilized to verify if the mean of the methods used would show a significant difference. And in turn, the result showed that the methods have no significant difference with each other. Since the obtained p-value is equal to 0.0729, which is greater than the significance level that is 0.025. Hence, the proponents have concluded that there is no significant difference between the methods. Thus, the constructed vision system which utilizes ImageJ plugins can be considered as an alternative in counting the filaments of the Spirulina platensis.    Target ALGAL www.ijacsa.thesai.org The proposed system was compared with a previous study [12]- [13] to verify which set-up yields better growth of Spirulina platensis as shown in Table III. The former has been re-enacted with the same conditions except that this experiment uses 20% of inoculum. The medium used for each culture was SOT (Society of Toxicology) culture media. On the other hand, the bio-environmental factors such as pH level and temperature were monitored. Meanwhile, previous studies [12]- [13] proved that the culture"s Dissolved Oxygen (DO) level remained on its ideal range which was 10-25 mg per liter. Thus, this study did not monitor the DO level of the culture anymore. The cultures were also aerated to obtain homogeneity in light absorption. This study uses Red LEDs as artificial lighting whereas the past study uses a Red-blue LEDs. For the vision system, to determine the cell count of the culture, the previous study used RGB analysis using Artificial Neural Network, while this study opted to made use of the microscopic image analysis using ImageJ. Furthermore, IoT implementation and Android application were implemented in this study, whereas the previous study did not.
The experimental setup also proved that Red-only LED helps increase the cell count of the Spirulina platensis culture compared to the previous research"s Red-Blue LED setup. During its Lag phase, the Red-only displayed an early increase in growth as it progresses through the week resulting in a clear gap having a 28.43% more cell count per ml compared to Red-Blue on the seventh day. Fig. 8 shows the cell count for each light setup for 7 days. Fig. 9 and 10, on the other hand shows the regression analyses for the two methods of artificial lighting. The growth rate of the Red LED is 0.388 while the Red-blue LED has 0.3021. The Red LED had 28.43% higher growth rate than the Red-blue LED. Table IV shows the t-test for the comparison of Red-only and Red-blue LED. The p-value 0.02 is less than the 0.05 significance level. The decision is to reject the null hypothesis, which states that the color of LED used in culturing Spirulina does not affect its cell count. This means that there is a significant difference between the two means. The Android application was able to obtain the data from the pH and temperature sensors. These sensors are connected to the Arduino using Raspberry Pi. Correspondingly, the Android application was programmed to fetch the upcoming data and to display the latest recorded entry the database has received per parameter. In turn, the accumulated data were presented into the developed application in graphical and numerical forms. These are shown in Fig. 11.   (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 12, No. 7, 2021 293 | P a g e www.ijacsa.thesai.org

VI. CONCLUSION
The proposed closed algal culturing system successfully and effectively maintained the parameters to its optimal level. Its maintenance system was consistent in keeping the parameters in their respective ideal range. The culture which was illuminated using red LED obtained more cell count than the ones with red and blue LED. This, in turn, improved the quality of the Spirulina that was produced throughout the study proper.
Since no significant statistical difference between the implemented ImageJ"s image processing and the manual counting and the ImageJ-based vision system"s counting took less than 10 seconds, the implemented ImageJ feature became a good substitute for counting cells manually. Lastly, the Android application was a great help for the cultivators since it showed convenience in monitoring the necessary parameters.

VII. FUTURE WORK
For future work, this study can be applied to other aquaculture systems especially other species of microalgae which requires an optimal range of bio-environmental factors to greatly improve its growth. Furthermore, the automation of collecting samples is advised as it can limit the frequency of opening the system, reducing the contamination of the culture. Improvement or alternative for the device"s camera is also advised to further improve the sample"s image resolution and quality. As for the IoT implementation, data encryption and improvement of the Android application"s GUI is advised for security and quality of life. Lastly, it is advised to increase the images to be assessed by the system and the timeframe in conducting the study since microalgae are species that need proficiency and precision in cultivating.