Journal Paper New
Journal Paper New
Department of Information Technology, Sri Lanka Institute of Information Technology, Malabe, Sri Lanka.
The field of mushroom cultivation is on the rise within Sri Lanka’s agricultural sector. This trend is gaining traction among
farmers, entrepreneurs, and consumers due to its cost-effectiveness, substantial yields, and growing demand both locally and
globally. Despite its potential, mushroom farming remains a relatively fresh concept in Sri Lanka, leaving many cultivators
unfamiliar with the necessary techniques. Button mushrooms, a widely consumed variety globally, are a prime example. These
mushrooms hold significant value as a crop, suitable for year-round cultivation under controlled conditions. Their short
production cycle enables farmers to yield multiple crops annually, ensuring a consistent income stream. This aspect elevates their
importance as a livelihood source for countless farmers and business owners across the world. While cultivating button
mushrooms presents numerous benefits, specific obstacles still impede farmers from achieving optimal harvests. Conventional
manual techniques often lead to deficiencies and imperfections in mushroom farming. In response, this paper proposes an ICT
solution to address these inefficiencies in the cultivation process. To tackle issues such as insect infestations and diseases,
advanced models like MobileNetV2 and DenseNet121 have demonstrated remarkable accuracies of 88% and 90%, respectively,
in identification. Furthermore, the implementation of the MobileNetV2 architecture attains an 85% accuracy in categorizing
mushroom quality attributes. Predicting harvest timing, a critical factor, employs the YOLOv8l instance segmentation model,
offering a substantial 0.657 [email protected] value. These cutting-edge techniques not only provide growers with crucial insights but
also empower them to take timely actions to enhance their cultivation practices.
Keywords— Button Mushrooms, Image Processing, diseases, Mushroom quality, insects, harvest time
Mushroom cultivation holds a prominent position in the significant risks arise from insect infestations and the spread of
agricultural landscape of Sri Lanka, with particular emphasis on the diseases within the crop.
cultivation of button mushrooms (Agaricus bisporus). This species
flourishes in the tropical and subtropical regions of the country, Identifying insect infestation in button mushrooms is crucial for
showcasing a rich diversity of fungal species (Mba. et al., 2020). several reasons. Firstly, it is essential for quality control since infested
The cultivation of button mushrooms, however, poses inherent mushrooms can be discolored, deformed, and emit unpleasant odors,
challenges, necessitating vigilant monitoring of critical parameters making them unsuitable for consumption or sale. Secondly, some
such as temperature, humidity, ventilation, and other environmental insects that infest button mushrooms can carry harmful bacteria such as
factors. Ensuring optimal growth conditions, employing effective Escherichia coli and Salmonella, which can cause food poisoning and
composting techniques, implementing meticulous harvesting pose health risks to consumers. Thirdly, insect infestation can have a
practices, and exhibiting expertise in post-harvest handling significant economic impact on mushroom farmers, resulting in crop
collectively contribute to enhancing the overall quality and flavor failures, reduced yields, and financial losses. Therefore, managing and
profile of button mushrooms. identifying insect infestation in button mushrooms is crucial to ensure
In Sri Lanka, button mushroom growing has grown in popularity their quality, safety, and economic viability in the market.
recently. They are also referred to as white mushrooms or white When considering insects, there are several insects that can harm
button mushrooms. They can be found in a wide range of foods and mushrooms, including flies and beetles. Beetles, including the lycid
cooking processes, such as pizza, pasta, pies, and omelets. White beetle, can also be a problem for mushrooms. Flies (Rinker D.L.,
mushrooms are high in nutrients, such as protein, Vitamin C, and D, 2017) such as the Bradysia, Cecid Fly, Phorid Fly, and Sciarid Fly can
yet low in calories (Mba. et al., 2020). White mushrooms are highly lay their eggs on compost, and their larvae can feed on the nutrients in
nutritious and also have a number of therapeutic applications. Some the compost, causing further damage. Farmers are often unable to detect
of the health benefits include lowering the risk of cancer, these infestations in their early stages. If this spreads, they will have to
controlling blood sugar, and boosting immunity (Desai R.V., replace the entire bag of compost mixture. As a result of the insect
2023). infestation in their compost mixtures, farmers may suffer significant
Button mushroom cultivation encompasses multiple stages losses in their mushroom cultivation.
(Vikaspedia., 2022), including substrate preparation, spawning, Button mushroom is among the greatest consumable cultivated
casing, and fruiting. The initial step entails the meticulous mushrooms in Sri Lanka due to their medicinal and nutritional
preparation of the substrate, typically composed of composted horse properties. One specific kind of fungal plant that is deficient in
manure, straw, and other organic matter. This substrate undergoes chlorophyll is the button mushroom (Ojha S. et al, 2 0 1 7 ). As
sterilization to eradicate any potentially harmful bacteria or fungi mushrooms are grown, a variety of dangerous fungi are discovered in
and is subsequently conditioned to reach the appropriate the casing soil and compost. The fruit body is hindered during
temperature. Once the substrate has cooled, it undergoes inoculation different phases of crop growth, resulting in specific disease
with mushroom spawn, a specialized mycelium cultivated on a symptoms (Ojha S. et al, 2 0 1 7 ). Currently, farmers in Sri Lanka
nutrient-rich medium. Following the spawning process, the casing detect mushroom diseases with their naked eye. However, this
layer is applied atop the compost layer, serving to facilitate the method may not be accurate or effective, especially if they are not
growth of mushroom fruiting bodies. The final stage entails familiar with disease types and their symptoms. As most of the
cultivation within a controlled environment to optimize growth farmers have very limited knowledge on the diseasetypes and their
conditions. Given the fungal nature of button mushrooms, the most symptoms and they are also not aware of control measures to prevent
the nearby crops from the diseases. This is because they consult based on diseases and symptoms once the data has been collected,
experts at that time, and it would be costly and time-consuming as the and they will be maintained in the knowledge base and accessed using
experts take time in classifying the diseases and identifying the the forward chaining approach. The system will then fetch the
symptoms. And most farms would not be able to afford to consult relevant rules and provide the proposed remedy when the farm owner
experts regularly. However, implementing this approach would be inputs the symptom. The user should input the answer to questions
time-consuming, require specialized knowledge of mushroom based on the symptoms and conditions of mushrooms for the system to
diseases, and involve an extensive workload, thereby potentially detect the associated diseases and suggest control measures. This
facilitating the rapid spread of diseases. Therefore, it is essential to system is being developed using methods including rule-based
identify the types of diseases to prevent their occurrence and algorithms and forward-chaining inference engines. The user may
minimize their impact on the crop. identify mushroom diseases using the online system with the assistance
The quality and taste of button mushrooms depend on appropriate of the findings processed by this system, which also offers helpful
composting, proper growing, careful harvesting, and professional suggestions.
post-harvest practices. Natural Harvest Mushroom (NH) mushrooms Using a support vector machine model, A. Masoudian and K.
are well known for their superior quality and flavor in the Sri Lankan A. Mcisaac (Masoudian et al, 2013) describes a system that identifies
market. The market values white button mushrooms (Agaricus bis- the microbial decay of mushrooms. According to the study,
porus) for their white appearance and glossy surface (Masoud et al, mushrooms will be classified as fresh or harmful to guarantee the
2012).Browning of the cap or discoloration shriveled or distorted quality of crops. This uses image processing and a support vector
caps, and open gills are some of the indicators of poor-quality white machine model for classification. The classification is done by
button mushrooms. This will lead to a reduction in the shelf life of capturing images, and techniques such as image preprocessing, image
the button mushroom and lower financial returns for the button enhancement, and SIFT feature extraction methods are used. This
mushroom farmers. The quality of the mushroom can be identified study has used images of both fresh and diseased mushrooms as the
using different factors. Size, Color, Shape, and gills are some of the dataset. To assess the effectiveness of the SVMs, the dataset makes use
main characteristics that can be checked when identifying the quality of several kernel functions.
of the mushroom. The surface of fresh button mushrooms should be Da-Wen Sun and Xiaohui Lin (Sun et al, 2019) thoroughly explore
smooth and spotless. If the mushroom is discolored, has abnormal the complex domain of mushroom browning in a comprehensive
shapes, or has black gills, it is of low quality. Overall, the quality of manner. The study not only explores a multitude of methodologies for
button mushrooms may significantly affect their flavor and texture, appraising the coloration of mushroom surfaces but also delves into the
so it’s critical to choose mushrooms that are vibrantly colored, fresh, pivotal determinants behind the browning process. These encompass
and flavorful. factors such as microbial infections, postharvest conditions, and the
For a batch of button mushrooms, there are three flushes. The first catalytic role of mushroom tyrosinase. Moreover, the research
flush has a higher yield than the other two because it absorbs the rigorously examines and contrasts diverse strategies aimed at curbing
majority of the nutrients from the soil and casing. Three weeks after browning occurrences, encompassing Modified Atmosphere Packaging
casing, the first crop appears. Every flush will be spaced out by 7 to (MAP), inhibitors of polyphenol oxidase (PPO), edible coatings,
14 days. The harvest is carried out during the button stage, with caps irradiation, freezing, and innovative cutting-edge techniques. Notably,
measuring 2.5 to 4 cm, according to the Vikaspedia (Vikaspedia., the empirical investigations were conducted on post-harvest white
2022) in India. In Sri Lanka, the harvesting is done by the most button mushrooms, providing valuable insights into the intricate
experienced workers. Based on the size, shape, color, and texture of dynamics of browning phenomena and its potential management
the cap, they are selecting mushrooms with their naked eyes. The strategies.
mushrooms may be small and immature if the workers are M. Nadim et al. (Nadim et al., 2019) have conducted a thorough
inexperienced in mushroom picking, and they may even be already investigation into the various image processing techniques utilized to
decomposing if they are harvested too late. Additionally, training carefully evaluate the quality of mushrooms. The research underscores
new employees is difficult. Therefore, it is essential to harvest at the the application of advanced image processing techniques to gauge the
proper time to increase productivity, quality, and profitability in the visual attributes of mushrooms, thereby elucidating their quality. This
mushroom farming industry. endeavor encompasses a comprehensive analysis of parameters like
color, area, density, and capacity, which were meticulously extracted
MATERIALS AND METHODS through data mining techniques. Leveraging the power of artificial
neural networks and fuzzy logic systems, the study employs a three-
A. Sanchez-Ortiz et al. (Sanchez-Ortiz et al., 2017) proposes a tier classification framework—comprising flawed, moderately
novel method for the larva image classification of Aedes mosquitos satisfactory, and pristine conditions—to meticulously analyze 250
based on convolutionalneural networks (CNN). The proposed scheme photographic instances. Remarkably, the image processing framework
provides a high identification rate of the Aedes larvae, giving a attains an impressive 95.6% accuracy in its adeptness at precisely
false negative error rate is 0% and a true negative rate is 70%. This discerning objects and their quality attributes.
makes the system suitable for quickly detecting them in the field, The growth phase of apricot mushrooms was captured using the
which in turn canlead to effective mosquito control measures. YOLOv4 model by B.R. Huang et al. (Huang et al., 2021), and they
The research paper, conducted by R. Rijal, P. Maity, and A. created an intelligent system that relies on image recognition that has
Kumar (Rijal et al., 2021) discusses the topic of pest control within beencreated and put to the test. The growth status of the mushroom has
mushroom farming. According to their findings, the main challenges been categorized using labeling classification as good, none, little,
in mushroom pest management are a lack of scientific research, the or red. The distance between the lens and the mushrooms was also
use of less innovative technologies, a lack of effective formulations, measured using an image distance identification approach.
and a lack of thorough analysis of mushroom ecosystems. Integrated A harvesting robot with a flexible joint was designed in a study
Pest Management (IPM), which includes biological, cultural, from China, and static analysis was suggested to measure the end-
physical, mechanical, and chemical methods, is the most effective and contact effector’s force during the plucking of button mushrooms.
efficient pest management tool. IPM helps ecosystem mushroom With the harvest robot, they have an 88.2% success rate and a 2.9%
growers manage mushroom pests by providing natural and injury rate according to (Yang et al., 2022).
environmentally friendly tools, allowing them to produce healthy and For oyster mushroom farms in Sri Lanka, an IOT-based monitoring
nutritious mushrooms. This study provides background information system has been created to identify harvest time by Y. Surige et al.
on pestmanagement in mushrooms. (Surige et al., 2021). They have captured oyster mushrooms in their
An intelligent system for identifying diseases of oyster five life stages and utilized CNN models to predict when they would
mushrooms is developed by M. Y. Munirah, M. Rozlini, and Y. S. be harvested. And they had over-fitting accuracy of 92% and 99%,
Mariam (Munirah e t a l , 2 0 1 3 ). using a set of rules regarding the respectively.
symptoms of the diseases. According to the study, the main sources A 99.24% mean average precision deep learning method called
for the system were obtained from one of the oyster mushroom farms Mushroom-YOLO is suggested for identifying mushroom growth. A
through an interviewing process. A set of rules will be developed prototype system called iMushroom is exhibited in (Wang et al., 2022),
showing how well it can regulate the growth quality of shiitake that needs to be checked for diseases will be captured through the
mushrooms withoutthe need for human involvement. mobile application.
b) Data Preparation - Prior to model training, the collected images
The primary objective of this research is to address the challenges underwent preprocessing steps to enhance the quality and ensure
encountered by button mushroom cultivators resulting from their consistency. These techniques encompassed resizing the images,
current manual farming practices. As a result, a study was conducted normalizing the pixel values, and performing one-hot encoding. As the
with the aim of developing a smart mushroom farming solution produced images exhibited variations in size and color formats, they
specifically for mushroom cultivators in Sri Lanka, effectively underwent a transformation process. This involved resizing all images
resolving the unaddressed issues they face. to a uniform size of 224 × 224 and converting their color format to
RGB. The normalization process involved scaling the pixel values to a
A. Insect Infestation Identification range between 0 and 1 by multiplying them by 255. These steps aimed
to reduce the computational complexity and improve the convergence
There are three primary categories (Paul R., 2019) of larvae
speed of the algorithms. To further augment the dataset and mitigate
that can have an impact on the growth of button mushrooms, as
potential overfitting, data augmentation techniques such as rotation,
illustrated in the accompanying Fig. 1.
flipping, and random cropping were applied to the images. This
helped introduce additional variations and increase the generalization
capability of the model.
c) Training the model - The model was implemented to identify
5 disease types that harm button mushrooms such as bacterial blotch,
green mold, black mold, cobweb and mite attack. Mainly five
disease types are divided based on their color and other features.
Fig. 1. Larvae Types Transfer learning-based CNN architectures were used to train the
models in the Google Colab environment. The architectures were
a) Data Collection - The experiment utilized a data set sourced DenseNet121, InceptionV3, MobileNetV2, ResNet50, VGG16,
from multiple channels, including online websites such as Kaggle, Xception and InceptionResNetV2. To ensure real-time predictions and
and on-site visits to a button mushroom farm situated in Ambewela, precise outcomes, the DenseNet121 architecture was selected due
Sri Lanka. A collection of 510 images was amassed during the data- to its accuracy and performance compared to other architectures.
gathering process and subsequently included in the data set. The DenseNet design encourages feature reuse and promotes efficient
training images constituted around 80% to 90% of the total data set, use of parameters through dense connections (Wang et al, 2021). The
with the remaining 10% to 20% assigned for validation purposes. key benefit of utilizing DenseNet121 lies in its faster execution
b) Data Preparation - To enhance the dataset’s accuracy, compared to a standard convolutional network, making it particularly
several preprocessing techniques were employed. These techniques well-suited for mobile applications. Input images were resized into a
encompass resizing the images, normalizing the pixel values, and uniform resolution. Subsequently, these images were passed through
performing one-hot encoding. The normalization process involved several convolutional layers, pooling layers, and finally a fully
scaling the pixel values to a range between 0 and 1 by multiplying connected layer to generate the classification results.
them by 255. Moreover, data augmentation techniques were
implemented to tackle overfitting and introduce greater diversity to
the data set. These techniques encompassed operations like rotation, C. Mushroom Quality Identification
shear, shift, zoom, flip, and fill, resulting in the generation of a) Data Collection- As per the insights provided by domain experts,
additional sample images. By utilizing these methods, the dataset’s a multitude of factors exert their influence on the quality attributes
precision was improved, facilitating more effective analysis and of white button mushrooms. This meticulous process unveiled four
interpretation. primary factors that emerged as the focal points for classification. A
meticulously curated collection of 1031 images, showcasing affected
c) Training the model- The model was implemented to identify
areas, was amassed from a white button mushroom farm nestled in
three larval types that harm button mushrooms, such as Sciarid fly
Sri Lanka’s expanse. This repository encompasses 251 instances of
larvae, Phorid fly larvae, and Cecid fly larvae. Mainly, these larvae
’Discolored Mushrooms,’ 212 instances of ’Black Gills,’ 210 instances
types are divided based on their color and size. Six architectures of
of ’Texture’ anomalies, 108 instances of ’Abnormal Capsize,’ and 250
transfer learning were used to train the models in the Google
instances of ’Good Mushrooms.’ The training dataset was thoughtfully
Colab environment. The architectures were InceptionV3,
composed, constituting an approximate range of 80% to 90% of the
MobileNetV2, ResNet50, VGG16, Xception, and
total dataset, with the remaining 10% to 20% meticulously earmarked
InceptionResNetV2. To ensure real-time predictions and precise
for validation purposes. It is of paramount importance to note that the
outcomes, the MobileNetV2 architecture was selected due to its
image requisition for assessing white button mushroom quality will be
accuracy and performance compared to other architectures. The key
facilitated through a dedicated mobile application, thus enhancing the
benefit of utilizing MobileNetV2 lies in its faster execution
efficiency and convenience of the quality evaluation process.
compared to a standard convolutional network, making it particularly
well-suited for mobile applications. Input images were resized to a b) Data Preparation- To refine the dataset’s accuracy, we adopted
uniform resolution of 224x224 using 3 channels. Subsequently, these several careful preprocessing techniques. These included adjusting
images were passed through several convolutional layers, pooling image sizes, standardizing pixel values, and using one-hot encoding.
layers, and finally a fully connected layer to generate the To normalize the pixel values, we scaled them between 0 and 1 by
classification results. multiplying by 255. Additionally, we countered the risk of overfitting
and added diversity by applying data augmentation methods. These
methods involved various transformations like rotating, shearing,
B. Disease Detection shifting, zooming, flipping, and filling pixels. This effort resulted
in the creation of extra images, broadening the dataset’s range. These
a) Data Collection - Initially, a comprehensive survey of the farm adjustments significantly improved the dataset’s reliability.
was conducted in collaboration with domain experts to identify the Consequently, our subsequent analyses and interpretations were
key disease types affecting the crops. Through this process, five underpinned by a more robust foundation, affirming the overall
disease types were selected as targets for classification. A total effectiveness of our research.
of 800 images of infected regions were collected from a button
mushroom farm located in sri lanka. The dataset carries 216 images c) Training the model- The main goal of the study was to create
as ‘Black Mould’, 214 images as ‘Green Mould’, 220 images as mite a model that could assess the quality of button mushrooms by
attack’, 102 as ’Bacterial blotch, and 108 as cobweb. The training considering four key factors: discoloration, the presence of black gills,
images constituted around 80% to 90% of the total data set, with the texture, and any irregularities in cap size or shape. To achieve this, the
remaining 10% to 20% assigned for validation purposes. The image research utilized five distinct transfer learning architectures:
InceptionV3, MobileNetV2, ResNet50, Xception, and
InceptionResNetV2. These architectures were implemented and
trained within the Google Colab platform. Among these options, the
MobileNetV2 architecture stood out due to its remarkable accuracy
and superior performance when compared to the other architectures.
As a result, it was chosen as the most suitable architecture for
ensuring real-time predictions and highly accurate outcomes.
Fig. 8. mAP50(B) graph for the Harvest time prediction of the mushroom
Rijal R., Maity P., and Kumar A. (2021), pests of mushroom and their
ecological management strategies: A review. Research Trend.
Surige Y., Perera W., Gunarathna P., Ariyarathna K., Gamage N., and
Nawinna D. (2021). Iot-based monitoring system for oyster
mushroom farming. 3rd International Conference on
Advancements in Computing (ICAC). IEEE, pp. 79–84.
Wang R., Li J., Chencho, An S., Hao H., Liu W., and Li L. (2021).
Densely connected convolutional networks for vibration based
structural damage identification. Engineering Structures, vol. 245,
p. 112871.
Wang Y., Yang L., Chen H., Hussain A., Ma C., and Al-gabri M.
(2022). Mushroom-yolo: A deep learning algorithm for
mushroom growth recognition based on improved yolov5 in
agriculture 4.0. 20th International Conference on Industrial
Informatics (INDIN). IEEE, pp. 239–244.
Yang S., Ji J., Cai H., and Chen H. (2022). Modeling and force
analysis of a harvesting robot for button mushrooms. IEEE
Access, vol. 10, pp. 78 519–78 526.