7
718 Technical Gazette 28, 3(2021), 718-724 ISSN 1330-3651(Print), ISSN 1848-6339 (Online) https://doi.org/10.17559/TV-20181010044923 Original scientific paper Design and Implementation of an Automated Colony Counter Using Artificial Vision Andres VARGAS, Cesar PEÑA*, Luis PEÑA Abstract: An automatic module for counting colony forming units (CFU) present in raw milk, and its analysed by an artificial vision algorithm was designed and implemented as the focus of this work. The purpose of the algorithm was to identify the total number of colonies present and its respective area, after a sample was plated in a selected agar media. The growth and evolution of the colonies with respect to time and a selected temperature could be studied. The results are shown by using a user interface. The designed device can be used not only for counting colonies, but also to obtain specific data when doing research in the area of food safety, among other areas of interest. Keywords: artificial vision; automation; colony forming units (CFU); petri dish; raw milk 1 INTRODUCTION Our country suffers from a continuous problem regarding the hygienic quality of milk, since some producers do not carry out proper hygiene practices both during milking and during storage and distribution of it, which may lead to health issues upon human consumption. Studies aiming to inspect or examine foods pay special attention to determine how many living or viable bacteria are present in them, to achieve this goal, the number of them that are capable of forming colonies in a specific solid medium is determined [1]. The procedure of verifying viable bacteria is called the viable number, however for practical reasons this number is known as Colony Forming Units (CFU) [1]. The common practice to diagnose if a product is suitable or not for consumption is based on the determination of its hygienic quality through the use of different laboratory tests and routinely tests, this is referred to as the determination of CFU. CFU is a broadly used technique in different fields and have been used for example to determine the number of bacteria to be inoculated in silage inoculation experiments [2], to test for fungal contamination in fruit salads [3], to help to identify the organisms causing high total bacterial count in bulk tank milk while used in conjunction with other techniques, [4] and to check the contamination of human milk in neonatal care units [5], among others. In recent years, technologies based on digital image processing have had good results in countless applications, as well as in areas of research such as medical and food biology. These areas have benefited from applications used in diagnostic processes, as well as in the detection of diseases and in the area of quality control [6]. In the area of microbiology, the CFU determination technique is constantly used to detect the behaviour of certain microorganisms present in samples of interest (milk, food, water, urine, etc.). In most cases, the counting is performed manually by a person skilled in the art, however, when the analysis of a large number of samples is required, despite the operators skill, there is a high predisposition to make mistakes [7]. Within the microbial analysis process, there is no automated module on the market that allows the CFU growth present in raw milk to be analysed in detail and a real-time analysis using artificial vision techniques. This work carried out the first stage of an investigation to develop an automated system for counting the CFU and its evolution. Raw milk was used as raw material, in order to achieve the identification and quantification of CFU with a competitive and viable technology to the environment through digital image processing processes. Image analysis is a process that allows the identification and understanding of different types of patterns, so it has a large number of applications. One of the main goals of computer image analysis is to equip a machine with the ability to perceive and analyse a specific environment, something that human beings can normally do [8]. 2 METHODOLOGY 2.1 Design and Construction of the CFU Module The construction of the module was made intending to integrate the traditional method usually used for this type of work; the design sought the saving of time and greater efficiency in the product's treatment. A CAD model was generated during the project (Fig. 1), seeking to facilitate the prototypes perception and make it more functional. Figure 1 CAD Model 1. LCD (Liquid Crystal Display) 2. Process light indicator 3. Camera hatch 4. Sensor 5. Incubator hatch

Design and Implementation of an Automated Colony Counter

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Design and Implementation of an Automated Colony Counter

718 Technical Gazette 28, 3(2021), 718-724 

ISSN 1330-3651(Print), ISSN 1848-6339 (Online) https://doi.org/10.17559/TV-20181010044923 Original scientific paper

Design and Implementation of an Automated Colony Counter Using Artificial Vision  

