text:
%%
%% Copyright 2007, 2008, 2009 Elsevier Ltd
%%
%% This file is part of the 'Elsarticle Bundle'.
%% ---------------------------------------------
%%
%% It may be distributed under the conditions of the LaTeX Project Public
%% License, either version 1.2 of this license or (at your option) any
%% later version.  The latest version of this license is in
%%    http://www.latex-project.org/lppl.txt
%% and version 1.2 or later is part of all distributions of LaTeX
%% version 1999/12/01 or later.
%%
%% The list of all files belonging to the 'Elsarticle Bundle' is
%% given in the file `manifest.txt'.
%%
%% Template article for Elsevier's document class `elsarticle'
%% with harvard style bibliographic references
%% SP 2008/03/01

\documentclass[preprint,9pt]{elsarticle}

%% Use the option review to obtain double line spacing
%% \documentclass[authoryear,preprint,review,12pt]{elsarticle}

%% Use the options 1p,twocolumn; 3p; 3p,twocolumn; 5p; or 5p,twocolumn
%% for a journal layout:
%% \documentclass[final,1p,times,authoryear]{elsarticle}
%% \documentclass[final,1p,times,twocolumn,authoryear]{elsarticle}
%% \documentclass[final,3p,times,authoryear]{elsarticle}
%% \documentclass[final,3p,times,twocolumn,authoryear]{elsarticle}
%% \documentclass[final,5p,times,authoryear]{elsarticle}
%% \documentclass[final,5p,times,twocolumn,authoryear]{elsarticle}

%% For including figures, graphicx.sty has been loaded in
%% elsarticle.cls. If you prefer to use the old commands
%% please give \usepackage{epsfig}

