Pan Cong

Zhang Lin

Huang Yuanfan

Lu Rui

Keywords: Fluvial dynamics, Wood in river, Streamside video monitoring, Automatic detection, Uncertainty, Video sampling, Operator Bias

Drift wood plays a significant role both on the ecology and morphology of a river. Therefore, quantifying the amount of wood in rivers is an important issue. During recent years, streamside video monitoring has been introduced as a feasible technique to evaluate the amount of wood in riverine environment. Beside many advances, there are still many questions needed to be address concerning this technique. Therefore, in this study, I focused on three major objectives. Firstly, I studied the relation between wood flux and flow discharge in order to create a model for predicting wood flux on invisible period of camera sight. Wood in-stream can show some different characteristics in some critical events, such as in two multi-peak floods, wood flux on the first peak of discharge is more than second one, and in a flood after a stronger windy day, wood flux can be activated by water elevation arise.

In addition, the second major objective was implementation and validation the application of an automatic detection software. After training the software, it is used to extract wood flux automatically by its own surveillance. The third major objective was evaluating human-based uncertainties in video monitoring due to two limitations, first time limitation which results in sampling the videos and second limitation in visibility of the operator which results in bias between different operators. I expect the results of this thesis develop the application of streamside video monitoring technique for practical concerns.

Résumé

Le bois flotté joue un rôle important à la fois sur l'écologie et la morphologie d'une rivière. Par conséquent, la quantification de la quantité de bois dans les rivières est une question importante. Ces dernières années, la surveillance vidéo en bord de rivière a été introduite comme une technique pour évaluer la quantité de bois en milieu fluvial. Outre de nombreuses avancées, il reste encore de nombreuses

Acknowledgement

First of all, I would like to express my sincere gratitude to my supervisor, Professor Hervé Piégay. Thank you very much for your patiently guidance and firm support. I thank you particularly for this opportunity given to me to work for Ph.D. in our laboratory. I am really interesting and exiting about this research project. Thanks to you, like a torch, to guide me and take me into the scientific temple. These six years of study in France change my life. With your encouragement, I muster up the courage to enhance communication with everyone in our lab; with your meticulous help and concern, I can adapt to the life in Lyon rapidly and Dr Hossein Ghaffarian Roohparvar can give me a lot of help about my thesis; and with kindness and rigorous suggestions, I can improve my scientific ability step by step and I was able to learn a lot of things. Thousands thanks to him to guide me how to deal with the data and accomplish camera calibration by MATLAB, how to write an article clean, and how to express my study idea by a presentation. These skills and capability can play an important role for my research career.

I also would like to thank my responsibility teacher in China, Professor Dong Zhibao. Thanks to you to imply me as a candidate for applying funding of CSC. And thanks to Professor François Métivier, because of your invitation, I have had a chance to meet my supervisor, Professor Hervé Piégay in LanZhou, China.

I appreciated that Bruce MacVicar gives me thousands helps and suggestions about my project and supply the previous monitoring data on Ain River. Thanks to him for his very interesting idea about wood pulse. Thanks very much for checking my English express in order to make my idea clean.

I also would like to thank Pierre Lemaire for teaching me how to operate the wood flux monitoring application, and how to code all the function of this algorithm.

Thousands thanks to Kristell Michel and Hervé Parmentier for kindness help. I appreciated that they gave me so many helps while I need any device, they made me VI working and studying fluently. I also appreciated that Lise Vaudor for teaching me how to model wood flux by Random Forest on P-program platform, and Aurelie Antonio for providing and keeping all the monitoring data to me. I would like to thank Professor Emmanuèle Gautier, Professor Thomas Buffin-Bélanger and Professor Virginia Ruiz-Villanueva for agreeing to participate in my thesis jury, in particular the two reviewers for the time spent evaluating this manuscript.

Thanks to Benacchio Veronique, Silvia Flaminio, Emeline Comby and Ahlueng Sebastien I have had the opportunity to work in a very warm environment while I arrived at Lyon on 2014. I also would like to thank Bianca Räpple for her join Dandan and me as a squad of working at night and weekends.

I would like to thank Mathieu Cassel for his kindness help, and I felt so luck that I had an opportunity to go field with him. It was a very impressive experience and I learned so many things that I never read them on the books and articles. Thousands thanks to Baptiste Marteau for your kindness and professional suggestions about my dissertation presentation. Thanks to Ludovic Bultingaire, Frank and Cristina for the help on field work. I would like to thank China Scholarship Council (CSC) and ShaanXi Normal University for providing the funding for my Ph.D. project during these years. I also would like to thank the Laboratory of LIA SALADYN, let me join their project as a Ph.D. candidate in ENS de Lyon, to enhance the communication between France and China.

At last, I want to thank to my family and friends. Thousands thanks to my father and mother. Thanks thousands for your love, firm support and trust me, which encourage me to accomplish and pursue my dream and my favor career. Love you three thousands! I also would like to thank my wife, Cui Dandan, thanks to you for your firm support, thanks to you that give me a very warmly and peacefully home. In this chapter, we shall first define wood in rivers as a significant element to nature and human beings. Introducing some wood in rivers is also an essential component of river systems that can influence river ecology and the channel geomorphology. Based on this, we know that wood in rivers can also intensify hazard during the transport of large wood in huge flood. Therefore, we investigate several approaches to quantify transport of wood in streams. In the final section of this chapter, we will introduce the objectives of this study work, which will guide us through the structure of the manuscript.

List of Figures

List of Tables

Context

Rivers are the natural flowing watercourse on the earth which play a significant role on the hydrological cycle. Along the river's erosion and sedimentation process transport and deposit sediments (rocks and sands) as well as the pieces of wood which are provided by shrub and tree growing on vegetated bars, fluvial islands and floodplains. These in-stream wood pieces can significantly influence over river morphology, sediment dynamics and fluvial ecosystems, which is a beneficial factor in context of natural cycle.

Wood in rivers can also be a crucial element to human. Many civilizations have been built around the rivers. However, during recent decades, these rivers are stressed by human activities such as the control of the river banks, the construction of bridges, dams and other hydraulic structures along the rivers. Moreover, during the last few decades, forest cover has generally increased in many European regions due to the widespread abandonment of agricultural surfaces and changes in framing practices. This phenomenon within global climate change enhances wood supply and entrainment to the rivers. Therefore, over the last 40 years, as the role of wood in river ecosystems has become an increasingly important focus for research, the video monitoring of the rivers has been known as a feasible method to quantify the amount of wood in rivers. Though, video monitoring, by itself is an inexpensive and practical technique in riverine environment, however, annotating wood piece is still a timeconsuming process. Therefore, the aim of this thesis is to introduce some protocols and techniques to quantify the amount of wood in rivers by using the video monitoring technique which enables us to be able to monitor wood pieces in rivers automatically and all along the day time.

Large wood in river channel

Importance of large wood in river

In-stream wood can be as important as sediment for channel change (e.g., [START_REF] Massong | Influence of sediment supply, lithology, and wood debris on the distribution of bedrock and alluvial channels[END_REF][START_REF] Brooks | Mediated equilibrium: the influence of riparian vegetation and wood on the long-term evolution and behaviour of a nearpristine river[END_REF][START_REF] Abbe | Patterns and processes of wood debris accumulation in the Queets river basin, Washington[END_REF][START_REF] Lay | Wood entrance, deposition, transfer and effects on fluvial forms and processes: problem statements and challenging issues[END_REF]. In-stream wood is also a significant and essential component of river systems that has a strong influence on stream and aquatic ecology, sediment transport, and the channel geomorphology along all along the river continuum [START_REF] Montgomery | Distribution of bedrock and alluvial channels in forested mountain drainage basins[END_REF].

The interactions between large wood and fluvial processes have significant implications for the ecology of river systems. Wood influences the functioning of aquatic and riverine ecosystems, enhances the biogeochemical cycling of carbon in ecosystems [START_REF] Battin | Biophysical controls on organic carbon fluxes in fluvial networks[END_REF][START_REF] Skalak | The distribution and residence time of suspended sediment stored within the channel margins of a gravel-bed bedrock river[END_REF][START_REF] Wohl | Mechanisms of carbon storage in mountainous headwater rivers[END_REF], and provides food for invertebrate, fish communities and habitats during different stages of their life cycles [START_REF] Sedell | Evaluating fish response to woody debris[END_REF][START_REF] Inoue | Effects of woody debris on the habitat of juvenile masu salmon (Oncorhynchus masou) in northern Japanese streams[END_REF][START_REF] Piégay | Public Perception as a Barrier to Introducing Wood in Rivers for Restoration Purposes[END_REF].

There are complex feedbacks between green wood, living trees and other riparian and aquatic plants. Living wood pieces transported by flowing water are deposited in and around wood logjam, which would create local regeneration niches for riparian vegetation [START_REF] Steiger | Sediment deposition along the channel margins of a reach of the middle River Severn, UK[END_REF][START_REF] Pettit | Flood-deposited wood creates regeneration niches for riparian vegetation on a semi-arid South African river[END_REF][START_REF] Osei | The role of large wood in retaining fine sediment, organic matter and plant propagules in a small, single-thread forest river[END_REF] and biogeochemical hotspots for microbial activity [START_REF] Krause | The potential of large woody debris to alter biogeochemical processes and ecosystem services in lowland rivers[END_REF][START_REF] Grabowski | The current state of the use of large wood in river restoration and management[END_REF]. Furthermore, wood accumulated in-stream may play an important role in regulating water quality and in sustaining refuge habitats to protect biota during pollution episodes and floods [START_REF] Gurnell | Large wood and fluvial processes[END_REF].

Large wood (LW) in rivers also facilitates diversification of river morphology and sediment dynamics [START_REF] Montgomery | Geomorphic effects of wood in rivers[END_REF][START_REF] Wohl | Mechanisms of carbon storage in mountainous headwater rivers[END_REF][START_REF] Wohl | Wood and sediment storage and dynamics in river corridors[END_REF]. The stable accumulation of wood has a direct influence over channel anabranching, platform geometry and floodplain topography. Some types of wood accumulation can also form stable in-stream which affects alluvial morphology [START_REF] Abbe | Patterns and processes of wood debris accumulation in the Queets river basin, Washington[END_REF]. Wood accumulation or large wood pieces in streams can bring more stabilization or mobilization to the river bed, bank or floodplain, it can also induce deposit of sediment and organic matter [START_REF] Grabowski | The current state of the use of large wood in river restoration and management[END_REF]. Wood along the river corridors creates hydraulic resistance that can decrease flow velocity and transport capacity in the vicinity of the wood [START_REF] Shields | Effects of large woody debris removal on physical characteristics of a sand-bed river[END_REF]Davidson and Eaton, 2013;[START_REF] Wohl | Management of Large Wood in Streams: An Overview and Proposed Framework for Hazard Evaluation[END_REF]. It can also provide surface roughness which declines floodplain surface flows, retains floating wood and deposits fine sediment [START_REF] Dosskey | The Role of Riparian Vegetation in Protecting and Improving Chemical Water Quality in Streams1[END_REF].

The important role played by the in-stream wood in ecology and morphodynamic of the rivers, invites us to consider it as a key component in river restoration and the production of a variety of physical habitats [START_REF] Gurnell | Wood and river landscapes[END_REF][START_REF] Gurnell | 11 Wood in fluvial systems[END_REF]. River restoration and management aim to improve physical natural form and processes of a river. The techniques to monitor and to manage large wood can reshape the natural habitat, control the riverbed, stabilize channel alignment and protect stream banks, these features are the important part of river restoration method [START_REF] Pagliara | Flume experiments on scour downstream of wood stream restoration structures[END_REF][START_REF] Cashman | Trends in the use of large wood in UK river restoration projects: insights from the[END_REF][START_REF] Grabowski | The current state of the use of large wood in river restoration and management[END_REF]. For instance, [START_REF] Wohl | Wood and sediment storage and dynamics in river corridors[END_REF] indicated that more abundant in-stream wood and beaver populations can be used to restore rivers ecologically, due to the fact that they could accumulate more sediment within river corridors and maintain more residual pool volume.

Problems associated with large wood in river

Although wood in stream has an undeniable positive effect on river morphology and restoration, improving ecosystems, , it can also be an exacerbating hazard factor during the transport of large wood material in huge flood [START_REF] Diehl | Potential Drift Accumulation at Bridges[END_REF]Comiti et al., 2006;[START_REF] Lassettre | Large woody debris in urban stream channels: redefining the problem[END_REF]Ruiz-Villanueva et al., 2014a). The presence of wood in a river can increase flow stage, alter movement of sediment and patterns of erosion and deposition. Its transportation during the flood events, threatens not only human activities on rivers but also the populations and infrastructures [START_REF] Lyn | Debris accumulation at bridge crossings: laboratory and field studies[END_REF][START_REF] Piégay | Dynamics of wood in large rivers[END_REF]Comiti et al., 2006;[START_REF] Wohl | Management of Large Wood in Streams: An Overview and Proposed Framework for Hazard Evaluation[END_REF]De Cicco et al., 2018), especially in or near urban settings [START_REF] Mazzorana | Determining flood hazard patterns through a combined stochastic-deterministic approach[END_REF]Ruiz-Villanueva et al., 2014a;[START_REF] Wohl | Management of Large Wood in Streams: An Overview and Proposed Framework for Hazard Evaluation[END_REF]. Moreover, in the past few decades, the development of the urbanization has occupied massive infrastructures in endangered zones of mountain areas, such as the recreation areas, ski resorts, hiking paths, as well as buildings, roads and bridges. These infrastructures are totally exposed to the impact of flood event (Comiti et al., 2006;Versini et al., 2010;[START_REF] Mazzorana | Determining flood hazard patterns through a combined stochastic-deterministic approach[END_REF]Tacnet et al., 2012;[START_REF] Mazzorana | Assessing and mitigating large wood-related hazards in mountain streams: recent approaches: Assessing and mitigating LW-related hazards in mountain streams[END_REF].

Dead and living wood incorporated into the floodplain (e.g. [START_REF] Arseneault | Asynchronous forest-stream coupling in a fire-prone boreal landscape: insights from woody debris[END_REF] can form 'hard points' that are resistant to erosion, supports the longer-term development of riparian vegetation, especially those large trees that provide a future wood supply to the river system (Collins et al., 2012). Finally, sustained floodplain inundation induced by large wood accumulations can lead to tree mortality and subsequent enhanced wood delivery to the river [START_REF] Brummer | Influence of vertical channel change associated with wood accumulations on delineating channel migration zones[END_REF]. It could increase the potential hazard for downstream bridge, river channel and infrastructures along the river.

As mentioned above, wood transported in the river channel is a threatening process due to its progressive increase of flood hazard. Log jams are often a major element of stream morphology, and floating logs may generate a natural hazard [START_REF] Manga | Stress partitioning in streams by large woody debris[END_REF][START_REF] Kraft | Development of spatial pattern in large woody debris and debris dams in streams[END_REF]Comiti et al., 2006;[START_REF] Mao | Acumulaciones de detritos leñosos en un cauce de montaña de Tierra del Fuego: análisis de la movilidad y de los efectos hidromorfológicos[END_REF]Curran, 2010;[START_REF] Mazzorana | Determining flood hazard patterns through a combined stochastic-deterministic approach[END_REF]Turowski et al., 2013a). As shown on To predict in real system risk associated with wood, [START_REF] Macvicar | Implementation and validation of video monitoring for wood budgeting in a wandering piedmont river, the Ain River (France)[END_REF] emphasized the need to develop new approaches for documenting and monitoring fluvial wood transport. A better understanding of LW (Large wood) supply, transfer, and deposition is necessary in order to balance the positive ecological factors of LW against the risks of increased flooding [START_REF] Piégay | Large woody debris and river geomorphological pattern: examples from S.E. France and S. England[END_REF]. Therefore, it is necessary to detect and to monitor the amount of in-stream wood in a quantitative manner, to be able to evaluate the LW-related hazards.

Definitions

In this section, we introduce some parameters of in-stream wood. Firstly, the wood pieces, which refer to the objects whose size spans from tiny pieces to entire trees. In terms of different types of floating objects, we can distinguish them such as leaves, needles and wood fragments to twigs, branches and even entire trees with leaves and mud. Large wood in streams generally refers to wood pieces that have the size of at least 10 cm in diameter and 1 m in length, it could be utilized by various wood size on different river forms [START_REF] Gurnell | Large wood and fluvial processes[END_REF].

Wood flux is the number of wood pieces that pass an observe point on the river per unit time. The wood flux is different from the wood discharge. The first one is a statistic for gathering the number of wood pieces, while the second one is defined by the volume of wood flux, it is the volume of transported wood per unit time. Wood budget is a quantitative framework for analyzing the mass budget of the pieces of wood. Wood budgeting at annual timescales encompasses several key elements, wood volumes and wood flux transport rate being crucial ones.

Bankfull discharge (Qbf) is the flow that reaches the threshold between the channel and river floodplain and is thus a significant morphological parameter [START_REF] Leopold | Fluvial processes in geomorphology[END_REF]. Bankfull discharge is usually estimated by 1 to 2 years peak flow [START_REF] Dunne | Water in environmental planning[END_REF][START_REF] Harman | Bankfull hydraulic geometry relationships for North Carolina streams[END_REF], or 1.5 years on average [START_REF] Rosgen | A classification of natural rivers[END_REF]Castro and Jackson, 2001;Ghaffarian et al., 2020a). However, the use of Qbf for weighing the flood event often applies variable measurements, depends on different river channel scenario. As mentioned on section 1.3.2, it is necessary to detect and monitor in-stream wood to be able to quantifiably evaluate the interaction between wood and river system, such as how wood decay and deposition could influence ecological habitat, how wood transportation and deposition influence river morphology, and how LW could relate with the natural hazard.

Quantifying in-channel wood fluxes

Both [START_REF] Martin | Patterns of Instream Wood Recruitment and Transport at the Watershed Scale[END_REF], and Benda and Sias (2003)

Use of imagery and video to quantifying wood flux

Optical imagery is one of the most common remote sensing tools installed on different platforms and acquiring different combinations of spatial resolution area.

The increasing spatial, temporal and spectral resolutions of imaging technologies are improving our ability to monitor river forms and processes. In the meantime more sophisticated analysis of the imagery obtained is providing new insights and understanding for river scientists (MacVicar et al., 2012). Aerial imagery allows larger reaches to be surveyed and could determine the changes in storage of wood in river channel on annual or decades [START_REF] Lassettre | Decadal changes in distribution and frequency of wood in a free meandering river, the Ain River, France[END_REF]. MacVicar et al., (2009) repeated wood surveys which were made from low-elevation high-resolution aerial images by using a drone aircraft on the Drôme River, France. These aerial imagery with high resolution could detect wood as small as 0.10 m in diameter. It allows us to calculate the change in wood deposition between flight dates and lateral outputs as a result of floodplain advancement. [START_REF] Boivin | The raft of the Saint-Jean River, Gaspé (Québec, Canada): A dynamic feature trapping most of the wood transported from the catchment[END_REF] estimated a wood raft volume in channel by using a planimetric analysis of aerial photos. Using decadal and annual intervals, this study aims to examine the accumulation of wood in a large raft of the Saint-Jean River and to conclude that the relationship between river discharges and wood volumes was not simple, explaining the river network can store or deliver wood in a variable manner during each of the flood events.

Wood removal records from reservoirs are a significant data for the quantification of wood transport. [START_REF] Benacchio | A new methodology for monitoring wood fluxes in rivers using a ground camera: Potential and limits[END_REF] have installed a camera to obtain ground camera images with 10 minutes interval on Génissiat Dam, located in the upstream reach of the Rhône River, France. A random forest algorithm makes a distinction between wood and water surface so as to extract automatically a wood raft area.

Although it has provided a high accuracy classification rate and has established a good relationship between wood weights which based on mechanical wood extractions and wood raft surface area monitoring just before the extraction, it is not possible to apply this method to detect wood delivery, because changes in raft density and form are very significant so that the conversion of wood area into wood weight or wood discharge is not direct.

Direct observation of wood movements is rare, the tracing of large wood movements is even less common. The first attempt at creating a wood transport curve used video monitoring of floods on the Ain River in France (MacVicar and Piégay, 2012). Researchers installed a video camera at the Pont de Chazey gauging station. The camera was located on one side of the river. The video feed was transmitted via remote servers to a computer at the University of Lyon and saved in movie jpeg format. For image processing, a semi-manual logging algorithm was written in MATLAB to extract the information of in-stream wood occurence from the videos. A rectification algorithm applying mapping coefficients was developed to transform the pixel coordinates of the wood into real coordinates. The wood length and diameter were calculated from real coordinates as a cylindrical shape for wood. monitoring approach in the riverine environment but has also showed its limits and constraints.

1.5.2 Detecting wood flux from a stream-side video camera.

Videography means to capture a series of images of the interested object. It can capture the movement of objects within the image frame to be distinguished (MacVicar et al., 2012). This technique can be practiced either manually (known as annotation) or automatically (known as detection).