Andres VARGAS, Cesar PEÑA*, Luis PEÑA

 Abstract: An automatic module for counting colony forming units (CFU) present in raw milk, and its analysed by an artificial vision algorithm was designed and implemented as the focus of this work. The purpose of the algorithm was to identify the total number of colonies present and its respective area, after a sample was plated in a selected agar media. The growth and evolution of the colonies with respect to time and a selected temperature could be studied. The results are shown by using a user interface. The designed device can be used not only for counting colonies, but also to obtain specific data when doing research in the area of food safety, among other areas of interest. Keywords: artificial vision; automation; colony forming units (CFU); petri dish; raw milk

1 INTRODUCTION

Our country suffers from a continuous problem regarding the hygienic quality of milk, since some producers do not carry out proper hygiene practices both during milking and during storage and distribution of it, which may lead to health issues upon human consumption. Studies aiming to inspect or examine foods pay special attention to determine how many living or viable bacteria are present in them, to achieve this goal, the number of them that are capable of forming colonies in a specific solid medium is determined [1]. The procedure of verifying viable bacteria is called the viable number, however for practical reasons this number is known as Colony Forming Units (CFU) [1]. The common practice to diagnose if a product is suitable or not for consumption is based on the determination of its hygienic quality through the use of different laboratory tests and routinely tests, this is referred to as the determination of CFU. CFU is a broadly used technique in different fields and have been used for example to determine the number of bacteria to be inoculated in silage inoculation experiments [2], to test for fungal contamination in fruit salads [3], to help to identify the organisms causing high total bacterial count in bulk tank milk while used in conjunction with other techniques, [4] and to check the contamination of human milk in neonatal care units [5], among others.

In recent years, technologies based on digital image processing have had good results in countless applications, as well as in areas of research such as medical and food biology. These areas have benefited from applications used in diagnostic processes, as well as in the detection of diseases and in the area of quality control [6].

In the area of microbiology, the CFU determination technique is constantly used to detect the behaviour of certain microorganisms present in samples of interest (milk, food, water, urine, etc.). In most cases, the counting is performed manually by a person skilled in the art, however, when the analysis of a large number of samples is required, despite the operatorꞌs skill, there is a high predisposition to make mistakes [7].

Within the microbial analysis process, there is no automated module on the market that allows the CFU growth present in raw milk to be analysed in detail and a real-time analysis using artificial vision techniques.

This work carried out the first stage of an investigation to develop an automated system for counting the CFU and its evolution. Raw milk was used as raw material, in order to achieve the identification and quantification of CFU with a competitive and viable technology to the environment through digital image processing processes.

Image analysis is a process that allows the identification and understanding of different types of patterns, so it has a large number of applications. One of the main goals of computer image analysis is to equip a machine with the ability to perceive and analyse a specific environment, something that human beings can normally do [8]. 2 METHODOLOGY 2.1 Design and Construction of the CFU Module

The construction of the module was made intending to

integrate the traditional method usually used for this type of work; the design sought the saving of time and greater efficiency in the product's treatment. A CAD model was generated during the project (Fig. 1), seeking to facilitate the prototypeꞌs perception and make it more functional.

Figure 1 CAD Model

1. LCD (Liquid Crystal Display) 2. Process light indicator 3. Camera hatch 4. Sensor 5. Incubator hatch

Page 2: Design and Implementation of an Automated Colony Counter

Andres VARGAS et al.: Design and Implementation of an Automated Colony Counter Using Artificial Vision 

Tehnički vjesnik 28, 3(2021), 718-724 719

6. Tray level 7. Tray for housing the Petri box 8. Resistance 9. Camera 10. Sensor light indicator 11. Electronics compartment 12. Buttons.

When designing the prototype, the operator's comfort was sought, in such a way that it optimized the operator's performance when starting the process. For this, a compartment with two entrances was strategically located in the frontal side of the module in order to facilitate the entry of samples to be studied. The interior was divided into two fundamental sections to have greater organization and control of the prototype. In the upper part, the electronic and electrical components were located (arduino mega 2560 card, circuits, source, buttons, LCD). In the lower section a camera was placed, which made the capture of images, followed by a sensor and the tray levels where the sample was housed in its respective Petri dish (necessary to carry out the analysis) and if possible analyse the sample and arrive at a clear and effective result; finally, a thermal resistance was fixed together with the lamp. The base material of the module was wood (MDF).

