Pesticides have become more necessary in modern agricultural production. However, these pesticides have an unforeseeable long-term impact on people's wellbeing as well as the ecosystem. Due to a shortage of basic pesticide exposure awareness, farmers typically utilize pesticides extremely close to harvesting. Pesticide residues within foods, particularly fruits as well as veggies, are a significant issue among farmers, merchants, and particularly consumers. The residual concentrations were far lower than these maximal allowable limits, with only a few surpassing the restrictions for such pesticides in food. There is an obligation to provide a warning about this amount of pesticide use in farming. Previous technologies failed to forecast the large number of pesticides that were dangerous to people, necessitating the development of improved detection and early warning systems. A novel methodology for verifying the status and evaluating the level of pesticides in regularly consumed veggies as well as fruits has been identified, named as the Hybrid Chronic Multi-Residual Framework (HCMF), in which the harmful level of used pesticide residues has been predicted for contamination in agro products using Q-Learning based Recurrent Neural Network and the predicted contamination levels have been analyzed using Complex Event Processing (CEP) by processing given spatial and sequential data. The analysis results are used to minimize and effectively use pesticides in the agricultural field and also ensure the safety of farmers and consumers. Overall, the technique is carried out in a Python environment, with the results showing that the proposed model has a 98.57% accuracy and a training loss of 0.30.
In agricultural production, pesticides are frequently utilized as they aid in the prevention of insects and illnesses, as well as the increase of harvests in agriculture. Pesticides in this category are indeed a mixture of elements, including chemical or biological factors, which are meant to resist, kill, or manage any pest, or even modulate plant development. Due to their capacity to permeate vegetable tissues, widespread use of these pesticides has the potential to cause considerable long-term environmental change and damage. As a result of the negative consequences caused by pesticide residue, there is now a global concern about pesticide usage in farming [
Mass spectrometry (MS) was probably one of the most frequently used confirmation methods to predict pesticide residue levels during the risk assessment stage [
Complex Event Processing (CEP) is a new technique that examines, filters, and combines conceptually low-level events to identify complex occurrences [
The major contributions of the proposed design are as follows: To minimize and effectively use pesticides in the agricultural field and also ensure the safety of farmers and consumers, By evaluating the use of pesticides, intensity, and types of pesticides with their percentage level, an objective function will be created to ensure the maximum threshold level. Setting up event generation in CEP to produce the best results in real-time pesticide level measurements.
By considering the above-stated objectives as major ones, a proposed model will be designed and its results will be examined.
The remainder of this paper has been formatted as follows: Section 2 offers a summary of the literature review section, while Section 3 describes the proposed approach. Section 4 details the experimental findings, while Section 5 concludes the research as a whole.
Many techniques have been proposed previously to find pesticide contamination in soil. Some of them are reviewed with their drawbacks below.
EL-Saeid et al. [
Malaj et al. [
DiGiacopo et al. [
Tang et al. [
Thus, by reviewing the methods discussed above it has been clear that there are some drawbacks such as lengthy measurement and frequent monitoring. Real-world applications mostly require a large quantity of information for processing. Thus to overcome this drawback a pesticide contamination prediction technique is required with the most probable results that have concern on consumer health.
The rapid increase of vegetable yield while minimizing consumption, notably pesticide misuse. Pesticides are seen as a crucial aspect of modern farming, serving an important role in sustaining high crop yields. Pesticide residues in agricultural goods, both primary and secondary, represent significant health concerns to consumers. Pesticides produce long-term adverse impacts on both the environment as well as people’s health. Pesticide residues were ubiquitous in all plant production, however, exposure to residues in major agricultural products such as veggies and fruits causes the greatest health hazard. As a result, the growing of vegetables and fruits demands the invention of a model that measures and determines the levels of pesticide be applied to decrease human health hazards. Thus, in this article, an HCMF based on Q-learning with RNN is provided. The HCMF model analyses the pesticide based on the proportion of contamination that has been analyzed to assure the diagnosis of its range in soil, vegetables, and fruits. A Q-learning-based RNN was utilized in this research to predict pesticide levels in soil, vegetables, and fruits by assessing their maximum and lowest residual limit of pesticides. To anticipate this pesticide residue contamination level, complex Event Processing has been used and is being done for decision-making reasons to reduce and effectively utilize the pesticide in the Agri- Products.
The HCMF model analyses the pesticide based on its contamination level, which is then analysed to validate the identification of its range in soil, vegetables, and fruits, as illustrated in
Prediction of residue level is required to determine the count of pesticides contained in agricultural goods based on MRL. MRLs can be discovered in the online Codex pesticides in the agriculture database. The pesticide database may be searched by common name or class, as well as commodity name or code. To establish a long-term forecast of HCMF, data between 0.2 and 0.8 were standardized. Utilizing the
Consequently,
Complex Event Processing (CEP) was used to obtain these contamination values since it computes contamination levels using RNN with Q-Learning and makes judgments by producing events based on the MRL permissible limit. To identify the presence of pesticides in agricultural goods, HCMF employs a CEP filtering process that was anticipated using criteria such as high temperature, less humidity, moisture, and excessive phosphorus level, as well as a lower nitrogen level, all of which create residue levels. The existence of abnormality has provided input on whether the supplied Agri product is fertile or non-fertile, which characterizes the harmfulness of the MRL level. The information on pesticide levels has become more complicated due to the chemical patterns of presenting pesticides in Agri goods that must be augmented with historical pesticide levels, and this data most likely requires retrieval from each class label such as fertile or not. As a result, each incoming data point is compared to the stored fertilizer value, and HCMF creates a metric to make a choice. The forecast was made by filtering the data that was expected to be polluted by the herbicide.
To determine the MRL limit, normalization was conducted, and the final values were checked for contamination by comparing them to normal values. These prediction findings will be useful in the following stage, which will analyse its specificity. The next section explains the measurement of contamination levels in agricultural goods were determined using RNN-Q learning.
The Q-Learning method is intuitively composed of learning a Q-table that represents the predicted future reward for each condition and action and the Q-table, which includes the Q-values of each state-action combination that has been iterated using the Q-value iteration. The Q-learning approach works effectively for finite states and actions spaces since storing every state-action combination would need a large amount of memory and many iterations for the Q-table to converge. It is simply impossible to utilize the Q-learning method when states space, actions space, or both are continuous. As a solution, we may calculate the Q-value function using Recurrent Neural Networks, which are well-known for their ability to estimate functions.
Consider the Q-table to be an assessment of an unknown function at certain places. Because it is a function, we can use Recurrent Neural Networks to estimate it, allowing us to work with uninterrupted spaces without difficulty.
When dealing with a complicated environment with several options and outcomes, the standard Q-learning process soon becomes inefficient. So, in this effort, we concluded combining the Deep Learning idea with Q learning and developing the Q Learning-based RNN. The
Stages for the Agent to learn the Q-table
1. To begin, a Q-table is arbitrarily initialized. The column counts reflect the number of activities whereas the count of rows denotes the state numbers that may be taken.
2. Then, as long as the episode isn’t finished:
2.1. In states, the agent chooses the action that maximizes the predicted rewards according to the Q-table.
2.2. In rare instances, the Agent is offered the choice of performing a random action. This is known as the epsilon greedy strategy. It enables the Agent to explore his environment when the epsilon rate falls. During the exploration phase, the agent gradually gains confidence in estimating the Q- values. Using the Bellman equation, the estimated new Q-values for being at the start and traveling right.
2.3. The Agent monitors the result state’s and the reward r, as well as modify the function Q (st, at) as regards:
where,
The RNN is fed a state as well as returns the Q-values among all possible actions for such a state. We understand that the RNN’s input layer is the same size as a state and that the output layer is the same size as the number of actions that the agent may do.
To summarize, when the agent reaches a specific state, he sends it through the RNN and selects the action with the greatest Q-value.
RNN-based Q-Learning presents two new techniques that allow for improved performance.
1 Memory Replay: The neural network is not instantaneously updated after each step. Rather, it records each encounter in a memory. The modifications are then performed towards a mini-batch comprising tuples drawn at arbitrary as from replayed memory. Employing this way, the algorithm can recall as well as maintain track of his previous encounters.
2 Target Network Separation: Using the same network to compute both the anticipated and goal values can cause significant instabilities. To address this issue, it is frequently appropriate to train two distinct networks with the same architecture: a prediction network and a target network. The prediction network operates as an “active” network, whereas the target network is a duplicate of the prediction network with frozen parameters that are updated regularly.
To estimate the objective, we may utilize a different network. The design of this target network is the same as that of the function approximator, but the parameters are fixed. After every cycle, all parameters from the predictive network were passed to the targeted system. These findings are in more steady training since the goal function remains constant.
Steps Involved in RNN based Q Learning Network and illustrated in
1. Preprocess the states in the Q-Table then feed them into our proposed Q Learning-based RNN, which can return exact Q-values for all possible activities throughout the state.
2. Damaged leaf images have been chosen randomly.
3. Depending on the epsilon-greedy strategy, select action. We randomly pick the action with epsilon probability as well as a maximal Q-value action having 1-epsilon probability.
4. To obtain a reward, do the action in state s and then go to the next states. This stage contains a preprocessed image of the subsequent action stage. This transition has been stored in our replay buffer.
5. Following that, choose several random batches of transitions from the replay buffer and compute the loss.
6.
7. To reduce this loss, use gradient descent concerning our real network parameters.
8. After each cycle, transform our actual network weights into target network weights.
9. Repeat these instructions for the desired number of episodes and a total reward has been obtained.
10. A new layer has been added that outputs the new Q value.
11. Finally, the Agent provides the contamination levels of the Agri products.
To measure the contamination levels of the pesticide Agri products, RNN based on Q learning has been utilized. The level of contamination has been evaluated using many types of spectrometers in existing works. However, a limited number of pesticides has been evaluated. To evaluate the number of pesticides that are present in Agri products, Q-based RNN has been utilized in which the states such as total Reward has been found. By optimally applying the Q learning with supervised learning that optimizes parameter
Complex event processing (CEP) is indeed an adaptive data processing methodology that originated there in the database area. Any modification in a single data condition is viewed as just an event, as well as the emergence of challenging situations can be seen as the incidence of complex events. This detects complex events through matching the occurrence of such a significant number of events utilizing specific complex event patterns including logical calculations that trigger subsequent actions. CEP technique can completely utilize data from numerous sources to conclude a specific situation. It has excellent asynchronous decoupling and scenario analysis capabilities and is a critical method of real-time processing and automation. This research employed CEP for smart pesticide control there in the agro product ecosystem that created an intelligent pesticide control scheme. This work focuses on the intelligent regulation of pesticide contamination levels in agricultural goods, examines the information generating function and transmission features, and summarises the primary information in a pesticide-free environment.
We propose a novel framework for complex event processing systems that would be appropriate in terms of pesticide contamination levels by examining the similarities and differences of different agricultural challenges. It is critical to encourage the widespread adoption of CEP technology in agriculture and also we developed an automata event accumulation approach, which now allows CEP technology to work more adaptively in complex pesticide control schemes. To determine whether or not high-level complex events occurred, it is essential to examine the logical relationship in time as well as space between low-level basic incidents. This sophisticated event flow is instead generated by calculating the relevant information from high-level events. This process of basic event flow evolving into sophisticated event flow is referred to as event aggregation. This logic which has been formed between events is referred to as event mode. This event processing agent is indeed the unit that performs event pattern matching as well as event creation. Complex events are eventually formed by layer-by-layer aggregation. These occurrences can cause control orders to be issued, additional useful judgment information to be obtained, and the reasoning process to be completed.
The purpose was to evaluate the level of pesticide to be applied in farming on vegetables, fruits, and soil, and the pesticide residues were presented in the output of RNN based on the matching results. By achieving these data, the level is assessed by creating an event comparable to that of CEP, relating to the similarity of two sequences of events. This refers to the measured episodic similarity value, where one is the outcome of matching and the other is the pesticide threshold level. Measurement of this similarity can be given as,
where
This part depicts the simulation result of the proposed framework, which offers a clear concept to test the model’s correctness. This work was completed using the PYTHON working platform with the following system specifications: Windows 8 OS, Intel Core i5 CPU, and 8GB RAM. The proposed HCMF uses three datasets, which are pre-processed and labeled before being sent to CEP for prediction, pattern matching, and decision making based on event production.
CEP obtained the assistance of RNN for pattern matching and discovering similarity scores at this step, and these events are created to decide on the degree of pesticide to be employed in farming. The implementation was carried out in the Python environment, and the performance was evaluated. When examining soil, veggies, including fruits, warmth, moisture, precipitation, kind of soil, category of the crop, phosphorus, nitrogen, potassium as well as nitrate were all taken into account. Those parameters were examined as well as compared to prior techniques including AlexNet [
This research took three datasets into account. Each dataset was examined for pesticide contamination levels and the potential harm they may cause to vegetables and fruits. The descriptions of the datasets are provided below.
We are delighted to notify you that around 50,000 expertly curated photographs of healthy as well as sick agro-based plant leaves have become available via the present Kaggle site Plant Village. It was described in the data as well as the platform. It includes apple, blueberry, cherry, maize, peach, orange, potato, and raspberry leaf pictures. After that, the dataset was transformed into a greyscale picture and segmented for further processing.
The second dataset is about soil pollution and the values that come from it. This dataset contains an item for drought level, which was monitored for 90 days using 18 indicators at a specified point in time. Latitude, longitude, median elevation, and slopes are all tabulated values.
The third collection is CSV data for fertilizer prediction. This dataset tracked warmth, moisture, humidity, kind of soil, category of the crop, potassium, phosphorus, and nitrogen as well as nitrate levels. In the suggested model, all three datasets were examined for further processing.
To merge the three datasets, we must first transform the picture dataset to a CSV file by using label binarzior. Now, all the 3 datasets are in the form of CSV file. Then, from the above 3 datasets Nitrogen, Phosphorous, and Potassium values were alone extracted to determine the contamination level in Agri items.
HCMF model has been executed and evaluated for the resultant output. Results are then plotted in the graph for persuasion. Measurement results of humidity, temperature, moisture, nitrogen, phosphorous, potassium, and nitrogen have been given in this section. A contamination level of vegetables, fruits, and soil has been given. Overall performance has been measured and presented to show the efficiency of HCMF.
By analysing the given dataset for a humidity level of prediction the obtained values are plotted as shown in
The resulting values are displayed in
From
The resultant values are presented in
Measurement of contamination level was done through chemical molecular structure pattern matching via rule policy that was implemented as a CEP framework. Contamination levels are measured for fruits such as apple, strawberry, kiwi, papaya, banana, tomato, spinach, potato, onion, carrot, capsicum, brinjal, radish, and sweet potato as shown in
RNN spontaneously learns given data samples, which would be an inherent feature. It’s indeed simple to train individual versions of the algorithm that function well on a specific sort of data. After each action is observed, algorithms that execute sophisticated event recognition should be able to provide incremental forecasts, thereby providing early predictions. Memory episodes are specific examples of more generic complicated occurrences in the world, and they can give important data for mining algorithms that abstract away different event kinds or linkages to construct complex event patterns that were shown in
This ROC curve is indeed a depiction of the rate of false-positive (x-axis) vs the rate of true positive (y-axis) for different available threshold values ranging from 0.0 to 1.0. A true positive rate is typically obtained by dividing the count of true positives by its total of true positives but also false negatives. This reflects how well the model predicts the positive class only when results are good. ROC curve was then shown in
Performance matrices that are considered for comparative analysis are defined below
The graph, as shown in
The processing time is the time it takes for the entire model to be performed and the outcome to be produced. According to the graph in
Overall, the examination of the results demonstrates that, when compared to other methodologies, the proposed hybrid chronical architecture is unquestionably the best, with excellent accuracy and little training loss. Following successful investigations into predicting the percentages of affected residue due to fertilizer using chemical structure-based machine learning models and neural networks, it can be concluded that the hybrid chronical model is the most accurate and sensitive model among pesticide contamination models.
An HCMF based on CEP and Q learning is proposed in this research to estimate the contamination level of pesticide residue and then continue to decide on its level of harmfulness. A dataset comprising 50,000 carefully selected photos of healthy and sick leaves of agricultural plants, obtained from the current web platform Plant Village, soil contamination and its resulting values in another dataset, and fertilizer prediction CSV data in a third dataset. These datasets have been preprocessed with label binary. Within the CEP framework, a labelled dataset is predicted for the presence of pesticide, matching is done using RNN and its Q learning, and a decision for the amount of contamination is made based on events created. The proposed framework achieves 98.7 percent accuracy with a training loss of 30%, according to the results. To fully understand pesticide utilization or even management throughout the future, more research will be conducted on both occupational and ecologic exposures, as well as the associated health hazard evaluation of pesticides. Furthermore, future research might include integrating the IoT with the CEP framework to monitor pesticides and make further decisions.
The authors wish to thank the Department of Computer Science and Engineering, KPR Institute of Engineering and Technology, to provide the computing facilities for project execution.