Algorithm for recognition of images of agricultural crops

. Remote sensing includes all types of non-contact. surveys that are carried out from various measuring platforms. The tasks in this area are the following: inventory of agricultural land, control of the state of crops, forecasting yields. The aim of the work is to classify 6 types of crop images (wheat, rice, sugarcane, corn, cotton and jute) with greater accuracy. The paper considers an algorithm for primary processing and recognition of images of agricultural crops and algorithms for constructing a neural network for initial processing and recognition of images to solve problems of noise elimination, minimization, smoothing, normalization, segmentation and image recognition.


Introduction
An important feature of remote methods is that they are indirect, i.e., they measure not parameters of objects that are of interest to researchers, but some quantities associated with them.To decipher such parameters, preliminary studies are required, including various ground-based measurements, which make it possible to link the heterogeneity of image zones with indicators of the state of vegetation.The satellite has 13 spectral channels that allow you to track the dynamics of the state of vegetation and minimize the impact of atmospheric photography on image quality [1].
On Figure 1 the dynamics of the state of the studied crops from June to August is presented.Analysis of images allows you to determine the time of harvesting (the first mowing in July).The image shows vegetation development in June (yellow-green area).The image in July shows that mowing was carried out, the vegetation cover was removed, and the soil surface was partially exposed.The soils in this case are marked in dark color, closer to brown.In August, intensive regrowth of vegetation was noted, which can be seen in the image in light green tones.Thus, the data of the images makes it possible to estimate the timing of harvesting and the timing of the growth of perennial grasses after mowing.The Healthy Vegetation combination renders objects in shades of red, brown, orange, and green.Soils can appear green or brown, urbanized areas appear whitish, gray and blue-green, bright blue indicates freshly cleared areas, and reddish indicates regrowth or sparse vegetation.Clear deep water will appear dark blue (almost black), while shallow or suspended water will appear in lighter blue hues.The addition of the mid-infrared channel makes it possible to achieve good discrimination of the vegetation age [2].
Spectralindex NDVI: Where NIR is the reflection in the near infrared region of the spectrum; VIS -reflection in the visible region of the spectrum.The main advantages of vegetation indices are the ease of obtaining them and the possibility of solving a wide range of problems with their help.The Normalized Differential Vegetation Index (NDVI) is often used to monitor drought and to estimate and forecast agricultural production.NDVI is a standardized vegetation index that generates an image that displays relative biomass.To calculate this index, the absorption of chlorophyll in the red zone and the relatively high reflectivity of vegetation in the near infrared region (NIR) are used.NDVI allows you to identify areas with oppressed vegetation and make the most correct decisions in the long term aimed at increasing yields [1][2].
On Figure 2 the state of the studied cultures is clearly visible.June -the beginning of the growing season and the intensive development of the vegetation cover.In July, the color changes from rich green to light green, which indicates a decrease in foliage and biomass (cutting was carried out at the indicated time).In August, the re-growth of biomass can be identified by a rich green color.

Fig. 2. Dynamics of the state of the studied crops (spectral index NDVI).
To implement modern concepts of precision farming, it is necessary to have accurate information about the state of crops.The traditional method of obtaining such information is field observations, but their implementation requires significant time and material costs.In recent years, there has been rapid progress in the development of unmanned aerial vehicles (UAVs) and their large-scale penetration into many areas of human activity, including agriculture.The use of UAVs for monitoring and collecting remote sensing data can significantly reduce the cost of research and speed up the process of obtaining up-todate data with high temporal and spatial resolution.However, one of the disadvantages of the most common UAVs is their low payload capacity, which is why UAVs are often equipped with home photo and video cameras of amateur and professional level, which allow obtaining RGB images [3][4].In studies by other authors, the possibility of using RGB images obtained from UAVs for weed detection (Peña, Torres-Sánchez et al., 2015), as well as for automated assessment of the condition of corn crops (Makanza, Zaman et al., 2018) has been established.In this paper, a method is proposed that allows one to obtain a quantitative and qualitative assessment of crop sprouts using RGB images from UAVs [3][4].