The final thermal system was constituted by a heat sink of 750 W mounted on a platform with thermal insulation.

The power stage was constituted by a current source having as a power element a TRIAC BT138, mounted on a control circuit. The temperature sensor (LM35) was separated from the heating resistance in order to measure the quantity to be controlled, so that the desired temperature is achieved.

For the acquisition of sensor temperature control data, the Arduino Mega2560 card was implemented, being a good option that allowed relatively easy programming, saving time in the prototype's development.

For image capture the Microsoft LifeCam Cinema HD 720 high resolution camera was used, solving the problem of image capture of the colony forming units.

Keeping the design details for the prototype, data visualization was developed through a LCD feedback, controlled by a pic16f877a microcontroller, whose function was to show the temperature changes given in the sensor.

For the aforementioned components, the respective printed circuit board was elaborated, as shown below (Fig. 2)

Figure 2 Electronic compartment

1. Control stage circuit 2. Sensor stage circuit

3. Arduino Mega 2560 Board 4. Display LCD 5. Transformer 110/12 Vac 6. Voltage Source 5 Vdc 7. Temperature display circuit. 2.2 Temperature Control

The module was designed to maintain a constant

temperature of 37 °C, which is the optimum temperature of incubation and evolution of most microorganisms that represent a risk to human health.

In this project, the PID controller [9] was implemented, so that the temperature sensor data was the first to be obtained in order to gain data for later analysis. The stepꞌs input was configured, in our case it was a voltage input headed to the input of the pulse width modulator (PWM), a gain was assigned so that 1 volt could be generated at the output acquisition cardꞌs pin 9. This acquisition was modelled in the Simulink program (Fig. 3)

Figure 3 Block diagram for data capture

An identification system was used to generate the

plantꞌs model in an open loop. This was generated in IDINT of Matlab where an estimate was made (Fig. 4) of the plant resulting in a first order behaviour and the approximation of 91.78% and in this way the transfer function was found.

Figure 4 Plant Estimate

Then the block diagram of the plant in open loop was

made (Fig. 5), to observe its behaviour.

Figure 5 Open loop plant block diagram

Page 3: Design and Implementation of an Automated Colony Counter

Andres VARGAS et al.: Design and Implementation of an Automated Colony Counter Using Artificial Vision 

720 Technical Gazette 28, 3(2021), 718-724 

The response of the plant was then observed (Fig. 6).

Figure 6 Response of the plant in open loop and determination of the

parameters for the Ziegler-Nichols method

The Ziegler-Nichols PID regulator tuning method allows defining the proportional (Kp), integral (Ki) and derivative (Kd) gains from the response of the open-loop system [10].

Fig. 6 shows a typical graph of the test, which is also known as the process reaction curve; the "S" shaped response is characteristic of second or higher order processes, with or without dead time. The next step is to match the process reaction curve with the model of a simple process in order to determine the model parameters. The model to be used is defined, where three parameters are characterized: the gain K, the dead time t0 and the time constant .

First the gain is obtained knowing the desired value as a reference ΔCs as shown in Fig. 6, then times are calculated t1, y, t2, knowing the 28,3% y 63,2% the value of temperature. Subsequently the mentioned values of and t0, are calculated in the Eqs. (1) and (2).

2 13 3

830 280 8252 2

t t (1)

0 2 830 825 5t t

(2)

Then the parameters Kc, Ti and Td were calculated,

based on the response to the step according to the parameters in Tab. 1 [10].

Table 1 Equations for response adjustment

Controller Type Proportional

Gain Kc Integration

Time Ti Derivative

Time Td

Proportional P 1

01 t

k

---------- ----------

Proportional- Integral PI

100 9 t,

k