%% The amssymb package provides various useful mathematical symbols
\usepackage{amsmath,amssymb,bm}
%\usepackage[dvips,colorlinks=true,citecolor=green]{hyperref}
\usepackage[colorlinks=true,citecolor=green]{hyperref}
%% my added packages
\usepackage{verbatim}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{booktabs} % for nice tables
\usepackage{csvsimple} % for csv read
\usepackage{graphicx}
%\usepackage[outdir=//odroid-sensors/sensors/aidd/reports/journal_papers/MSSP_Paper/Figures/]{epstopdf}
%\usepackage{breqn}
\usepackage{multirow}
% matrix command
\newcommand{\matr}[1]{\mathbf{#1}} % bold upright (Elsevier, Springer)
% vector command
\newcommand{\vect}[1]{\mathbf{#1}} % bold upright (Elsevier, Springer)
\newcommand{\ud}{\mathrm{d}}
\renewcommand{\vec}[1]{\mathbf{#1}}
\newcommand{\veca}[2]{\mathbf{#1}{#2}}
\renewcommand{\bm}[1]{\mathbf{#1}}
\newcommand{\bs}[1]{\boldsymbol{#1}}
\graphicspath{{Figures/}{//odroid-sensors/sensors/aidd/reports/journal_papers/MSSP_Paper/Figures/}}
%\graphicspath{ {Graphics/Figures/} }
%% The amsthm package provides extended theorem environments
%% \usepackage{amsthm}
%% The lineno packages adds line numbers. Start line numbering with
%% \begin{linenumbers}, end it with \end{linenumbers}. Or switch it on
%% for the whole article with \linenumbers.
%% \usepackage{lineno}
\journal{Mechanical Systems and Signal Processing}

\begin{document}
	\begin{frontmatter}
		\addcontentsline{toc}{section}{References}
		%% Title, authors and addresses
		%% use the tnoteref command within \title for footnotes;
		%% use the tnotetext command for theassociated footnote;
		%% use the fnref command within \author or \address for footnotes;
		%% use the fntext command for theassociated footnote;
		%% use the corref command within \author for corresponding author footnotes;
		%% use the cortext command for theassociated footnote;
		%% use the ead command for the email address,
		%% and the form \ead[url] for the home page:
		%% \title{Title\tnoteref{label1}}
		%% \tnotetext[label1]{}
		%% \author{Name\corref{cor1}\fnref{label2}}
		%% \ead{email address}
		%% \ead[url]{home page}
		%% \fntext[label2]{}
		%% \cortext[cor1]{}
		%% \address{Address\fnref{label3}}
		%% \fntext[label3]{}

		\title{Full Wavefield Processing by Using FCN for Delamination Detection}

		%% use optional labels to link authors explicitly to addresses:
		%% \author[label1,label2]{}
		\address[IFFM]{Institute of Fluid Flow Machinery, Polish Academy of Sciences, Poland}

		\author{Abdalraheem A. Ijjeh\fnref{IFFM}}
		\author{Saeed Ullah \fnref{IFFM}}
		\author{Pawel Kudela\corref{cor1}\fnref{IFFM}}
		\ead{pk@imp.gda.pl}
		%\ead{pfiborek@imp.gda.pl}
		%\author{Tomasz Wandowski \fnref{IFFM}}

		\cortext[cor1]{Corresponding author}

		\begin{abstract}

		\end{abstract}

		\begin{keyword}
			%% keywords here, in the form: keyword \sep keyword
			Lamb waves \sep dispersion curves \sep structural heath monitoring \sep damage detection \sep deep learning \sep Convolutional neural networks. \sep fully convolutional neural network
			%% PACS codes here, in the form: \PACS code \sep code

			%% MSC codes here, in the form: \MSC code \sep code
			%% or \MSC[2008] code \sep code (2000 is the default)

		\end{keyword}

	\end{frontmatter}
	%% main text
	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

	\section{Introduction}
	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	Composite materials have a wide range of applications in various industries, due to their characteristics such as high strength, low density, resistance to fatigue, and corrosion.
	However, damage can occur in composites materials due to impacts resulting from the lack of reinforcement in the out-of-plane direction.
	In particular, laminated composite materials are more sensitive to delamination damage due to weak transverse tensile and interlaminar shear strengths.
	Delamination can alter the compression strength of composite laminate, and gradually affect the composite to encounter failure by buckling.
	Delaminations can seriously decrease the performance of composites structures, accordingly, delamination detection in its early stages can significantly help to avoid catastrophic structural collapses.

	One of the conventional techniques for damage identification for nondestructive evaluation (NDE) involves arrays of transducers that can be mounted or embedded in the structures for registering the response of the guided wave propagation.
	However, damage identification regarding structures with curved and deformable geometry can be inaccurate when using transducers array, also, damage influence maps resulted from transducer array have low resolution, due to the small number of sensing points.
    Accordingly, this issue of low resolution damage influence map can be solved by utilising a Scanning Laser Doppler Vibrometry (SLDV), which is a non-contact technique dedicated to full wavefield measuring vibration and guided wave propagation by registering measurements for a dense mesh of measuring points spanned over the area of the investigated structure.
    Consequently, SLDV produces a full wavefield of measurements with high resolution of damage influence maps which can significantly improve the process of damage detection and localization.

    Conventional damage detection and localization methods focus on patterns extraction from registered measurements (whether from transducers array or SLDV) and accordingly make decisions based on the patterns ~\cite{Gul2009}.
    Moreover, conventional methods for patterns recognition requires feature selection and classification (handcrafted features).
	These conventional methods can perform efficient damage detection, however, these methods depend on selected features from their scope of measurement, accordingly, introducing new patterns will cause them to fail in detecting the damage.
	Moreover, these methods could fail in detecting damage when dealing with big data requiring a complex computation of damage features.

    In this work, we investigate delamination since it is one of the most dangerous damage types.

\subsection{Review of Damage detection Techniques within composite materials }
Different approaches were applied for detecting damage in composite materials. Yet, A well-known method that is used for that purpose are the Lamb wave techniques. In general, we can define Lamb waves as an elastic vibration that can propagate in solid structures (plates wrapped into cylindrical pipes or vessels or plates cut into thin strips, etc.) with free boundaries. In which, Lamb waves consist of two types of waves, symmetric ($S0,S1,S2...$) and anti-symmetric ($A0,A1,A2...$) modes , and each mode can propagate independently of the other. Lamb waves ($A0$ mode) are commonly used due to the fact that it can propagate for long distances with little dispersion, and no higher modes are present to turbulence the resulting response wave~\cite{Valed2000}.

The earliest application of Lamb waves on composite materials was performed by Saravanos~\cite{doi:10.2514/6.1994-1754}, in which he explored the possibility of detecting delamination in composite beams using Lamb waves. Later, Percival and Birt~\cite{Percival1997}, who started focusing their work on the two fundamental Lamb wave modes have concluded the same. Damage Detection in composite materials of other forms was also inspected by Seale~\cite{Seale1998}, who examined fatigue and thermal damage. Also, Tang~\cite{Tang1989} examined the sensitivity of Lamb wave propagation to fiber fracture.

There are plenty of methods which utilizes Lamb waves for damage detection in SHM. One of the successful approaches has been done by two separate groups (Cawley and Soutis) at Imperical College, Cawley's group has developed polyvinylidenefluride(PVDS) transducers in which it can generate Lamb waves and receive it, those generated waves are highly focused. Soltis's group main focus was on sensor placement and signal processing issues~\cite{Valed2000,Valed2000a,Valed2001}. They have chosen to use Lead–Zirconate–Titanate (PZT) actuators and sensors over PVDF since they require a factor of ten less voltage to generate Lamb waves. Moreover, implemented Lamb wave techniques in SHM are broadly reported to be beneficial, efficient and sensitive in detecting defects in metallic structures, disbonds and delaminations in composite structures~\cite{Boller2000,Diamanti2004,Su2006,Raghavan2007,Diamanti2007} \newline Authors in~\cite{Ng2009}

In this work, we went a step further, we used a large collection of signals (animation of propagating elastic waves), which are registered on very dense grid of points resembles scanning laser vibrometer measurements. Such collection of signals is often called full wave-field.
It was found
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Methodology}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Dataset}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
In this work, we have generated a large dataset of 475 cases of a full wavefield of propagating Lamb waves in a plate made of carbon fibre-reinforced plastic (CFRP).
The time domain spectral element method was used for simulation of Lamb wave interaction with delamination.
For each case single delamination was modelled by using the method of splitting nodes between appropriate spectral elements.
It was assumed that the composite laminate is made of eight layers of total thickness 3.9 mm.
The delamination was modelled between the third and fourth layer (see Fig.~\ref{fig:plate_setup} for details).
It should be noted that the figure shows exaggerated cross-section through the delamination.
Zero-volume delamination was assumed in the model.
For each case delamination location was selected randomly so that interaction of guided waves excited at the plate centre with delamination is different for each case.
It includes cases when delamination is located at the edge of the plate which is the most difficult to identify by signal processing methods.
Additionally, the size of the delamination was randomly simulated by selecting ellipse minor and major axis from the interval 5--20 mm.
Also the angle between delamination major axis and horizontal axis was randomly selected.
\begin{figure}
	\centering
	\includegraphics[scale=0.8]{plate_delam_arrangement_MSSP.png}
	\caption{Setup for computing Lamb wave interactions with delamination.}
	\label{fig:plate_setup}
\end{figure}

The output from the top and bottom surface of the plate in the form of particle velocities at the nodes of spectral elements were projected on the uniform grid of 500\(\times\)500 points by using shape functions of elements (see Parallel spectral element method for guided wave based structural health monitoring paper for detail).
It essentially resembles measurements acquired by scanning laser Doppler vibrometer (SLDV) in the transverse direction (perpendicular to the plate surface).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Signal processing strategy}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{figure}
	\centering
	\includegraphics[scale=0.8]{FCN_adaptive_filtering_diagram_MSSP.png}
	\caption{Diagram of signal processing strategy by the proposed Fully Convolutional Network (left branch) in comparison to signal processing utilising adaptive wavenumber filtering method (right branch). }
	\label{fig:sig_proc_strategy}
\end{figure}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Adaptive wavenumber filtering}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Fully Convolutional Network approach}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
In this work, A deep learning approach for delamination detection in composite materials is presented.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{Data preprocessing}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
It should be noted that the output from the wave propagation model is in the form of 3D matrix which contains amplitudes of propagating waves at location \((x, y)\) and time \(t\). We can look at it as a set of frames of propagating waves at discrete time moments \(t_k\).

The data preprocessing as it is indicated in Fig. ?? include a step of computation of root mean square value:
\begin{equation}
\hat{s}(x,y) = \sqrt{\frac{1}{N}\sum_{k=1}^{N} s(x,y,t_k)^2}
\end{equation}
where number of sampling points \(N\) was 512.
In this way, dataset was collapsed to 475 2D matrices in which amplitudes are stored as double precision values.
The next step was conversion of these matrices to greyscale images (colour image quantisation).
Colour scale values of obtained images vary between (\(0 - 255\)) hence normalization
to a range of (\(0-1\)) was applied to enhance the optimizer function during the learning process.
Furthermore data augmentation was achieved by flipping images vertically, horizontally and diagonally to enhance the learning process through enabling the model to learn and recognize new complex patterns.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{Basic concept of Fully Convolutional Network}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
The main purpose of such approach is to automatically perform feature extraction by training a model using full wavefield images, hence, it will learn by itself to recognise the patterns and detect the delamination and localize it.
In our work we are using fully convolutional network (FCN), which aims to perform pixel-wise segmentation by classifying every pixel of the input image as damaged or not.
Therefore, several models were implemented for that purpose.

The idea behind FCN is to stack a group of convolutional layers in an encoder-decoder style.
The encoder is capable for downsampling the input image through convolutions with strides, consequently, resulting in a compressed feature representation of the input image, and the decoder is capable to upsample the image with compressed features applying techniques like transposed convolution with strides and upsampling with interpolation (e.g. bilinear or nearest).

In order to reduce overfitting in the models, some techniques were applied such as adding dropouts to layers.

For the output layer, we have applied two activation functions in separate experiments, the first one is softmax and the second one is sigmoid.
The softmax function calculates the probability of the damaged and the undamaged for every single pixel, hence, the summation of the two probabilities must equal one. Eqn.~\ref{softmax} illustrates the softmax, where \(P(x)_{i}\) is the probability of each target class \(x_{j}\) over all possible target classes \(x_{j}\), C in our case are two classes  (damaged and undamaged.
To predict the output label of the detection (\(y_{pred}\)) which represent the probability of damaged and undamaged we applied the \(argmax\) function to select the maximum probability of the softmax activation function.
\begin{equation}
P(x)_{i} = \frac{e^{x_{i}}}{\sum_{j}^{C} e^{x_{j}}}
\label{softmax}
\end{equation}
\begin{equation}
y_{pred} = aragmax_{i}\left( \left[P(x)_{i}\right]\right)
\label{argmax}
\end{equation}

When using sigmoid in the output layer, it produces a vector of values between (\(0\) and \(1\)) indicating the damage weight for each pixel.
Low values indicate low damage probability and high output values indicate high damage probability. Eqn.~\ref{sigmoid} illustrates the sigmoid function,
where \(z\) is the summation of adjustable weights \(\{w_0,w_1,...,w_n \}\) multiplied by input variables (from previous layer) \(\{x_0,x_1,_...,x_n\}\) and a bias \(b\) as shown in Eqn~\ref{z}.
\begin{equation}
	\sigma(z) = \frac{1}{1+e^{-z}}
	\label{sigmoid}
\end{equation}
\begin{equation}
	z= \sum_{i=0}^{n}  w_i\times x_i +b
	\label{z}
\end{equation}
Selecting the loss function is a crucial task in deep learning since it measures how good the model predicts.
We have applied two types of losses based on the used function in the final activation layer: Binary cross-entropy (BCE) loss function applied with a sigmoid activation function in the output layer, Categorical cross-entropy (CCE) loss function with a softmax activation in the output layer which is also called softmax loss function.
Eqn.~\ref{BCE} illustrates the BCE, where \(\hat{Y}\) represents the predicted vector values and \(Y\) represents the ground truth vector values, when \(\hat{Y} \approx Y\) then the BCE will be almost \(0\) meaning that the model was able to predict the output, so, the aim is to reduce the loss function to the minimum value.
\begin{equation}
	BCE = (1-Y)log(1-\hat{Y})+Ylog(\hat{Y})
	\label{BCE}
\end{equation}
Eqn.~\ref{CCE} illustrates the CCE, where \( P(x)_{i}\) is the softmax value of the target class.
\begin{equation}
CCE = -log\left( P(x)_{i} \right)
\label{CCE}
\end{equation}

Moreover, we have applied intersection over union (IoU) as our accuracy metric.
IoU is applied to find the intersection area between the ground truth value and the predicted value eqn.~\ref{IoU} illustrates the IoU metric.
The intersection between the predicted and the ground truth values is simply calculated through multiplying their values then summing the resulted values.
As we mentioned earlier the ground truth values are either \((0\) or \(1)\) thus only the predicted values larger than \(0\) and their ground truth label is \(1\) will be counted, the rest values will equal to \(0\).
The union can be calculated by summing all values in both the predicted and the ground truth  vectors, then we subtract the intersection from their sum.
Our main goal is to maximize the IoU accuracy metric, since the higher the IoU, the higher the accuracy of the predicted delamination damage.
\begin{equation}
IoU = \frac{Intersection}{Union} = \frac{\hat{Y} \cap Y}{\hat{Y} \cup Y}
\label{IoU}
\end{equation}

Furthermore, during training the model our focus is to minimize the loss and maximize the accuracy metric by converting it into an optimization problem.
The optimizer is responsible for updating the model learnable parameters such as filters weights and biases in a way the overall loss is minimized and the accuracy is maximized.
In our work, Adam optimizer was applied, which is considered as a combination of RMSprob and Stochastic Gradient Descent (SGD)~\cite{Kingma2015}.

In the next subsections we are going to present three FCN models for pixel wise semantic segmentation in order to detect and localize delaminations.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{U-net based model}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Our first FCN model is the U-net model, which was introduced by Ronneberger et al.~\cite{Ronneberger2015} for biomedical image segmentation constructed from two parts encoder and decoder.
This architecture consists of three sections: The downsampling section, The bottleneck, and the upsampling section.
The downsampling section holds several contraction blocks.
Each block takes an input applies two (\(3\times3\)) convolution layers followed by a (\(2\times2\)) max pooling with a (\(2\times2\)) strides.
The number of convolutional filters is doubled after each downsampling block so that architecture can learn the complex patterns effectively.
The bottleneck layer meddles between the downsampling section and the upsampling section.
It composed of two (\(3\times3\)) convolution layers followed by (\(2\times2\)) up convolution layer (Transpose convolution).
The upsampling section is similar to downsampling section, it also consists of several upsampling blocks.
Each block passes the input to two (\(3\times3\)) convolution layers followed by a (\(2\times2\)) Convolutional transposed layer (upsampling).
Moreover, after each block, the number of feature maps used by convolutional layer get half to keep the model symmetrical.
Further, skip connections were added by appending feature maps of the downsampling block with the corresponding upsampling block to retrieve lost spatial information during the downsampling to due to decreasing the input resolution.
By doing so, the model ensures that the feature maps which were learned during the image downsampling will be utilised to reconstruct it.
Furthermore, to enhance the model training performance we applied a technique called batch-normalization (BN)~\cite{Ioffe2015}.
The term "batch" was added because, during training, we normalize the output of the previous layer for each batch, applying a transformation that keeps the mean activation value close to \(0\) and the activation standard deviation close to \(1\), which eventually enhances the learning rate.
\begin{figure} [h!]
	\begin{center}
		\includegraphics[scale= 0.8]{Unet_model.png}
	\end{center}
	\caption{U-Net architecture.}
	\label{fig:Unet}
\end{figure}
Fig.~\ref{fig:Unet} presents the model architecture showing the path of the input of a full wavefield image of a size (\(512\times512\)) through the downsampling, bottleneck then the upsampling finally to the output which contains the prediction of delamination size and location.
In the downsampling section,
Each layer performs (\(3\times3\)) convolution, followed by Relu activation function followed by BN operation.
Further, the Transmission Down layer contains a Maxpool function with (\(2\times2\)) pooling filter and a (\(2\times2\)) strides that picks the maximum value in a local pool filter in one feature map (or \(n\)-feature maps), resulting in a reduction in the dimension of feature maps~\cite{Lecun2015}, consequently, reducing computation complexity.
The bottleneck section is the deepest section in the model, it contains two convolutional layers, with 256 filters which helps the model to learn and recognize new complex patterns.
The Upsampling section is similar to the down sampling section, in which each layer  performs (\(3\times3\)) convolution, followed by Relu activation function followed by BN operation. But, for the Transmission Up layer it perform the opposite of downsampling.
The purpose is to retrieve the dimensions before sampling and increase the resolution of the images.
For this model we have applied a (\(3\times3\))Transposed convolution with (\(2\times2\)) strides.
Transposed convolution layer differs from the regular upsampling function, by introducing learnable parameters regarding the transposed convolution filters that enhance the learning process of the model, therefore, new patterns are recognized.

\subsubsection{FCN-DenseNet based model}
FCN-DenseNet was introduced by Simon Jegou et al.~\cite{Jegou} for semantic segmentation, it was originally based on the DenseNet model proposed by Gao Huang et al.~\cite{Huang}.
The main advantage of FCN-DenseNet over DenseNet is the extra utilising of feature maps by adding the upsampling path to the model.
FCN-DenseNet is composed of downsampling path, upsampling path and skip connection.
Skip connections from the downsampling path to the corresponding upsampling path are essential for recovering spatially detailed information by reusing feature maps.

The essential component in FCN-DenseNet is the dense block.
The purpose of the dense block is to concatenate layer input (feature maps) with its output (feature maps) to emphasize spatial details information.
A dense block is constructed from \(n\) varying number of layers, each layer is composed of a series of operations.
Figure~\ref{dense_block} presents the architecture of dense block has an input (\(x\)) (input image or output of transition layer) with \(k\) feature maps is concatenated with the output of first layer and this process is recursively performed for all layers in the dense block ending up with output (\(y\)) with a (\(n\times k\)) feature maps.
Transition down layer was introduced to reduce the spatial dimensionality of the feature maps, to perform that a (\(1\times 1\))  convolution followed by (\(2\times2\)) Maxpool operation are applied.

\begin{figure} [h!]
	\begin{center}
		\includegraphics{DenseBlock_layer.png}
	\end{center}
	\caption{Dense Block architecture.}
	\label{dense_block}
\end{figure}

For the transition up layer, it was introduced in FCN-DenseNet to recover the input spatial resolution, to do that a transpose convolution operation is performed which upsamples the previous feature maps.
Feature maps emerging from upsampling are concatenated with the ones resulting from the skip connection forming the input to a new dense block.
During the upsampling, the input to the dense block is not concatenated with its output to overcome the overhead of memory shortage since the upsampling path expands the spatial resolution of the feature maps.
Table~\ref{layers} presents the architecture of a single layer, the transition down  and transition up layers in details.

\begin{table}[]
	\centering
	\scriptsize
	\begin{tabular}{|c|l|c|l|c|}
		\cline{1-1} \cline{3-3} \cline{5-5}
		\textbf{Layer} &  & \textbf{Transition Down} &  & \textbf{Transition Up} \\ \cline{1-1} \cline{3-3} \cline{5-5}
		Batch Normalization &  & Batch Normalization &  & \multirow{5}{*}{\begin{tabular}[c]{@{}c@{}}(\(3\times3\)) Transposed Convolution, \\ strides = (\(2\times2\))\end{tabular}} \\ \cline{1-1} \cline{3-3}
		Relu &  & Relu &  &  \\ \cline{1-1} \cline{3-3}
		(\(3\times3\)) Convolution &  & (\(1\times1\)) Convolution &  &  \\ \cline{1-1} \cline{3-3}
		\multirow{2}{*}{Dropout \(p = 0.2\)} &  & Dropout \(p = 0.2\) &  &  \\ \cline{3-3}
		&  & (\(2\times2\)) Maxpooling &  &  \\ \cline{1-1} \cline{3-3} \cline{5-5}
	\end{tabular}
	\caption{Layer, Transition Down and Transition Up layers.}
	\label{layers}
\end{table}

Our constructed model is composed of \(3\) dense blocks in the downsampling path, one dense block in bottleneck and 3 dense blocks for the upsampling path.
Each dense block in the downsampling and upsampling paths consists of \(2\) layers, the bottleneck dense block consists of \(4\) layers.
The model input is a full wavefield image with size of (\(512\times 512\)), at the beginning , we perform a  convolution operation and concatenate the original input with the output then the concatenated output is fed into the first dense block that consist of (\(2\)) layers, each layer is composed of BN followed by Relu then (\(3\times3\)) convolution with same padding is applied followed by a dropout with probability \(p = 0.2\).
Then, the output of the first dense layer is concatenated with its input are fed into a transition down layer composed of BN followed by Relu then (\(1\times1\)) convolution followed by a dropout with probability \(p = 0.2\) then (\(2\times2\)) Maxpool with strides of (\(2\times2\))  , this process is repeated till the bottleneck dense block.
The bottleneck dense block consist of 4 layers
The output of the bottleneck is directed into upsampling path starting with transition up layer.
Accordingly, the output of the transition up layer is concatenated with the corresponding dense block output in the downsampling path, the final layer in the network is  (\(1\times1\)) convolution followed by a sigmoid function to calculate the probability of damage for each pixel.
\begin{figure} [h!]
	\begin{center}
		\includegraphics[scale= 0.8]{FCN_dense_net.png}
	\end{center}
	\caption{FCN-DenseNet architecture.}
	\label{fcn}
\end{figure}
Figure~\ref{fcn} illustrates the FCN-DenseNet architecture for image segmentation used for delamination detection.

\subsubsection{FCN-VGG16}
In this model we address the use of VGG16-based encoder~\cite{Simonyan2015} with 13-convolutional layers.
VGG16 encoder is composed of convolutional layers, pooling layers and dense layers, and it was used for classification purposes.
In our last model, we employed an encoder decoder scheme for pixel wise image segmentation.
Both encoder and decoder layers were trained from scratch.
Figure~\ref{vgg16} presents the architecture of VGG16- encoder decoder model.
The model consists of two paths: downsampling and upsampling.
The downsampling path consists of \(5\) convolutional blocks,  with a total \(13\) convolutional layers  with same padding and kernel size (\(3\times3\))and 32 filters for each layer, followed by BN and activation function Relu.
Each convolutional layer is responsible for extracting high level features from the input image such as edges.
A Maxpool operation with pool size of (\(2\times2\))  and (\(2\times2\)) strides followed by dropout is performed after each convolutional block.
The upsampling path is introduced to recover spatial resolution, it also has \(5\) convolutional blocks with a total \(13\) convolutional layers  with same padding and kernel size (\(3\times3\))and 32 filters for each layer, followed by BN and activation function Relu.
For upsampling, bilinear interpolation with (\(2\times2\)) kernel size is applied.
Skip connections were added between downsampling blocks and the corresponding upsampling blocks in order to enhance recovering fine-grained details by enabling feature reusability from earlier layers.
\begin{figure} [h!]
	\begin{center}
		\includegraphics[scale=0.8]{VGG16_encoder_decoder.png}
	\end{center}
	\caption{VGG16 encoder decoder architecture.}
	\label{vgg16}
\end{figure}

\section{Results and Discussions}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Conclusions}

	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

	%\appendix

\section*{}

\section*{ }
\bibliography{report}{}
\bibliographystyle{num_order}

\end{document}


text:
\chapter{Installation}\label{sec:installation}

Installing Rockbox is generally a quick and easy procedure. However
before beginning there are a few important things to know.

\section{Before Starting}

\opt{e200}{\fixme{NOTE: These instructions will not work on the
``Rhapsody'' version of the E200 series (also known as E200R). Please
follow the instructions at
\url{http://www.rockbox.org/twiki/bin/view/Main/SansaE200RInstallation}.}}

\opt{ipodnano,ipodnano2g,ipodvideo,e200,c200,c200v2,e200v2,clipv1,clipv2,cowond2,fuze,fuzev2}{
\begin{description}
\item[Supported hardware versions.]
    \opt{ipodnano,ipodnano2g}{
    The \playertype{} is available in multiple versions, not
    all of which run Rockbox.  Rockbox presently runs only on
    the first and second generation Ipod Nano. Rockbox does
    \emph{not} run on the third, fourth or fifth generation Ipod Nano.
    For information on identifying which Ipod you own, see this page on
    Apple's website: \url{http://www.info.apple.com/kbnum/n61688}.
  }
  \opt{ipodvideo}{
    The \playertype{} is the 5th/5.5th generation \playerman{} only.
    Rockbox does \emph{not} run on the newer, 6th/Classic generation Ipod.
    For information on identifying which Ipod you own, see this page on Apple's
    website: \url{http://www.info.apple.com/kbnum/n61688}.
  }
  \opt{c200,c200v2,e200,e200v2}{
    The \playertype{} is available in multiple versions, and you need to make
    sure which you have by checking the Sandisk firmware version number under
    Settings $\rightarrow$ Info. The v1 firmware is named 01.xx.xx, while the
    v2 firmware begins with 03. Make sure that you are following the
    instructions from the correct manual.
}
  \opt{clipv1,clipv2,fuze,fuzev2}{
    The \playertype{} is available in multiple versions, and you need to make
    sure which you have by checking the Sandisk firmware version number under
    Settings $\rightarrow$ \opt{fuze,fuzev2}{System Settings $\rightarrow$}
    Info. The v1 firmware is named 01.xx.xx, while the v2 firmware begins with
    02. Make sure that you are following the instructions from the correct
    manual.
}
  \opt{cowond2}{
    Rockbox runs on all \playerman{} \playertype{} and \playertype{}+ variants
    (2 / 4 / 8 / 16~GB, with or without DAB/DMB).
    \note{Newer \playertype{}+ hardware revisions use an updated power
    management chip, and some functionality is not yet implemented on these
    players (e.g. touchscreen support).}
}
\end{description}
}

\opt{cowond2}{
\begin{description}
  \item[Current limitations.] Most Rockbox functions are usable on the
    \playertype{}/\playertype{}+, including music playback and most plugins, but
    there are a number of shortcomings that prevent it from being a fully
    supported target:
    \begin{itemize}
      \item An SD card is required to use many features, since the internal
        flash memory is read-only in Rockbox.
        \warn{The SD driver is still in development and may contain bugs.
          There have been reports of SD cards becoming unusable after being used
          with Rockbox on \playerman{} \playertype{}. Only use old, low-capacity
          cards until we are satisfied the driver is safe to use.\\}
      \item There is only basic touchscreen support. Further work is
        required to make the UI more usable with a touchscreen in general.
        \note{The touchscreen can be used in two modes, either a 3$\times$3 grid mode
          which divides the screen into areas to emulate a set of physical
          buttons (the default setting), or ``absolute point'' mode where the
          touchscreen is used to point to items on the screen.\\}
    \end{itemize}
\end{description}
}
\opt{ondavx777}{
\begin{description}
  \item[Current limitations.] Most Rockbox functions are usable on the
    \playertype{}, including music playback and most plugins, but
    there are a number of shortcomings that prevent it from being a fully
    supported target:
    \begin{itemize}
      \item A MicroSD card is required to run Rockbox, since the internal
        flash memory hasn't been figured out yet.
      \item There is only basic touchscreen support. Further work is
        required to make the UI more usable with a touchscreen in general.
        \note{The touchscreen can be used in two modes, either a 3$\times$3 grid mode
          which divides the screen into areas to emulate a set of physical
          buttons (the default setting), or ``absolute point'' mode where the
          touchscreen is used to point to items on the screen.\\}
    \end{itemize}
\end{description}
}
\opt{iriverh300}{
\begin{description}
  \item[DRM capability.] If your \dap{} has a US firmware, then by installing Rockbox you will
  \emph{permanently} lose the ability to playback files with DRM.
\end{description}
}

\opt{sansaAMS,fuzeplus}{
\begin{description}
  \item[DRM capability.] It is possible that installation of the bootloader
  may lead to you \emph{permanently} losing the ability to playback files
  with DRM.
\end{description}
}

\nopt{gigabeats}{
\begin{description}

\nopt{ipod1g2g}{
  \item[USB connection.]
}
\opt{ipod1g2g}{
  \item[Firewire connection.]
}
  To transfer Rockbox to your \dap{} you need to
  connect it to your computer. For manual installation/uninstallation, or
  should autodetection fail during automatic installation, you need to know
  where to access the \dap{}. On Windows this means you need to know
  the drive letter associated with the \dap{}. On Linux you need to know
  the mount point of your \dap{}. On Mac OS X you need to know the volume
  name of your \dap{}.

  \opt{ipod}{
    If you have Itunes installed and it is configured to open automatically
    when your \dap{} is attached (the default behaviour), then wait for it to
    open and then quit it. You also need to ensure the ``Enable use as disk''
    option is enabled for your \dap{} in Itunes. Your \dap{} should then enter
    disk mode automatically when connected to a computer via
    \nopt{ipod1g2g}{USB.}\opt{ipod1g2g}{Firewire.} If your computer does not
    recognise your \dap{}, you may need to enter disk mode manually. Disconnect
    your \dap{} from the computer. Hard reset the \dap{} by pressing and
    holding the \ButtonMenu{} and \nopt{IPOD_3G_PAD}{\ButtonSelect{}}%
    \opt{IPOD_3G_PAD}{\ButtonPlay{}} buttons simultaneously. As soon as the
    \dap{} resets, press and hold the \nopt{IPOD_3G_PAD}{\ButtonSelect{} and
    \ButtonPlay{}}\opt{IPOD_3G_PAD}{\ButtonLeft{} and \ButtonRight{}} buttons
    simultaneously. Your \dap{} should enter disk mode and you can try
    reconnecting to the computer.
  }
  \opt{iaudiox5}{
    When instructed to connect/disconnect the USB cable, always use
    the USB port through the subpack, not the side `USB Host' port. The side port
    is intended to be used for USB OTG connections only (digital cameras, memory
    sticks, etc.).
  }
  \opt{sansa,e200v2,clipv1,clipv2,fuzeplus,c200v2}{
    \note{The following steps require you to change the setting in
    \setting{Settings $\rightarrow$ USB Mode} to \setting{MSC} from within the
    original firmware.}

    \nopt{sansaAMS,fuzeplus}{
        \warn{Never extract files to your \dap{} while it
        is in recovery mode.}
    }
  }

  \opt{fuze,fuzev2,clipplus,clipzip}{
    \note{The following steps require you to change the setting in
    \setting{Settings $\rightarrow$ System Settings $\rightarrow$ USB Mode} to
    \setting{MSC} from within the original firmware.  Further note that
     all original firmware settings will be lost immediately after patching
     the bootloader, so you may need to correct this setting again after
     installing rockbox.}
  }

  \opt{iriverh10,iriverh10_5gb}{
    The installation requires you to use UMS mode and so
    may require use of the UMS trick, whereby it is possible to force a MTP
    \playertype{} to start up in UMS mode as follows:
      \begin{enumerate}
        \item Ensure the \dap{} is fully powered off by \opt{iriverh10}{using
          a pin to push the small reset button inside the hole between the
          \ButtonHold{} switch and remote control connector.}\opt{iriverh10_5gb}{removing
          the battery and putting it back in again.}
        \item Connect your \playertype{} to the computer using the data cable.
        \item Hold \ButtonRight{} and push \ButtonPower{} to turn the \dap{} on.
        \item Continue holding \ButtonRight{} until the USB Connected screen appears.
        \item The \dap{} will now appear as a regular disk on your computer.
      \end{enumerate}
      \note{Once Rockbox has been installed, when you shut down your \dap{} from Rockbox it will totally
       power the player off so step 1 is no longer necessary.}
  }
  \opt{gigabeatf}{The installation requires you to change a setting in the
      original firmware.  Make sure the option under \setting{Setup
      $\rightarrow$ Connections $\rightarrow$ PC Connections} is set to
      \setting{gigabeat room}. Also, during installation, do not connect your
      \dap{} using the cradle but plug the USB cable directly to the \dap{}.
  }
  \opt{vibe500,samsungyh}{
    The installation requires you to use UMS mode.
    In order to start up your \playertype{} in UMS mode you need to:
      \begin{enumerate}
        \item Turn off the \dap{} (Original Firmware).
        \item Connect your \playertype{} to the computer using the data cable.
        \opt{vibe500}{
        \item Push and hold \ButtonPower{} (for about 2 seconds) until the ``USB'' screen appears.
        }
      \end{enumerate}
    The \dap{} will now appear as a regular disk on your computer.
  }
\end{description}
}

\opt{ipod,sansa}{
\begin{description}
  \item[Administrator/Root rights.] Installing the bootloader portion of Rockbox
  requires you to have administrative (Windows) or root (Linux) rights.
  Consequently when doing either the automatic or manual bootloader install,
  please ensure that you are logged in with an administrator account or have root rights.
\end{description}
}

\opt{ipod}{
\begin{description}
  \item[File system format.] Rockbox only works on Ipods formatted with
  the FAT32 filesystem (i.e. Ipods initialised by Itunes
  for Windows). It does not work with the HFS+ filesystem (i.e. Ipods
  initialised by Itunes for the Mac). More information and instructions for
  converting an Ipod to FAT32 can be found on the
  \wikilink{IpodConversionToFAT32} wiki
  page on the Rockbox website. Note that after conversion, you can still use
  a FAT32 Ipod with a Mac.
\end{description}
}

\section{Installing Rockbox}\label{sec:installing_rockbox}\index{Installation}
There are two ways to install Rockbox: automated and manual. The automated
way is the preferred method of installing Rockbox for the majority of
people. Rockbox Utility is a graphical application that does almost everything
for you. However, should you encounter a problem, then the manual way is
still available to you.\\

\opt{gigabeats}{\note{The automated install is not yet available for the
  \playerlongtype{}. For now you can use the manual method to install Rockbox.
  Please still read the section on the automatic install as it explains
  various important aspects of Rockbox, such as the different versions
  available.\\}}

\opt{hwcodec}{Rockbox itself comes as a single package. There is no need
  to install additional software to run Rockbox.}
\opt{swcodec} {
  \opt{HAVE_RB_BL_ON_DISK}{There are three separate components,
    two of which need to be installed in order to run Rockbox:}
  \opt{HAVE_RB_BL_IN_FLASH}{There are two separate components
    which need to be installed in order to run Rockbox:}

\begin{description}
\opt{HAVE_RB_BL_ON_DISK}{
\item[The \playerman{} bootloader.]
  The \playerman{} bootloader is the program that tells your \dap{} how to load
  and start the original firmware. It is also responsible for any emergency,
  recovery, or disk modes on your \dap{}. This bootloader is stored in special flash
  memory in your \playerman{} and comes factory-installed. It is not necessary
  to modify this in order to install Rockbox.}

\item[The Rockbox bootloader.] \index{Bootloader}
  \opt{HAVE_RB_BL_ON_DISK}{The Rockbox bootloader is loaded from disk by
  the \playerman{} bootloader. It is responsible for loading the Rockbox
  firmware and for providing the dual boot function. It directly replaces the
  \playerman{} firmware in the \daps{} boot sequence.
  \opt{gigabeatf}{\note{Dual boot does not currently work on the Gigabeat.}}}

  \opt{HAVE_RB_BL_IN_FLASH}{
  The bootloader is the program that tells your
  \dap{} how to load and start other components of Rockbox and for providing
  the dual boot function. This is the component of Rockbox that is installed
  to the flash memory of your \playerman.
  \opt{iaudiom3,iaudiom5,iaudiox5}{\note{Dual boot does not currently work on the \playertype.}}}

\item[The Rockbox firmware.]
  \opt{HAVE_RB_BL_IN_FLASH}{Unlike the \playerman{} firmware, which runs
  entirely from flash memory,}
  \opt{HAVE_RB_BL_ON_DISK}{Similar to the \playerman{} firmware,}
  most of the Rockbox code is contained in a
  ``build'' that resides on your \daps{} drive. This makes it easy to
  update Rockbox. The build consists of a directory called
  \fname{.rockbox} which contains all of the Rockbox files, and is
  located in the root of your \daps{} drive.
\end{description}
}

\nopt{player} {
    Apart from the required parts there are some addons you might be interested
    in installing.
    \begin{description}
    \item[Fonts.] Rockbox can load custom fonts. The fonts are
        distributed as a separate package and thus need to be installed
        separately. They are not required to run Rockbox itself but
        a lot of themes require the fonts package to be installed.

    \item[Themes.] The appearance of Rockbox can be customised by themes. Depending
        on your taste you might want to install additional themes to change
        the look of Rockbox.
    \end{description}
}

\subsection{Automated Installation}

To automatically install Rockbox, download the official installer and
housekeeping tool \caps{Rockbox Utility}. It allows you to:
\begin{itemize}
\item Automatically install all needed components for using Rockbox
        (``Minimal Installation'').
\item Automatically install all suggested components (``Complete Installation'').
\item Selectively install optional components.
\nopt{player}{\item Install additional fonts and themes.}
\item Install voice files and generate talk clips.
\item Uninstall all components you installed using Rockbox Utility.
\end{itemize}

Prebuilt binaries for Windows, Linux and Mac OS X are
available at the \wikilink{RockboxUtility} wiki page.\\

\opt{gigabeats,ondavx777}{\note{Rockbox Utility does not currently support the
\playertype{} and you will therefore need to follow the manual install
instructions below.\\}}

When first starting \caps{Rockbox Utility} run ``Autodetect'',
found in the configuration dialog (File $\rightarrow$ Configure). Autodetection
can detect most player types. If autodetection fails or is unable to detect
the mountpoint, make sure to enter the correct values. The mountpoint indicates
the location of the \dap{} in your filesystem. On Windows, this is the drive
letter the \dap{} gets assigned, on other systems this is a path in the
filesystem.\\*

\opt{iriverh100,iriverh300}{
  Rockbox Utility will ask you for a compatible copy of the original
  firmware. This is because for legal reasons we cannot distribute
  the bootloader directly. Instead, we have to patch the Iriver firmware
  with the Rockbox bootloader.

  Download a supported version of the Iriver firmware for your
  \playername{} from the Iriver website, links can be found on
  \wikilink{IriverBoot}.

  Supported Iriver firmware versions currently include
  \opt{iriverh100}{1.63US, 1.63EU, 1.63K, 1.65US, 1.65EU, 1.65K, 1.66US,
    1.66EU and 1.66K. Note that the H140 uses the same firmware as the H120;
    H120 and H140 owners should use the firmware called \fname{ihp\_120.hex}.
    Likewise, the iHP110 and iHP115 use the same firmware, called
    \fname{ihp\_100.hex}. Be sure to use the correct firmware file for
    your player.}
    \opt{iriverh300}{1.28K, 1.28EU, 1.28J, 1.29K, 1.29J and 1.30EU.
    \note{The US \playername{} firmware is not supported and cannot be
    patched to be used with the bootloader. If you wish to install Rockbox
    on a US \playername{}, you must first install a non-US version of the
    original firmware and then install one of the supported versions patched
    with the Rockbox bootloader.}
    \warn{Installing a non-US firmware on a US \playername{} will
    \emph{permanently} remove DRM support from the player.}}

  If the file that you downloaded is a \fname{.zip} file, use an unzip
  utility like mentioned in the prerequisites section to extract
  the \fname{.hex} from the \fname{.zip} file
  to your desktop. Likewise, if the file that you downloaded is an
  \fname{.exe} file, double-click on the \fname{.exe} file to extract
  the \fname{.hex} file to your desktop.
  When running Linux you should be able to extract \fname{.exe}
  files using \fname{unzip}.
}

\opt{mpiohd200,mpiohd300}{
  Rockbox Utility will ask you for a compatible copy of the original
  firmware. This is because for legal reasons we cannot distribute
  the bootloader directly. Instead, we have to patch the MPIO firmware
  with the Rockbox bootloader.

  Download a supported version of the MPIO firmware for your
  \playername{} from the MPIO website, links can be found on
  \opt{mpiohd200}{\wikilink{MPIOHD200Port}}%
  \opt{mpiohd300}{\wikilink{MPIOHD300Port}}.

  \warn{The only tested version of the original firmware is
  \opt{mpiohd200}{1.30.05}\opt{mpiohd300}{1.30.06}
  and as such is the only supported version}

  If the file that you downloaded is a \fname{.zip} file, use an unzip
  utility like mentioned in the prerequisites section to extract
  the \fname{.SYS} from the \fname{.zip} file
  to your desktop. Likewise, if the file that you downloaded is an
  \fname{.exe} file, double-click on the \fname{.exe} file to extract
  the \fname{.SYS} file to your desktop.
  When running Linux you should be able to extract \fname{.exe}
  files using \fname{unzip}.
}

\opt{fuzeplus}{
  Rockbox Utility will ask you for a compatible copy of the original
  firmware. This is because for legal reasons we cannot distribute
  the bootloader directly. Instead, we have to patch the \playerman{}
  firmware with the Rockbox bootloader.

  Download a supported version of the \playerman{} firmware for your
  \playername{} from the \playerman{} website, links can be found on
  \wikilink{SansaFuzePlusPort}.
  \note{Although the only tested version of the original firmware is 02.38.6,
    Rockbox Utility should be able to patch any newer version.}
  \note{If the file that you downloaded is a \fname{.zip} file, use an unzip
    utility like mentioned in the prerequisites section to extract the
    \fname{firmware.sb} from the \fname{.zip} file to your desktop.}
}
\subsubsection{Choosing a Rockbox version}\label{sec:choosing_version}

There are three different versions of Rockbox available from the
Rockbox website:
\label{Version}
Release version, current build and archived daily build. You need to decide which one
you want to install and get the appropriate version for your \dap{}. If you
select either ``Minimal Installation'' or ``Complete Installation'' from the
``Quick Start'' tab, then Rockbox Utility will automatically install the
release version of Rockbox. Using the ``Installation'' tab will allow you
to select which version you wish to install.

\begin{description}

\item[Release.] The release version is the latest stable release, free
   of known critical bugs. For a manual install, the current stable release of Rockbox is
   available at \url{http://www.rockbox.org/download/}.

\item[Development Build.] The development build is built at each change to
  the Rockbox source code repository and represents the current state of Rockbox
  development. This means that the build could contain bugs but most of
  the time is safe to use. For a manual install, you can download the current build from
  \url{http://build.rockbox.org/}.

\item[Archived Build.] In addition to the release version and the current build,
  there is also an archive of daily builds available for download. These are
  built once a day from the latest source code in the repository. For a manual install,
  you can download archived builds from \url{http://www.rockbox.org/daily.shtml}.

\end{description}

\note{Because current and archived builds are development versions that
      change frequently, they may behave differently than described in this manual,
      or they may introduce new (and potentially annoying) bugs. Unless you wish to
      try the latest and greatest features at the price of possibly greater instability,
      or you wish to help with development, you should stick with the release.\\*}

Please now go to \reference{ref:finish_install} to complete the installation procedure.

\subsection{Manual Installation}

The manual installation method is still available to you, should you need or desire it
by following the instructions below. If you have used Rockbox Utility
to install Rockbox, then you do not need to follow the next section and can skip
straight to \reference{ref:finish_install}

\opt{gigabeats}{\subsubsection{Installing the bootloader}
    \input{getting_started/gigabeats_install.tex}
}

\subsubsection{Installing the firmware}\label{sec:installing_firmware}

\opt{gigabeats}{\note{When your \dap{} is in the Rockbox USB or bootloader
USB mode, you will see two visible partitions - the 150~MB firmware
partition (containing at least a file called \fname{nk.bin}) and
the main data partition. Rockbox \emph{must} be installed onto the main
data partition.}}

\begin{enumerate}
\item Download your chosen version of Rockbox from the links in the
  previous section.

\item Connect your \dap{} to the computer via USB
  \opt{sansa,sansaAMS,iriverh10,iriverh10_5gb,vibe500,fuzeplus,samsungyh}
  { in MSC mode }
  \opt{ipod3g,ipod4g,ipodmini,ipodcolor}{ or Firewire }as described in
  the manual that came with your \dap{}.

\item Take the \fname{.zip} file that you downloaded and use
 the ``Extract all'' command of your unzip program to extract
 the files onto
 \opt{gigabeats,fuzeplus}{the main data partition of }
 \opt{cowond2}{either an SD card or the internal memory of }
 \opt{ondavx777}{the MicroSD of }
 your \dap{}.
 \opt{cowond2}{\note{If you have chosen to extract to the internal memory, it
     will not be possible to save settings.}}
\end{enumerate}

\note{The entire contents of the \fname{.zip} file should be extracted
directly to the root of your \daps{} drive. Do not try to
create a separate directory on your \dap{} for the Rockbox
files! The \fname{.zip} file already contains the internal
structure that Rockbox needs.\\}

\opt{archos}{
 If the contents of the \fname{.zip} file are extracted correctly, you will
 have a file called \fname{\firmwarefilename} in the main directory of your
 \daps{} drive, and also a directory called \fname{.rockbox}, which contains a
 number of other directories and system files needed by Rockbox.
}

% This has nothing to do with swcodec, just that these players need our own
% bootloader so we can decide where we want the main binary.
\opt{swcodec}{
 If the contents of the \fname{.zip} file are extracted correctly, you will
 have a directory called \fname{.rockbox}, which contains all the files needed
 by Rockbox, in the main directory of your \daps{} drive.
}

\opt{swcodec}{%
    \nopt{gigabeats}{%
    \subsubsection{Installing the bootloader}
        \opt{iriverh100,iriverh300}{\input{getting_started/iriver_install.tex}}
        \opt{mpiohd200,mpiohd300}{\input{getting_started/mpio_install.tex}}
        \opt{ipod}{\input{getting_started/ipod_install.tex}}
        \opt{iaudio}{\input{getting_started/iaudio_install.tex}}
        \opt{iriverh10,iriverh10_5gb}{\input{getting_started/h10_install.tex}}
        \opt{gigabeatf}{\input{getting_started/gigabeat_install.tex}}
        \opt{sansa}{\input{getting_started/sansa_install.tex}}
        \opt{sansaAMS}{\input{getting_started/sansaAMS_install.tex}}
        \opt{mrobe100}{\input{getting_started/mrobe100_install.tex}}
        \opt{cowond2}{\input{getting_started/cowond2_install.tex}}
        \opt{vibe500}{\input{getting_started/vibe500_install.tex}}
        \opt{ondavx777}{\input{getting_started/ondavx777_install.tex}}
        \opt{IMX233}{\input{getting_started/IMX233_install.tex}}
        \opt{samsungyh}{\input{getting_started/samsungyh_install.tex}}
    }
}

\subsection{Finishing the install}\label{ref:finish_install}

\opt{gigabeatf}{
  After installing you \emph{need} to power-cycle the
  \dap{} by doing the following steps. Failure to do so may result in problems.
  \begin{itemize}
  \item Safely eject / unmount your \dap{} and unplug the USB cable.
  \item Unplug any power adapter.
  \item Hold the \ButtonPower{} button to turn off the \dap{}.
  \item Slide the battery switch located on the bottom of the \dap{} from
  `on' to `off'.
  \item Slide the battery switch back from `off' to `on'.
  \end{itemize}
}

\opt{iaudiom3,iaudiom5,iaudiox5}{
  After installing you \emph{need} to power-cycle the
  \dap{} by doing the following steps.
  \begin{itemize}
  \item Safely eject / unmount your \dap{} and unplug the USB cable.
  \item Hold the
     \opt{IAUDIO_X5_PAD}{\ButtonPower}
     \opt{IAUDIO_M3_PAD}{\ButtonPlay}
     button to turn off the \dap{}.
  \item Insert the charger. The Rockbox bootloader will automatically be flashed.
  \end{itemize}
}

\opt{iriverh10,iriverh10_5gb,ipod,mrobe100,sansa,archos,cowond2,vibe500,ondavx777,samsungyh}{
  Safely eject / unmount the USB drive, unplug the cable and restart.
}

\opt{sansaAMS}{
  Safely eject the device, unplug USB and wait for the firmware update to finish.
  Don't try to power off the device, it will shutdown by itself after a minute.
}

\opt{gigabeats}{
  Safely eject / unmount your \dap{}.
}

\opt{iriverh100,iriverh300}{
  \begin{itemize}
  \item Safely eject / unmount your \dap{}.

  \item \warn{Before proceeding further, make sure that your player has a full charge
  or that it is connected to the power adapter. Interrupting the next step
  due to a power failure most likely will brick your \dap{}.}
  Update your \daps{} firmware with the patched bootloader. To do this, turn
  the jukebox on. Press and hold the \ButtonSelect{} button to enter the main menu,
  and navigate to \setting{General $\rightarrow$ Firmware Upgrade}. Select
  \setting{Yes} when asked to confirm if you want to upgrade the
  firmware. The \playerman{} will display a message indicating that the
  firmware update is in progress. Do \emph{not} interrupt this process. When the
  firmware update is complete the player will turn itself off. (The update
  firmware process usually takes a minute or so.). You are now ready to go.
\end{itemize}
}
\opt{fuzeplus}{
  \warn{Before proceeding further, make sure that your player's battery is enough charged.
    Interrupting the next step due to a power failure most likely
    will brick your \dap{}.
  }
  \note{If you are updating/reinstalling the bootloader on a previously
    rockbox installed bootloader you will need to boot into the original
    firmware in order to perform the following step. See \reference{ref:Dualboot}
    for details on how to do so
  }
  Update your \daps{} firmware with the patched bootloader. To do this,
  safely eject /unmount your \dap{}. The update process should start
  immediatly. The \playerman{} will display an animation indicating that the
  firmware update is in progress with words: ``Updating Fuze+''.
  Do \emph{not} interrupt this process. When the firmware update is complete the
  player will restart (The update firmware process usually takes one to several
  minutes.). You are now ready to go.
}
\opt{mpiohd200}{
  \begin{itemize}
  \item Safely eject /unmount your \dap{}.

  \item \warn{Before proceeding further, make sure that your player has a full charge
  or that it is connected to the power adapter. Interrupting the next step
  due to a power failure most likely will brick your \dap{}.}
  Update your \daps{} firmware with the patched bootloader. To do this, turn
  the jukebox on. The update process should start automatically. The \playerman{} will
  display animation indicating that the firmware update is in progress. Do \emph{not}
  interrupt this process. When the firmware update is complete the player will restart.
  (The update firmware process usually takes a minute or so.). You are now ready to go.
\end{itemize}
}
\opt{e200}{Your e200 will automatically reboot and Rockbox should load.}

\subsection{Enabling Speech Support (optional)}\label{sec:enabling_speech_support}
\index{Speech}\index{Installation!Optional Steps}
If you wish to use speech support you will also need a voice file. Voice files
allow Rockbox to speak the user interface to you. Rockbox Utility can install
an English voice file, or you can download it from \url{http://www.rockbox.org/daily.shtml}
and unzip it to the root of your \dap{}.
Rockbox Utility can also aid you in the creation of voice files with different voices
or in other languages if you have a suitable speech engine installed on your computer.
Voice menus are enabled by default and will come
into effect after a reboot. See \reference{ref:Voiceconfiguration} for details
on voice settings.
Rockbox Utility can also aid in the production of talk files, which allow Rockbox
to speak file and folder names.

\section{Running Rockbox}
\nopt{ipod,gigabeats,cowond2}{When
you turn the unit on, Rockbox should load.}
\opt{ipod}{Hard reset the Ipod by holding
  \opt{IPOD_4G_PAD}{\ButtonMenu{} and \ButtonSelect{} simultaneously}%
  \opt{IPOD_3G_PAD}{\ButtonMenu{} and \ButtonPlay{} simultaneously}
  for a couple of seconds until the \dap{} resets. Now Rockbox should load.
}

\opt{gigabeats}{Rockbox should automatically load when you turn on your player.\\

  \note{
    If you have loaded music onto your \dap{} using the \playerman{}
    firmware, you will not be able to see your music properly in the
    \setting{File Browser} as MTP mode changes the location and file names.
    Files placed on your \dap{} using the \playerman{} firmware can be
    viewed by initialising and using Rockbox's database.
    See \reference{ref:database} for more information.}
}

\opt{cowond2}{
  To boot the Rockbox firmware set the \ButtonHold{} switch immediately after
  power on.\\
  \note{If you have chosen to install to an SD card and it is inserted at power
    on, Rockbox will boot from that card and use it as the primary drive for
    storing settings, etc. If there is no SD card inserted, Rockbox will boot
    from the internal memory, and it will not be possible to save settings.}
}

\opt{ipod}{
  \note{
    If you have loaded music onto your \dap{} using Itunes,
    you will not be able to see your music properly in the \setting{File Browser}.
    This is because Itunes changes your files' names and hides them in
    directories in the \fname{Ipod\_Control} directory. Files placed on your
    \dap{} using Itunes can be viewed by initialising and using Rockbox's database.
    See \reference{ref:database} for more information.
  }
}

\opt{iaudiom3}{
  \fixme{Add a note about the charging trick and place it here?}
}

\section{Updating Rockbox}
Rockbox can be easily updated with Rockbox Utility.
You can also update Rockbox manually -- download a Rockbox build
as detailed above, and unzip the build to the root directory
of your \dap{} as in the manual installation stage. If your unzip
program asks you whether to overwrite files, choose the ``Yes to all'' option.
The new build will be installed over your current build.\\

\opt{gigabeats}{
  \note{When your \dap{} is in the Rockbox USB or bootloader
  USB mode, you will see two visible partitions, the 150~MB firmware
  partition (containing at least a file called \fname{nk.bin}) and
  the main data partition. Rockbox \emph{must} be installed onto the main
  data partition.\\}
}

\nopt{hwcodec}{
  The bootloader only changes rarely, and should not normally
  need to be updated.\\
}

\note{If you use Rockbox Utility be aware that it cannot detect manually
        installed components.}

\section{Uninstalling Rockbox}\index{Installation!uninstall}

\nopt{gigabeatf,iaudiom3,iaudiom5,iaudiox5,archos,mrobe100,gigabeats,fuzeplus}{
  \note{The Rockbox bootloader allows you to choose between Rockbox and
  the original firmware. (See \reference{ref:Dualboot} for more information.)}
}

\subsection{Automatic Uninstallation}
\opt{gigabeats}{\note{Rockbox can only be uninstalled manually for now.}}

You can uninstall Rockbox automatically by using Rockbox Utility. If you
installed Rockbox manually you can still use Rockbox Utility for uninstallation
but will not be able to do this selectively.

\opt{iriverh100,iriverh300,fuzeplus}{\note{Rockbox Utility cannot uninstall the bootloader due to
the fact that it requires a flashing procedure. To uninstall the bootloader
completely follow the manual uninstallation instructions below.}}

\subsection{Manual Uninstallation}

\opt{archos}{
  If you would like to go back to using the original \playerman{} software,
  connect the \dap{} to your computer, and delete the
  \fname{\firmwarefilename} file.
}

\opt{iriverh10,iriverh10_5gb,mrobe100,vibe500,samsungyh}{
  If you would like to go back to using the original \playerman{} software,
  connect the \dap{} to your computer, and delete the
  \originalfirmwarefilename{} file and rename
  \fname{OF.mi4} to \originalfirmwarefilename{}
  in the \fname{System} directory on your \playertype{}.
  \nopt{mrobe100}{As in the installation,
  it may be necessary to first put your device into UMS mode.
  }
}

\opt{e200}{
  If you would like to go back to using the original \playerman{} software,
  connect the \dap{} to your computer, and follow the instructions to install
  the bootloader, but when prompted by sansapatcher, enter \texttt{u} for uninstall,
  instead of \texttt{i} for install. As in the installation, it may be necessary to
  first put your \dap{} into MSC mode.
}

\optv{ipod}{
  To uninstall Rockbox and go back to using just the original Ipod software, connect
  the \dap{} to your computer and follow the instructions to install
  the bootloader but, when prompted by ipodpatcher, enter \texttt{u} for uninstall
  instead of \texttt{i} for install.
}

\opt{iaudiom3,iaudiom5,iaudiox5}{
  If you would like to go back to using the original \playerman{} software,
  connect the \dap{} to your computer, download the original \playername{}
  firmware from the \playerman{} website, and copy it to the \fname{FIRMWARE}
  directory on your \playername{}. Turn off the \dap{}, remove the USB cable
  and insert the charger. The original firmware will automatically be flashed.
}

\opt{iriverh100,iriverh300}{
    If you want to remove the Rockbox bootloader, simply flash an unpatched
    \playerman{} firmware. Be aware that doing so will also remove the bootloader
    USB mode. As that mode can come in quite handy (especially if you experience
   disk errors) it is recommended to keep the bootloader. It also
    gives you the possibility of trying Rockbox anytime later by simply
    installing the distribution files.
    \opt{iriverh100}{
      The Rockbox bootloader will automatically start the original firmware if
      the \fname{.rockbox} directory has been deleted.
    }
    \opt{iriverh300}{
      Although if you retain the Rockbox bootloader, you will need to hold the
      \ButtonRec{} button each time you want to start the original firmware.
    }
}

    \opt{sansaAMS,fuzeplus}{
      Copy an unmodified original firmware to your player, and then reboot into
      the Sandisk firmware. See \reference{ref:Dualboot} for more information.
}

\opt{mpiohd200}{
    If you want to remove the Rockbox bootloader, simply flash an unpatched
    \playerman{} firmware.
}

\nopt{gigabeats}{
  If you wish to clean up your disk, you may also wish to delete the
  \fname{.rockbox} directory and its contents.
  \nopt{iaudiom3,iaudiom5,iaudiox5}{Turn the \playerman{} off.
    Turn the \dap{} back on and the original \playerman{} software will load.}
}

\opt{gigabeats}{
  If you wish to clean up your disk by deleting the
  \fname{.rockbox} directory and its contents, this must be done
  before uninstalling the bootloader in the next step.

  Before installation you should have downloaded a copy of the \playerman{}
  firmware from
  \url{http://www.tacp.toshiba.com/tacpassets-images/firmware/MESV12US.zip}.
  \begin{itemize}
  \item Extract \fname{MES12US.iso} from the \fname{.zip} downloaded above.
  \item There are two files within \fname{MES12US.iso} called
  \fname{Autorun.inf} and \fname{gbs\_update\_1\_2\_us.exe}.  Extract them with
  your favourite unzipping utility e.g. 7zip.
  \item Connect your \dap{} to your computer.
  \item Extract \fname{nk.bin} from within
  \fname{gbs\_update\_1\_2\_us.exe} using e.g. 7zip and copy it to the 150~MB
  firmware partition of your \dap{}.
  \item Safely eject / unmount the USB drive, unplug the cable and restart.
  \end{itemize}

  \note{From Windows, you can also run \fname{gbs\_update\_1\_2\_us.exe}
  directly to restore your \dap{}. This will format your \dap{},
  removing all files.}
}

\section{Troubleshooting}
\begin{description}
\opt{sansa,ipod}{
  \item[Bootloader install problems]
  If you have trouble installing the bootloader,
  please ensure that you are either logged in as an administrator (Windows), or
  you have root rights (Linux)}

\opt{fuzeplus}{
  \item[Immediately loading original firmware.]
  If the original firmware is immediately loaded without going into updating
  the firmware, then the Rockbox bootloader has not been correctly installed.
  The original firmware will only perform the update if the filename is
  correct, including case. Make sure that the patched Sansa firmware is called
  \fname{firmware.sb} and present in the root directory of your player.
}

\opt{iriverh100,iriverh300}{
  \item[Immediately loading original firmware.]
  If the original firmware is immediately
  loaded without the Rockbox bootloader appearing first, then the Rockbox bootloader
  has not been correctly installed. The original firmware update will only perform
  the update if the filename is correct, including case. Make sure that the patched
  Iriver firmware is called \fname{.hex}.}

\nopt{iriverh100,iriverh300,mpiohd200}{\item[``File Not Found'']}
\opt{iriverh100,iriverh300,mpiohd200}{\item[``-1 error'']}
  If you receive a
  \nopt{iriverh100,iriverh300,mpiohd200}{``File Not Found''}
  \opt{iriverh100,iriverh300,mpiohd200}{``-1 error''}
  from the bootloader, then the bootloader cannot find the Rockbox firmware.
  This is usually a result of not extracting the contents of the \fname{.zip}
  file to the proper location, and should not happen when Rockbox has been
  installed with Rockbox Utility.

  To fix this, either install Rockbox with the Rockbox Utility which will take care
  of this for you, or recheck the Manual Install section to see where the files
  need to be located.
\end{description}

\optv{gigabeats}{
If this does not fix the problem, there are two additional procedures that you
can try to solve this:

\begin{itemize}
\item Formatting the storage partition. It is possible that using the
mkdosfs utility from Linux to format the data partition from your PC
before installing will resolve this problem. The appropriate format command is:
\begin{code}
    mkdosfs -f 2 -F 32 -S 512 -s 64 -v -n TFAT /path/to/partition/device
\end{code}
\warn{This will remove all your files.}

\item Copying a \fname{tar}. If you have a Rockbox build environment
then you can try generating \fname{rockbox.tar} instead of
\fname{rockbox.zip} as follows:
\begin{code}
    make tar
\end{code}
and copying it to the data partition. During the next boot, the bootloader
will extract it.
\end{itemize}
}

ext: tex

max_stars_repo_name: Rockbox-Chinese-Community/Rockbox-RCC

max_issues_repo_name: Rockbox-Chinese-Community/Rockbox-RCC

max_forks_repo_name: Rockbox-Chinese-Community/Rockbox-RCC