A R-SHINY BASED PHENOLOGY ANALYSIS SYSTEM AND CASE STUDY USING DIGITAL CAMERA DATASET

Accurate extracting of the vegetation phenology information play an important role in exploring the effects of climate changes on vegetation. Repeated photos from digital camera is a useful and huge data source in phonological analysis. Data processing and mining on phenological data is still a big challenge. There is no single tool or a universal solution for big data processing and visualization in the field of phenology extraction. In this paper, we proposed a R-shiny based web application for vegetation phenological parameters extraction and analysis. Its main functions include phenological site distribution visualization, ROI (Region of Interest) selection, vegetation index calculation and visualization, data filtering, growth trajectory fitting, phenology parameters extraction, etc. the long-term observation photography data from Freemanwood site in 2013 is processed by this system as an example. The results show that: (1) this system is capable of analyzing large data using a distributed framework; (2) The combination of multiple parameter extraction and growth curve fitting methods could effectively extract the key phenology parameters. Moreover, there are discrepancies between different combination methods in unique study areas. Vegetation with single-growth peak is suitable for using the double logistic module to fit the growth trajectory, while vegetation with multi-growth peaks should better use spline method. * Corresponding author


INTRODUCTION
As vegetation life cycle in terrestrial ecosystem response to global climate change in recent years, vegetation phenology as an important parameter can reflect the relationship between vegetation and climate change (White, 1997), which is important to study the change of vegetation in terrestrial biosphere at different scales such as year or season (Zhang, 2003).The traditional method of vegetation phenology observation mainly relies on manual monitoring and remote sensing data, such as MODIS, SPOT/ VEGETATION, HJ-CDD, NOAA/AVHRR, LANDSAT TM and so on (Serbin, 2013).The results of manual monitoring are greatly affected by subjective factors.Although remote sensing monitoring method provides a more reliable data source for the comprehensive assessment of vegetation phenology in large area, there are discrepancies to identify the phenology differences between different vegetation communities and species due to its coarse resolution.
With the development of automated observation technology, vegetation phenology studies based on digital camera photographs is widely applied, which could automatically detect the detailed vegetation phenology characteristics of small communities and individual species, and also provide a reliable basis for verifying the results of vegetation phenology in largescale by remote sensing data.For example, Liao (2016) used ginkgo time series data obtained from visible-infrared digital camera of Dujiangyan City in 2014 to extract key phenology parameters, and provided some reference values for forest ecotourism research.In addition, some researchers used the relative greenness index to simulate the growth characteristics of the vegetation in the North American Valleys ranch through nearsurface digital camera images (Zhou, 2016).In the existing studies relate to the digital camera photographs' phenology parameters extraction, systematic extraction and diversity of phenology parameters of different types of vegetation need to be further explored.
Here, we used digital camera photographs from ecosystem phenology camera observation network, which cover various vegetation types, such as forests, grassland and crops.R language is applied to develop an application to extract, analysis and visualize the vegetation phenology parameters.This webbased system mainly achieved a variety of vegetation indices extraction from the time series images at ROI scale.After the data smoothing and fitting, the key phenology parameters of three different vegetation types were finally extracted and analyzed at different scales.

System Development Environment
System is running on the Ubuntu16.04LTS64-bit installed on the virtual machine VMware Workstation Pro 14.0, where Shiny Server v1.5.5.872 is hosted on.A variety of R-packages that Shiny depends on should be installed in advance, such as shiny, rmarkdown, libcurl, devtools, ggplot2, etc.
The virtual machine's IP address should be modified according to the LAN address when system is deployed, and the virtual machine's network adapter is set to bridge way to make sure the virtual machine and the physical machine in the same network segment.And then start the ShinyServer service.Users can access to the system via a URL with other computers on the LAN

System Framework Design
The purpose of system construction is about visualize and analysis the vegetation phenology parameters extraction based on digital camera photo.The main functional modules include site distribution visualization, ROI drawing, vegetation index calculation and visualization, data filtering, fitting of growth curve trajectory and extraction of phenology parameters.Each module is refined into multiple sub-modules, including vegetation indexes, data fitting methods and combination phenology extraction methods, which providing diverse methods for different types of vegetation.System framework and system function module design shown in Figure 1.