03 33, t ----------

Proportional- Integral -

Derivative PID

101 2 t,

k

02 0, t 0

1

2t

Where:

s

1

46230

0 2

Ck

U ,

(3)

Replacing the values of Kc, Ti and Td in the Eqs. (4), (5) and (6), the parameters of the PID closed loop controller are obtained, as shown in Fig. 7.

 

p c 0,86K K (4)

ci

i

0,086K

KT

(5)

d 01

2,52

K t

(6)

Once this data was obtained, the parameters of the PID

controller were entered in the block diagram (Fig. 7) in a closed loop.

Regarding the behaviour of the plant (Fig. 8) the PID controller, in the real test with a working time of 24 hours, where it was observed that after 300 seconds there was an over-impulse below 45 °C, this value is within the controllerꞌs acceptance range, the signal tended to stabilize at 600 seconds where the controller's performance was evidenced, being located at the desired temperature of 37 °C, the oscillations were due to the thermal inertia produced inside of the plant.

Figure 7 Closed loop controller block diagram

Figure 8 Close loop controller behavior

Page 4: Design and Implementation of an Automated Colony Counter

Andres VARGAS et al.: Design and Implementation of an Automated Colony Counter Using Artificial Vision 

Tehnički vjesnik 28, 3(2021), 718-724 721

2.3 Evolution of the Colony Forming Units Through Artificial Vision Below is the automated system for the recognition and

counting of colony forming units (CFU), designed for the purpose of analysing the quality of raw milk (viable bacteria) by means of an artificial vision algorithm, based on the evolution that It is presented in the petri dish.

The initial step in the digital image processing process was to visualize and capture the last image of the process (Fig. 9).

Figure 9 Original image

After that, the process was steered towards the

elimination of parts that are not of interest these were cut out to later modify the image starting from the colour components (RGB), see Fig. 10.

Figure 10 Segment to be analyzed

The next step consisted in the execution of a

morphological opening operation, which consists of eroding an image and then dilating it. In the erosion a structuring element (in this case a circle) is passed through the image and the central value is replaced by the minimum value found in its vicinity. This causes regions with high values to shrink in size. By making the disk take a significant size (e.g., 100 pixels), these regions will disappear completely. After the erosion, the dilation is applied so that the region to be analysed regains its original size (now with low values), as can be seen in Fig. 11. Basically, with this procedure the Petri dishꞌs background value is being obtained despite the changes of lighting present in the image.

Figure 11 Morphological opening operation to obtain the background (erosion

followed by dilation) Having the segment of the image to be analysed and its

background, we proceeded to subtract the two images obtaining the pixels of interest (corresponding to the colonies), as can be seen in Fig. 12.

Figure 12 Subtraction of the image and background

Subsequently a binarization of the image is performed

by means of a pre-established threshold, the smaller regions (corresponding to the noise) are eliminated and the rest are characterized. The characteristics correspond to the size and location of its centroid. Finally, a count of the CFU is made, as can be seen in Fig. 13.

Figure 13 Localized and labeled UFCs

Page 5: Design and Implementation of an Automated Colony Counter

Andres VARGAS et al.: Design and Implementation of an Automated Colony Counter Using Artificial Vision 

722 Technical Gazette 28, 3(2021), 718-724 

2.3 User Interface The user interface (Fig. 14) created, has two main

panels, one for controlling the device and the other for the digital treatment of images. For the case of this device, there were two buttons that allowed executing the block diagram of the controller program and finally analyzing the graphics of the closed loop control system.

For the digital image treatment panel there were also two buttons, one for the capture and recording of images for every determined time and another for the treatment of digital images algorithm's execution, with the purpose of analyzing the behavior and evolution of CFU.

Figure 14 HMI interface

3 TESTS AND RESULTS

An experimental test was conducted for the food industry in which the behavior and evolution of CFUs present in raw milk was studied in order to diagnose the quality and if this was suitable for human consumption, obtaining a prototype in model real. In Fig. 15 you can see its external appearance (A) and its components on the inside (B).

