Multidisease in coffee leaf prediction approach using GFPO-YOLOv3
Predicting coffee leaf disease utilizing DL has been trendy research; however, it could not predict disease even with small spots. This paper proposes a model for multi-disease prediction in coffee leaf utilizing GFPO-YOLOv3 model as displayed in Fig 1.
Pre-processing
Obtained raw images are given for pre-processing and their distortions are suppressed for finding deep features for further processing. Pre-processing was done in three steps:Image resizing,contrast enhancement and edge enhancement.
•
Contrast enhancement
Gaussian-Contrast Limited Adaptive Histogram Equalization (G-CLAHE) has been utilized for contrast enhancement. Conventional CLAHE was taken owing to its operation even in small regions of the image. Still, it has been enhanced by utilizing overall Gaussian value of image to select a threshold Gaussian value is the weighted average of each pixel’s neighborhood. Resized image (Ez) has been given to G-CLAHE for contrast enhancement image as (Ezc)
Where,
Vcr-xp = Signifies number of pixels in contextual region (m).
Vcr-yp = Pixels in contextual region (n) number of gray levels is specified as Vgray.
CLAHE was then clipped utilizing Gaussian function (G) computed by fraction of mean and standard deviation values of an image. The parameters of the formulas used in this section are listed in Table 5.
G = y - mean/std dviation ...(2)
Ezc = GCLAHE (Ez) ...(3)
• Edge enhancement
Pansharpening Rational Unsharp Mask Filter (PRUF) has been proposed for edge enhancement. For extracting and amplifying target image’s high-frequency components, then adding them back to target image, a conventional Rational Unsharp Mask Filter has been selected. Primarily, filter (Edi) of PRUF works as,
Edi = Ezc + ϑ(Ezc-z) ...(4)
Where,
Smoothed image is symbolized as Z that was low pass filter’s output and factor of gain is signified as ϑ. After that, by passing through a high-pass filter,outcomes were modified as,
Edi = Ezc + ϑa ...(5)
Where,
α = indicates the input image’s high-frequency component. To find α equation (4) is utilized.
a = Fy (p,q)Cy(p,q) + Fz(p,q)Cz(p,q) ...(6)
Where,
Fy(p,q) = 2y(p,q) - y(p,q-1) - y(p,q+1) ...(7)
Fz (p, q) = 2y(p, q) - y(p - 1, q) - y(p + 1, q) ...(8)
κ = Constant parameter.
y(p,q) = Pixel intensity value at location.
(p,q) = Input image.
These rational operations (Fy,Fz) could enhance details of gradients at low and medium intensities Cy and Cz. Afterward, applying this rational filter to original image,its enhanced image is expressed as,
(E
p) symbolizes enhanced image,