A semi-manual logging algorithm is used to record the position, velocity, dimensions, and other details about detected wood pieces in the video (MacVicar et al., 2009;[START_REF] Macvicar | Implementation and validation of video monitoring for wood budgeting in a wandering piedmont river, the Ain River (France)[END_REF]. This algorithm advances the video one frame at a time. The observer manually marks the endpoints and the edges of the wood.

The time is then read from the image, and the coordinates of the wood are transformed using a rectification algorithm to obtain the size of wood (Figure I-3).

However, there is a weakness for detecting wood manually in the rivers. Since the video is advanced frame by frame to detect wood flux in front of the camera, the observer is obliged to check more than 150 thousand frames per day, which is a huge piece of work. Although [START_REF] Kramer | Estimating fluvial wood discharge using time-lapse photography with varying sampling intervals[END_REF] increased sampling interval to monitoring large volume in a low gradient river, it still costs a long time for annotating wood flux on long-term survey. Ali and Tougne ( 2009) developed an unsupervised method to identify floating wood in videos by applying intensity, gradient and temporal masks and then tracked the objects through the frame to ensure that they followed the direction of flow. An analysis of about 35 minutes of video showed that approximately 90% of the wood was detected (i.e. about 10% of detections were missed), which confirmed the potential utility of this approach. An additional set of false detections related to surface wave conditions amounted to approximately 15% of the total detections.

However, the developed algorithm was not always stable, and was found to perform poorly when applied to a larger data set.

Challenges in video-monitoring of wood discharge

Despite the advantages of video monitoring techniques, there are always some gaps. The first one is about the visibility of the camera (e.g., lack of light during the night time or in cloudy weather or connection lost in case of online cameras [START_REF] Muste | Large-scale particle image velocimetry for measurements in riverine environments[END_REF]MacVicar et al., 2009;[START_REF] Macvicar | Implementation and validation of video monitoring for wood budgeting in a wandering piedmont river, the Ain River (France)[END_REF]Ghaffarian et al., 2020a). Although the stream-side camera can monitor wood flux with high temporal resolution, visual detection is still limited to wood pieces that can be clearly distinguished on an annotated frame. Conditions such as night time, cloudy weather, fog, rainfall, snow or dirty lens, affect monitoring quality for several hours. In these cases, modeling wood fluxes would be an effective and low-cost solution so as to get a good estimate of wood flux per contributing event.

The second challenge is about the complexity of the natural environment that has many constraints constantly. The flow of water in rivers contains turbulences and waves which could influence the precision of automatic function. In addition, the cloud movement in sky could alter the luminosity of the river surface. The difference of the brightness plays an important rule of unsupervised monitoring as well. Then, our aim is to overcome these gaps by using models and reduce uncertainties in wood piece censing.

Objectives

As mentioned above, to be able to quantify wood flux, it is important to detect the huge number of wood pieces for a long-term. Therefore, here study follows three main objectives:

1-Create a model to predict wood flux during entire flood events.

The current study aims to find the relation between wood flux and flow discharge to simplify the monitoring procedure, and to verify whether or not the wood transport threshold is influenced by other weather conditions beside floods. Moreover, we need to explore wood flux in darkness or lens blocked period, in order to estimate whole wood discharge during flood events.

2-Implementation and validation of wood automatic detection software

Although methods for monitoring and tracking wood are progressing rapidly [START_REF] Macvicar | Implementation and validation of video monitoring for wood budgeting in a wandering piedmont river, the Ain River (France)[END_REF]Ravazzolo et al., 2015a), the temporal dynamics of in-stream wood and long-term observations are extremely rare [START_REF] Iroumé | Large Wood Volume and Longitudinal Distribution in Channel Segments Draining Catchments with Different Land Use, Chile[END_REF]Ruiz-Villanueva et al., 2016a). Therefore, the implementation and validation of wood monitoring application are very necessary for detecting wood fluxes continuously.

3-Evaluate human-based uncertainties in video monitoring

We still need manually collected wood flux data to train the automatically wood detection algorithm, and to compare them with different river monitoring data. Analyzed operator bias is very important for considering a patch on the video frames as wood piece is different.

CHAPTER II. Video monitoring of in-channel

Abstract

Wood flux (piece number per time interval) is a key parameter for understanding wood budgeting, determining the controlling factors, and managing flood risk in a river basin. Quantitative wood flux data is critically needed to improve the understanding of wood dynamics in rivers and estimate wood discharge in streams.

In this study, the streamside videography technique was applied to detect wood passage and measure instantaneous rates of wood transport. The goal was to better understand how wood flux responds to flood and wind events. In total, one exceptional wind and 7 flood events were monitored on Ain River, France, and around than 24000 wood pieces were detected manually. We find an empirical relation between wood frequency and wood discharge, which is used to simplify the monitoring procedure. A one-to-one link exists between the fraction of detected pieces of wood and the dimensionless parameter " 𝑝𝑎𝑠𝑠𝑖𝑛𝑔 𝑡𝑖𝑚𝑒 × 𝑓𝑟𝑎𝑚𝑒𝑟𝑎𝑡𝑒 ", which provides a general guideline for the design of monitoring stations. It is confirmed that, in general, there is a threshold of wood motion in the river equal to 60% of bankfull discharge. However, in a flood following a windy day, no obvious threshold for wood motion was observed, confirms that wind is important for the preparation of wood for transport between floods. In two multi-peaks floods, around two-thirds of the total amount of wood was delivered on the first peak, which confirms the importance of the time between floods for predicting wood fluxes. The data set is used to develop a random forest regression model to predict wood frequency as a function of three input variables that are derived from the flow hydrograph. The model calculates the total wood volume either during day or night based on the video monitoring technique for the first time, which expands its utility for wood budgeting in a watershed.

Introduction

Floating wood in rivers, known as driftwood is a significant component of catchments, notably in forested temperate regions (Ruiz-Villanueva et al. 2016a;[START_REF] Wohl | Floodplains and wood[END_REF]. It is delivered in the rivers by a set of processes (landslides, debris flows, blowdown, bank erosion and so on) which vary from upstream to downstream [START_REF] Nakamura | Effects of coarse woody debris on morphology and sediment storage of a mountain stream system in western Oregon[END_REF][START_REF] Montgomery | Distribution of bedrock and alluvial channels in forested mountain drainage basins[END_REF][START_REF] Abbe | Patterns and processes of wood debris accumulation in the Queets river basin, Washington[END_REF][START_REF] Gurnell | Trees as riparian engineers: the Tagliamento river, Italy[END_REF]. Among different recruitment processes, bank erosion probably delivers most of the large organic material into larger lowland rivers [START_REF] Keller | Effects of large organic material on channel form and fluvial processes[END_REF]. These large pieces of wood (i.e., 1m length, 10cm diameter), in a river induce variations in hydraulic and sediment dynamics, and contribute flow resistance and obstructions within the channel [START_REF] Young | Flume study of the hydraulic effects of large woody debris in lowland rivers[END_REF][START_REF] Gippel | Potential of turbidity monitoring for measuring the transport of suspended solids in streams[END_REF][START_REF] Shields | Prediction of Effects of Woody Debris Removal on Flow Resistance[END_REF][START_REF] Wilcox | Flow resistance dynamics in step-pool stream channels: 1. Large woody debris and controls on total resistance: FLOW RESISTANCE DYNAMICS, 1[END_REF][START_REF] Mao | Acumulaciones de detritos leñosos en un cauce de montaña de Tierra del Fuego: análisis de la movilidad y de los efectos hidromorfológicos[END_REF]. Especially during a flood, the transport and deposition of large wood pieces could represent a potential increase in the destructive power of floods, which increases the potential risks to human populations and infrastructures [START_REF] Lassettre | Large woody debris in urban stream channels: redefining the problem[END_REF]De Cicco et al., 2018;[START_REF] Mazzorana | Assessing and mitigating large wood-related hazards in mountain streams: recent approaches: Assessing and mitigating LW-related hazards in mountain streams[END_REF]. For instance, a flow obstruction due to wood accumulation can lead to upstream bed aggradation, channel avulsion, and local scouring processes, which can in turn cause embankment or bridge collapse and floodplain inundation [START_REF] Diehl | Potential Drift Accumulation at Bridges[END_REF][START_REF] Lyn | Debris accumulation at bridge crossings: laboratory and field studies[END_REF][START_REF] Fischer | Driftwood During the Flooding in Klosters in 2005[END_REF][START_REF] Waldner | Schwemmholz. Ereignisanalyse Hochwasser 2005-Teil 1: Prozes se, Schäden und erste Einordnung[END_REF][START_REF] Mao | Acumulaciones de detritos leñosos en un cauce de montaña de Tierra del Fuego: análisis de la movilidad y de los efectos hidromorfológicos[END_REF][START_REF] Mazzorana | Hazard index maps for woody material recruitment and transport in alpine catchments[END_REF]Comiti et al., 2012;Ruiz-Villanueva et al., 2014a). Therefore, quantifying wood inputs, transport, deposition, and budgeting in general is crucial for understanding and managing wood risk in rivers.

Understanding the variability and the process-scale dynamics which control wood delivery and transport rate is also a critical challenge [START_REF] Martin | Patterns of Instream Wood Recruitment and Transport at the Watershed Scale[END_REF]Benda et al., 2003;[START_REF] Marcus | Response of the Fluvial Wood System to Fire and Floods in Northern Yellowstone[END_REF][START_REF] Schenk | Large wood budget and transport dynamics on a large river using radio telemetry[END_REF][START_REF] Boivin | The raft of the Saint-Jean River, Gaspé (Québec, Canada): A dynamic feature trapping most of the wood transported from the catchment[END_REF].

Wood budgeting can be explored at different time scales. The wood recruitment sites are often observed close to the preferential sites of deposition [START_REF] Schenk | Large wood budget and transport dynamics on a large river using radio telemetry[END_REF]Ravazzolo et al. 2015), but not systematically, as shown along the Isère River,

France [START_REF] Piégay | Assessment of transfer patterns and origins of in-channel wood in large rivers using repeated field surveys and wood characterisation (the Isère River upstream of Pontcharra, France)[END_REF]. Some pieces of wood can be transported over very long distances during a single flood [START_REF] Gurnell | Large wood and fluvial processes[END_REF][START_REF] Gurnell | Wood and river landscapes[END_REF]Comiti et al., 2016;Kramer and Wohl, 2017). Moreover, the amount of wood can be documented at multi-annual and annual time intervals over long time periods by historical data [START_REF] Seo | Factors controlling the fluvial export of large woody debris, and its contribution to organic carbon budgets at watershed scales[END_REF][START_REF] Seo | Scale-dependent controls upon the fluvial export of large wood from river catchments[END_REF]Ruiz-Villanueva et al., 2014b). Based on this long time scale, however, it is not possible to record continuous series and study wood transport processes during shorter but critical hydrological events such as floods, exceptional wind events, and landslides, which are known to drive wood fluxes in rivers [START_REF] Lassettre | Large woody debris in urban stream channels: redefining the problem[END_REF]Ruiz Villanueva et al., 2014a).

To generate wood input series in shorter time scales, Moulin and Piégay, (2004) used weekly time steps to measure the wood stored in a reservoir. The results quantified the timing and magnitude of Large Wood (LW) export during flood events in the reservoir and allowed the recruitment and transport processes of LW at the watershed scale to be better understood. [START_REF] Benacchio | A new methodology for monitoring wood fluxes in rivers using a ground camera: Potential and limits[END_REF] monitored wood delivery and calculated wood weight in a reservoir by an automated image processing technique using much finer time intervals (10 min). In addition to the reservoir-based monitoring, [START_REF] Kramer | Estimating fluvial wood discharge using time-lapse photography with varying sampling intervals[END_REF] showed that in high-discharge, low-velocity rivers, the deployment of monitoring cameras with coarse frame rates (≥ 1 min) enables monitoring of LW transport at large spatial and long temporal scales.

However, in smaller and steeper rivers the velocity of wood pieces is higher or the field of view is too small such that low frame rate photography cannot provide accurate estimates of wood delivery.

Video monitoring of the water surface can be used to continuously monitor wood flux at a high temporal resolution. [START_REF] Lyn | Debris accumulation at bridge crossings: laboratory and field studies[END_REF] were the first to apply this technique, using two stream-side video cameras to observe and detect wood accumulation on bridge pier in the Eel River, Unites States. Due to data storage issues, [START_REF] Lyn | Debris accumulation at bridge crossings: laboratory and field studies[END_REF] downgraded the frame rate to 0.1 fps (frame per second)

and applied image compression to the recorded frames through the monitoring period. Such issues were overcome by MacVicar et al. (2009), and MacVicar and Piégay (2012) who established a monitoring station at the Ain River, France, but transferred the full resolution images recorded at 5 fps to a remote server for analysis.

The high quality and frequency of the data, which is likely necessary in high gradient rivers, allowed them to compare LW dynamics with flood hydrograph and develop a quantitative relation between wood and water discharges. Other studies have implemented similar approaches [START_REF] Boivin | The raft of the Saint-Jean River, Gaspé (Québec, Canada): A dynamic feature trapping most of the wood transported from the catchment[END_REF]Kramer et al., 2017;[START_REF] Senter | Wood export prediction at the watershed scale[END_REF]Ruiz-Villanueva et al., 2018;Ghaffarian et al., 2020a) but overall the technique remains undersubscribed and models of the wood flux as a function of the flow hydrograph remain poorly parameterized.

Overall, the success of a particular monitoring station will be determined by issues of wood size and image resolution (MacVicar and Piégay, 2012;Ghaffarian et al., 2020a). Ghaffarian et al. (2020a) monitored floods on the Isère River (France)

and demonstrated the generalizability of technique to other rivers along with some limits, constraints, and methodological recommendations. The oblique angle of the camera means that it is particularly important to understand where wood will pass relative to the camera position (Ghaffarian et al., 2020a). Moreover, a problem remains that there are gaps within the data. Such gaps can occur due to the poor visibility in low light or cloudy weather, lost connections where data is transferred to a remote server for storage [START_REF] Muste | Large-scale particle image velocimetry for measurements in riverine environments[END_REF]MacVicar et al., 2009;[START_REF] Macvicar | Implementation and validation of video monitoring for wood budgeting in a wandering piedmont river, the Ain River (France)[END_REF]Ghaffarian et al. 2020a), or simply to the time required to extract information about floating wood from videos. Despite some efforts at automatic extraction [START_REF] Ali | Unsupervised Video Analysis for Counting of Wood in River during Floods[END_REF][START_REF] Lemaire | Automatically monitoring driftwood in large rivers: preliminary results[END_REF], the procedure to date remains predominantly manual. Improved modeling of wood fluxes as a function of flow hydrographs or other environmental conditions could be an effective strategy to reduce sampling effort and fill in missing data such that wood fluxes could be integrated over time to support wood budgeting in watersheds.

The A random forest (RF) model was used to answer the second question.

Study site

The study site is located on the lower Ain River, a sixth-order piedmont river flowing through a forested corridor in France. The channel is typically single thread with occasional islands, and a wandering system with prominent meander scrolls and cutoff channels ( , 2012). Along the study site, wood influx has been estimated over several decades from the analysis of aerial photographs at 18 to 38 m 3 /km/yr [START_REF] Lassettre | Decadal changes in distribution and frequency of wood in a free meandering river, the Ain River, France[END_REF].

Floating wood was counted on the river at Pont de Chazey, where a stream gauge is maintained by a regional authority (Figure II-1.b, c). Along the river, the characteristic discharge of 1.5-year return period was 𝑄 1.5 = 840 m 3 /s (Ghaffarian et al., 2020a), and at this study site, an estimated bankfull discharge (𝑄 𝑏𝑓 ) of 530m 3 /s was confirmed by visual observation (MacVicar and Piégay, 2012). At this point the flow discharge is calculated based on the water elevation measured at the gauging station. These data are available online from 1959 at (www.hydro.eaufrance.fr).

Mean daily wind speed is also available from the Meteorological Station of Lyon-Bron windy period (events F4 to F7 and W1). At minimum compression, each video segment occupied approximately 94Mb of memory and approximately 15 minutes so that a 4TB hard drive stored approximately one year of video. Flood levels were reviewed every few days and videos of interest were saved for later analysis.

Monitored events