Figure 15 Real prototype model

1. LCD (Liquid Crystal Display) 2. Process light indicator 3. Camera 4. Sensor 5. Tray for Petri box 6. Lamp 7. Sensor light indicator

8. Resistance 9. Petri box (sample) 10. Tray level.

In the analysis process, it was determined that it was of vital importance that the controller was in optimal operation, for this, it was recommended to preheat the module for a period of 10 minutes to achieve the stabilization of the same at the desired incubation temperature, for the current case of 37 °C; Then, the sample was placed in the module, where the artificial vision process began, to then start the program under the parameters already entered by the user. Afterwards, an image capture was made every so often, covering the whole process that lasted 24 hours, and a record was kept in images.

For the analysis of the behavior of the evolution of CFUs present in raw milk, the treatment of images previously described to each of the images had to be done, in order to observe the evolution and formation of said CFU, in addition to this data such as number of colonies, formation time, among others was acquired.

For the final count of the CFUs, the last image was analyzed (see Fig. 16), and thus a report which served as the basis to decide whether the sample complied or not was generated with the UFC standards for human consumption, based in the existing regulations and in technical concepts of the operator.

Figure 16 Number of colonies

Then it was preceded to perform the following

calculation: N C D

(7)

Where: N - colony forming units per millilitre sample / CFU/ml C - total number of colonies on the plate (6) D - factor or inverse of the dilution (104)

6 10000 60000 CFU/mlN

(8)

According to the final test result, in order to determine

the hygienic quality of the sample of raw milk, it was determined that the product was fit for consumer

Page 6: Design and Implementation of an Automated Colony Counter

Andres VARGAS et al.: Design and Implementation of an Automated Colony Counter Using Artificial Vision 

Tehnički vjesnik 28, 3(2021), 718-724 723

consumption. The foregoing was based on what is stated in the Colombian regulations under Decree 2838 of 2006, which regulates the microbial study for the food industry [11].

With the final treatment of the images, the data from the CFU areas were analysed in the final count, condensed in Tab. 2.

Table 2 Evolution of the colony forming units over time Areas in each colony

Time / min CFU 1 2 3 4 5 6 0 0 0 0 0 0 0 0 60 1 4 0 0 0 0 0 120 1 5 0 0 0 0 0 180 2 5 3 0 0 0 0 240 3 5 3 1 0 0 0 300 4 5 3 1 1 0 0 360 4 5 3 1 1 0 0 420 4 5 3 1 1 0 0 480 5 5 3 1 1 1 0 540 5 5 3 1 1 28 0 600 5 5 3 1 1 51 0 660 5 5 3 1 1 70 0 720 5 5 3 1 1 92 0 780 5 5 3 1 1 126 0 840 5 5 3 1 1 181 0 900 5 5 3 1 1 235 0 960 5 5 3 1 1 298 0

1020 5 5 3 1 1 324 0 1080 5 5 3 1 1 376 0 1140 5 5 3 1 1 407 0 1200 5 5 3 1 1 463 0 1260 5 5 3 1 1 507 0 1320 5 5 3 1 1 557 0 1380 6 5 3 1 1 606 1 1440 6 5 3 1 1 660 2

As can be seen, the time in which each of the colony

forming units evolve (Fig. 17) was analysed.

Figure 17 Behavior of colony forming units

In the test carried out in the CFU present in the sample

of raw milk, with a duration of 24 hours (we highlight the time), it can be noted that the behaviour of the samples [1-4, 6] was not very relevant in its evolution, noting that sample 5 (Fig. 18) obtained a great evolution until the end of the process.

We observe its evolution and the change in size respecting the time and the area to study, where it is shown that from the beginning to the 480th minute there was no evolution, from that moment on, its evolution was increasing significant until the end of the process.

Figure 18 Evolution of colony # 5 respecting the area

4 CONCLUSIONS

This prototype contributes to the technical and scientific development for the research areas in the food industry, given the importance of the determination of CFU as the aerobic mesophilic bacteria count, the most indicated test to determine the hygienic quality of the milk.

