Extraction of Tobacco Planting Information Based on UAV High Resolution Remote Sensing Images

Tobacco is a critical cash crop in China, so its grow status has been attributed more and more attention. How to acquire the accurate plant area, row spacing and plant spacing have been the key points for its grow status monitoring and yield prediction. Currently, remote sensing has been a popular method for its speediness, large scale and costless, which could replace the traditional manual methods. We proposed a method to extract the planting information of tobacco at the rosette stage with UAV (Unmanned Aerial Vehicle) remote sensing images, and solved the following problems: the difficulty of detecting the small and densely planted tobacco objects, the scattered tobacco fields with different shapes in Sichuan Province. Four experimental areas were selected in Sichuan Province, and image processing and sample label production were carried out. The results indicate that the average accuracy of tobacco field area, row spacing and plant spacing extracted by this method reached 98.35%, 97.90% and 97.74%, respectively, which proved the extraction method of plant information are valuable.


INTRODUCTION
Tobacco is taken as the most attractive cash crop in China, especially in southwestern region (Sichuan, Yunnan, and Guizhou provinces).Due to the special geographical environment as high altitude, complex terrain, and inconvenient transportation, dynamic monitoring of planting information (area, density, disease and pest situation, and yield prediction) has always been a challenging problem in Southwest region.Traditional manual statistical and measurement methods have been proved inefficient and costly, which make it difficult to quickly and accurately obtain tobacco planting information.UAV remote sensing and deep learning technology provide powerful data sources and analysis tools for precision agriculture, which are helpful for tobacco planting management.Meanwhile, the technology application also plays a key role in the sustainable development of tobacco production and the construction of modern tobacco agriculture [1,2].The current method of extracting crop area mainly relies on remote sensing images, which includes crop classification and field segmentation: After classifying the land cover from images, Wu et al. proposed a method by combining remote sensing data segmentation with sample strip sampling, which can estimate crop acreage in complex agricultural landscapes with high accuracy [3].Du et al.Used deeplabv3+model to extract the crop area and position from remote sensing images in small area [4].De Macedo et al. applied CLSTM network for crop recognition based on remote sensing data, and realized the estimation of crop area was obtained in large areas [5].Other related studies use also remote sensing images for crop segmentation and area prediction [6][7][8].While, in related literature, few methods that utilize highresolution UAV images to carry out tobacco object detection and tobacco growing information are documented.So, the research proposed a tobacco planting information extraction method based on high-resolution UAV images.The method can quickly and accurately extract key information such as area, row spacing and plant spacing of tobacco fields by using high-resolution images collected by UAVs, and then the object detection technology was introduced to improve the precision and efficiency of tobacco production management.

Experimental Area and data
We selected the Chongzhou Modern Agricultural R&D Base of Sichuan Agricultural University (103°39'24"E, 30°33'42"N), Jiange County, Guangyuan City, Sichuan Province (105°27'02"E, 32°00'49"N), Dazhai, Gulin County, Luzhou City, Sichuan Province (105°38'46"E, 28°07'35"N,) and Shifang City, Deyang City, Sichuan Province ( 104°06'41E, 31°06'31N) as the experimental areas (Figure 1), and then UAV images of the tobacco at rosette stage were taken.We use DJI UAV equipped with high-definition digital camera to obtain tobacco images.The model of the UAV is DJI phantom 4 Pro quadrotor UAV.Focusing on tobacco detection, the tobacco dataset contains 1380 images with resolution of 1024×1024, and then the dataset was randomly divided into 1103 training images and 277 test images.In addition, in order to improve the generalization ability of the model and prevent over fitting, we performed data enhancement operations on the training images, including brightness transformation, scaling, flipping and rotation.So, the training images were expanded to 2206 images finally.In the process of manually annotating tobacco targets, the cropping of images resulted in the fragmentation of tobacco near the image edges.To address this issue, we established a criterion that tobacco regions occupying less than 40% of their original size were excluded from annotation.
Fig. 1 Location of the experimental area and UAV images.