In total, 7 flood events were monitored in this study (Table II-1 Gumbel distribution of the over 70 years of record [START_REF] Yue | The Gumbel mixed model for flood frequency analysis[END_REF].

Monitoring process

In total 183 hours of video were analyzed, including 18 hours monitored by

MacVicar & Piégay (2012) (Table II-1). After detecting each piece of wood in a video frame, the position of wood was annotated manually frame by frame.

Two methods were applied for counting piece number: (i) 15 minutes sampling for events (F1 to F3) and (ii) continuous monitoring for events (F4 to F7 and W1). In the first approach, from each one hour, only 15 minutes video segment was monitored e.g. from 8:30 to 8:45, and then from 9:30 to 9:45, etc. until the end of the day (5:30 pm) when video monitoring was impossible due to the lack of light. Then by multiplying the number of detected pieces by 4 the total number of wood pieces during each hour was extrapolated. It should be noted that, in this approach, it is not obvious if the selected 15 min appropriately represents the wood flux for the entire one hour which is a source of uncertainty. In the second approach, all daytime (from 8:30 am to 5:30 pm) was monitored continuously by an operator.

Considering the detection time for each piece of wood (this time is indicated on top of each frame, see Figure II-4.a) wood flux is defined as the number of wood pieces within a time interval. In the current study, a 1 hr time interval was selected to model the wood fluxes through the flood events (sections 2.6.1, and 2.6.2). This interval was found to minimize uncertainty due to short term variability in wood fluxes (Ghaffarian et al., 2020a). Then, to study these short-term events (e.g. delivery of a large number of wood pieces in a short time, known as wood pulses) 1 and 10minute time intervals were selected in section 2.6.3.

Observer bias

The analyzed events in this work are based on two different operators (MacVicar and Zhang). During the detection process, the operator bias can play a role in the quantity of wood fluxes. To check this effect, 13 segments of 15-minute videos from events F1 to F3 were selected and wood was detected by both operators following the process used by Ghaffarian et al. (2020a). These video segments were selected such that they cover different light conditions (e.g. sunshine or cloudy weather or different day times) to evaluate the operator visions in different conditions. Also, the amount of wood pieces varies greatly among videos (from 0 to more than 300 pieces).

Overall, there was about a 7% difference in wood flux estimates between the two observers, with most discrepancies occurring when many small wood pieces pass through the image within a short time interval.

Modeling wood flux

A random forest (RF) non-linear regression algorithm was applied to model the link between wood flux and flow discharge in this study. It produces multiple decision trees (here, 500), each of which is trained on a randomly selected subset of the data (in-bag portion) while the remaining subset is used to test the regression and assess its performance (out-of-bag portion) [START_REF] Breiman | Random Forests[END_REF][START_REF] Hastie | The elements of statistical learning: data mining, inference, and prediction[END_REF][START_REF] Belgiu | Random forest in remote sensing: A review of applications and future directions[END_REF]. The RF error corresponds to the residual sums of squares averaged across all the out-of-bag portions of the regression trees. The importance of a variable in the RF model can be assessed through a score that corresponds to the total decrease in error due to splits on that particular variable, averaged across all trees [START_REF] Breiman | Random Forests[END_REF].

For the current study, the response variable was the wood flux and the predictor variables were all derived from the flow time series. We considered three predictors that could influence the wood flux during flood including: (i) flow discharge 𝑄(𝑡), (ii) the time elapsed since the last time that 𝑄 was higher or equal to 𝑄(𝑡), known as 𝑇 𝑄 , and (iii) the gradient of discharge over a time lag (5 min) 𝑑𝑄 𝑑𝑡 ⁄ . The application of these predictors in the model is presented in the results (section 2.6.2). Due to gaps in sampling (e.g., during night time), periods where the time interval between two consecutive detections exceeded 10 hr were removed from the data. In cases when several pieces of wood were annotated in the same image frame, we assume a time interval of 0.5 s between wood pieces.

The RF and all related data-wrangling were carried out using the R software (R Core Team, 2019) and the Random Forest package (Liaw and Wiener, 2002). The random forest consisted of a default number of trees set to 500 and the sampling of in-bag/out-of-bag samples was made with replacement. The R notebook gathering all RF-related commands is available from https: ://github.com/lvaudor/wood_flux.

From wood flux to wood discharge

In the study by MacVicar and Piégay (2012), wood discharge was calculated as m 3 /s by estimating the length and diameter of all detected floating wood pieces. This process is time consuming, and a decision was made for the current study that, rather than completing the size measurements, the wood pieces would only be counted for floods F4 through F7. The wood count allowed the calculation of the wood flux as a frequency (pieces/minute). This approach was justified by considering while if ∆𝑡 < 𝑃𝑇 we can be sure that no wood piece is missed between each pair of frames (Figure bottom). Therefore, the fraction of the detected wood pieces can be defined as the ratio between detected wood pieces in the green region in Figure b and the summation of detected (green region) and missed pieces (red region). To study the link between the frame rate and the fraction of detected wood pieces, all detections in Table II-1 was used. Knowing ∆𝑡 = 0.2𝑠 (5 𝑓𝑝𝑠) and 𝑃𝑇 ≅ 5 𝑠 on the Ain river, we can be sure that ∆𝑡 ≫ 𝑃𝑇 means that there is enough overlap between each pair of frames (the condition presented in the bottom of Figure and all detectable pieces (not pieces that are not visible by an operator e.g. small pieces far from the camera) are taken into account. Then, knowing the exact detection time for each piece of wood (it is indicated on top of each frame (e.g.

Figure ) by artificially changing the framerate, the number of detected wood pieces at different framerates from 0.001 to 5 𝑓𝑝𝑠 ( 0.2𝑠 < ∆𝑡 < 1000𝑠 ) has been estimated and will be presented in section 2.6.3.

Results

Estimate of wood fluxes during critical events

Overall, the results show 3-stages of (i) rising from a threshold of motion, (ii) high but flat at discharges above the bankfull, and then (iii) around one order of magnitude lower on the falling limb (Figure II-5 and Table II-1 During the exceptional windy day (W1 from 8 to 17 hr) almost no wood was detected on the river (Table II-1). This means that the wood flux is only observed during flood events. As it is seen in Figure II-5 in all cases but F7, there are almost no wood pieces in the river for flow discharge less than ~300 m 3 /s. In the case of the flood event F7 following W1 (the exceptional wind event), however, the threshold appears to be much lower or non-existent. For this event only, the wood flux increases immediately following the increase in flow discharge, which demonstrates the potential effect of W1, not in terms of transport of floating wood downstream, but in the wood transfer from the river banks to the channel where it can be readily mobilized in the subsequent flood.

In Figure II-5, events F4 and F6 are characterized by multi-peak hydrographs. Event F4, for example, is characterized by three peaks with similar discharges (Table II-2), during which 3098, 1134 and 839 pieces of wood were observed respectively in the first to third peaks. Event F6 is characterized by two slightly lower peaks, and 995 and 427 pieces of wood were observed in two peaks, respectively (Table II-2). Despite some differences in the timing of the floods with respect to daylight hours, these results do indicate that around two-thirds of the wood are mobilized in the first peak of a multi-peak flood. As the number of peaks increases, it also appears that the amount of transported wood progressively decreases.

Predicting wood fluxes during night time

As described in section 2.5.5 three predictors derived from the flow hydrograph that were thought to influence the wood flux during the flood were used to develop an RF model. The examination of the relationship between the number of trees and R 2

showed that the number of trees used here (500) was by far sufficient for R 2 to be as high as possible. The average R 2 for the out-of-bag portion across all trees was 49.5%. When carrying out cross-validation for the RF as a whole (with 80% of the data randomly sampled -without replacement-as the training set and 20% as the test set) the R 2 for training set was 49.5% on average across all trees for the training set (estimated on the out-of-bag data) and 69.8% on the test set. Based on the field observations and the RF modeled wood fluxes, it is possible to check both the wood mobility during the night and the critical threshold of motion.

The critical threshold of motion is defined by the discharge which initiates the mobility of wood flux on the rising limb of the flood. Moreover, to be able to compare the wood volume in two different approaches (observation and model) the process described in section 2.5.6 was used.

The new phenomenon that is observed here is the exceptional windy day W1 with low flow (𝑄 < 0.18𝑄 𝑏𝑓 ) which is followed by a flood (𝑄 > 𝑄 𝑏𝑓 ) F7. During this wind event, almost no wood flux was detected at the video monitoring station (only 2 m 3 ). Then it is observed that in the following flood, the threshold of wood motion decreased to 0.2𝑄 𝑏𝑓 (95 m 3 /s). Table II-3 also presents the critical threshold of motion for all events either by the field observation or by the model. This table confirms that the threshold of wood motion is almost at 60% of the 𝑄 𝑏𝑓 except as a result of exceptional antecedent conditions (F7). In addition to the fraction of detected wood pieces, the time interval can affect the detection of some short events like wood pulses. By selecting an appropriate time interval, the wood pulse can be defined qualitatively as the delivery of large amount of wood in a short time period (in the order of minutes). A flood hydrograph can be characterized by several peaks. We observed that the second or the third peaks, even when more intense, carry lower amounts of wood (Table II-2). This result agrees with Moulin and Piégay (2004) who indicate that the deposited wood on floodplain from last event (such as: flood, wind and ice [START_REF] Boivin | The raft of the Saint-Jean River, Gaspé (Québec, Canada): A dynamic feature trapping most of the wood transported from the catchment[END_REF]) is transmitted by the first rising of water depth. In addition, Kramer et al. 2017 show that the sequence of peaks and the magnitude and characteristics of the rising limb of individual floods can decline the amount of wood during a flood. As it is seen in the Table II-2, more than 60% of wood pieces are carried out on the first peak and then, only 30~40% of wood pieces are observed. This decrease in the wood flux by increasing the peaks of the flood can be related to the rate of bank erosion. The first peak of hydrograph washes most of the woods along the river, it just deposits few wood fluxes near the bank as new bank erosion. There is also less green wood which is recruited by a new bank erosion process in the next peaks of hydrograph. Moulin and Piégay (2004) show that the wood flux during flood events is not independent from previous floods. Events F5 and F6 are the examples which happen after one year and two months from a big flood event respectively. F5 benefits from recent previous small floods which may have introduced some wood pieces that are flashed by F5. This event carries 5 times more wood pieces than F6 which occur right after F5 which may have less material available. Therefore, wood flux can be a combination of fresh material as well as in-channel stored material. This agrees with Ruiz-Villanueva et al. ( 2016a) which shows a lot of wooden material in Genissiat Dam spent time in the river before being delivered to the reservoir. Moreover, some other processes like exceptional wind events before a flood can play a role on wood delivery. Event F7 in this study is the example that carries the wood pieces provided by W1.

Discussions and conclusions

The link between flow pattern and the wood fluxes

This result indicates that during a windy period, pieces of wood are recruited into the river, but there is not enough flow velocity and depth for moving these wood pieces further downstream. Then as soon as water depth and the wetted area of the river starts to increase, the river washes away these wood pieces, regardless of the regular threshold of wood motion (0.6𝑄 𝑏𝑓 ). Therefore, while the wind is not directly related to the mobility of wood, it can decrease the threshold of motion and prepare wood material to be exported during the next flood. This result is the first example in which we were able to detect the effective role of a potential driver within the upper catchment.

A practical recommendation that derives from this improved understanding of wood mobilization is that recording can largely be initiated strictly as a result of flow discharge, for example by setting the camera to record only when 𝑄 exceeds 0.6𝑄 𝑏𝑓 , which would minimize the storage needs for videos while capturing by far the largest contributions to the annual wood flux. However, the effect of wind that causes wood transport at lower discharges needs to be more deeply explored using longer time series to explain wood flux differences between floods.

Continues modeling of wood fluxes

As it is described in section 2.5.5 a Random Forest model was used to model wood pieces during nighttime, when no wood piece is visible. Finally, concerning the third predictor, 𝑇 𝑄 was introduced as the input processes between floods. Other input processes between floods are also likely to be relevant for preparing wood for transport during floods. Here, these processes are lumped into the variable 𝑇 𝑄 , but greater understanding at the process scale may help to develop models that are more readily adapted for different catchments. Kramer et al. 2017 show the strong effect of this parameter on the pulses of wood exported from the Slave River, Canada. They showed the importance of flow history for estimating wood flux magnitude. In continue, Ghaffarian et al. (2020a) show that it is a significant parameter on the total amount of wood in rivers which has a logarithmic relation with wood flux. This logarithmic link was also confirmed in

Selecting an optimized framerate

There is always a trade-off between the temporal resolution of video and the recording and post-processing costs. Therefore, reducing the framerate can be another strategy to reduce recording storage. But in this case, we have to pay attention to the reduction of the detected pieces, so that by using, for example, framerate two times larger than the passing time, roughly 50% of wood pieces are As it is seen, on the Isere and Ain Rivers if the passing time exceeds 0.2 and 1 s the observer can detect all wood pieces while in both cases 𝑃𝑇 ≫ 1𝑠. Therefore, in Ghaffarian et al. (2020a), MacVicar and Piégay, (2012) and this work, all "detectable wood pieces on video frames" are detected.

To discuss about the Slave River, we need first to distinguish between timelapse photography and videography techniques. It is important to note that although time-lapse photography and video monitoring are basically the same approaches (photos are taken per unit time), time-lapse photography is simply a method on which to subsample wood flux, and missing data is expected and planned for, whereas video capture is a method to store and record the entire sample of wood flux.

Consequently, the condition when 𝑃𝑇 ≅ ∆𝑇 is essentially a transition zone from timelapse photography to video monitoring. This transition zone can be accompanied by double-counting one piece in two different sides of the field of view. This is because a piece might be the same piece, but due to some problems like the operator bias, lack uncertainty. As a practical recommendation, it is important to select an appropriate framerate for the camera, based on the scope of the study. For example, if the pattern of pulses or the source of wood pieces is important, the framerate should be large enough to continuously detect wood pieces, while if there is a limitation on storage or long-term data is needed it is recommended to decrease framerate.

In Figure II-11, increase of 𝑃𝑇 results in exponential increase of fraction of detected wood pieces which is governed by ∆𝑡 (Figure . This exponential link is actually a strength point for this model which means that the fraction of detected wood pieces is not so sensitive to the 𝑃𝑇, so we do not need to select an exact ∆𝑡 and it can be varied in the same order of magnitude.

Wood pulses

During our observations, it is seen that in some cases the wood flux is mobilized in a sharp pulse, which is typically accompanied by some large pieces of wood that may be recent tree falls or a jam suddenly mobilized. The clarity of these pulses in It can be hypothesized that; a wood pulse can potentially be a localized wood delivery. Presumably, in such cases of local mobilization, the source of wood could be close to the camera and so the wood would be tightly grouped in time. By contrast, the source of wood could be far upstream from the camera. In this case, the recruited pieces tend to clump up during transport over longer distances. This is because a wood piece will run into another one and then they are rafted and traveling together, this 'raft' or 'clump' then tends to attract other pieces that get stuck to it [START_REF] Braudrick | Dynamics of wood transport in streams: a flume experiment[END_REF]Kramer et al., 2017). Therefore, due to the dissipation, the wood pulse spreads out during transport in long distances. The pulses at the camera location would therefore be very spread out and come more or less regularly, which could mean that the inputs are random or that the distribution has been randomized by dissipation during transport. By contrast, on the falling limb, despite the bank erosion due to the decrease in the soil pore pressure, the flow might not be enough to transport this wood. Also, some wood pieces have already been deposited in the highest possible locations with other wood jams on the upstream floodplain (Ruiz-Villanueva et al., 2016b;[START_REF] Wohl | Distribution of large wood within river corridors in relation to flow regime in the semiarid western US[END_REF]. A careful analysis of wood flux pattern thus provides some potentially key insights about the processes preparing wood stock within reach (e.g., wind introducing wood all along the channel length).

CHAPTER III. Automated quantification of floating

wood pieces in rivers from video monitoring: a new software tool and validation.

Résumé

Abstract

Wood is an essential component of rivers and plays a significant role in ecology and morphology. It can be also considered as a risk factor in rivers due to its influence on erosion and flooding. Quantifying and characterizing wood fluxes in rivers during floods would improve our understanding of the key processes but is hindered by technical challenges. Among various techniques for monitoring wood in rivers, streamside videography is a powerful approach to quantify different characteristics of wood in the river, but past research has employed a manual approach that has many limitations. In this work, we introduce a new software for the automatic detection of wood pieces in rivers. We apply different image analysis techniques such as static and dynamic masks, object tracking, and object characterization to minimize false positive and missed detections. To assess the software performance, results are compared with manual detections of wood from the same videos. Key parameters that affect detection are assessed including surface reflections, lighting conditions, flow discharge, wood position relative to the camera, and the length of wood pieces. Preliminary results had a 36% rate of false positive detection, primarily due to light reflection and water waves, but postprocessing reduced this rate to 14%. The missed detection rate was 71% of piece numbers in the preliminary result, but post processing reduced this error to only 6.5% of piece numbers, and 13.5% of volume. The high precision of the software shows that it can be used to massively increase the quantity of wood flux data in rivers around the world, potentially in real time. The significant impact of post-processing indicates that it is necessary to train the software in various situations (location, timespan, weather conditions) to ensure reliable results. It is worth noting that the manual annotations in this work took more than one human-month labor. The presented software, coupled with an appropriate post processing step, performs a comparable task at real time (55 hr) on a standard desktop computer.

Introduction

Floating wood has a significant impact on river morphology [START_REF] Gurnell | Large wood and fluvial processes[END_REF][START_REF] Gregory | Ecology and management of wood in world rivers[END_REF][START_REF] Wohl | Floodplains and wood[END_REF][START_REF] Wohl | Wood and sediment storage and dynamics in river corridors[END_REF]. It is both a component of stream ecosystems and a source of risk for human activities (Comiti et al., 2006;[START_REF] Badoux | Damage costs due to bedload transport processes in Switzerland[END_REF][START_REF] Lucí A | Dynamics of large wood during a flash flood in two mountain catchments[END_REF]. The deposition of wood at given locations can cause a reduction of the cross-sectional area, which can both increase upstream water levels (and the risk for neighboring communities), and laterally concentrate the flow downstream, which can lead to damaged infrastructure [START_REF] Lyn | Debris accumulation at bridge crossings: laboratory and field studies[END_REF][START_REF] Lagasse | Effects of debris on bridge pier scour[END_REF][START_REF] Mao | The effects of large wood elements during an extreme flood in a small tropical basin of Costa Rica[END_REF][START_REF] Badoux | Damage costs due to bedload transport processes in Switzerland[END_REF]V. Ruiz-Villanueva et al., 2014d;De Cicco et al., 2018;[START_REF] Mazzorana | Assessing and mitigating large wood-related hazards in mountain streams: recent approaches: Assessing and mitigating LW-related hazards in mountain streams[END_REF]. Therefore, understanding and monitoring the dynamics of wood within a river is fundamental to assess and mitigate risk. An important body of work on this topic has grown over the last two decades, which has led to the development of many monitoring techniques [START_REF] Marcus | Mapping the spatial and temporal distributions of woody debris in streams of the Greater Yellowstone Ecosystem[END_REF]MacVicar et al., 2009a;[START_REF] Macvicar | Implementation and validation of video monitoring for wood budgeting in a wandering piedmont river, the Ain River (France)[END_REF][START_REF] Benacchio | Automatioc imagery analysis to monitor wood flux in rivers[END_REF]Ravazzolo et al., 2015;Ruiz-Villanueva et al., 2018;Ghaffarian et al., 2020;Zhang et al., 2020)and conceptual and quantitative models [START_REF] Braudrick | When do logs move in rivers?[END_REF][START_REF] Martin | Patterns of Instream Wood Recruitment and Transport at the Watershed Scale[END_REF][START_REF] Abbe | Patterns and processes of wood debris accumulation in the Queets river basin, Washington[END_REF][START_REF] Gregory | Ecology and management of wood in world rivers[END_REF][START_REF] Seo | Scale-dependent controls upon the fluvial export of large wood from river catchments[END_REF][START_REF] Seo | Dynamics of large wood at the watershed scale: a perspective on current research limits and future directions[END_REF]. A recent review by Ruiz-Villanueva et al. ( 2016), however, argues that the area remains in relative infancy compared to other river processes such as the characterization of channel hydraulics and sediment transport.

Many questions remain open areas of inquiry including wood hydraulics, which is needed to understand wood recruitment, movement and trapping, and wood budgeting, where better parametrization is needed to understand and model the transfer of wood in watersheds at different scales.

In this domain, the quantification of wood mobility and wood fluxes in real rivers is a fundamental limitation that constrains model development. Most early works were based on repeated field surveys [START_REF] Keller | Effects of large organic material on channel form and fluvial processes[END_REF][START_REF] Lienkaemper | Dynamics of large woody debris in streams in old-growth Douglas-fir forests[END_REF], with more recent efforts taking advantage of aerial photos or satellite images [START_REF] Marcus | High spatial resolution hyperspectral mapping of in-stream habitats, depths, and woody debris in mountain streams[END_REF][START_REF] Lejot | Very high spatial resolution imagery for channel bathymetry and topography from an unmanned mapping controlled platform[END_REF][START_REF] Lassettre | Decadal changes in distribution and frequency of wood in a free meandering river, the Ain River, France[END_REF][START_REF] Senter | Large wood aids spawning Chinook salmon (Oncorhynchus tshawytscha) in marginal habitat on a regulated river in California[END_REF][START_REF] Boivin | Interannual kinetics (2010-2013) of large wood in a river corridor exposed to a 50-year flood event and fluvial ice dynamics[END_REF] to estimate wood delivery at larger time scales of 1 year up to several decades. Others have monitored wood mobility once introduced by tracking wood movement in floods [START_REF] Jacobson | Transport, retention, and ecological significance of woody debris within a large ephemeral river[END_REF][START_REF] Haga | Transport and retention of coarse woody debris in mountain streams: An in situ field experiment of log transport and a field survey of coarse woody debris distribution: COARSE WOODY DEBRIS IN MOUNTAIN STREAMS[END_REF][START_REF] Warren | Dynamics of large wood in an eastern US mountain stream[END_REF]. Tracking technologies such as active and passive

Radio Frequency Identification transponders (MacVicar et al., 2009;[START_REF] Schenk | Large wood budget and transport dynamics on a large river using radio telemetry[END_REF]or GPS emitters and receivers (Ravazzolo et al., 2015b) can improve the precision of this strategy. To better understand wood flux, specific trapping structures such as reservoirs or hydropower dams can be used to sample the flux over time interval windows (Moulin and Piégay, 2004;[START_REF] Seo | Factors controlling the fluvial export of large woody debris, and its contribution to organic carbon budgets at watershed scales[END_REF]Turowski et al., 2013).

Accumulations upstream of a retention structure can also be monitored where they trap most or all of the transported wood, as was observed by [START_REF] Boivin | The raft of the Saint-Jean River, Gaspé (Québec, Canada): A dynamic feature trapping most of the wood transported from the catchment[END_REF] to

get wood flux at one flood event or annual scale. All these approaches allow the assessment of wood budget and the in-channel wood exchange between geographical compartments within a given river reach and over a given period [START_REF] Schenk | Large wood budget and transport dynamics on a large river using radio telemetry[END_REF][START_REF] Boivin | The raft of the Saint-Jean River, Gaspé (Québec, Canada): A dynamic feature trapping most of the wood transported from the catchment[END_REF][START_REF] Boivin | Interannual kinetics (2010-2013) of large wood in a river corridor exposed to a 50-year flood event and fluvial ice dynamics[END_REF].

For finer scale information on the transport of wood during flood events, video recording of the water surface is suitable for estimating instantaneous fluxes and size distributions of floating wood in transport (Ghaffarian et al., 2020). Classic monitoring cameras installed on the river bank have main advantages such that these cameras are cheap, and relatively easy to acquire, setup and maintain. As is seen in Table 1 wide range of sampling, spatial and temporal scales have been used in different studies to assess the wood budget in rivers. MacVicar and Piégay (2012) and Zhang Piégay, 2012;[START_REF] Senter | Wood export prediction at the watershed scale[END_REF]. Critically for this approach, the time it takes for the researchers to extract information about wood fluxes has limited the fraction of the time that can be reasonably analyzed. Given the outdoor location for the camera, the image properties depend heavily on lighting conditions (e.g. surface light reflections, low light, ice, poor resolution or surface waves) which may also limit the accuracy of frequency and size information [START_REF] Muste | Large-scale particle image velocimetry for measurements in riverine environments[END_REF]MacVicar et al., 2009a). In such situations, simpler metrics such as a count of wood pieces, a classification of wood transport intensity, or even just a binary presence/absence may be used to characterize the wood flux [START_REF] Boivin | Interannual kinetics (2010-2013) of large wood in a river corridor exposed to a 50-year flood event and fluvial ice dynamics[END_REF]Kramer et al., 2017). A fully automatic wood detection and characterization algorithm can greatly improve our ability to exploit the vast amounts of data on wood transport that can be collected from streamside video cameras. From a computer science perspective, however, automatic detection and characterization remain challenging issues. In computer vision, detecting objects within videos typically consists of separating the foreground (the object of interest) from the background [START_REF] Roussillon | Automatic computation of pebble roundness using digital imagery and discrete geometry[END_REF]Cerutti et al., 2011Cerutti et al., , 2013)). The basic hypothesis is that the background is relatively static and covers a large part of the image, allowing it to be matched between successive images. In the riverine environments, however, such an assumption is unrealistic because the background shows a flowing river, which can have rapidly fluctuating properties [START_REF] Ali | Unsupervised Video Analysis for Counting of Wood in River during Floods[END_REF]. Floating objects are also partially submerged in water that has high suspended material concentrations during floods, making them only partially visible (e.g. a single piece of wood may be perceived as multiple objects) (MacVicar et al., 2009). Detecting such an object in motion within a dynamic background is an area of active research [START_REF] Ali | Space-time spectral model for object detection in dynamic textured background[END_REF][START_REF] Ali | Adding a rigid motion model to foreground detection: application to moving object detection in rivers[END_REF]Lemaire et al., 2014;[START_REF] Ruiz-Villanueva | Wood density assessment to improve understanding of large wood buoyancy in rivers[END_REF][START_REF] Benacchio | A new methodology for monitoring wood fluxes in rivers using a ground camera: Potential and limits[END_REF]. Accurate object detection typically relies on the assumption that objects of a single class (e.g. Faces, bicycles, animals, etc.) have a distinctive aspect or set of features that can be used to distinguish between types of objects. With the help of a representative dataset, machine Learning algorithms aim at defining the most salient visual characteristics of the class of interest [START_REF] Lemaire | Automatically monitoring driftwood in large rivers: preliminary results[END_REF]Viola and Jones, 2006). When the objects have a wide intra-class aspect range, a large amount of data can compensate by allowing the application of deep learning algorithms [START_REF] Gordo | Deep image retrieval: Learning global representations for image search[END_REF][START_REF] Liu | Deep learning for generic object detection: A survey[END_REF]. To our knowledge, such a database is not available in the case of floating wood.

The camera installed on the Ain River in France has been operating more or less continuously for over 10 years and vast improvements in data storage mean that this data can be saved indefinitely [START_REF] Zhang | Video monitoring of in-channel wood fluxes: critical events, flux prediciton and sampling window[END_REF]. The ability to process this image database to extract the wood fluxes allows us to integrate this information over floods, seasons and years, which would allow us to significantly advance our understanding of the variability within and between floods over a long time period. An unsupervised method to identify floating wood in these videos by applying intensity, gradient and temporal masks was developed by [START_REF] Ali | Unsupervised Video Analysis for Counting of Wood in River during Floods[END_REF] and [START_REF] Ali | Wood detection and tracking in videos of rivers[END_REF]. In this model, the objects were tracked through the frame to ensure that they followed the direction of flow. An analysis of about 35 minutes of the video showed that approximately 90% of the wood pieces was detected (i.e. about 10% of detection were missed), which confirmed the potential utility of this approach. An additional set of false detection related to surface wave conditions amounted to approximately 15% of the total detection. However, the developed algorithm was not always stable and was found to perform poorly when applied to a larger data set.

The objectives of the presented work are to describe and validate a new algorithm and computer interface for quantifying floating wood pieces in rivers. First, the algorithm procedure is introduced to show how wood pieces are detected and characterized. Second, the computer interface is presented to show how manual annotation is integrated with the algorithm to train the detection procedure. Third, the procedure is validated using data from the Ain River. The validation period occurred over six days in January and December 2012 where flow conditions ranged from ~400 𝑚 3 /𝑠 , which is below bankfull discharge but above the wood transport threshold, to more than 800 𝑚 3 /𝑠 . The developed algorithm can be used to characterize wood pieces for a large image database at the study site. Future applications of this approach at a wide range of sites should lead to new insights on the variability of wood pieces at the reach and watershed scales in world rivers.

Methodological procedure for automatic detection of wood

The algorithm for wood detection comprises a number of steps that seek to locate objects moving through the field of view in a series of images and then identify the objects most likely to be wood. The algorithm used in this work modifies the approach described by [START_REF] Ali | Wood detection and tracking in videos of rivers[END_REF]. The steps work from a pixel to image to video scale, with the context from the larger scale helping to assess whether the information at the smaller scale indicates the presence of floating wood or not. In a still image, a single pixel is characterized by its location within the image, its color and its intensity. Looking at its surrounding pixels, on an image scale, allows that information to be spatially contextualized. Meanwhile, the video data adds temporal context, so that previous and future states of a given pixel can be used to assess its

Wood probability masks

In the first step, each pixel was analyzed individually and independently. The static probability mask answers the question "is one pixel likely to belong to a woodblock, given its color and intensity?". The algorithm assumes that the wood pixels can The second mask, dynamic probability, outlines each pixel's recent history. The corresponding question is: "is this pixel likely to represent a woodblock now, given its past and present aspects?". Again, this step is based upon a simple observation made on our database: it is assumed that a wood pixel is systematically darker than a water pixel. Depending on lighting conditions like shadows cast on water or waves, water pixels can be as dark as wood pixels. However, pixels displaying successively water then wood tend to become immediately and significantly darker, while pixels displaying wood then water tend to become significantly lighter. Meanwhile, pixels that keep on displaying wood tend to be rather stable. Thus, we proposed to assign On a probability map, a pixel value ranges from 0 (likely not wood) to 1 (likely wood).

The temporal mask value for a pixel at location (𝑥, 𝑦) and at time 𝑡 is 𝑃 𝑇 (𝑥, 𝑦, 𝑡)= 𝐻(∆ 𝑡 , 𝐼) + 𝑃 𝑇 (𝑥, 𝑦, 𝑡 -1). We apply a threshold to the output of 𝑃 𝑇 (𝑥, 𝑦, 𝑡) so that it always stays within the interval [0,1]. The idea is that a pixel that becomes suddenly and significantly darker is assumed to be likely wood. 𝐻(∆ 𝑡 , 𝐼) is such that under those conditions, it increases the pixel probability map value (parameters 𝜏 and 𝛽 ). A pixel that becomes lighter over time is unlikely to correspond to wood (parameter 𝛼). A pixel which intensity is stable and that was previously assumed to be wood shall still correspond to wood, while a pixel which intensity is stable and which probability to be wood was low is unlikely to represent wood now. A small decay factor (𝛿 ) was introduced in order to prevent divergence (in particular, it prevents noisy areas from being activated too frequently). The final wood probability mask is created using a combination of both the static and dynamic probability masks. Wood objects thus had to have a combination of the correct pixel color and the expected temporal behavior of water-wood-water color.

The masks were combined assuming that both probabilities are independent, which allowed us to use the Bayesian probability rule in which the probability masks are simply multiplied, pixel by pixel, to obtain the final probability value for each pixel of every frame.

Wood object identification and characterization

From the probability mask it is necessary to group pixels with high wood probabilities into objects and then to separate these objects from the background to track them through the image frame. For this purpose, pixels were classified as highor low-probability based on a threshold applied to the combined probability mask.

Then, the high-probability pixels were grouped into connected components (that is, small, contiguous regions on the image) to define the objects. At this stage, a pixel size threshold was applied on the detected objects and the bigger objects were generally the most likely it is to represent a woody object on the water surface (Figure III-4.a the big white region at the middle). A number of smaller components were often related to non-wood objects, for example waves and reflections, or noise from the camera sensor or data compression.

In the next level, movement direction and velocity were used as filters to distinguish real objects from the false detections. The question here is, "is this object moving through the image frame the way we would expect floating wood to move?".

After extracting the objects that are most likely to be a wood piece by applying a pixel size threshold, the spatial and temporal behavior of components were analyzed. First, to deal with partly immersed objects, we associated connex components within frames, based on a threshold on the distance separating them. Second, as a primitive tracker for wood objects, we associated connex components between successive frames as it is shown in Figure b. If a component could be tracked on several frames, and if its motion was compatible with a motion that was expected from driftwood, it was classified as a wood object. In our case, tracking wood is rather difficult for classical object tracking approaches in computer vision: the background is very noisy, the acquisition frequency is low and the objects appearance is highly variable due to temporarily submerged parts and highly variable 3D structures. With that respect, we preferred to use very basic rules for this step. They are based on loose expectations, in terms of pixel intervals, on the motions of the objects, depending on the camera location and the river properties. How many pixels from left to right when proceeding to the next frame? How many pixels from top to bottom? How many appearances are required for a block? How many frames can we miss because of temporary immersions? Thus, computational cost remains low and is real-time compatible, while the software keeps providing rather efficient results. The final step was to characterize the objects. using this algorithm an object (be it annotation or detection) appears several times as a sequence of occurrences.

Therefore, it is needed to pick one single occurrence or use a statistic tool to retrieve characterization data. Here among different detections for the same piece the biggest occurrence, in terms of pixels number, was considered as the most representative state. It is assumed that a bigger number of pixels corresponds to a better or a fuller view (the object is less immersed than on other occurrences, for instance). When annotating the flood, we tend to pick the view where the object covers the largest area. Thus, in this paper, every object was characterized by its size and its location, using those of its biggest occurrence.

Image rectification

Warping the images according to the perspective transform results in important quality loss. On warped images, areas of the image farther to the camera provide little detail and are overall very blurry and non-informative. Therefore, given the topology of our images, image rectification is necessary for calculating wood length, velocity, volume and other characteristics. To do so, first, the fisheye lens distortion was corrected. A fisheye lens distortion is a characteristic of the lens that produces visual distortion intended to create a wide panoramic or hemispherical image. This effect has been corrected by a standard Matlab process using the ComputerVisionToolbox TM .

Ground-based cameras have also an oblique angle of view, which means that pixel to meter correspondence is variable and images should be orthorectified before analysis [START_REF] Muste | Large-scale particle image velocimetry for measurements in riverine environments[END_REF]. Orthorectification refers to the process by which image distortion is removed and the image scale is adjusted to match the actual scale of the water surface. Translating from pixels to actual metric measurements required us to make the following assumptions: our camera follows the pinhole camera model, and the river can be assimilated to a plane of constant altitude. Under such conditions, it is possible to translate from pixel coordinates to a metric 2D space thanks to a perspective transform assuming a virtual pinhole camera on the image and estimating the position of the camera and its principal point (center of the view). An blue points). To achieve better accuracy, it is advised to acquire additional points and to solve the subsequent over-determined system with the help of a Least Square Regression (LSR). Robust estimators such as RANSAC can provide useful to prevent acquisition noise. After identifying the virtual camera position, the perspective transform matrix then becomes parameterized with the water level. Handling the variable water level was performed for each piece of wood, by measuring the relative height between the camera and the water level at the time of detection.