This prototype, in addition to automatically counting the CFU, allows us to monitor the growth of itself, without altering the temperature conditions, which opens the door to future investigations where premises can be taken in a much shorter analysis time. On the other hand, this prototype allows UFP to be counted in less than a second, which could be used to analyse experiments with a smaller number of dilutions and draw conclusions more quickly, considering them as future work.

Additionally, this prototype can calculate each of the areas of the CFU with which very accurate data for future research can obtained.

5 REFERENCES

[1] Wistreich, G. A. (2003). Microbiology Laboratory

Fundamentals and Application. Saddle River, New Jersey 07458: Pearson Education, Inc.

[2] Kim, D. H., Amanullah, S. M., Lee, H. J., Joo, Y. H., Han, O. K., Adesogan, A. T., & Kim, S. C. (2018). Effects of hybrid and bacterial inoculation on fermentation quality and fatty acid profile of barley silage. Animal Science Journal, 89(1), 140-148. https://doi.org/10.1111/asj.12923

[3] Tournas, V. H., Heeres, J., & Burgess, L. (2006). Moulds and yeasts in fruit salads and fruit juices. Food Microbiology, 23(7), 684-688. https://doi.org/10.1016/j.fm.2006.01.003

[4] Katholm, J., Olesen, L. T., Petersen, A., & Sigurdsson, S. (2018). Evaluation of a new qPCR test to identify the organisms causing high total bacterial count in bulk tank milk. Journal of Integrative Agriculture, 17(6), 1241-1245.

https://doi.org/10.1016/S2095-3119(17)61781-7 [5] Slutzah, M., Codipilly, C. N., Potak, D., Clark, R. M., &

Schanler, R. J. (2010). Refrigerator Storage of Expressed Human Milk in the Neonatal Intensive Care Unit. Journal of Pediatrics, 156(1), 26-28.

https://doi.org/10.1016/j.jpeds.2009.07.023 [6] Tadeo F., González S., & Alvarez M. T. (2001).

Classification of Microorganisms, by Image Processing. Department of Systems Engineering and Automation, University of Valladolid, and Wastewater Treatment Plant, Avila, Spain.

[7] Corkidi, G., Diaz-Uribe R., Folch-Mallol J. L., & Nieto Sotelo, J. (1998). COVASIAM: An Image Analysis Method that Allows Detection of Confluent Microbial Colonies and

Page 7: Design and Implementation of an Automated Colony Counter

Andres VARGAS et al.: Design and Implementation of an Automated Colony Counter Using Artificial Vision 

724 Technical Gazette 28, 3(2021), 718-724 

Colonies of various Sizes for Automated Counting. Applied and Environmental Microbiology, 64(4), 1400-1404.

https://doi.org/10.1128/AEM.64.4.1400-1404.1998 [8] Gonzalo, J. & Cruz, M. (2002). Computer vision: Digital

images and applications. 275-278. Editorial Alfa Omega [9] Belta, C., Yordanov, B., & Gol, E. A. (2017). Formal

Methods for Discrete-Time Dynamical Systems. Springer International Publishing.

https://doi.org/10.1007/978-3-319-50763-7 [10] Smith, C. A. & Corripio, A. B. (2006). Principles and

practice of automatic process control. Wiley. [11] Uribe, A., Arias, A., & Palacio, D. (2006). Decreto 2838.

Ministry of Social Protection. Bogotá D. C. Contact information: Andres VARGAS, M.Sc. University of Pamplona, Faculty of Engineering, Km 1 vía Bucaramanga, Pamplona, Colombia E-mail: [email protected] Cesar PEÑA, PhD (Corresponding author) University of Pamplona, Faculty of Engineering, Cr 4a # 10 - 53, Pamplona, Colombia E-mail: [email protected] Luis Carlos Peña, PhD University of Pamplona, Faculty of Agricultural Sciences, Ciudadela Universitaria, Pamplona, Colombia E-mail: [email protected]