Methods
We optimize the YOLOv8s model by adjusting parameters related to image overlap and non-maximum suppression to address issues such as tobacco planting density, differences in tobacco size in different planting areas, and duplicate or missed detection of tobacco at the edges of cropped images.This adjustment addresses issues such as varying tobacco planting density, differences in tobacco size across different planting areas, and instances of duplicate or missed detections of tobacco at the image edges.Subsequently, a tobacco detection model for large-scale planting areas was constructed.The detection and localization of tobacco objects in UAV images had been obtained, including the coordinates of the tobacco center point.Providing coordinates for the center points of detected tobacco.Based on the tobacco coordinates output by the object detection model Leveraging the tobacco coordinates output by the object detection model, we applied the Density Based Spatial Clustering of Applications with Noise (DBSCAN) algorithm to partition different tobacco fields in UAV images.On this basis, we propose a planting distance extraction algorithm based on tobacco coordinates to achieve the calculation of tobacco row spacing and plant spacing.Specifically, we calculate the distance between the tobacco row and its nearest neighbor one as the plant spacing, and the average of the vertical distance between the tobacco row and another tobacco coordinates as the row spacing.Finally, by extending the initial contour of the tobacco field obtained by the Alpha Shape algorithm, a tobacco planting area extraction algorithm based on the extended contour is designed.Which realizes the extraction of the tobacco field area in each region this algorithm facilitates the extraction of the tobacco field area within each region.The overall process of the proposed method is shown in Figure 2. The following is our definition and calculation method of plant spacing: For each tobacco plant, the Euclidean distance between two nearest tobacco plants is taken as the two plant distances of the tobacco.If the current tobacco coordinates are (, ) and other tobacco coordinates are (  ,   ) , then the plant spacing d can be calculated by Formula (1), where minD means to select the minimum and second smallest distance between other points and the current point as the plant spacing.Next, all the plant spacing in each tobacco field area is arranged to get the average plant spacing  ̅ in this area, as shown in Formula (2).In the process, we use the quartile method to detect outliers and filter the abnormally large or small plant spacing, .  is the plant spacing value filtered according to the quartile of the corresponding limit.  is the quantile shown in Formula (3), p is the percentage (for example,  in  25 is 25%),  is the total number of data, ⌊⌋ is the integer part of , {} is the decimal part of , and   indicates the corresponding row spacing or row spacing at the  position after the row spacing or row spacing is arranged from small to large.
For row spacing, we calculate it as follows: the tobacco in the field is roughly distributed in a regular grid.The current tobacco coordinate, the adjacent tobacco coordinate, and the coordinates of other tobacco are set as (, ),  0 ( 0 ,  0 ), and   (  ,   ) respectively. is the angle between  0 �������⃗ and . Then row spacing  in Figure 6 can be calculated by Formula (4), where  denotes the smallest distance in the perpendicular distance between the selected   (  ,   ) and the straight line  0 (greater than  ̅ ).Subsequently, we averaged all row spacings within each tobacco field region to obtain the average row spacing  ̅ shown in Formula (5).Similarly, we used the quartile method to filter and correct the line spacing.  as the row spacing after filtering according to the interquartile of the corresponding inner limit.In tobacco cultivation, row spacing is 2-3 times plant spacing.When analyzing point   , we only consider its vertical distance from the current line within the last 1-2 rows.This reduces calculations and improves accuracy in determining row spacing.
The tobacco coordinates obtained from the detection model are discrete, which makes it impractical to directly compute the field area by pixel counting.Hence, a natural solution is to consider utilizing tobacco field contours for area calculation.So, in order to obtain various shapes of tobacco field area, we designed an area extraction algorithm based on tobacco field contour.The steps of the improved Alpha Shape algorithm to obtain the initial tobacco field contour are shown below: 1.Construction of Delaunay triangulation based on tobacco coordinate points.2.Traverse the Delaunay triangulation, calculate the circumscribed circle radius of each triangle, and eliminate the triangles whose radius is greater than the alpha value.3.In the remaining triangles, the edges that appear only once are reserved and connected in turn in a counterclockwise direction to obtain the initial contour of the tobacco field.

RESULTS
Aiming to verify the accuracy of the model and algorithm proposed in the research.MV and CV denote measured and calculated values, respectively.ACC denotes the accuracy, which is calculated as shown in Equation 6.
In the research, a model and algorithm of tobacco planting information extraction based on UAV high-resolution images are proposed, whose feasibility is verified by the results of multiple independent tobacco fields.In order to further verify the availability of the model and algorithm in the actual production environment, we stitched the images taken by UAV, and extracted the tobacco planting information from the stitched images.As shown in Figure 3, 23 and 5 tobacco fields were obtained in Jiange and Dazhai, respectively.Further, the area, row spacing and plant spacing of each tobacco field were calculated.Different from the independent tobacco fields separated above, the large mosaic image contains multiple tobacco fields.Therefore, before calculating the area, row spacing and plant spacing, DBSCAN algorithm was applied to cluster tobacco coordinates, which can separate multiple tobacco fields in the UAV high-resolution image and eliminate the over-detection coordinates.The row spacing and plant spacing of each field in the same experimental area are basically referred as the same number.However, the row spacing and plant spacing of Dazhai are larger than that of Jiange, which indicate that the different planting norms formed by soil conditions, climate characteristics or agricultural management methods among different experimental areas.We measured the area, row spacing and plant spacing of the first five tobacco fields in two experimental areas, and compared them with the calculated results.The average accuracy rates of area, row spacing and plant spacing were 98.35%, 97.90% and 97.74%, respectively.The results show that the algorithm designed can extract the planting information of multiple tobacco fields on a large area image, and has high calculation accuracy.Different from the independent tobacco fields, the large-area image contains more blank space, which may present false results for similar shape and color.Therefore, an effective object detection model can solve this problem.In conclusion, the model and algorithm proposed have better feasibility and availability in extracting tobacco planting information from UAV highresolution images, and provide effective technical support for tobacco production management.

CONCLUSION
The research proposed an automatic calculation method of tobacco row spacing, plant spacing and tobacco field area based on dense small and medium-sized object detection in UAV images.The experiment selected four typical areas in Sichuan Province of China as experimental examples, and extracted tobacco planting information by solving the problems as complex geographical environment, irregular shape of tobacco fields, small tobacco objects in the cluster stage and dense tobacco planting.We verified the feasibility and accuracy of the tobacco planting information extraction algorithm for single tobacco fields with different shapes and in the actual environment with multiple tobacco fields.In the actual production environment, the average calculation accuracy of the extracted tobacco field area, row spacing and plant spacing reached 98.35%, 97.90% and 97.74%, respectively.The method provides a reference for the calculation of crop spacing, row spacing and tobacco field area on UAV high-resolution images, and provides valuable information support for precision agriculture.In the future, more work should be done to improve the algorithm and optimize the tobacco detection model to further improve the stability and accuracy of tobacco planting information calculation.

Fig. 3
Fig.3 Tobacco field region division and contour extraction
(a)Jiange tobacco fields (b)Dazhai tobacco fields Fig.4 Calculation results of experimental area (a)Jiange tobacco fields (b) Dazhai tobacco fields Fig.5 Accuracy statistics of planting information calculation in two tobacco fields.