User interface

The software was developed to provide a single environment for the analysis of wood pieces on the surface of the water from streamside videos. It consists of four distinct modules: Detection, Annotation, Learning, and Performance. The home screen (see Figure allows the operator to select any of these modules. From within a module, a menu bar on the left side of the interface, allows operators to switch from one module to another. In the following, the operation of each of these modules will be presented.

Detection

The detection module is the heart of the software. This module allows, from The detection process is intended to work as a video file player. The idea is to load a video file (or a stream url), and to let the software read the video until the end.

When required, the reader generates a visual output, showing how the masks behave by adding color and information to the video content (see Figure 7). A small textual display area shows the frequency of past detections. Meanwhile, the software generates a series of files summarizing the positive outputs of the detection. They consist in YAML and CSV files, as well as image files to show the output of different masks, the original frames, etc. A configuration tab is available, and provides many parameters organized by various categories. The main configuration tab, is divided in seven parts. The first part is dedicated to the general configurations such as frame skipped between each computation, defining the useless parts of the frame by ignoring some pixels from each side or defining a patch where there is no wood there (e.g. bridge pier or river bank). In the second and third parts, the parameters of the intensity and temporal masks are introduced (see section 3.

Annotation

As mentioned in Sec. 2, the detection procedure requires the classification of pixels and objects into wood and non-wood categories. To train and validate the automatic detection process, a ground-truth or set of videos with manually annotations are required. Such annotations can be performed through many different manners. For example, objects can be identified with the help of a bounding box or [START_REF] Zhang | Video monitoring of in-channel wood fluxes: critical events, flux prediciton and sampling window[END_REF]. It is also possible to sample wood pixels without specifying instances or objects, or to sample pixels within annotated objects. Finally, objects and/or pixels can be annotated multiple times in a video sequence to increase the amount and detail of information in such an annotation database. However, such annotation becomes extremely time-consuming and it is not clear how much information will be required to obtain reliable results for different lighting conditions, camera parameters, wood properties, and river hydraulics.

Given that the tool is meant to be as flexible as possible, the annotation tool was The principle of this module is to associate annotations with the frames of a given video. Annotating a piece of wood is like drawing its shape, directly on a frame of the video, using the drawing tools provided by the module. It is possible to add a text description to each annotation. Each annotation is linked to a single frame of the video; however, a frame can contain several annotations. An annotated video, therefore, consists of a video file, as well as a collection of drawings, possibly with textual descriptions, associated with frames. It is possible to link annotations from one frame to another to signify that they belong to the same piece of wood. These data can be used to learn the movement of pieces of wood in the frame.

Learning

The Learning module makes it possible, from manual annotation data, to determine the optimal parameters (described in Sec. 2) for the automatic detection of pieces of wood. The principle is to load a series of manual annotation data and to start learning based on this data. The user interface of this module is presented in powerful in the event of evaluating the algorithm performances, and eventually refining its parameters with the help of some machine learning technique. However, it requires an extensive annotation work.

Performance assessment

To assess the performance of the automatic detection algorithm, we used a set of videos from the Ain River in France that were both comprehensively manually annotated and automatically analyzed. According to the data annotated by the observer, the performance of the software can be estimated in different conditions: (i, ii) light and darkness of the frame, (iii) daylight, (iv) flow discharge, (v, vi) wood X, Y position, (vii) its distance from the camera and (viii) its length. If for example software detects 1 cm piece 100 m far from the camera, there is a high probability that it is a wring detection. Therefore, knowing the performance of the software in different conditions, it is possible to develop some rules to enhance the quality of data. The positive point of this approach is that all 8 parameters introduced here are accessible easily in the detection process. In this section the monitoring details and annotation methods are introduced before the performance of the software is evaluated by comparing the manual annotations with the automatic detections.

Material and methods

Monitoring site and annotation

The Ain River is a piedmont river with a drainage area of 3630 𝑘𝑚 2 at the gauging station of Chazey-sur-Ain, with a mean flow width of 65 m, a mean slope of 0.15%, and a mean annual discharge of 120 𝑚 3 /𝑠 . The lower Ain River is characterized by an active channel shifting within a forested floodplain [START_REF] Lassettre | Decadal changes in distribution and frequency of wood in a free meandering river, the Ain River, France[END_REF]. An AXIS221 Day/Night TM camera with a resolution of 768 × 576 pixels was The survey period on this river was during 2012 from which two periods, from 1 st to 7 th January and in 15 th December was selected for annotation. A range of discharges from 400 𝑚 3 /𝑠 to 800 𝑚 3 /𝑠 occurred during these periods (Figure III-11), which is above a previously observed wood transport threshold of ~300 𝑚 3 /𝑠 (MacVicar and Piégay, 2012). On January 3 rd and 5 th, a spider was active in front of the camera, which prevented a good video recording and these days were therefore removed from the database. Detection was only possible during the daylight. A summary of automated and manual detections for the six days is shown in Table III-1.

Assessment Methodology

Ghaffarian et al., (2020), [START_REF] Zhang | Video monitoring of in-channel wood fluxes: critical events, flux prediciton and sampling window[END_REF]show that the wood discharge can be measured from flux. Therefore, here an object level (see section 3.5.4) was applied to annotate wood pieces. This approach stays relevant for the aim of our whole study, which is being able to sense driftwood pieces. Comparing automatically occurrences of objects and detected pixels, with a set of annotated data raises three main options:

• True Positive (𝑇𝑃): an object was correctly detected and is available on both detection and annotation database

• False Positive (𝐹𝑃): an object was incorrectly detected, and is available only on the detection database.

• False Negative (𝐹𝑁): an object is not available on the detection database, while it figures in the annotations database.

Determining an object as a True Positive (𝑇𝑃) means that we have to witness a co-occurrence of it into both the detections and the annotations databases. In the remaining of this paper, we set the co-occurrence threshold when at least 50% of detection and an annotation bounding box areas are common, or when at least 90% of a detection bounding box area is included in its annotation counterpart.

In addition to the bare number of 𝑇𝑃𝑠, 𝐹𝑃𝑠, and 𝐹𝑁𝑠, we add the recall and precision rates as measures of the performances of the application.

• The Recall Rate (𝑅𝑅) is the fraction of relevant objects that are detected (in opposition to False Negative, non-detected objects). Its mathematical formula is 𝑇𝑃/(𝑇𝑃 + 𝐹𝑁).

• The Precision Rate ( 𝑃𝑅 ) is the fraction of detected objects that are relevant (in opposition to false alarms). Its mathematical formula is 𝑇𝑃/(𝑇𝑃 + 𝐹𝑃)

The higher the 𝑃𝑅 and the 𝑅𝑅 are, the more accurate our application is. However, both rates tend to interact. It is possible to design an application that displays a very high 𝑅𝑅 (which means that it doesn't miss many objects), but suffers from a very low 𝑃𝑅 (it outputs a high amount of inaccurate data), and vice-versa. Thus, we have to find a balance that seems relevant in our application case.

Factors used to understand variation in performance

It was well known from previous manual efforts to characterize wood pieces and develop automated detection tools that it is easier to detect certain wood objects than others. In general, the ability to detect the wood objects in the dynamic background of a river in flood was found to vary with the amount and variability of the light, other weather conditions such as wind and rain, interference from other moving objects such as spiders, the size of the wood object, its position in the image frame, and the flow discharge. In this section, we describe and define the metrics that were used to understand the variability of the detection algorithm performance. Detection is also strongly affected by the frame 'roughness', defined here as the variation in light over small distances in the frame. The change in light is important for the recognition of wood objects, but light roughness can also occur when there is a region with relatively light pixels due to something such as reflection of the surface of the water, and dark roughness can occur when there is a region with relatively dark pixels due to something such as shadows from the surface water waves. Detecting wood is typically more difficult around light roughness, which results in false negatives, while the color-map of a darker surface is often close to that of wood, which results in false positives. Both of these conditions can be seen in Figure which is highlighted in Figure III-12.a. In general, the frame roughness increases in windy days or when there is an obstacle in the flow, such as downstream of the bridge pier in the current case. The light roughness was calculated for the current study by defining a light intensity threshold and calculating the ratio of pixels of higher value among the frame. The dark roughness is calculated in the same way, but in this case the pixels less than the threshold were counted. In this work thresholds equal to 0.9 and 0.4 were used for light and dark roughness, respectively.

The oblique view of the camera means that in the photography technique the distance that a wood piece is detected is another important factor in detection (Figure . However, the effect of distance on detection can be meaningful in relation with wood length, i.e. by going from near the camera toward the other bank due to the pixel size variation the shorter pieces of wood are not detectable (Ghaffarian et al., 2020). Moreover, if a piece of wood passes through a region with high roughness (Figure or amongst bushes or trees (Figure III-13 right hand side) it is more likely that the software is unable to detect it. In our case, one day detection was removed due to the presence of a spider in front of the camera. Flow discharge is another key variable in wood detection. Increasing flow discharge generally means that water levels are higher, which brings wood in the foreground of the image closer to the camera and can make small pieces of wood more visible, but it also reduces the angle between the camera position and pixels increases the vertical motion of the flow that can decrease the visible region of the wood. It also increases the flow velocity which results in more roughness in a frame.

Moreover, more suspended sediment is carried during high flow which can change water surface color. The flow discharge was extracted from the website (www.hydro.eaufrance.fr).

Detection performance

Following section 3.6.1.2, to evaluate the feasibility of the software it is important to first evaluate the 𝑇𝑃, 𝐹𝑃, and 𝐹𝑁 in an event which is automatically detected and then to evaluate both precision and recall rates. This section is dedicated to present these two steps. Table III-2 describes a summary of both annotation and detection.

On average the operator annotates around 2 times more wood pieces than the software. While the software only detects 29% of all floating objects (Recall rate), among detected objects 36% have been false detections (𝑃𝑅 = 64%). Our analysis shows that some of the parameters that were used to evaluate the performance of the automatic detection software have a strong correlation. The correlation between each pair of parameters was calculated (Table III-3). As shown, dark/light roughness, length/distance and discharge/time have a high correlation ( 𝐶𝑜𝑟𝑟. = 0.59, 0.46, 0.37 respectively). Thus, they are presented as a pair of parameters together. X/Y positions are presented together as the position of an object, and in-channel structures as well. It should be noted that though the correlation between time and dark roughness is higher than discharge/time but we used discharge/time as pair because discharge has a good correlation only with time.

Therefore, four pairs of parameters are defined and justified, including: (i) light and dark roughness, (ii) daytime and flow discharge, (iii) X, Y coordinates of detection position, and (iv) distance of detection as a function of piece length (Figure III-14, Table III-3). precise for small pieces of wood (less than the order of 1 m), and second there is an obvious link between wood length and the distance from the camera so that by increasing the distance from the camera, the software is precise only for larger pieces of wood.

To estimate the fraction of wood pieces that the software did not detect, the recall rate 𝑅𝑅 is calculated in different conditions and a linear interpolation was applied on 𝑅𝑅 as it is presented in Figure III-14, third column. As it is seen, frame roughness, daytime, and flow discharge do not play a significant role in the recall rate (Figure III-14. C, f). There is, however, a slight effect of dark roughness, so that when the dark roughness of the frame is important (many shadows on the surface) the software detects many patches amongst which some are 𝑇𝑃. However, in this range of dark roughness software detects small number of wood pieces (Figure results in not accurate 𝑅𝑅. By contrast, the wood position and its length are the key parameters on the 𝑅𝑅. The 𝑅𝑅 is much better on the left side of the frame than on the right side. It can be because the operator's eye needs some time to detect a piece of wood, so most of the annotations are on the right side of the frame (Figure

III-14.i).
Having a small number of detections on the left side of the frame results in the small value of 𝐹𝑁 which followed by high values of 𝑅𝑅 in this region (𝑅𝑅 = 𝑇𝑃/(𝑇𝑃 + 𝐹𝑁). Therefore, while the position of detection plays a significant role in the recall rate, it is completely dependent on the operator bias. Finally, according to Figure III-14.l, 𝑅𝑅 is fully dependent on piece length so that for the lengths at the order of 10 m (𝐿 = 𝑂(10)) 𝑅𝑅 is very good. By contrast when 𝐿 = 𝑂(0.1~1) the 𝑅𝑅 is too small. there is a transient region when 𝐿 = 𝑂(1) which is slightly depends on the distance from the camera. One can say, the wood length is the most crucial parameter that affects the recall rate independent of the operator annotation.

Table III-3 shows why instead of simple histograms, pair of parameters were used and as it is seen in Figure III-14 second and third columns, the parameters are more meaningful when we use them in pairs. For example, it is possible to say the software works best in the morning, specifically if the flow discharge exceeds 600 𝑚 3 /𝑠, or that the software can detect the pieces far from the camera only if the pieces are large enough. In summary, the software shows different precision and recall rates in different conditions. Therefore, it is important to evaluate the software in different conditions to know when it is possible to trust the software and when not.

Besides, it is seen that the software is very sensitive to the piece length so that for very large woods, software works very well, while there are many small pieces 𝐿 = 𝑂(0.1 ~1) that the software could not detect them (𝐹𝑃𝑠).

Post-processing

This section is separated into two main parts. First, we show how to improve the precision of the software by a posteriori distinction between 𝑇𝑃 and 𝐹𝑃 . After removing 𝐹𝑃𝑠 from the detected pieces, in the second part, we show the process to predict the annotated data that software could not detect them i.e. false negatives.

Precision improvement

We first run the software and detect pieces, as described in section 3.5.1. Then for each piece, the eight key parameters described in section 3.6.1.3 were extracted.

Thus, knowing the position of the object in each sub-figure of Figure III-14, the total precision for each object would be the average of four precisions. Finally, if the total 𝑃𝑅 is more than 50% the object will be categorized as 𝑇𝑃 otherwise it is considered as 𝐹𝑃. It should be noted that following a Bayesian approach and depending on the propose of study, this 50% threshold can be changed for one or all four pairs of parameters, so that if only the wood pieces are interested even if 𝐹𝑃 increases significantly, this threshold can be increased and vice versa.

This process was used in two scenarios: (i) Cross-validation, by leaving one day out, calculating the precision matrices based on five other days, and apply these 𝑃𝑅 matrices on the leaved day. (ii) Total training, by using all database for calculating the precision matrices, and apply these 𝑃𝑅 matrices on the database. The results of both scenarios are presented in Table III -4. As is seen in this table, after post-processing in both scenarios, the software precision rises to 85% (85 -64 = 21% enhancement).

No significant differences are observed between two scenarios (Cross-validation /

Total training) which gives the confidence of using this process for new/not annotated events. It is interesting to note that the enhancements are not the same for different days (from 10 to 42%). In the cross validation, when one day is leaved out if the other days had the similar condition as the leaved day, the 𝑃𝑅 matrices are well trained and can highly distinguish between 𝑇𝑃 and 𝐹𝑃 (e.g. 2 nd Jan with 42% enhancement), while the 𝑃𝑅 matrices are blind if different conditions in the leaved day were unique (e.g. 15 th Dec with 10% enhancement). 1 𝐹𝑁 𝑝𝑝 denotes the false estimations of the precision matrices which results in missing some 𝑇𝑃.

2 𝑅𝑅 𝑝𝑝 denotes the recall rate of post processing which corresponds to 𝐹𝑁 𝑝𝑝 .

In this process, the precision matrices may also have a false estimation, i.e. they detect a real object as a false positive or vice-versa. These kinds of objects are categorized as post-processed false negatives 𝐹𝑁 𝑝𝑝 and their recall rate is 𝑅𝑅 𝑝𝑝 .

Based on Table III- or (1,3,4)) result in better precision and some cases (e.g. (1,2) or (1,3)) there is almost no difference between post-processed 𝑃𝑅 and the raw data. The reason that configurations like (2,4) or (1,3,4) with a better precision rate were not used here was that in these cases the post-processed recall rate RRpp was low (around 60%) meaning that by using these configurations many of true positives was removed.

Therefore, to have the best precision enhancement with maximum post-processed recall rate all 4 different precision matrices are used dark red scatters).

Modeling missed wood pieces based on the recall rate

Based on Table III-4 (Raw data) the software only detected 29% of data, which means that 71% of the wood pieces were missed. In the previous section, it was described how to enhance the precision of the software to be sure this 29% of total wood pieces are 𝑇𝑃𝑠. The following section is dedicated to describing how to model the rest of 71% missed pieces.

Based on Figure III-14, the software works pretty well for very large objects everywhere, while it could not detect the smaller pieces. Therefore, among eight key parameters, the wood length is the most important factor governing the recall rate.

Here, the idea is to identify a threshold length from which the software starts to On the Ain River by separating videos to 15 min segments, MacVicar and Piégay, (2012) and [START_REF] Zhang | Video monitoring of in-channel wood fluxes: critical events, flux prediciton and sampling window[END_REF] proposed the following equation for calculating wood discharge from the wood flux:

𝑄 𝑤 = 0.0086𝐹 1.24 (1)

Where, Qw is the wood discharge (𝑚 3 /15𝑚𝑖𝑛) and F is the wood flux (piece number/15 min). Using this equation, the total volume of wood is calculated based on and post-processed data (blue scatters) from the other hand. As it is seen while for the raw detection (red scatters) there is almost one order of magnitude underestimation for the total volume of wood, after processing the detected data (blue scatters), the results are very similar to what operator annotates. In total 125

𝑚 3 wood was annotated by the operator; the software detects automatically 46 𝑚 3 (contain 𝐹𝑃𝑠) while after post-processing 142 𝑚 3 wood is estimated in the river which results in 13.5% relative error. Note that, there is a slight difference for the very small volumes of woods (4, 7 Jan), but in practical works these values are negligible.

Conclusion

Here, we present new software for the automatic detection of wood pieces on the river surface. After presenting the corresponding algorithm and the user interface, an example of automatic detection was presented. Moreover, we annotate 6 days of flood events that are used to first, check the performance of the software and second reproduce the data that are possibly missed by the software.

To evaluate the performance of the software, we used precision and recall rates.

The automatic detection software detects around one third of all annotated wood pieces with 64% precision rate. Then using the operator annotations as the ultimate goal, the post-processing part was applied to extrapolate data extracted from detection results, aiming to come as close as possible to the annotations. It is shown that using four pair of key factors: (i) light and dark roughness of the frame, (ii) daytime and flow discharge, (iii) X, Y coordinates of detection position, and (iv) distance of detection as a function of piece length, it is possible to detect false positives and increase the software precision to 86% from one hand, and model the missed wood pieces (false negatives) from the other hand, to increase the recall rate results in relative error of 6.5% for piece number and 13.5% for wood volume. The good agreement between cross-validated and total trained models confirms that this software coupled with an appropriate post-processing has a high potential to be used for the future flood events.

This work shows the feasibility of the detection software to detect wood pieces automatically which significantly reduces the annotation costs. It can be a powerful tool for researchers as well as river managers to quantify the amount of wood in rivers. To develop this work, the next step would be to apply this software in other rivers to increase our experience in different contexts and enhance its accuracy. [START_REF] Montgomery | Geomorphic effects of wood in rivers[END_REF][START_REF] Wilcox | Flow resistance dynamics in step-pool stream channels: 1. Large woody debris and controls on total resistance: FLOW RESISTANCE DYNAMICS, 1[END_REF][START_REF] Battin | Biophysical controls on organic carbon fluxes in fluvial networks[END_REF][START_REF] Bocchiola | Hydraulic characteristics and habitat suitability in presence of woody debris: a flume experiment[END_REF][START_REF] Gurnell | 11 Wood in fluvial systems[END_REF][START_REF] Welber | Morphodynamics and driftwood dispersal in braided rivers[END_REF][START_REF] Wohl | Floodplains and wood[END_REF][START_REF] Wohl | Wood and sediment storage and dynamics in river corridors[END_REF]. Alongside many positive effects, the wood must also be considered as a risk factor in terms of flooding and infrastructure damage [START_REF] Schmocker | Probability of drift blockage at bridge decks[END_REF][START_REF] Lassettre | Large woody debris in urban stream channels: redefining the problem[END_REF][START_REF] Ruiz-Villanueva | Reconstruction of a flash flood with large wood transport and its influence on hazard patterns in an ungauged mountain basin[END_REF]De Cicco et al., 2018;[START_REF] Mazzorana | Assessing and mitigating large wood-related hazards in mountain streams: recent approaches: Assessing and mitigating LW-related hazards in mountain streams[END_REF]. Consequently, many attempts have been made to quantify the amount of wood in rivers experimentally [START_REF] Lyn | Debris accumulation at bridge crossings: laboratory and field studies[END_REF][START_REF] Bocchiola | A flume experiment on the formation of wood jams in rivers[END_REF][START_REF] Ghaffarian | Experimental study of the transient motion of floats reproducing floating wood in rivers[END_REF]Ghaffarian et al., , 2019)), numerically [START_REF] Yin | Modelling the motion of cylindrical particles in a nonuniform flow[END_REF]Virginia Ruiz-Villanueva et al., 2014b;[START_REF] Persi | Large wood transport modelling by a coupled Eulerian-Lagrangian approach[END_REF][START_REF] Persi | Calibration of a dynamic Eulerian-lagrangian model for the computation of wood cylinders transport in shallow water flow[END_REF] and through field surveys [START_REF] Gurnell | Large wood and fluvial processes[END_REF][START_REF] Piégay | Public Perception as a Barrier to Introducing Wood in Rivers for Restoration Purposes[END_REF][START_REF] Wohl | River restoration[END_REF]Ruiz-Villanueva et al., 2016a;[START_REF] Piégay | Video-monitoring of wood flux: recent advances and next steps[END_REF].

The presence of wood in the riverine environment can be studied at different temporal and spatial scales using different monitoring techniques such as plastic tags [START_REF] Lenzi | Displacement and transport of marked pebbles, cobbles and boulders during floods in a steep mountain stream[END_REF][START_REF] Warren | Dynamics of large wood in an eastern US mountain stream[END_REF], passive or active radio frequency identifiers (RFID) (MacVicar et al., 2009) or GPS devices [START_REF] Ravazzolo | Displacement length and velocity of tagged logs in the tagliamento river[END_REF]. Thanks to new platforms such as kites, microlights, drones, and satellites [START_REF] Lejot | Very high spatial resolution imagery for channel bathymetry and topography from an unmanned mapping controlled platform[END_REF][START_REF] Carbonneau | Fluvial remote sensing for science and management[END_REF], airborne and spaceborne multispectral and hyperspectral imaging systems [START_REF] Marcus | Mapping the spatial and temporal distributions of woody debris in streams of the Greater Yellowstone Ecosystem[END_REF][START_REF] Marcus | High spatial resolution hyperspectral mapping of in-stream habitats, depths, and woody debris in mountain streams[END_REF][START_REF] Leckie | Automated mapping of stream features with high-resolution multispectral imagery[END_REF] and terrestrial or aerial Light detection and ranging (Lidar) [START_REF] Fleece | Modeling the Delivery of Large Wood to Streams with Light Detection and Ranging (LIDAR) Data1[END_REF][START_REF] Boivin | Using a terrestrial LIDAR for monitoring of large woody debris jams in gravel-bed rivers[END_REF], which are finding their way into riverine sciences, remote sensing is also widely used to monitor the amount of wood along rivers.

Among various remote sensing studies on wood mobility, usually expressed in meters per year, or per flood event, videography is a technique that presents data per second or hour. Stream-side videography provides high temporal-resolution data, which is useful for computing rates of transport and fine-scale relationships between wood and water discharges, using a camera that is located in a safe position from flooding on a riverbank [START_REF] Lyn | Debris accumulation at bridge crossings: laboratory and field studies[END_REF][START_REF] Muste | Large-scale particle image velocimetry for measurements in riverine environments[END_REF]MacVicar et al., 2009;[START_REF] Macvicar | Implementation and validation of video monitoring for wood budgeting in a wandering piedmont river, the Ain River (France)[END_REF][START_REF] Kramer | Estimating fluvial wood discharge using time-lapse photography with varying sampling intervals[END_REF][START_REF] Benacchio | A new methodology for monitoring wood fluxes in rivers using a ground camera: Potential and limits[END_REF]. During the recent years, there have been many advances on this technique such as:

measuring the volume of wood only by counting piece numbers (Ghaffarian et al., 2020a;[START_REF] Zhang | Video monitoring of in-channel wood fluxes: critical events, flux prediciton and sampling window[END_REF], estimating length distribution and transverse distribution of wood pieces (Ghaffarian et al., 2020a) or even predicting the pattern of wood recruitment in a river during flood events (with a threshold of motion at 60% of bankfull discharge -0.6Qbf-, much more recruitment during the rising limb of flood hydrograph rather than the falling limb, and a maximum value of wood recruitment at Qbf ; MacVicar and Piégay, 2012). Finally, automatic monitoring of wood with detection software [START_REF] Ali | Unsupervised Video Analysis for Counting of Wood in River during Floods[END_REF][START_REF] Ali | Space-time spectral model for object detection in dynamic textured background[END_REF][START_REF] Ali | Adding a rigid motion model to foreground detection: application to moving object detection in rivers[END_REF][START_REF] Lemaire | Automatically monitoring driftwood in large rivers: preliminary results[END_REF][START_REF] Benacchio | A new methodology for monitoring wood fluxes in rivers using a ground camera: Potential and limits[END_REF]Ghaffarian et al., 2020b) and continuous estimation of wood fluxes (piece number per time) even during the night, based on discharge descriptors [START_REF] Zhang | Video monitoring of in-channel wood fluxes: critical events, flux prediciton and sampling window[END_REF], make this technique a low cost, and highly efficient tool both for scientists as well as urban and river managers.

Video monitoring includes two principal tasks: recording and detection. Each of these tasks comes with some uncertainties. Limits in the camera's spatial and temporal resolution, as well as the problem of connection for remote cameras, or recording limitations, cause uncertainty in the results. However, there are some techniques to minimize these uncertainties (Ghaffarian et al., 2020a;[START_REF] Zhang | Video monitoring of in-channel wood fluxes: critical events, flux prediciton and sampling window[END_REF]. Wood detection itself (either automatic or manual) also can be tainted by uncertainty. To reduce uncertainties in the wood automatic detection software, Ghaffarian et al. (2020b) used manual annotations to train the software and increase its precision. However, there is the remaining question about the uncertainties due to the visual detection and video annotation by operators.

This study aims to estimate the human-based uncertainties in the video monitoring technique. These uncertainties are separated into two main categories: (i)

operator bias: the vision of different operators and their criteria for considering a patch on the video frames as a wood piece is different; (ii) the sampling strategy:

while an automatic detection software monitors the river surface during an infinite period, manually annotating wood piecesis time-consuming, so it is better to select only a part of the video for annotation. Therefore, after introducing our material and methods, we first estimate operator-related uncertainties and then introduce some ways to minimize these uncertainties base on the project requirements.

Study site

To generalize our observations, the data were collected from two different sites, at the study site, actively shifting so that a significant amount of wood is delivered by bank erosion. Along the study site, the wood influx has been estimated over several decades from the analysis of aerial photographs at 18 to 38 m 3 /km/yr [START_REF] Lassettre | Decadal changes in distribution and frequency of wood in a free meandering river, the Ain River, France[END_REF]. Floating wood was counted on the river at Pont de Chazey, where a stream gauge is maintained by a regional authority (

Materials and methods

Stream-side video camera

On the Ain river, wood pieces were monitored at Pont-de-Chazey gauging station using an A IS P221 Day/Night™ fixed network camera. The camera was located on the side of the river closest to the thalweg to provide a maximum resolution where the majority of wood pieces are observed. The camera elevation is 9.84 m above the base flow surface at a sufficiently wide-angle to afford a view of the entire river width during most periods. Ethernet connectivity enables the automatic transfer of recorded videos to a central server located at CNRS UMR 5600 -Environment Ville et Société, Site of École Normale Supérieure, Lyon, France.

Videos were recorded continuously at a frequency of 3~5 fps and 640 × 480 pixels.

On the Allier river, wood pieces were monitored at the Châtel-de-Neuvre gauging station using a Hikvision DS-2CD2T42WD-I8 6 mm fixed network camera. Videos

were recorded continuously at a frequency of 6 fps and a resolution of 1920×1080 pixels. As on the Ain river, the camera is positioned close to the thalweg, but installed on the bridge facing downstream at 11 m above the baseflow surface.

Using the manual algorithm, written in Matlab R2017a, video playback was stopped by the user when a piece of wood was observed. Both ends of wood pieces were annotated. The video was then advanced frame by frame and the endpoints of the wood were detected again.

Studied events

According to the main purposes of this study, two different strategies were applied for monitoring: (i) monitoring 15min video segments and (ii) monitoring continuous flood events. As it is shown in Table II-1, five different operators monitored and detected 11 video segments on the Ain River and 2 video segments on the Allier River, in order to assess operator bias. The 15min video segments were selected such that they correspond to different light conditions (e.g. sunshine or cloudy weather or different day times), in order to evaluate the operator visions in different conditions. Also, the amount of wood pieces varies greatly across videos (from 0 to more than 300). Moreover, in order to assess the effect of sampling strategies on estimations and uncertainty, 7 flood events were continuously monitored, i.e. a total video of around 37 days with more than 64000 detected pieces (Table IV-2).

Piece number and volume

Piece number and volume are two main characteristics of wood flux in the river.

While the first is the most readily available measure in video monitoring, the second also depends on the size of floating pieces. Hence the uncertainty in piece number results in some uncertainty in the estimated volume, but also selecting different pixels as the borders of a wood piece is another source of error for calculating the piece volume (Ghaffarian et al., 2020a).

To calculate the volume of each piece of wood, first, the video frames were rectified and the coordinates transformed from pixel to cartesian (Ghaffarian et al., 2020b). Having the metric coordinates, then the length distribution was calculated on both sites (Figure IV-3). The volume of each piece of wood was then calculated following the same approach proposed by Ghaffarian et al. (2020a) on the Ain River.

It should be noted that having (i) a similar wood length distribution (Figure IV-3), (ii) the same dominant species on both sites, and (iii) a good position for the camera (near the transverse position where most of the wood pieces are passing and with almost same pixel size distribution in both sites (Ghaffarian et al., 2020a)), comforts the use of the same relationship between length and volume on the Allier River.

Sampling time window (𝑻𝑾)

To study the effect of sampling on the accuracy of data acquisition, a flood event duration was divided into equal time intervals, each with duration ∆𝑡 (Figure IV-4).

Then among each ∆𝑡 period a sample time 𝑑𝑡 was selected. Therefore, the time window inside each time interval can be defined as 𝜏 = 𝑑𝑡 ∆𝑡 ⁄ . Then, if during the 𝑖 𝑡ℎ time window, 𝑛 𝑖 pieces of wood were detected, the corresponding total number of woods in this time interval is estimated to be 𝑛 𝑖 𝜏 ⁄ .

𝑁 𝑖 ̅̅̅ = ∫ 𝑛 𝑖 𝜏 ⁄ 𝑡 0 =∆𝑡-𝑑𝑡 𝑡 0 =0 𝑑𝑡 0 ∆𝑡 -𝑑𝑡 , (1)
Due to the time excluded from sampling (from the start of ∆𝑡 to 𝑡 0 and from 𝑡 0 + 𝑑𝑡 to the end of ∆𝑡 (bottom of Figure IV-4)), 𝑁 𝑖 ̅̅̅ can be different from the total piece number in each time interval based on the real observations (𝑁 𝑖 ), which is a source of error. The following equation was used to calculate this error inside the 𝑖 𝑡ℎ time interval:

∆𝑁 𝑖 * = | 𝑁 𝑖 -𝑁 𝑖 ̅̅̅ ∑ 𝑁 𝑖 𝑚 1 | (2)
where 𝑚 is the number of time intervals during a flood event. Therefore, this equation shows the difference between the total piece number in the 𝑖 𝑡ℎ time interval based on the real observations (𝑁 𝑖 ) and sampling strategy (𝑁 𝑖 ̅̅̅ ) which is normalized by total number of wood pieces during a flood event (∑ 𝑁 𝑖 𝑚 1

) based on the real observations. Then ∆𝑉 𝑖 * were calculated in the same way by substituting 𝑛 𝑖 with 𝑣 𝑖 as the detected wood volume in 𝜏.

Results

Uncertainty on piece number and volume

The reliability of each operator would be the first and the most important step for checking the operator bias. To do so, two elements were checked: wood length distribution and transverse wood distribution, both should be unique in a crosssection (Ghaffarian et al., 2020a). If the results of one of the operators were far from the reality (field measurements), it should be considered as an outlier and be removed from the database.

Sampling time window (TW)

Sampling a fraction of videos, reduce significantly monitoring costs. Following the method described in section 4. There is however, an error due to the time excluded from sampling. Following There are many studies showing that, flow discharge has a significant effect on wood mobility [START_REF] Macvicar | Implementation and validation of video monitoring for wood budgeting in a wandering piedmont river, the Ain River (France)[END_REF]Ghaffarian et al., 2020a;[START_REF] Kramer | Estimating fluvial wood discharge using time-lapse photography with varying sampling intervals[END_REF]. Therefore, to optimize the detection time based on flow discharge, ) was used as it is a unique parameter during one flood (see Eq 2). This gives the possibility to compare the errors at each time (correspond to a flow discharge) with the rest of flood.

Discussion

Bias of operator

Based on our observations on two different rivers, reliability of video monitoring directly relates to the size of wood pieces. In the case of small pieces (<1m), there is more than 70% uncertainty on piece number among different operators (Figure . This uncertainty should be added to many other uncertainties e.g., transverse distribution of pixel size which limits the detection far from the camera (Ghaffarian et al., 2020a), immersed parts of the object, and so on. By applying a truncation length, the uncertainty due to the operator bias drops down exponentially (e.g., from more than 20% when 𝐿 𝑡𝑟 = 0 to less than 5% for 𝐿 𝑡𝑟 = 1𝑚

while the lost volume is limited to 5%). However, there is always a constant error on wood volume due to the optical limitations (resolution, luminosity, etc.) and natural conditions (immersed part, flow roughness, high discharge or exceptional wind and so on (MacVicar and Piégay, 2012;Ghaffarian et al., 2020b, Zhang et al., 2020)).

The effect of wood length on the accuracy of acquired data was also observed by Ghaffarian et al. (2020a). They compare the results of the length distribution in two different conditions: (i) wood pieces pass just near the camera (on the Ain River) and (ii) wood pieces pass far from the camera (on the Isere River, France). Their comparison, reveals that while the length distribution for pieces more than 2m (𝐿 𝑡𝑟 > 2𝑚 ) was quite similar, it was totally different for small pieces ( 𝐿 𝑡𝑟 < 1𝑚 ). This confirms that first it is necessary to locate camera in the transient section where most of the wood pieces are passing and second using a truncation length is necessary for the accuracy of data. It should be noted that not only manual annotations affect the wood length, but also Ghaffarian et al. (2020b) showed the wood length is a crucial parameter in the accuracy of the automatic detection. They showed that by going away from the camera, this parameter becomes more and more important.

Sampling videos

Our observations showed that there is always a limitation of 𝜏 = 20% below which monitoring is not reliable. For 𝜏 > 20% however using a constant value for 𝜏might be a sub-optimal strategy since relative accuracy is higher for low discharges and lower for high discharges. Therefore, for sampling a video, defining an appropriate strategy is crucial. It should be noted that this method only can be used as a rough guess to limit the errors and find an optimum timeline for sampling and due to the big dispersion of the data, as presented in Figure IV-10, calculating an accurate timeline for sampling is not practical and impossible.

Conclusions

Here we studied two sources of uncertainties due to operator limitations in video monitoring technique; first operator bias, vision limits, and second video sampling or time limits. To assess these uncertainties, 7 flood events and 13 video segments were monitored by 5 different operators on two different rivers, Ain and Allier, France.

The results show that using a truncation length reduces the uncertainties on number of wood pieces significantly while total volume of wood remains almost constant. Regarding the video sampling, it is seen that selecting an appropriate

Summary

Characteristic of wood flux in critical flood events

In CHAPTER I, the wood flux is studied by a video monitoring technique on the Ain River in France. In total, seven flood events and one exceptional wind event were surveyed by detection procedure. In this section, we find that the deposited wood in river channel from the last flood event can be transmitted by the first rising of water depth. Thus, in multipeak floods, wood flux decreases by increasing the number of peaks. Wood flux also can be a combination of fresh material as well as in-channel stored material. Moreover, some other processes like exceptional wind events before a flood can play a role on wood delivery. While the wind is not directly related to the mobility of wood, it can decrease the threshold of motion and prepare wood material to be exported during the next flood. This result is the first example in which we were able to detect the effective role of a potential driver within the upper catchment. In the

Implementation and validation of wood automatic detection software

We annotated 7 days of flood events that are used to first, validate the performance of the software and second reproduce the data that are possibly missed by the software. Here, the application is evaluated by precision and recall rates. In section of software validation, the rates of precision and recall were 64% and 29%.

Both low rates of precision and recall mean the software needs improvement. Four key factors were used by researchers, such as: (i) light and dark roughness of the frame, (ii) daytime and flow discharge, (iii) X, Y coordinates of detection position, and

(iv) distance of detection as a function of piece length. The result of implementation upgrades the rates from 64 to 83% (precision), 29 to 96% (recall). It only has 12%

error on the total volume of wood estimated. The good agreement between crossvalidation and total training models confirms that this software coupled with appropriate post-processing has a high potential to be used for monitoring wood flux in riverine environments.

Evaluate observer-based and sampling uncertainties in video monitoring

In this study, researchers analyze two important sources of uncertainties coming from human limitations; first operator bias (vision limit), and second video sampling (time limit). The result indicates that the observer bias decline with the size of wood flux growing. Regarding the video sampling, it is seen that selecting an appropriate sampling timeline, reduces significantly monitoring time with a limited uncertainty. It should be noted that first the sampling time should be more than 20% and second, it is recommended to use a dynamic sampling time according to the flow discharge, rather than a constant value.

Outlooks

In continue, the following topics would further improve our understanding concerning the application of video monitoring in rivers.

Validating the automatic software in different conditions

Over the last years, the automatic detection software coupled with an appropriate post processing has been used to estimate wood flux and volume.

Though this software provided original results on the Ain River, France (see CHAPTER III), it is important to note that our findings show that the software is sensitive to different variables (e.g. light, discharge, day time, wood length and position). Therefore, to improve the performance of the software, it is necessary to extend its application on other riverine contexts.

Present wood study in China

In China, over 137 millions of unhabitants are under the risk of flooding [START_REF] Rubinato | Urban and river flooding: Comparison of flood risk management approaches in the UK and China and an assessment of future knowledge needs[END_REF]. Many intense flash flooding events have been recorded in the China during recent years, and as it is shown on Figure V-1, the wood mobility during a flood event can be considered as a risk factor in China. However, there is a lack of data regarding the effects of in-stream woods in Chinese rivers. Therefore, this field of study which is relatively new all around the world, can be an interesting and important subject for future researches.

Applying different steps of video monitoring technique together to calculate wood budgeting.

During recent years, there have been different works concerning the development of video monitoring.In continue, the present work can be assembled as a methodology to estimate wood budgets for future work. There is a camera on the Ain river which has been recorded data almost continously since 2007. These videos contain more than 30 flood events with some exceptional ones (e.g. Q10). As a future work, it would be interesting to apply all different techniques together based on this rich database.

Finding the source of wood pieces by analyzing wood pulses.

The wood pulses were monitored as observed in 1-minute intervals on the Ain River, France. As it is seen on Figure II-10, the wood pulse can deliver amount of wood pieces in a short time period. This phenomenon can influence wood flux, potentially indicating sudden wood delivery by an acting process (e.g. sliding, bank erosion…). We then hypothesis the source of wood pieces can be found by analyzing the duration and the value of these pulses. In the future work, a long-term and high frame-rate automatic video monitoring technique can be used to detect this phenomenon.

  questions à résoudre concernant cette technique. Par conséquent, dans cette étude, nous nous sommes concentrés sur trois objectifs majeurs. Dans un premier temps, nous avons étudié la relation entre flux de bois et débit d'écoulement afin de créer un modèle de prévision du flux de bois sur une période durant laquelle la caméra ne peut enregistrer le flux vidéo. Le bois dans les cours d'eau peut présenter des caractéristiques différentes lors de certains événements critiques, comme par exemple, lors de deux crues à plusieurs pics, le flux de bois sur le premier pic de débit est supérieur au second, et en cas d'inondation après une journée venteuse plus forte, le flux de bois peut être activé par l'élévation de l'eau. En outre, le deuxième objectif majeur était la mise en oeuvre et la validation de l'application d'un logiciel de détection automatique. Après avoir entrainé l'algorithme de détection, il est utilisé pour extraire automatiquement les flux de bois de manière continue. Le troisième objectif majeur était d'évaluer les incertitudes d'origine humaine dans la surveillance vidéo en raison de deux principaux facteurs. La détection manuelle est extrêmement fastidieuse et longue et nécessite ainsi d'envisager une stratégie d'échantillonnage des vidéos. Le second problème nécessitant une évaluation de l'incertitude est lié à la capacité souvent variable de l'opérateur à détecter les flottants, qui se traduit par un biais de mesure entre les différents opérateurs. Nous espérons que les résultats de cette thèse permettront de diffuser l'usage de la technique de surveillance vidéo fluviale à des fins pratiques. Mots clés : Dynamique fluviale ; Bois dans les rivières ; Surveillance vidéo en bord de rivière ; Détection automatique ; Incertitude ; Échantillonnage vidéo ; Biais de l'opérateur

Figure I- 1 : 5 Figure I- 2 :

 152 Figure I-1: Wood accumulations on the river channel, a) in Everett, USA, wood jam at the bridge on the Snohomish River (2019); b) In Soquel, USA, after January 1982 storm, logjam obstructed the bridge (Lassettre et al., 2012). .................. 5 Figure I-2: Illustration of variables used in wood budgeting analysis (Martin and Benda, 2001) .................................................................................................. 7 Figure I-3: Wood detection procedure showing: a) definition of a region of interest (ROI) based on a visual detection of wood including measurement of data and time from time stamp, b) precise location of end and side points to define the piece length, diameter, and first position, c) definition of second position after advancing a number of frames to allow calculation of velocity and angular velocity (MacVicar and Piégay, 2012). .......................................................... 11 Figure II-1. Study site at Pont de Chazey: a) Location of the Ain River course in France and location of the gauging and meteorological stations, b) camera position and its view angle in yellow, c) overview of the gauging station with the camera installation point, d) view of the River channel from the camera . 22 Figure II-2. Monitored events a) the daily mean discharge series monitored by MacVicar & Piégay (2012) (red lines) and monitored in this work (blue lines) on the discharge series from 2007 to 2014. b) The daily mean wind velocity series from 1977 to 2013. ............................................................................. 24 Figure II-3. Wood discharge as a function of wood flux ........................................... 27 Figure II-4. a) wood flux position on video frame b) link between video time laps ∆𝐭 and the passing time 𝑷𝑻 ........................................................................... 29 Figure II-5. Comparison between wood flux based on sampling (red) and continuous (blue) monitoring and flood hydrograph (black line). The gray boxes show the night time when video monitoring was impossible. Different symbol shapes show different events. ................................................................................... 31