is mean of the high-frequency component and this image was then mapped utilizing pansharpening mapping. The mapping indexes were obtained by determining threshold of vectors. These indexes assist in finding whether the disease spots were highly thresholded at leaf tip or edge area. It is represented as,
Perimeter and Area indicate perimeter and area of patches correspondingly.
Color spacing model
After pre-processing, the image was further given to color spacing models to enhance luminance and intensity of image. RGB2HSI, YCbCr, YCgCr, HIS and HSV are the color spacing models utilized. Primarily, input image was taken and converted to a grayscale, which was then plotted in a histogram. It might further undergo extraction of color components that produce an enhanced image as depicted in Fig 2.
RGB2HSI color spacing
Edge-enhanced images were attained here. Images were initially at chrominance Red (
α), Green (
β) and Blue (
δ) values, which were then converted to (Hue Saturation Intensity) HSI as follows
HSV color spacing
Same as the HSI model, Hue, saturation were computed for (Ep) with formulation and V is value or brightness of the color.
V = max (α, β, δ) ...(18)
YCbCr Color spacing
Here, obtained edge-enhanced image (Ep) is transformed to YCbCr, as Y is luminance,Blue chrominance is Cb and red is Cr.
YCgCr color spacing
Similar to YCbCr, green chrominance was signified as Cg and this also gets input as edge enhanced image (Ep) and generates YCgCr as,
The overall enhanced image obtained out of color spacing is exemplified as (Eoe) and this image was given to the next stage.
Feature extraction
The images obtained (Eoe) were then given to feature extraction to identify multi-diseases in coffee leaves. Features extracted here are both conventional (Color and Texture) and additional features (Gist and PHOG). To enhance the classifier’s accuracy, additional features were added in feature extraction. The features extracted are explicated further,
ΓF = {Γ1, Γ2, Γ3, Γ4} ...(21)
Texture features (Γ1)
These features are extracted since they have important details about structural arrangement of surfaces with their relationships.Texture features extracted here are,
Contrast(Con)
where,
L = Limit of intensity value of image.
Homogeneity (Hom)
Dissimilarity (Disim)
Correlation (corr)
where,
Variance
Color features (Γ2)
Color features were extracted for finding representation of image’s pixel values at position (p,q). Let the input image has dimensions f × g. Color features extracted are,
Mean (N)
Deviation (ϕ)
Gist feature (Γ3)
The Gist feature was selected as it could describe infected area even with a lower dimensional matrix and further provided a spatial structure of infected area. Gist feature has a collection of perceptual dimenwsions. It can overcome perceptual completion problem.Feature extraction technique filters input images with several low-level visual feature channels like flicker, motion, orientation, color, intensity. These filter output maps were computed by,
My (p, q) = |Oy (p) Θ Oy (q)| ...(33)
Where,
Mapping filter output is specified as My, pixels were mapped at varying scales, denoted as Θ and scale difference was indicated as. These results of feature map when given through orientation channels resulted in,
M y (p) = Gabor (θy, p) ...(34)
Were,
θy = Symbolizes image’s different spatial angles.
From this computation, a low level of center features was attained.
Pyramid of histogram of oriented gradients (PHOG) features (Γ4)
PHOG features describe an image by its local shape along with spatial layout,were spatial descriptors. These features enclosed HOG over every single sub-region of image at every resolution stage. Histogram of Oriented Gradients (HOG) was computed from an image for varying bin count (Bc). PHOG features attained for an image is a weighted combination of above HOG features (HB), which is expressed as,
Γ4 = Bc ∈ HB ...(35)
W-GFPO YOLOv3 segmentation
By utilizing W-GFPO YoloV3 model, segmentation of multi-diseased areas in leaves was done by taking input image Eoe. The conventional YoloV3 model was selected since it has an efficient selection of multi-disease in a single subject. Utilizing leaky Relu or Relu as activation function failed in training when a non-linear input pixel neighborhood occurs. Thus, to surpass this issue, Learnable Leaky ReLU is activated, which has advantage of learning deeply with features and obtaining outcome. Fig 3 elucidates overall framework of W-GFPO Yolo V3.
Yolov3 framework utilized DarkNet-53 as the basic network. Model contains 106-layer network and significant,familiar structure is made by deeper network level.A hop layer connection along with a residual module with multi-dimensional detection and upsampling feature fusion technique is enclosed in framework.
Weibull distributed- golden flower pollination optimization algorithm (W-GFPO)
The target score of each bounding box on different scales is predicted by Yolo-V3 and values are chosen using W-GPFO. Conventional Golden Flower Pollination Optimization (GFPO) algorithm was selected. Although it has advantage of finding infected area of disease with less convergence, still it has a maximum value constraint on updating stage. To overcome issue,it was selected using weigh bull distribution strategy.W-GPFO creates population and solution space. For searching purpose,Weibull distribution has been adopted and given as follows,
The value w signifies scale parameter, j epitomizes shape parameter and fitness function of maximum threshold is exemplified as fi.After that, this fitness function was selected grounded on obtained features that are less than threshold and is given as,
fi = Max(Γ) ...(37)
At this evaluation stage, a heavy-tailed probability distribution algorithm has been utilized that undergoes global explorative process and random selection was done with Weibull distribution given as:
fit+1 = fit + stp*Q(fi)*(fit - g*) ...(38)
Where,
fi t+1 = Specifies solution vector at t+1 iteration.
Likewise; Fit is solution vector at t iteration.
Q(fi) = Indicates the Weibull distribution.
g* = Symbolizes global solution.
stp.= Srep size.
Utilizing the switching probability, global and local search processes were controlled. This probability permits pollens to investigate the global as well as local pollination functions.Golden selection was done to divide search space into line segments as follows:
v indicates inverse golden ratio and golden ratio(∃) was a constant value. After,separate search equations were obtained as:
fi1 = j + 0.618(w - j) ...(40)
fi2 = j + 0.618(w - j) ...(41)
In 40 and 41 equations, fi1 and fi2 are two solution vectors. These new intervals were applied for subsequent iteration. Step size is computed by disparity between individuals in current population and given as:
fi0 = low + (up - low)* rand(R) ...(42)
Here, solution vector attained via intensification process is represented as fi0. Initial solution obtained was dispersed uniformly over the search area utilizing following equation:
fit+1 = fit + stp*tanθ* (fit - g*) ...(43)
From optimized solution [Q(x)], only one box gets selected for identifying infected area. Further, YoloV3 model processes the image as follows,
Step 1: Let pre-processed image pixel K(p,q) be divided into U*U grids. The position information of (Bb) boundary boxes and their corresponding objectness score is computed by grid and is represented as,

signifies objectness score of T
th grid, P
l,m(Object) denotes object function of mth bounding box in
ith grid and IOU
Truth Pred signifies intersection over union between predicted box and ground truth box. Correspondingly, P
l, m (Object) =1 illustrates presence of object in grid and otherwise 0. Intersection Over Union (IOU) is formulated as,
A1 and A2 denote area of box1 and box2, correspondingly.
Step 2: The binary cross entropy (EBC) is determined for predicted objectness score and ground truth objectness score. It is expressed as,
U2 = Image’s number of grids.
G signifies number of bounding boxes and.
is entropy loss function.
Moreover,