Materials and methods
RGB images were used for research.The crop dataset contains over 50 images of each crop (corn, wheat, jute, rice, cotton, and sugarcane).The dataset contains over 179 augmented Crop Images of each class.Zoom contains horizontal flip, rotation, horizontal offset, vertical offset.
To assess the quality of seedlings, a procedure was used that includes the following sequence of actions [5][6]:  Building a vegetation map using the modified TGI index. Splitting the image into intersecting fragments and counting the number of pixels in each of them occupied by vegetation (that is, those for which the index value is above a certain threshold).The ratio of the area occupied by vegetation to the area of the fragment is considered the density of vegetation in this fragment. Determination of the number of fragments with a satisfactory density of vegetation (i.e., more than a given threshold).The ratio of the number of such fragments to the total number of fragments is considered the final indicator of the quality of seedlings in the image.
The blurred and noisy image is restored in an iterative way [2]:  Step 1. Image reading.we read the RGB image and cut out a part of it. Step 2. Simulation of blurs and noise.Simulation of a realistic image containing motion blur or poor camera focus and noise.Blurring is simulated by convolving a Gaussian filter with an image.The Gaussian filter is represented as a function of the extent of a point.To simulate a noisy image, Gaussian noise with deviation V is added to the blurry image.Next, the deviation value V will be used as the damping parameter. Step 3. Restoring a blurry and noisy image.The blurred and noisy image will be restored using the iteration point extension function.The resulting array has the same data format as the original array. Step 4. Interactive recovery analysis.The resulting image changes with each iteration.
To study the process of image restoration, a function is implemented in a step-by-step mode, i.e. the result is analyzed at each iteration.In this case, the resulting array contains four numeric arrays, the first of which represents the blurred image, the second -the same image in double format, the third -the result of the penultimate operation, and the fourth -some processing parameters.
A neural network architecture for image recognition is proposed.Results are expected depending on the loss program error.The loss function Loss does not work very well on a limited database.This is because some of the fuzzy sets may perform well at values that are too small and others that are too large.We use fuzzy membership functions to reduce the value of the loss function.The essence of training is to select weights that minimize the difference between the result of the following neuro-fuzzy approximations and the real properties of the object [7][8][9][10][11][12][13][14][15][16][17]: For training,the following system of recurrent relations is used, which minimizes the criterion α used in the theory of neural networks: ( 1) ( ) () ( 1) ( ) () ( 1) ( ) () Here: ^j y and j y -theoretical and experimental results of object (1) at the j-step of training; ;, Rule weights are trained: Similarly, the neural fuzzy network training algorithm consists of two steps.In the first step, the model value of the object ( ) output corresponding to the given mesh architecture is calculated.

Results and Discussion
A neural network for classifying 6 types of crop images (wheat, rice, sugarcane, corn, cotton and jute) was developed and a recognition model was created.The types of figures in the data set are shown in Figure 3.The prediction results for the trained model by neural networks are shown in figure 5.In (Hunt, Doraiswamy et al., 2013), it is proposed to use the TGI (Triangular Greenness Index) to estimate the amount of chlorophyll in leaves according to RGB survey data.The article provides an overview of a large number of other indices, including those calculated only from RGB data (VARI, GLI, NGRDI), however, it was found that the TGI index correlates better than 293 others with chlorophyll content and can be used to determine the required amount of fertilizer, assess pest damage, weed infestation, etc.The value of the TGI index is determined as the area of a triangle formed by points on the spectral curve with wavelengths of 480, 550 and 670 nm, according to the formula [5][6]: To evaluate the efficiency of using the index, we created a labeled image of a small size (400×300 pixels) for training and a test image (400×300 pixels).The training and test images are fragments of full-size crop images.The accuracy of division of the training image using the TGI index with a threshold of 0.07 (the optimal value, selected empirically) was 94.19%, and that of the test image was 83.88%.Since the task under consideration differs from the one for which the TGI index was developed, it seems appropriate to modify the index for a specific sensor and specific shooting conditions.

Conclusion
The paper proposes a method for isolating vegetation, which makes it possible to carry out a quantitative and qualitative assessment of seedlings of agricultural crops.The method is based on the use of the TGI index, which has been modified to solve this problem.Unlike other common methods, the proposed method does not use data in the IR range, so it can be used to work with RGB images obtained using consumer cameras and video cameras.This makes it possible to use modern compact and affordable means of remote sensing of the Earth, including UAVs, for shooting.The method allows to allocate with sufficient accuracy the areas occupied by agricultural crops in the absence of weeds.Further research will be aimed at solving the problems of separating plantings from weeds and separating rows of crops.

Fig. 1 .
Fig. 1.Dynamics of the state of the studied crops.
-rule weights () w and parameters of relevance functions( , )   ab at the t-step of training;  -a training parameter that can be selected according to the recommendations;

,Fig. 3 .
Fig. 3. Types of drawings in the dataset.The training schedule and validation are shown in Figure 4.

Fig. 5 .
Fig. 5. Prediction results for the trained model by neural networks.