Figure I- 1 ,

 1 Figure I-1, the main potential hazard damage is logjam at the bridges, it reduces flow openings, causes blockage and inundation of nearby areas, which lead to infrastructures collapsing during floods (Ruiz-Villanueva et al., 2014a; Wohl et al., 2016; De Cicco et al., 2018). By increasing resistance and obstructions to flow, large wood accumulations along one bank can deflect flow toward the opposite bank and accelerate bank erosion(Montgomery, 1997).

Figure

  Figure I-1: Wood accumulations on the river channel, a) in Everett, USA, wood jam at the bridge on the Snohomish River (2019); b) In Soquel, USA, after January 1982 storm, logjam obstructed the bridge (Lassettre et al., 2012).

Figure

  Figure I-2: Illustration of variables used in wood budgeting analysis (Martin and Benda, 2001)

  indicated a quantitative framework for evaluating fluvial transport of wood. The fluvial transport of wood has consistently identified three essential processes, namely wood recruitment (I), transport (QI and QO) and storage (D) (Figure I-2). Therefore, over 20 years of research into LW in streams, many different techniques were used to measure and monitor wood. These field data can lead the researchers to understand and quantify the three essential processes of wood transport in streams. Turowki et al. (2013) used a bedload traps which consist of an aluminum frame and the automatic basket samplers which consist of metal cubes with 1 m edges to sampling wood flux during flood event. After the samples were classified and ovendried, the mass of wood flux can be as a non-linear function of discharge on Erlenbach Steam, Switzerland. Turowki et al.(2013) also suggest that the wood flux export for all size fractions can be estimated from the volumes of LW debris exported in a large event, for example by measuring piece sizes trapped in a reservoir or by video monitoring the passage of wood pieces (e.g.,MacVicar and Piegay, 2012). To be more clear; while in the case of coarse wood, the wood discharge has a direct relation withQf (Turowski et al. 2013), for the large woodsMacvicar et al. (2012) found a big non-monotonic behavior at Qbf for large wood discharge.

