2.1. Machine Vision System Development
A mobile machine vision system was developed by fabricating a custom platform (width × length × height: 2.184 m × 1.219 m × 0.737 m) using locally sourced bicycle components to minimize the cost (
Figure 1).
The custom-based machine vision system was fabricated by modifying image acquisition hardware, as defined in Mahmud et al. [
22], in order to effect real-time detection in the field. The system was manually propelled by pushing an integrated handle bar. An artificial cloud lighting condition (ACC) system was mounted on the mobile platform to minimize the variation of illumination during image acquisition in the field [
22]. The ACC was made with a black cloth cover to avoid direct sunlight during image acquisition (
Figure 1). The light illumination readings inside of the ACC chamber ranged from 800 to 900 lx during field trials. The system was designed to operate within single strawberry rows (1.219 m width) and slim bicycle wheels were used to minimize the damage on strawberry runners during the study. The system consisted of two μEye 1240 LE/C color cameras (IDS Imaging Development System Inc., Woburn, MA, USA), a HiPer
® Lite + RTK-GPS (Topcon Positioning Systems Inc., Livermore, CA, USA) for georeferencing and a ruggedized laptop computer (Toshiba Corporation, Minato, Tokyo, Japan). Each of the cameras acquired 24-bits blue–green–red (BGR) 640 × 256 pixels images covering a 0.6096 m × 0.2438 m (length × width) area of interest (AOI) of each section (half of row) in strawberry row (
Figure 2).
The AOI was used to minimize the barrel effect caused by the wide-angle lens by extracting from the center of the full frame images of 1280 × 1024 pixels. The wide-angle field of view lenses (LM4NCL, Kowa Optimed Inc., Torrance, CA, USA) were set up to a fixed aperture (f/4.0) and infinity focus with a 3.5 mm focal length. The cameras were set up with a 30° inclination from the vertical
Z-axis (downward), as shown in the
Figure 3, for acquiring suitable images for PM detection in the field. The inclination of 30° was chosen based on testing different angles prior to the start of the study. Images acquired with a 30° inclination facing the driving direction made the PM symptoms more visible since the disease is located under the leaves initially and infected leaf edges may also roll upward. Examples of images captured using a two-camera set up (one is 90° vertically downward and another is 30° inclination with the vertically downward-axis) are shown in
Figure 4.
Cameras were connected directly to the laptop computer using universal serial bus (USB) cables. Image acquisition by the cameras were conducted at a travelling speed rate of 25 frames per second (FPS) during the experiments. An image was extracted from every 15 frames to avoid overlapped areas between images. The cameras had a 0.3 m working depth from the camera sensor to leaf canopy. The system speed was manually controlled at 1.50 ± 0.40 km h
−1 and was maintained constant during the study by continuous monitoring of the graphical user interface (GUI) display. The system speed (in knots) was parsed from RTK-GPS string and converted into metric units (speed (ms
−1) = 0.51444 × speed (knots)). The 0.30 m working depth and image acquisition speed of 1.50 km h
−1 was previously determined to be optimum for strawberry powdery mildew detection [
22]. Digital gain and exposure time were automatically controlled by autogain control and autoexposure shutter. The RTK-GPS antenna was mounted above the cameras to simultaneously record the coordinates. The RTK-GPS position of the images was continuously stored in laptop computer by using National Marine Electronics Association (NMEA-0183) standard code sentences. The program was designed to only store the powdery mildew image location, when it was detected, into a comma-separated values (CSV) file.
A real-time strawberry powdery mildew disease detection algorithm was developed in C# (sharp) using Visual Studio 2017 (Microsoft, Redmond, WA, USA). The algorithm was programmed to process images and differentiate powdery mildew affected leaves from healthy or other diseased leaves (that did not retain similar features to PM). The image processing steps started with a conversion of the acquired blue, green and red (BGR) image into a green ratio, and hue, saturation and intensity (HSI) image. According to Meng et al. [
26], the HSI color space works better compared to RGB (red, green, and blue) and YUV (luminance, chrominance, and chroma) for image processing under field conditions. The hue channel from HSI color space represents the purity of color, such as pure blue (
b), green (
g), and red (
r) in terms of degree, whereas saturation represents the measure, from 1 to 0, to which pure color is diluted by a neutral color [
27]. The
b,
g, and
r intensity levels of individual pixel of an image were utilized to calculate the hue (
H), saturation (
S), and intensity (
I) components of that pixel by using the geometrical transformation relationships. These relationships were defined by the International Commission on Illumination (CIE) chromaticity diagram [
27]. A color conversion was performed for this study from BGR to HSI color plane on input images. Each input image was used to create three two-dimensional arrays in the process of CCM, color co-occurrence matrix. The pixel intensity of each array was applied for CCM construction from each color plane. The
H,
S, and
I images were converted using Equations (1)–(4) suggested by [
27].
where,
is the angle, and hue (
H) color plane was calculated based on angle (0–360°) of circle which was normalized in the range between 0 and 1. This normalized angle was then linearly transformed to 256 different intensity levels for calculating the
H of particular pixel depending upon its
r, g, and
b components (Equation (2)).
where,
S is the saturation color plane.
The ratio used was (G × 255) (B + G + R)
−1 and a manually obtained threshold (>86) for conversion to g-ratio images. The g-ratio images were masked with the original images to remove the background. Another thresholding was conducted with the masked image along with the manually obtained threshold (red > 190 and red < 220, green > 220 and green < 245, and blue > 180 and blue < 200) to obtain the final image for extracting valuable features. Color co-occurrence matrices (CCMs) [
23] were constructed from converted images, followed by textural features extraction. The CCMs were constructed with four converted images from one image followed by extracting a set of 10 features from the individual CCM. Since frequency in the CCMs is a function of the angular relationship and distance between neighboring pixels, in this research, an angular relationship (
) of 0° and a displacement vector (
) of 1 pixel were selected for CCM construction. The displacement vector of 1 pixel was selected, as it provided exceptional results when varied between 1 and 5 [
28]. The features data were normalized and resulting normalization of each CCM value varied from 0 to 1. The CCMs were normalized by dividing the individual entity in the CCM matrix by the total number of pairs in each matrix using the relationship presented in Equation (5) [
29].
where,
N (
a, f) is a normalized
CCM, n (
a, f) is a marginal probability function,
a is the intensity level at a certain pixel,
f is another matching intensity level with displacement vector,
= 1 and an orientation angle
, and the denominator of the equation, sum of
n (
a,
f), is the total number of pairs in the matrix with specific orientation and displacement vector.
A total of 40 textural features were extracted from an individual image after constructing the CCM but 23 features were specifically chosen to detect PM disease. The textural features were extracted by equations used from Shearer and Holmes [
23] and presented in
Table 2.
The 23 textural features were chosen due to their optimal performance compared to extracted 50 features for powdery mildew disease detection reported in laboratory experiments by Mahmud et al. [
22] using stepwise discriminant analysis. The selected features are presented in
Table 3.
Dandawate and Kokare [
30] reported that a combination of feature extraction using CCM and artificial neural networks (ANN) machine learning was suitable for detection of different plant diseases. Among the many supervised machine learning technologies available, using co-occurrence-based feature extraction with ANN generated better results when dealing with different leaf angles or positions, which is likely to occur under field conditions [
31]. Therefore, the CCM extracted features were analyzed for PM by using the ANN-based machine learning classifier. ANN-based machine learning was also chosen due to its superior performance relative to support vector machines and k-nearest neighbor for powdery mildew detection reported in controlled experiments [
32]. Peltarion Synapse (Peltarion Corp., Stockholm, Sweden) software was used to select the optimal ANN model architecture using our extracted features data. A total of 20 combinations of model architectures were tested and 4 optimal architectures were selected (
Table 4).
A back-propagation artificial neural network (BP-ANN) algorithm was applied to train the proposed network architectures. Four different transfer functions, including the tanh sigmoid, exponential, logistic sigmoid, and linear functions were used to translate the input signals into output signals ranging from 0 to 2 (i.e., 0, 1, and 2). The extracted textural features were selected as inputs for the input layer and corresponding healthy or disease labels (powdery mildew and other diseases) were established as an output in the output layer. All the settings of developed models were kept constant, the mathematical functions were changed, and finally mean absolute error (MAE) and root mean square error (RMSE) were recorded to find an optimal mathematical function for this study. A 1W (23/46) 1W (46/46) 1F (46/1) ANN model architecture with a tanh sigmoid transfer function was chosen having the epoch size of 15,000. Farooque et al. [
33] also developed an optimal ANN model with an epoch size of 15,000 and reported that the model was more suitable in capturing nonlinearity of relationships between variables. A 6000 image dataset was analyzed (60% for training and 40% for validation) to select an optimal model architecture. Three categories of images, e.g., healthy, powdery mildew affected, and other disease affected, were collected from 10:00 a.m. to 4:00 p.m. Upon selection of an optimal ANN model architecture, the model was deployed from Peltarion Synapse software as a dynamic link library file (dll) file. The deployed dll file used by the real-time powdery mildew disease detection algorithm ensured real-time selection of one of the three categories, i.e., powdery mildew affected, healthy, or other disease affected leaves. The algorithm had a statement (is the image powdery mildew affected?) to save the georeferenced coordinates in a CSV file of leaves identified as PM affected. The detection results of georeferenced coordinates location were imported into ArcGIS 10.5 computer software (ESRI, Redlands, CA, USA) for prescription mapping. Overview of the real-time detection algorithm is presented in
Figure 5.
2.2. Field Evaluation of Machine Vision System for Strawberry Powdery Mildew Detection
Testing of the real-time machine vision system on powdery mildew disease detection in commercial strawberry fields was carried out on the 6, 7, and 13 August 2018. The commercial strawberry operations located in Debert, Nova Scotia, provided fields under production for the evaluation of the real-time system. The tests were conducted on sunny days, with temperatures ranging from 20 to 32 °C, relative humidity (R
H) from 50% to 82%, and wind speeds from 3 to 14 km h
−1 [
34].
Three strawberry field sites were selected in Debert, Nova Scotia, to evaluate the performance of machine vision-based powdery mildew disease detection system. A commercial 12-hectare strawberry farm was used to conduct this study. The field sizes were 1.3 ha each (area) located in Debert site I (field 1; 45.429318° N, 63.483843° W), Debert site II (field 2; 45.429611° N, 63.48114° W), and Debert site III (field 3; 45.429098° N, 63.480276° W). All fields were cultivated with an Albion strawberry variety. Albion is a day-neutral or everbearing strawberry variety that grows quickly to about 12 inches (0.30 m) in height, with a spread of 12–24 in (0.30–0.60 m). They are high yielding and everbearing, which means they usually provide flower and fruit continuously from late spring into the fall. The fields have been cultivated in strawberries over the past few years and each maintained commercial management practices including mowing, pruning, fertilizing, and application of herbicides, pesticides, fungicide, etc. A total of 12 randomly selected strawberry rows were tested in each field (
Figure 6). The strawberry rows evaluated had dimensions of 1.22 m × 220 m (wide × length) for field site-I and 1.22 m × 180 m for field site-II and field site-III with a 0.31 m buffer between rows (
Figure 6).
Manual detection of PM disease was conducted for each experimental field based on recommendations from two experienced field scouts who checked for symptoms including white patches of mycelium on the upper leaf surface, roll upward leaf edges, and reddish irregular spots on leaf. Manual detection was conducted by carefully confirming all the symptoms of strawberry PM, especially checking white patches with roll edges leaves throughout the experiments. The detected points were marked by inserting red flags. The number of detected points of powdery mildew affected plants in a single row was calculated manually recorded in a paper notebook (Hilroy, Mississauga, ON, Canada) after counting. The locations of the detected points were also recorded using a ProMark3 mobile mapper (Thales Navigation, Santa Clara, CA, USA).
The machine vision system was deployed over individual rows of strawberry plants for continuous image acquisition by the two cameras. A total of 36 rows were covered over 3 strawberry fields (12 rows each) in this study. The images were processed through texture analysis by CCM and followed by detection using the ANN classifier. A step-by-step real-time strawberry PM disease detection process of an image is presented in
Figure 7. The average processing time for an image was 7648 μs (~0.0076 s). The powdery mildew detected leaf image locations (latitude and longitude) were saved automatically to a CSV file using a function in the custom software. Manually and automatically detected points were compared by manually counting points to evaluate the outcomes of the system. The detected points were mapped to create prescription map using the co-ordinates (longitude and latitude) collected from RTK-GPS and mobile mapper.
The software interface of the machine vision system was developed using Microsoft Visual Studio 2017 (Microsoft Corp, Redmond, WA, USA) (
Figure 8).
Communication between the RTK-GPS and laptop computer was established using a serial link setting (COM Port 1, baud rate 9600 bps, stop bit none, and parity bit 1). The speed of the system was calculated from NMEA-0183 standard code system directly from the RTK-GPS data displayed in GUI (
Figure 8). The latitude and longitude were also recorded from standard code from the RTK-GPS. The checkbox of camera selection was added to control the two cameras used for real-time image acquisition. Although the experiments used four processed images from one camera, two picture boxes (for one camera) were added in the real-time software due to a lack of space in the GUI display. The processed g-ratio and hue images were displayed from both cameras. The program was able to process the images to differentiate powdery mildew leaf images in the strawberry fields in real-time from both images taken by the two cameras. The system performance was evaluated by correlating the manual detection results with the automatic system detection results from both cameras in all the fields. The performance of the developed system is also evaluated by calculating recall, precision, and F-measure using relationship presented in Equations (6)–(8), respectively. Prescription maps were developed from the experimental data using ArcGIS 10.5 software.
where,
is the correctly detected points of PM disease,
is the number of healthy and other diseases points that are falsely classified as PM disease, and
is the number of points of PM disease that are falsely detected as healthy or other disease.
is the F-measure value representing accuracy using recall and precision relationship, and
is a non-negative real value, we set
= 0.80 in this study to weigh recall more than precision.