Key Methods
(1) R-Shiny.Shiny is a web application framework in R, which can turn our analyses into interactive web applications.The basic files for the web application include server.R and ui.R.Moreover, we can add additional ancillary files to optimize the system, such as global variable file, CSS file, JavaScript files and so on.In this paper, the user interface is defined through the ui.R file, and the server.R file defines the background computing service.Additionally, we add global.R to host global variables and add style.css to realize user interface.
The working principle of R-Shiny is described as follows.In site distribution module, the user interface is divided into map output box and the data selection box; The observer() make a judgment call the appropriate expression by reading the value of selectInput to in the application layer, the type of site and information.And the online map tool leaflet is used to create a map widget, loading map tiles from Mapbox.In addition, the use of pipeline functions %>% and addMarkers () can make the site detailed information stored in the source data displayed in the map.In the ROI selection module, the data reference panel is added by outputting the response data source returned by the reactiveFileReader via the renderTable() command below the data selection panel; When the user clicks the "OK" button, the paste () function is called to bind the input values of the variable site ID "SITE" and the year ID "YEAR" to the correct input file path of the selected file; When the user clicks the "Draw ROI" button, firstly readJPEG () function in jpeg package and rasterImage() in graphics package are called to display the reference image，and then define the polygons that make up the ROI through the locator () function.The module interface is shown in Figure 3. (1) In the above formula, g(t) refers to vegetation index.RDN, GDN and BDN respectively refer to pixel brightness values of the red, green and blue band.
Max, night and spline methods are applied in data filtering module [6] .Max is the best method to reconstruct the time-series vegetation index by experimental verification.The principle is that the 10th and 90th percentiles of the relative greenness indices (GI) for the three days were identified through the moving window algorithm, and filtered data that is beyond the defined range."Beck", "Gu", "Elmore", and "Klosterman" methods based on the double logistic model are used in growth trajectory fitting and phenology parameters extraction module for growth curve fitting (formula 2).Then extracting the key phenological parameters by using the klosterman, derivatives, gu and trs methods."Klosterman" is the curvature maximum method, the principle is calculating two extreme points in plant growth stage as the starting point of greenup date and maturity date, while calculating the two extreme points in the aging stage as starting points of the decline and dormancy period (Beck 2006, Gu 2009, Elmore 2012, Klosterman 2014).
(2) g (t) is the vegetation index to characterize phenology, the parameters a and b represent the minimum value and amplitude of g(t) respectively, and the parameters c and d, e and f respectively control the time and rate change of growth and in the decline.
(3) The typical vegetation growth curve is depicted in Figure 4.In order to extract the key phonological events on the curve, we firstly need to reconstruct and smooth the time series of vegetation indices derived from camera images.There is mainly two kind methods to obtain phenological parameters, vegetation growth threshold method and growth curve derivatives method.The critical phenological points are the start and end of growing season (SOS, EOS), which determine the growing season length (Figure 4).

Vegetation index analysis
Taking data of the Freemanwood site in 2013 as an example, the relative vegetation index RI, BI, GI and BRI time series are extracted from the single-band brightness R-G-B (Figure 5).
The time series of R, G, B band brightness and the relative vegetation indices in figure 4 show that the amplitude of a single band is too small to represent the seasonal variation of vegetation growth trajectory.And the result of relative indices(RI, BI, GI and BRI) shows obvious amplitude and the trend of time series is higher than that of single band time series.
Beside that, GI has the largest amplitude of time series among the relative indices, which could clearly illustrate the vegetation growth trajectory and peak of different stages.

Comparative analysis between different fitting and parameter extraction methods
Firstly, the time-series vegetation index were constructed using max method, and then double logistic and Spline method were used to fit the seasonal variation of vegetation communities, after that we extract the phenology parameters by the TRS, Derivatives, Klosterman and Gu method respectively.The comparison of the results is shown in Figure 6.The combination of different phenology parameter extraction methods has difference performance results in various vegetation types, and have different annual growth trajectories (Figure 6).The longest growth season length is woodland, followed by forest.The shortest growth season length is corn, which is far less than other three vegetation types.Among them, two growth seasons appeared in grassland, and the dormant period appeared in summer.Due to high temperature and droughty constraint, the cold-season turf have two growth peak in spring and autumn.The earliest greenup date appears in grass, followed by woodland, forest and corn, while the decline date order is corn, forest, grass and woodland in ascending order.The dormancy of corn is the longest, and the growing season was concentrated within the period 160-260th DOY.The woodland has the shortest dormant period, since it belongs to evergreen broadleaved mixed forest, the growth period is about in the period from 110th to 340th DOY , while the forest growth period is slightly shorter than that of the woodland, distributed in the period 150-280th DOY.

CONCLUSION
Our R-Shiny web application could be used to extract, analysis and visualize the vegetation phenology from digital camera photo, which has user-friendly interface and good performance.
In addition, the following conclusions can be obtained from the system test result.
(1) Relative index of vegetation is more obvious than single band.And the amplitude of GI is the most significant, which not only conforms to the actual conditions of the seasonal growth trajectory and the peak value of the different growth stages, but also represents the seasonal variation process.
(2) There are significant differences in the extraction results between different phenological extraction methods.Double logistic are suitable for the growth trajectory fitting of singlegrowth vegetation, while the "Spline" method is suitable for multi-growth vegetation.Besides that, the "Klosterman", "Gu", "Trs", "Derivatives" methods combined with double logistic fitting methods also have good performance in extracting the key phenology parameters.

Figure 1 .
Figure 1.Design of system framework and function modules

Figure 2 .
Figure 2. Flowchart of data process and phenology extraction

Figure 4 .
Figure 4. Vegetation growing curve and key phonological events.