Figure I- 3 :

 3 Figure I-3: Wood detection procedure showing: a) definition of a region of interest (ROI) based on a visual detection of wood including measurement of data and time from time stamp, b) precise location of end and side points to define the piece length, diameter, and first position, c) definition of second position after advancing a number of frames to allow calculation of velocity and angular velocity (MacVicar and Piégay, 2012).

  aim of the current study is to advance the video monitoring technique for wood flux measurement by addressing the following questions: i) Is wood transported only during floods (approximately two thirds of the bankfull discharge (MacVicar and Piégay, 2012)) and, if so, is the transport threshold discharge a function of antecedent conditions? ii) Can wood flux be modeled as a function of the flood hydrograph? and iii) Can we accurately estimate wood flux from sampling? The analysis uses the database assembled by MacVicar and Piégay (2012) of sampled periods during three floods on the Ain River but significantly adds to this work by performing a complete analysis of the daytime videos from four new flood events and one period with the low flow but an exceptional wind condition, which was then followed by a flood event. This much larger database comprises nearly 180 hours of annotated videos or around than 24,000 annotated wood pieces including 18 hours videos and 7800 wood pieces monitored by[START_REF] Macvicar | Implementation and validation of video monitoring for wood budgeting in a wandering piedmont river, the Ain River (France)[END_REF]. The windy day event with 35-year return period allowed us to address the first research question.

  Figure II-1.a) (MacVicar et al., 2009). The hydrograph shows a strong seasonal pattern, with low flows in the summer and most of floods occurring between October and April. Bed material sizes are gravel-cobble mix with a median size of 2.5 cm. The unvegetated channel width is 65 m in average at the study site, actively shifting so that significant amount of wood is delivered by bank erosion. Tree species established in the floodplain are a mix of soft and hardwood species dominated by black poplar (Populus nigra) that can reach up to 75 cm in diameter and 25 m in height (MacVicar and Piégay

(

  1949-2020) (see Figure II-2).

Figure II- 1 .

 1 Figure II-1. Study site at Pont de Chazey: a) Location of the Ain River course in France and location of the gauging and meteorological stations, b) camera position and its view angle in yellow, c) overview of the gauging station with the camera installation point, d) view of the River channel from the camera

  ). Three flood events from 2007 to 2008 were collected from[START_REF] Macvicar | Implementation and validation of video monitoring for wood budgeting in a wandering piedmont river, the Ain River (France)[END_REF], referred to herein as events F1 to F3 (Figure II-2.a, red lines). A video camera has been recorded video at this location more or less continuously from 2007. For the current work, four additional flood events between 2012 to 2014 were selected for study and sampling and are referred to as events F4 to F7 (Figure II-2.a, blue lines). The floods range from 578 m 3 /s (≅ 𝑄 𝑏𝑓 ) to 1020 m 3 /s (≅ 2𝑄 𝑏𝑓 ). Event F7 was selected to assess whether wind has an effect on the wood delivery because it occurred just two days after an exceptional windy day. The windy day occurred on December 24, 2013 and is referred to herein as event W1 (Figure II-2.b). The average daily wind speed on this day was 13.6 m/s, which is considered to be a one in 35 year event based on a

Figure

  Figure II-2. Monitored events a) the daily mean discharge series monitored by MacVicar & Piégay (2012) (red lines) and monitored in this work (blue lines) on the discharge series from 2007 to 2014. b) The daily mean wind velocity series from 1977 to 2013.

Figure

  Figure II-3, which shows that there was a strong correlation between wood flux and wood discharge for the 15 min video segments (see section 2.5.3) sampled by MacVicar and Piégay (2012) for F1, F2 and F3 (𝑅 2 = 0.83). This strong relation gives confidence that wood discharge and the total wood volume can be reliably estimated from the wood flux to allow comparison with other studies and models of the wood budget. Extrapolating this relation for other rivers would be an open question that can be the objective of future comparative works.

Figure II- 3 .

 3 Figure II-3. Wood discharge as a function of wood flux

Figure II- 4

 4 Figure II-4. a) wood flux position on video frame b) link between video time laps ∆𝐭 and the passing time 𝑷𝑻

  ). In Figure II-5 the blue scatters from the new events are quite consistent with the events in red from MacVicar andPiégay (2012) which validates the sampling technique.

Figure II- 5 .

 5 Figure II-5. Comparison between wood flux based on sampling (red) and continuous (blue) monitoring and flood hydrograph (black line). The gray boxes show the night time when video monitoring was impossible. Different symbol shapes show different events.

  Figure II-6 shows the link between (i) flow discharge (𝑄(𝑡)) (Figure II-6.a), (ii) the gradient of discharge over 5 min time lag (𝑑𝑄 𝑑𝑡 ⁄ ) (Figure II-6.b), and (iii) the time elapsed since the last time that 𝑄 was higher or equal to 𝑄(𝑡) (𝑇 𝑄 ) (Figure II-6.c) from one hand, and the wood flux from the other hand. Regarding the first predictor, as is seen in Figure II-6.a, 𝑄(𝑡) has a non-linear positive relationship with the wood flux. Wood flux starts to respond to 𝑄(𝑡) from a threshold almost equal to 450 m 3 /s and reaches its maximum value at around 850 m 3 /s. These values are in agreement with observed values in Figure II-5. For the second predictor, a comparison between positive and negative values of 𝑑𝑄 𝑑𝑡 ⁄ (rising and falling limb) in Figure II-6.b shows that while there is a strong effect of flow discharge gradient on the rising limb, there is almost no effect of the discharge gradient on the falling limb. Finally, as seen in Figure II-6.c even with a strong initial fluctuation, the wood flux increases with increasing interflood time.

Figure II- 6

 6 Figure II-6 Predicted value of wood flux (in red) as a function of a) flow discharge 𝑸 (m3/s), b) discharge gradient 𝐝𝑸 𝒅𝒕 ⁄ (m3/s/1hr) and c) the time elapsed since the last time that 𝑸 was higher or equal to 𝑸(𝒕), 𝑻 𝑸 (days). Dashed lines indicate the 90% and 10% quantiles of the data.

Figure

  Figure II-7 compares the observed and the modelled wood fluxes time series (aggregated by hour) for continuous (blue) and sampled (red) videos. The strength of

Figure II- 7 .

 7 Figure II-7. Wood fluxes based on continuous (blue) and sampled (red) videos and modeled wood fluxes (green line) using RF model as a function of time.

Figure II- 8 .

 8 Figure II-8. Comparison between observed and modeled piece number: filled and empty scatters show data on the rising and falling limbs of the hydrograph, respectively. Data are compared with a 1:1 line. There are 3 points for F4 and 2 points for F6 due to multiple pick floods.

2. 6 . 3

 63 Figure shows only the numerical link between framerate, passing time, and the fraction of detected objects while in practice there can be some other sources of uncertainty which are discussed in section 2.7.

Figure II- 9 .

 9 Figure II-9. Effect of framerate and passing time on the fraction of detected wood pieces.

  Figure II-10.a is an example of detected pulses in the event F4. In this figure, the wood flux is presented based on 1 min intervals and as it is seen beside the regular wood flow, there are always some pulses that flux is much higher than the average in a very short time interval. To check the quality of detection for such short events Figure II-10.b shows one day detection of wood with one pulse at 10am 3 th Jan 2012. As it is seen, the possibility to detect wood pulse decreases by decreasing framerate (from red to blue).

Figure

  Figure II-10. a) Wood fluxes as observed in 1-minute intervals. Beside short fluctuations of wood flux, pulses of wood can be defined qualitatively as the delivery of large amount of wood in a short period of time. The gray boxes show the night time when video monitoring was impossible. b) Effect of the temporal resolution on detecting short time events (a wood pulse).

  Our observations confirm that, most of the wood pieces are mobilized on the rising limb of the hydrograph than the falling limb following MacVicar and Piégay, (2012),[START_REF] Kramer | Estimating fluvial wood discharge using time-lapse photography with varying sampling intervals[END_REF] andGhaffarian et al. (2020a). The peak in wood flux is generally reached before the flood peak. These observations demonstrate some hysteresis of water discharge that agrees with[START_REF] Macvicar | Implementation and validation of video monitoring for wood budgeting in a wandering piedmont river, the Ain River (France)[END_REF] andGhaffarian et al. (2020a), who state that the peak discharge and peak of wood flux do not occur simultaneously and normally wood transport rate decreased before the peak of hydrograph. This result has also been confirmed by the model ofRuiz- Villanueva et al. (2016a). They show that wood flux increases with discharge until it attains an upper threshold or tipping point and then decreases or increases much more slowly.

  Figure II-6 shows a meaningful correlation between the three predictors and wood flux. Regarding the first predictor 𝑄(𝑡), MacVicar & Piégay, (2012) and Ghaffarian et al. (2020a), both showed that the wood flux is expected to have a non-linear positive relationship with flow discharge, which was reflected in Figure II-6.a. Also, 𝑑𝑄 𝑑𝑡 ⁄ , as the second predictor, captures the effect of variations in water discharge on wood recruitment during rising (positive values) vs falling (negative values) limb. The direct link between 𝑑𝑄 𝑑𝑡 ⁄ and wood flux on the rising limb in Figure II-6.b suggests that increasing the water level during the rising limb of flow hydrograph can be considered as one of the key parameters on wood delivery in rivers as we used it here as a predictor.