and

represent predicted objectness score and truth objectness score, correspondingly.
Step 3: Selecting multiple targets at same location and thereby best bounding boxes using (Q(x)) is selected.Then, K(C
i,C
j) is modeled as,
K(Ci, Cj) = tanh (βTi Cj + Z) ...(47)
β and Z = Kernel parameter.
Therefore, the objects detected in image are signified as K(p,q)
Where T=1,2,3,..,L which signifies number of objects detected. These segmented images were labeled (Li) grounded on their features. The Learning Leaky Relu function wielded as activation is given as,
l symbolizes the input’s control learning point and f(l) is activation function.The term exp symbolizes exponential function.
Pseudocode 1 for W-GPFO
Input: Input image and features
Output: Labeled bounding box of infected area
Begin
Initialize GF population,
low, up, rand (R) maximum
iteration
tmax
Set Iteration
t = 1
while (
t ≤
tmax) do
calculate fitness
fi
obtain best global solution (
g*)
if (
rand < Γ){
Distribute flowers with Weibull distribution
(Q(x))
Apply tangent flight algorithm
}else {
Perform Uniform distribution
Apply

}
end If
Evaluate new flower fitness
if (fi
t+1 > fi
t) {
Update position by fi
t + stp * tan θ * (fi
t -g*)
}else {
Discard flower
}
end If
Update current best solution
end While
t = t+1
Return optimal solution
End
Clustering using J-Fcm
Labeled data obtained (Li ) was further given for clustering with similar diseases utilizing J-FCM. Since conventional Fuzzy C-Means Clustering (FCM) has low constraint properties, it has been selected here. The J-FCM working process is described further,
• (L
i ) are given as input and number of cluster centroids
(z
k) is selected randomly. It is expressed as,
Zk = Z1, Z2, ......., Zy ...(49)
• Jaccard distance between initial pixels T and cluster centroids (zk) is computed using equation (49),
G signifies the cluster and.
• J-FCM’s objective function is computed as,
Where,
specifies real number greater than 1 that controls degree of fuzziness, mjk displays membership function. Further, it was modified as,
||m jk (It) - m jk (It + 1)|| ≤ ε ...(52)
is a constant in range of 0 to 1, indicates number of iterations. Thus, finally obtained clusters are given as,
H = {h0, h1, h2, h3, h4} ...(53)
signifies total clusters, is healthy leaf cluster, coffee leaf miner, phoma tarda, coffee leaf rust and Iron spot are signified as and , correspondingly.
Pseudocode 2 for G-YOLOv3
Input: Labelled image (Li)
Output: clusters H
Begin
Initialize pixels T, It
For each labeled feature do
Determine (zk)
Perform
with Jaccard distance
Update G until all pixels are grouped
Compute
end For
Return clusters H
End
Experiments
Datasets and details
The coffee leaf dataset consists of 1747 images, including healthy and damaged leaves that have undergone one or more biotic stressors. The dataset comprises following stresses: Cercospora leaf spot, brown leaf spot, rust and leaf miner. The photos were labeled based on main biotic stress experienced by each leaf and its severity. Out of these, 372 photos showed leaves subjected to various pressures; among them, 62 leaves experienced stresses that were alike in magnitude, complicating visual determination of dominant stress. This dataset did not incorporate 62 photos as a result. Fig 4. depicts sample image results after proposed preprocessing and segmentation. The proposed WJMPCL framework was developed with the help of Python and tested with 1747 images of coffee leaves. Dataset was split into training, validation and test sets with a ratio which amounts to 1229 images for training, 271 for validation and 247 for testing. All input images were resized to 416 × 416 pixels and contrast enhanced using Gaussian-Contrast Limited Adaptive Histogram Equalization (G-CLAHE) and edge enhanced using Pansharpening Rational Unsharp Mask Filter (PRUF) before training. To enhance generalization capability of the model, training images were used for data augmentation methods, such as horizontal flipping, vertical flipping, rotation, scaling and brightness variation. The proposed segmentation model used a combination of YOLOv3, DarkNet-53 as the backbone network structure and Learnable Leaky ReLU as activation function. The model was trained for 100 epochs with a learning rate of 0.001 and optimizer Adam and batch size of 16. The W-GFPO algorithm was combined with YOLOv3 and the optimization process was evaluated for 10 to 50 iterations, of which 50 iterations gave best results. The experiments were performed in Google Colaboratory with an NVIDIA Tesla T4 GPU having 16GB of memory. The implementation was implemented in python 3.10, PyTorch 2.0, torchvision 0.15, OpenCV 4.8, NumPy 1.24 and scikit-learn 1.3. The optimized outputs from segmentation stage were then labeled and passed onto J-FCM clustering stage for multi-disease prediction. The pre-processing, training and evaluation conditions were used with comparative models to give a fair experimental comparison.