Figure

  Figure II-6.c.

  detectable (Figure II-9). Figure II-11 shows the link between fraction of detected fluxes as a function of passing time 𝑃𝑇 based on the model presented in Figure II-9 for three different framerates: (i) Kramer and Wohl, (2014) on the Slave River, Canada with 0.033 fps, (ii) Ghaffarian et al. (2020a) on the Isere River, France with 1fps and (iii) MacVicar and Piégay, (2012) and this study on the Ain River, France with 5 fps. According to Ghaffarian et al. (2020a), both Ain and Isere Rivers have almost constant transverse position for passing wood with corresponding 𝑃𝑇 = 5𝑠and 10𝑠 respectively. While on the Slave River, the transport distance was reported from 20 to 100 m[START_REF] Kramer | Estimating fluvial wood discharge using time-lapse photography with varying sampling intervals[END_REF]. Moreover, flow velocity on the Slave River is around 10 times less than Ain and Isere Rivers. Large variation in transport distance and low flow velocity both result in huge variation of 𝑃𝑇 on this river, roughly from 30𝑠 to 120𝑠.

Figure II- 11 .

 11 Figure II-11. Fraction of detected woods based on passing time in different rivers. Dashed lines show the estimated passing time on each river.

  of clarity in frames, variation in buoyancy, and orientation of the piece of wood, surface reflections and variation in light condition along the field of view, it looks like a different piece. Therefore, it should be noted that Figure II-9 only presents a numerical link between framerate, passing time, and the fraction of detected objects while the mentioned problems are remaining questions in the video monitoring technique. On the Slave River, as it is seen in Figure II-11,having the framerate of 0.033 𝑓𝑝𝑠 (∆𝑡 = 30𝑠) and 30𝑠 < 𝑃𝑇 < 120𝑠 we are located on the transition zone from time-lapse photography to video monitoring which can result in double-counting

  the video monitoring technique directly relates to the temporal resolution of the camera (Figure II-10.b). Moreover, such pulses are fully detectable only if continuous monitoring approach is applied. The difference between continuous monitoring and sampling is visible in Figure II-5 where the blue scatters show more consistency through each day, which likely is due to the continuous sampling method (samples were the total per hour rather than 15 min multiplied by 4 as for the red scatters).

  et al., (2020), for instance, monitored wood fluxes at 5 frames per second (fps) and a resolution of 640 × 480 up to 800 × 600 pixels. Boivin et al. (2017) used a similar camera and frame rate as MacVicar and Piégay(2012) to compare periods of wood transport with and without the presence of ice. Senter et al.(2017) analyzed the complete daytime record of 39 days of videos recorded at 4 fps and a resolution of 2048 × 1536 pixels. Conceptually similar to the video technique, time-lapse imagery can be substituted when large rivers where surface velocities are low enough and the field of view is large. Kramer and Wohl (2014); Kramer et al. (2017) applied this technique in the Slave River (Canada) and recorded one image every 1 and 10 minutes. Where possible, wood pieces within the field of view are then visually detected and measured using simple software to measure the length and diameter of the wood to estimate wood flux (piece/s) or wood volume (𝑚 3 /𝑠) (MacVicar and

  likeliness of representing floating wood. Since an image is only a discrete 2D representation of the real 3D world, details about the camera parameters such as optical image deformations, geographic situation, perspective deformations or behavior regarding luminosity can be used to infer what wood should look like and where it should occur. On a video scale, the method can embed expectations about how wood pieces should move through frames, how big they should be, and how lighting and weather conditions can evolve to change the expectations of wood appearance, location, and movement. The specific steps followed by the algorithm are shown in a simple flow chart (Figure III-1.a). An example image with a wood piece in the middle of the frame is also shown for reference (Figure III-1.b).

Figure

  Figure III-1 a) Flowchart of the detection software and b) an example of frame on which these different flowchart steps are applied.

  be identified by pixel light intensity (𝑥 ) following a Gaussian distribution (Figure III-2.a). To set the algorithm parameters, manual annotations of wood are used to obtain a representative sample of wood pixels, from which both the mean (𝜇) and standard deviation (𝜎) are calculated. This procedure produces a static probability mask (Figure III-2.b). From this figure, it is possible to identify the sectors where wood presence is likely, which includes the floating wood piece seen in Figure III-1.b, but also includes standing vegetation in the lower part of the image and a shadowed area in the upper left. The advantage of this approach is that it is computationally very fast. However, misclassification is possible, particularly when light condition changes.

Figure III- 2

 2 Figure III-2 Static probability mask, a) Gaussian distribution of light intensity range for a piece of wood, b) employment of probability mask on the sample frame.

  pixel probability according to an updated version of the function proposed by Ali et al. (2011) (Figure III-3.a) that takes 4 parameters. This function 𝐻 is an updating function, which produces a temporal probability mask from the inter-frame pixel value.

Figure III- 3

 3 Figure III-3 Dynamic probability mask, a) updating function 𝑯(∆ 𝒕 , 𝑰) adapted from Ali et al. (2011) and b) employment of probability mask on the sample frame.

Figure III- 4 a

 4 Figure III-4 a) Object extraction by (i) combining static and dynamic masks and (ii) applying a threshold to retain only highprobability pixels. b) Object tracking as a filter to deal with partly immersed objects and to distinguish between moving objects from static waves.

  example of orthorectification on a detected wood piece in a set of continuous frames and pixel coordinates (Figure III-5.b) is presented in Figure III-5.c in metrics coordinates. The transform matrix is obtained with the help of at least 4 non-colinear points (Figure III-5.a blue GCPs (Ground Control Points) acquired with DGPS) from which we know both the relative 2D metric coordinates for a given water level (Figure III-5.c blue points), and their corresponding localization within the image(Figure III-5.b

Figure III- 5

 5 Figure III-5 Image rectification, process. 3D view of non-colinear GCPs in metric coordinates (a), their corresponding localization within the image (b), and the relative 2D metric coordinates for a given water level (c). (b,c) A practical example of the transformation of the coordinates is presented. The different solid lines represent the successive detection in a set of consecutive frames.

Figure III- 6

 6 Figure III-6 User interface of the detection software.

  learned or manually specified parameters, the detecting of floating objects without human intervention (see Figure III-7). This module contains two main parts: (i) Detection tab, which allows operator to open, analyze and export the results from one video or a set of videos, and (ii) Configuration tab, which allows operator to load and save the software configuration by defining the parameters of wood detection (as described in section 3.4), saving and extracting the results, and the display of the interface.

  4.1). The default values are 𝜇 = 0.2, 𝜎 = 0.08 for intensity mask and 𝜏 = 0.25, 𝛽 = 0.45 for temporal mask. In the fourth and fifth parts object tracking and characterization parameters are defined respectively as described in section 3.4.2. Detection time is defined in the sixth part using OCR (Optical character recognition) technique. Finally, the parameters of the orthorectification (see section 3.4.3) are defined in the seventh part. The detection software can be used to process videos in batch ("script" tab), without generating a visual output to save computing ressource. Thus, it can process important amounts of data with minimum human work.

Figure III- 7

 7 Figure III-7 User interface of the detection module of automatic detection software.

  , as in MacVicar and Piégay(2012);Ghaffarian et al., (2020),

  developed to allow operator to perform as fine annotation as they wish. As it is shown in Figure III-8 this module contains three main parts: (i) The column on the far left allows operator to switch to another module (detection, learning or performance), (ii) the central part consists of a video player with a configuration tab for extracting the data, and (iii) the right part which concentrates the functionality, allowing to generate, create, visualize and save annotations. This way of annotating allows us to make rather quick coarse annotation, as in MacVicar andPiégay (2012) and[START_REF] Boivin | The raft of the Saint-Jean River, Gaspé (Québec, Canada): A dynamic feature trapping most of the wood transported from the catchment[END_REF] or finer grain annotation.

Figure III- 8

 8 Figure III-8 User interface of the annotation module of automatic detection software.

Fig

  Fig. 6(d)

  installed at this station to continuously record the water surface of the river at a maximum frequency of 5 fps (Figure. This camera replaced a lower resolution camera at the same location used by[START_REF] Macvicar | Implementation and validation of video monitoring for wood budgeting in a wandering piedmont river, the Ain River (France)[END_REF]. The specific location of the camera is on the outer bank of a meander, on the side closest to the thalweg, at a height of 9.8 m above the base flow elevation. The meander and a bridge pier upstream help to steer most of the floating wood so that it passes relatively close to the camera where it can be readily detected with a manual procedure (MacVicar andPiégay, 2012). The transformation matrix at the base flow elevation with the camera as the origin is shown in Figure III-10. Straight lines near the edges of the image appear curved because the fisheye distortion has been corrected on this image (see section 3.4.3); conversely, a straight line, in reality, is presented without any curvature in the image.

Figure III- 9

 9 Figure III-9 Study site at Pont de Chazey: a) Location of the Ain River catchment in France and location of the gauging and meteorological stations, b) camera position and its view angle in yellow, c) overview of the gauging station with the camera installation point

Figure III- 11

 11 Figure III-11 Daily mean discharge series for monitoring period from 1st to 7th January and in 15th December.

Figure III- 12

 12 Figure III-12 Different light conditions during (a) morning, (b) noon and (c) late afternoon, results in different frame roughness's and different detection performances.

Figure III- 13

 13 Figure III-13 Wood position can highly affect the quality of detection. Pieces that are passing in front of the camera are detected much better than the pieces far from the camera.

Figure

  Figure d, g, j shows the dispersion of piece number in different conditions. Based on these figures, it is possible to compare the software

Figure III- 14

 14 Figure III-14 Correction matrices: a, b, c) light and dark roughness's, d, e, f) flow discharges during the daytime, g, h, i) detection position and j, k, l) wood lengths as a function of the distance from the camera. The first column shows number of pieces as 𝑻𝑷 + 𝑭𝑵 (all annotated pieces), 𝑻𝑷 (correct detections) and 𝑭𝑷 (wrong detections). Second and third columns show Precision and Recall rates of the software respectively.

  4, this precision enhancement process, lost only around 14% of 𝑇𝑃𝑠 (𝑅𝑅 𝑝𝑝 = 86, 87% for two different scenarios). Instead of using all eight key parameters (four 𝑃𝑅 matrices) to calculate the overall precision, it is also possible to use other configurations by combining different matrices as it is shown in Figure III-15. In this figure, the precision matrices 1 to 4 are the same as the matrices presented in Figure III-14 and different colors show different combinations of these matrices.As it is seen, some configurations (e.g.(2,4)

Figure III- 15

 15 Figure III-15 Effect of using different combinations of 𝑷𝑹 matrices on precision improvement compared with 1:1 line(no improvement), 10% and 20% improvement lines.

  deviate from annotations. To do so, first, the actual length distribution based on annotation (𝑇𝑃 + 𝐹𝑁, green line) and the raw results of the detection software (𝑇𝑃 + 𝐹𝑃, red line) are plotted in Figure III-16.a . Then, based on the process described in section 3.6.3.1 the false positives are removed from the raw data so that the dashed blue line shows only true positives that are detected by the software. At this stage, the difference between the dashed blue line and the green line are the false negatives that the software has missed. Comparison between the annotated data (green line) and software true positives (blue dashed line) show a threshold length equal to 2.3 m, more than that, almost all pieces are detected by the software while below that some pieces are missed, as it is predicted above. To calculate this threshold, the correlation coefficient between green and blue lines is calculated for different thresholds, from 1 cm to 15 m length (Figure) and 2.3 m length was defined as the optimum threshold length for recall modeling. Knowing the difference between software true positives (𝑇𝑃, blue dashed line) and operator annotations (𝑇𝑃 + 𝐹𝑁, green line), the next step is to model 𝑇𝑃 + 𝐹𝑁 based on software 𝑇𝑃𝑠 for the wood pieces less than 2.3 m lengths. Defining 𝑅𝑅 = 𝑇𝑃/(𝑇𝑃 + 𝐹𝑁) (section 3.6.1.2) 𝑇𝑃 + 𝐹𝑁 = 𝑇𝑃/𝑅𝑅. In this relation, 𝑇𝑃 is known from the software detentions (blue dashed line). Following the same protocol as precision enhancement in section 3.6.3.1, 𝑅𝑅 was calculated using the recall matrices in Figure by dividing 𝑇𝑃 by 𝑅𝑅 for the pieces less than the 2.3 m threshold, the total amount of wood pieces was modeled (Figure III-16.a, blue line). The result shows a good agreement between operator annotations (green line, totally 6249 pieces) and modeled wood pieces (blue line, totally 5841 pieces) which results in only 6.5% relative error in the total number of wood pieces.

Figure

  Figure III-16 a) Steps to post-process software automatic detections: (i) raw detections (𝑻𝑷 + 𝑭𝑷 red line), (ii) Only true positives using the 𝑷𝑹 improvement process (𝑻𝑷 blue dashed line), and (iii) modeling false negatives (blue line). Operatorannotation (green line is used as a benchmark). b) The correlation coefficient between operator annotation and modeled 𝑻𝑷 to find an optimum threshold length for 𝑹𝑹 improvement.

  three different conditions: (i) operator annotation ( 𝑇𝑃 + 𝐹𝑁 ), (ii) raw data of the detection software (𝑇𝑃 + 𝐹𝑃) and (iii) post-processed data of the detection software (𝑇𝑃 𝑚𝑜𝑑𝑒𝑙𝑒𝑑 ). Figure III-17 shows the comparison of the total volume of wood between operator annotation as the benchmark from one hand and raw data (red scatters)

Figure III- 17

 17 Figure III-17 Comparison of the total volume of wood between operator annotation as the benchmark and raw data (red scatters) and post-processed data (blue scatters), compared with a 1:1 line.

  both in France: (i) the Ain river (Figure II-1). with 1.5-year flow discharge, Q1.5 = 840 m 3 /s as the dominant flow, and (ii) the Allier river (Figure IV-2). with Q1.5 =460 m 3 /s. The study site in the Ain river is located on the lower Ain, a sixth-order piedmont river flowing through a forested corridor in France. The channel is typically single thread with occasional islands, and a wandering system with prominent meander scrolls and cutoff channels (Figure II-1.a) (MacVicar et al., 2009). The hydrograph shows a strong seasonal pattern, with low flows in the summer and most of the floods occurring between October and April. Bed material sizes are gravel-cobble mix with a median size of 2.5 cm. The unvegetated channel width is 65 m on average

  Figure II-1.b).

Figure IV- 1 .

 1 Figure IV-1. Study site at Pont de Chazey: a) Location of the Ain River course in France and location of the gauging station, b) camera position and its view angle in yellow,

Figure IV- 2 .

 2 Figure IV-2. Study site at Châtel-de-Neuvre a) Location of the Allier River course in France, b) camera position and its view angle in yellow.

Figure IV- 3 .

 3 Figure IV-3. Comparison of the wood length distribution on two sites.

Figure IV- 4 .

 4 Figure IV-4. Schematic view of the sampling time window (𝑻𝑾)

  Figure IV-5. a and b show these two elements on the Ain River. The data on this river have been already validated (black dashed line) by MacVicar & Piégay, (2012) and Ghaffarian et al. (2020a). As it is seen both wood length distribution (Figure IV-5.a) and wood transverse distribution (Figure IV-5.b) are almost in the same range as the black dashed line. Therefore, it is possible to rely on the data provided by all operators.

Figure IV- 5 .

 5 Figure IV-5. Comparision of the results of different operators for a) cumulative distribution function of wood length and b) probability distribution function of transversal position of wood pieces on the Ain River, compared with the validated data (dashed line) from MacVicar & Piégay, (2012), Ghaffarian et al. (2020a).

Figure IV- 6 .

 6 Figure IV-6. Classification of results based on piece length; a) the difference between different operators based on the normalized standard deviation of piece number (𝝈 𝒊 / ∑ 𝝈 𝒊 ), b) probability distribution function of piece number and c) volume.

Figure

  Figure IV-7.a, b shows the mean value (solid line) and the standard deviation (dashed line) of 𝑁 𝑡𝑟 /𝑁 𝑡 and 𝑉 𝑡𝑟 /𝑉 𝑡 respectively. We use the mean value to show the evolution of piece number and volume as a function of 𝐿 𝑡𝑟 and the standard deviation to show the relative error between different operators. As it is seen in

Figure IV- 7 .

 7 Figure IV-7. Effect of applying a truncation length (𝑳 𝒕𝒓 ) on piece number and volume: a) truncated piece number (𝑵 𝒕𝒓 ) normalized by total piece number (𝑵 𝒕 ), and b) truncated piece volume (𝑽 𝒕𝒓 ) normalized by total piece volume (𝑽 𝒕 ). Solid and dashed lines represent mean and standard deviation for the results of different operators.

Figure

  Figure for smaller truncation lengths ( 𝐿 𝑡𝑟 < 2𝑚 ), the relative error on volume in both rivers is almost constant. This constant error can be more due to the blurry pixels around the object, especially far from the camera, which causes selecting different pixels as the limits of one single wood piece which results in a systematic error among different operators rather than bias on the number of detected pieces by different operators.

5 . 4 ,

 54 Figure IV-8.a shows a one by one link between the fraction of monitored videos and the fraction of detected wood pieces.

Figure IV- 8 .

 8 Figure IV-8. Link between time window 𝝉 and the fraction of detected wood pieces.

  section 4.5.4 this error is shown in Figure IV-9. a, b for total number and volume of wood pieces respectively. As mentioned in Table IV-2, totally 7 flood events were monitored in this study. So, to show the errors for all events together, solid and dashed lines represent the mean and maximum errors for different monitored floods respectively. As it is seen in this figure the relative error of both total piece number and total volume decrease rapidly by increasing 𝜏 up to 𝜏 ≅ 20%. It should be noted that though the error was different among different events (in the range of dotted lines in Figure IV-9), 𝜏 < 20% always results in much larger error and is not recommended.

Figure IV- 9 .

 9 Figure IV-9. Error due to time excluded from sampling as a function of time window 𝑻𝑾. Solid and dashed lines represent the mean and maximum errors for different monitored floods respectively.

Figure

  Figure IV-10 shows the effect of flow discharge on the relative error in each time interval (∆𝑁 𝑖 * ) only for 𝜏 = 50% as an example and then Figure IV-11 shows this effect on ∆𝑁 𝑖 * and ∆𝑉 𝑖 * for a range of 𝜏 from 0 to 100% on both rivers. As it is seen, despite big dispersion of data due to the random effects on the river, by increasing the flow discharge, the error always increases which is due to the increase in |𝑁 𝑖 -𝑁 𝑖 ̅̅̅ | in Eq 2. It should be noted that the reason ∆𝑁 𝑖 * shows rather small values (of the order 10 -2 to 10 -1 ) is that to be able to show the error due to the sampling strategy as a function of flow discharge in Figure IV-10 and Figure IV-11, for normalizing the difference between sampling and real detections in one time interval(|𝑁 𝑖 -𝑁 𝑖 ̅̅̅ |), total number of wood pieces during a flood(∑ 𝑁 𝑖 𝑚 1

Figure IV- 10 .

 10 Figure IV-10. Relative error due to the sampling with 𝝉 = 𝟓𝟎% for different discharges as a function of flow discharge. Solid line shows the linear interpolation and dashed lines show the 95% confidence boundes on the Ain (red) and Allier (blue) Rivers.

Figure IV- 11 .

 11 Figure IV-11. Relative error due to the sampling as a function of flow discharge. a, b) The errors on pieces number ;c, d) the errors on wood volume on two rivers.

  operator detection is quite reliable for detecting large wood pieces.

  Figure IV-12 is an example of defining an optimum timeline according to Figure IV-11 and based on the needed accuracy both for piece number (Figure IV-12.a) and piece volume (Figure IV-12.b) on the Ain (solid line) and Allier (dashed line) Rivers. To prepare the sampling timeline first the acceptable error should be defined. Here, 0.5, 1.0, 1.5 and 2% are selected for ∆𝑁 𝑖 * (Figure IV-12.a) and ∆𝑉 𝑖 * (Figure IV-12.a). Knowing the acceptable error, by passing an imaginary horizontal line on Figure IV-11, the needed 𝜏 for each 𝑄 𝑄 1.5 ⁄ can be extracted. For practicality t, in Figure IV-12, 𝜏 is discretized in 20% groups. It is interesting to note that the timeline on both rivers are almost the same.

Figure

  Figure IV-12. An optimum timeline for sampling based on different accuracies (from 0.5 to 2%) both for a) piece number and b) piece volume on the Ain (solid line) and Allier (dashed line) Rivers.

  reduces significantly monitoring time with a limited uncertainty. It should be noted that first the sampling time should be more than 20% and second, it is recommended to use a dynamic sampling time according to the flow discharge, rather than a constant value.CHAPTER V. Summary and outlookDans cette étude, la technique de vidéographie en bord de rivière a été appliquée pour détecter le passage du bois et mesurer les taux instantanés de transport du bois. L'objectif était de mieux comprendre comment les flux de bois réagissent aux inondations et aux vents. Au total, un vent exceptionnel et 7 crues ont été surveillés sur l'Ain, en France, et environ 24 000 morceaux de bois ont été détectés manuellement. Nous trouvons une relation empirique entre la fréquence du bois et le rejet de bois, qui est utilisée pour simplifier la procédure de suivi. Il existe un lien univoque entre la fraction de morceaux de bois détectés et le paramètre adimensionnel «temps de passage × framerate», qui fournit une ligne directrice générale pour la conception des stations de surveillance. Il est confirmé qu'en général, il existe un seuil de mouvement du bois dans la rivière égal à 60% du débit à pleine rive. Cependant, lors d'une inondation suivant une journée venteuse, aucun seuil évident de mouvement du bois n'a été observé, ce qui confirme que le vent est important pour la préparation du bois pour le transport entre les crues. Lors de deux crues à plusieurs pics, environ les deux tiers de la quantité totale de bois ont été livrés au premier pic, ce qui confirme l'importance du temps entre les crues pour prédire les flux de bois. L'ensemble de données est utilisé pour développer un modèle de régression forestière aléatoire pour prédire la fréquence du bois en fonction de trois variables d'entrée dérivées de l'hydrogramme d'écoulement. Le modèle calcule le volume total de bois pendant la journée ou la nuit en se basant pour la première fois sur la technique de surveillance vidéo, ce qui élargit son utilité pour la budgétisation du bois dans un bassin versant.

  current study, we installed a high-resolution camera to monitor fluvial transport of wood event in extreme low-light. However, this camera cannot support the function of nighttime surveillance. The lens of camera still has some possibilities of being blocked. Because of the camera was installed on the field and along the river, the site of the camera can be influenced by different problems, such as a spider net in front of the lens for several days. These two limitations in the camera monitoring can generate a censing gap as shown on Figure II-5. The database of seven events is used to fit on a RF regression model. The model can calculate the total wood volume either during day, night or any other gaps. As shown on Figure I-2, this model can quantify the wood flux input and output on a surveyed river reach with the video monitoring technique.

Figure V- 1

 1 Figure V-1 The wood hazard with flood in China: a)&b) The flood and wood crush the building of village and wood push down a car into pool during flood, Sichuan, China (2012) (The news is reported by following link: http://news.cnr.cn/tttp/201008/t20100817_506906910_3.shtml); c)&d) flood broke the bridge and destroyed the road with wood and sediment, Shandong, China (2018) (The home-photo is caught by following link: https://dy.163.com/article/DPONQIDO0537094R.html?referFrom=)

  5.2.2 Present wood study in China .......................................................................... 5.2.3 Applying different steps of video monitoring technique together to calculate wood budgeting............................................................................................................. 5.2.4 Finding the source of wood pieces by analyzing wood pulses. ...................... BIBLIOGRAPHY ...................................................................................................

  Table II-1 Wood sampling statistics at the Pont de Chazey for different events. ...... Table II-2 Wood flux in multi peak floods F4 and F6 ................................................ Table II-3 Wood volume and threshold of wood motion, modeled (M) or observed (O)...................................................................................................................... Table III-1 Characteristics of streamside video monitoring techniques in different studies. ......................................................................................................... Table III-2 Summary of automated and manual detections ......................................

	CHAPTER I. Introduction
	1.1 Résumé du chapitre I : Introduction
	Dans ce chapitre, nous définirons d'abord le bois des rivières comme un élément
	important pour la nature et les êtres humains. Nous introduire du bois dans les
	rivières est également une composante essentielle des systèmes fluviaux qui peut
	influencer l'écologie des rivières et la géomorphologie des chenaux. Sur cette base,
	nous savons que le bois dans les rivières peut également intensifier les risques lors

Table III-3Correlation between each pair of parameters .......................................... Table III-4 Precision rate (PR) before and after post-processing ............................. Table IV-1. Sampled videos statistics ...................................................................... Table IV-2. Continuous monitoring statistics ............................................................ du transport de bois de gros diamètres en cas de crue énorme. Par conséquent, nous étudions plusieurs approches pour quantifier le transport du bois dans les cours d'eau. Dans la dernière section de ce chapitre, nous présentons les objectifs de ce travail d'étude et nous guidons à travers la structure du manuscrit.

wood fluxes: critical events, flux prediction, and sampling window 2.1 Résumé

	modèle de régression forestière aléatoire pour prédire la fréquence du bois en
	fonction de trois variables d'entrée dérivées de l'hydrogramme d'écoulement. Le
	modèle calcule le volume total de bois pendant la journée ou la nuit en se basant
	pour la première fois sur la technique de surveillance vidéo, ce qui élargit son utilité
	pour la budgétisation du bois dans un bassin versant.
	Le flux de bois (nombre de pièces par intervalle de temps) est un paramètre clé
	pour comprendre la budgétisation du bois, déterminer les facteurs de contrôle et
	gérer le risque d'inondation dans un bassin hydrographique. Des données
	quantitatives sur les flux de bois sont indispensables pour améliorer la
	compréhension de la dynamique du bois dans les rivières et estimer le débit de bois
	dans les cours d'eau. Dans cette étude, la technique de vidéographie en bord de
	rivière a été appliquée pour détecter le passage du bois et mesurer les taux
	instantanés de transport du bois. L'objectif était de mieux comprendre comment les
	flux de bois réagissent aux inondations et aux vents. Au total, un vent exceptionnel et
	7 crues ont été surveillés sur l'Ain, en France, et environ 24 000 morceaux de bois
	ont été détectés manuellement. Nous trouvons une relation empirique entre la
	fréquence du bois et le rejet de bois, qui est utilisée pour simplifier la procédure de
	suivi. Il existe un lien univoque entre la fraction de morceaux de bois détectés et le
	paramètre adimensionnel «temps de passage × framerate», qui fournit une ligne
	directrice générale pour la conception des stations de surveillance. Il est confirmé
	qu'en général, il existe un seuil de mouvement du bois dans la rivière égal à 60% du
	débit à pleine rive. Cependant, lors d'une inondation suivant une journée venteuse,
	aucun seuil évident de mouvement du bois n'a été observé, ce qui confirme que le
	vent est important pour la préparation du bois pour le transport entre les crues. Lors
	de deux crues à plusieurs pics, environ les deux tiers de la quantité totale de bois ont
	été livrés au premier pic, ce qui confirme l'importance du temps entre les crues pour
	prédire les flux de bois. L'ensemble de données est utilisé pour développer un

Table II -1 Wood sampling statistics at the Pont de Chazey for different events.

 II

	Flood periods	Events	Peak flows (m3/s) total daylight	Daily wind	velocity(m/s)	Analyzed	video (hr)	Monitored	fraction*	Number of floating woods Rising limb falling limb
	22 to 24-Nov-2007	F1	578	576	6.6	06:15		09%		2800	38
	10 to 12-Dec-2007	F2	616	616	6.3	03:45		05%		968	93
	10 to 13-Apr-2008	F3	1050	1007	3.8	07:45		08%		3331	584
	01 to 07-Jan-2012	F4	808	807	4.9	57:00		34%		3681	1641
	15 to 16-Dec-2012	F5	932	821	4.9	17:15		36%		6901	798
	01 to 06-Feb-2013	F6	701	701	8.5	56:30		39%		1040	473
	24 to 25-Dec-2013	W1	134	134	13.6	08:45		37%		8	-
	25 to 27-Dec-2013	F7	600	580	5.6	25:45		36%		1443	43
	* Monitored fraction = monitored duration / total duration of an event

Table II -2 Wood flux in multi peak floods F4 and F6

 II

	Flood event	F4.1(Peak1) F4.2(Peak2) F4.3(Peak3) F6.1(Peak1) F6.2(Peak2)
	Qmax (m 3 /s)	801	808	786	701	627
	Pieces number	3098	1134	839	995	427
	Fraction*	61%	23%	16%	71%	29%
	Flux on rising limb (num/hr) 268	211	82	97	35

* Fraction = piece number during one peak / total piece number during an event.

Table II -3 Wood volume and threshold of wood motion, modeled (M) or observed (O).

 II

	Event	F1	F2	F3	F4	F5	F6	W1	F7
	Modeled wood volume* (m 3 )	218.69	84.95	680.68	347.08	412.54	52.81	1.88	77.11
	Observed wood volume (m 3 )	88.75	32.41	120.01	118.29	235.05	26.12	0.03	29.36
	Threshold(m 3 /s)	275	300	300	300	350	356	<95	95
	Modeled/Observed	M	O	O	M	M	M	O	O
	* Modeled wood volume includes volume both during day and night time.

  Le bois est une composante essentielle des rivières et joue un rôle important dans l'écologie et la morphologie. Elle peut également être considérée comme un facteur de risque dans les rivières en raison de son influence sur l'érosion et les inondations. La quantification et la caractérisation des flux de bois dans les rivières lors des crues amélioreraient notre compréhension des processus clés, mais sont Pour évaluer les performances du logiciel, les résultats sont comparés aux détections manuelles de bois à partir des mêmes vidéos. Les paramètres clés qui affectent la détection sont évalués, notamment les réflexions de surface, les conditions d'éclairage, le débit, la position du bois par rapport à la caméra et la longueur des morceaux de bois. Les résultats préliminaires avaient un taux de détection de faux positifs de 36%, principalement en raison de la réflexion de la lumière et des vagues d'eau, mais le post-traitement a réduit ce taux à 14%. Le taux de détection manquée était de 71% du nombre de pièces dans le résultat préliminaire, mais le post-traitement a réduit cette erreur à seulement 6,5% du nombre de pièces et 13,5% du volume. La haute précision du logiciel montre qu'il peut être utilisé pour augmenter massivement la quantité de données sur les flux de bois dans les rivières du monde entier, potentiellement en temps réel. L'impact significatif du post-traitement indique qu'il est nécessaire de former le logiciel dans diverses situations (lieu, durée, conditions météorologiques) pour garantir des résultats fiables. Il convient de noter que les annotations manuelles de ce travail ont nécessité plus d'un mois de travail humain. Le logiciel présenté, couplé à une étape de post-traitement appropriée, effectue une tâche comparable en temps réel (55 h) sur un ordinateur de bureau standard.

entravées par des défis techniques. Parmi les diverses techniques de surveillance du bois dans les rivières, la vidéographie en bord de rivière est une approche puissante pour quantifier les différentes caractéristiques du bois dans la rivière, mais les recherches antérieures ont utilisé une approche manuelle qui a de nombreuses limites. Dans ce travail, nous introduisons un nouveau logiciel pour la détection automatique des morceaux de bois dans les rivières. Nous appliquons différentes techniques d'analyse d'images telles que les masques statiques et dynamiques, le suivi d'objets et la caractérisation d'objets pour minimiser les détections faussement positives et manquées.

Table III -1 Characteristics of streamside video monitoring techniques in different studies.

 III

	Article	Sampling	Temporal scales	Camera	Study site
				resolution
	MacVicar & Piégay	15 min segments	3 floods/18 hr/5 fps	640 × 480	Ain, France
	(2012)
	Kramer & Wohl (2014)	Total duration	32 days/12761 frames/0.017 fps
	Boivin et al. (2017)		3 floods/150 hr		St Jean, Canada
	Kramer et al. (2017)	Total duration	11 months/0.0017 fps	1268 × 760	Slave, Canada
	Senter et al. (2017)	15 min segments	39 days/180 hr/4 fps	2048 × 1536	North Yuba, USA
	Ghaffarian et al. (2020) Total duration	2 floods/80 hr/1 fps	600 × 800	Isère, France
	Zhang et al. (2020)	Total duration	7 floods & 1 windy period	from 640 × 480	Ain, France
			/183 hr/5 fps	up to 800 × 600

Table III -2 Summary of automated and manual detections

 III

	Date	discharge (𝑚 3 /𝑠) Qmax Qmin	Water level (𝑚) hmax hmin	Detection time (ℎ𝑟)	Number annot.	det.	Precision rate%	Recall rate%
	1/1/2012	718	633	-7.4	-7.8	7 to 17	2282	972	77	33
	2/1/2012	772	674	-7.2	-7.6	7 to 17	802	380	52	24
	4/1/2012	475	423	-8.4	-8.6	7 to 17	140	158	20	22
	6/1/2012	786	763	-7.2	-7.2	7 to 17	712	384	54	29
	7/1/2012	462	430	-8.5	-8.6	7 to 17	117	73	40	25
	15/12/2012	707	533	-7.5	-8.2	9 to 14	1296	503	72	28
	Total	786	423	-7.2	-8.6	55 ℎ𝑟	5349	2470	64	29

Table III -3Correlation between each pair of parameters

 III

		Dark	roughness	Light	roughness	Length	Distance	X position	Y position	Discharge	Time
	Dark roughness			0.59		-0.02	-0.04	0.04	0.1	0	0.57
	Light roughness	0.59				-0.03	-0.03	0.03	0.09	-0.04	0.29
	Length	-0.02	-0.03		0.46	-0.45	-0.35	-0.02	-0.01
	Distance	-0.04	-0.03	0.46		-1	-0.16	0.14	-0.05
	X position	0.04		0.03		-0.45	-1		0.15	-0.15	0.05
	Y position	0.1		0.09		-0.35	-0.16	0.15		0	0.07
	Discharge	0		-0.04	-0.02	0.14	-0.15	0		0.37
	Time	0.57		0.29		-0.01	-0.05	0.05	0.07	0.37

Table III -4 Precision rate (PR) before and after post-processing

 III

				1 st strategy: cross validation					2 nd strategy:
				1 Jan	2 Jan	4 Jan	6 Jan	7 Jan	15 Dec	Total	Total training
		𝑇𝑃		745	196	31	206	29	363	1570	1570
		𝐹𝑃		227	184	127	178	44	140	900	900
	Raw data	𝐹𝑁 𝑃𝑅% 𝑅𝑅%	1537 77 33	606 52 24	109 20 22	506 54 29	88 40 25	933 72 28	3779 64 29	3779 64 29
		𝑇𝑃		658	150	30	178	22	315	1353	1362
		𝐹𝑃		64	10	60	39	11	68	252	244
		𝐹𝑁 𝑝𝑝	1	87	46	1	28	7	48	217	208
	Post-proc.	𝑃𝑅% 𝑅𝑅 𝑝𝑝 2 %	91 88	94 77	33 97	82 86	67 76	82 87	85 86	85 87
	𝑃𝑅 improvement 14	42	13	28	27	10	21	21

  Le bois fait partie intégrante des rivières qui jouent un rôle à la fois positif et négatif. Différentes techniques ont été développées pour quantifier le bois dans les rivières. Parmi eux, la technique de surveillance vidéo côté flux est une technique efficace pour surveiller des pièces de bois avec une résolution temporelle et spatiale relativement élevée pendant un temps infini et dans un certain endroit. Cependant, la détection visuelle des morceaux de bois dans les vidéos est entachée d'incertitudes dues à deux types de limitations; premièrement, le biais de l'opérateur (limite de vision), et deuxièmement, l'échantillonnage vidéo (c'est-à-dire le fait que seule une partie de la vidéo est utilisée pour évaluer le flux de bois, en raison de la nature chronophage de la tâche de détection visuelle). Pour évaluer ces incertitudes, 7

	CHAPTER IV. Operator 2003;	based	uncertainties	in
	streamwise video monitoring technique
	4.1 Résumé
	crues et 13 segments vidéo correspondant à plus de 37 jours, et plus de 64 000
	morceaux de bois, ont été suivis sur deux rivières différentes, l'Ain et l'Allier, France.
	Les résultats montrent que s'il existe une grande différence entre les différents
	opérateurs pour détecter les petites pièces de bois (<1 m), tous les opérateurs
	détectent environ le même nombre de grandes pièces de bois (> 1 m). L'application
	d'une longueur de troncature (c'est-à-dire en considérant des pièces de bois d'une
	taille supérieure à un certain seuil) réduit considérablement l'incertitude du nombre
	de pièces, sans impliquer un changement significatif du volume total de bois. Bien
	que l'utilisation d'échantillons vidéo au lieu d'une surveillance continue puisse être
	très efficace en termes de temps, il est important d'ajuster une stratégie
	d'échantillonnage pertinente, avec une chronologie dynamique. Ici, nous détaillons
	une telle méthode, en utilisant à la fois une longueur de troncature et une stratégie
	d'échantillonnage pour réduire les coûts de détection, avec un impact limité sur

Table IV -1. Sampled videos statistics

 IV

				Number of wood pieces detected by operators
	River Date	Time	Operator 1 Operator 2 Operator 3 Operator 4 Operator 5
		22/11/2007 9:15 AM	0	0	0	0	0
		22/11/2007 11:15 AM 0	0	0	0	0
		22/11/2007 12:00 AM 1	0	1	0	1
		22/11/2007 3:56 PM	11	12	12	10	8
		22/11/2007 5:11 PM	4	4	5	5	3
	Ain	23/11/2007 7:56 AM	313	226	293	275	313
		23/11/2007 9:56 AM	354	313	386	358	326
		23/11/2007 10:11 AM 290	216	236	225	210
		23/11/2007 11:56 AM 337	175	243	253	183
		23/11/2007 2:26 PM	253	95	143	118	92
		23/11/2007 5:05 PM	271	136	216	179	130
	Allier	25/11/2019 3:33 PM 23/12/2019 11:15 AM 191 672	--	643 92	366 108	408 128

Table IV -2. Continuous monitoring statistics

 IV

			𝑄 𝑚𝑎𝑥	Analyzed	Monitored	Total amount of wood
	River	Flood periods	(𝑚 3 /𝑠)	video (hr)	fraction	number	Volume(m 3 )
		01 to 07-Jan-2012	808	57:00	34%	5316	281
	Ain	15 to 16-Dec-2012 01 to 06-Feb-2013	932 701	17:15 56:30	36% 39%	7697 1465	504 105
		21 to 24-Dec-2018	1430	25:45	36%	8871	310
		23 to 28/11/2019	494	70:00	41%	24587	1109
	Allier	15 to 16/12/2019	348	20:00	41%	3453	129
		21 to 30/12/2019	530	100:00	41%	12773	346

Performance

The performance module allows the operator to set rules to compare automatic and manual wood detection results. This section also allows the operator to specify the orthorectification matrix, so that the operator can extract metrics directly from the output of an automatic detection, or a bare, pixel-wise annotation.

For this module an automatic detection file is first loaded and then the result of this detection is compared with a manual annotation for that video, if the latter is available. Comparison results are then saved in the form of a summary file (*.csv format), allowing the operator to perform statistical analysis of the results or the performance of the detection algorithm. A manual annotation file can only be loaded if it is associated with an automatic detection result.

The performance of the detected algorithm can be realized on several levels:

• Object. The idea is to annotate one (or more) occurrences of a single object, and to operate the comparison at bounding box scale. A detected object may comprehend a whole sequence of occurrences, on several frames. It is validated when only a single occurrence happens to be related to an annotation. This is the minimum possible effort required to have an extensive overview of the object frequency on such an annotations database. This approach can however lead us to misjudge overall wrongly detected sequences as True Positives (see below), or vice-versa.

• Occurrence. The idea is to annotate, even roughly, every occurrence of every woody object, the comparison then happening between bounding boxes rather than at pixel level. Every occurrence of any detected object can be validated individually. However less demanding than the next case, this option still requires a rather extensive annotation work.

• Pixel, which is the most comprehensive option. This case implies that every pixel of every occurrence of every object is annotated as wood. It is very l'incertitude.

Abstract

Wood is an integral part of rivers which play both positive and negative role.

Different techniques have been developed to quantify wood in rivers. Among them, stream-side video monitoring technique is an effective technique to monitor wood pieces with a relatively high temporal and spatial resolution during an infinite time and in a certain location. However, the visual detection of wood pieces in the videos is tainted by some uncertainties due to two kinds of limitations; first, operator bias (vision limit), and second, video sampling (i.e. the fact that only a portion of the video is used to assess the wood flux, due to the time-consuming nature of the visual detection task). To assess these uncertainties, 7 flood events and 13 video segments corresponding to more than 37 days, and more than 64000 pieces of wood, were monitored on two different rivers, Ain and Allier, France. The results show that while there is a big difference between various operators to detect small wood pieces (<1m), all operators detect about the same number of large wood pieces (>1m). Applying a truncation length (i.e. considering wood pieces with a size superior to a certain threshold) reduces the piece number uncertainty significantly, without implying a meaningful change in the total volume of wood. Although using video samples instead of continuously monitoring could be highly time-effective, it is important to adjust a relevant sampling strategy, with a dynamic timeline. Here, we detail such a method, using both a truncation length and a sampling strategy to reduce detection costs, with a limited impact on uncertainty.

Introduction

Driftwood is a significant component of the riparian zone both ecologically and morphologically [START_REF] Gonor | What we know about large trees in estuaries, in the sea, and on coastal beaches. From the forest to the sea, a story of fallen trees[END_REF][START_REF] Abbe | Patterns and processes of wood debris accumulation in the Queets river basin, Washington[END_REF]Gregory et