## 3 Materials and Methods
### The FRCNN Method  
Region-based convolutional neural network is specifically designed for object detection. The most important focus of a region-based convolutional network is generating region proposals using selective search. The developed region proposals will be resized and converted into a feature vector. A typical CNN will treat these feature vectors where pre-trained SVM will be a classifier to classify the objects into specific classes. The R-CNN has some drawbacks such as heavy storage requirements, a rigid structure that could be more flexible for customization, and time complexity due to selective search. Due to these disadvantages, it is extended to the next level: FRCNN. Basic units of FRCNN are pre-trained CNN, ROI pooling layer, and two fully connected layers for Softmax layer and bounding box regression. The pre-trained convolutional neural network used in the proposed system is ResNet 50 which is explained in the last part of the work. The proposed fast RCNN takes a full input image and proposals generated by ACF. Since our input image is a vast SAR image where the iceberg and ship are microscopic objects in an image whose shape and size are very complex to predict, ACF output is used as region proposals. The initial step of the proposed network is generating a feature map for the entire input image with the help of multiple convolutional layers and a max pooling layer. The next step is creating a feature vector for each proposal that ACF produces. This model can be applied by extracting features from the feature map for each proposal and then converting them into fixed-length feature vectors with the help of the ROI pooling layer. Figure 2: Proposed ACF detector model. With the help of the max pooling layer, the ROI pooling layer picks all features of the region proposal and converts it into a fixed-size vector, which could be in the size of height \(\times\) width where height and width are hyperparameters. If the ROI window is in the size of height \(\times\) width, then a grid of sub-windows can be created by dividing the ROI window into sub-window sizes. For example, if their m \(\times\) n grid of sub-windows is there, each sub-window or cell size could be height/m \(\times\) width/n. The third step is  
Figure 3: ResNet 50 architecture model. feeding these feature vectors to a set of fully connected layers, which ends with an output layer of two branches. The first branch is the softmax layer for predicting object classes: background, iceberg, and ship. Another branch has four values as a bounding box for locating predicted objects. If there are k ROIs, the first branch calculates the discrete probability for all k numbers of ROI as P = {p0, p1, p2, p3... pk}. In the second branch bounding box, regression will be performed for calculating bb = {bbx, bby, bbw, bbh} where bbx is the x coordinate, bby is the y coordinate, bbw is the width, and bbh is the height of the bounding box. The bounding box will be created for all ROIs. For calculating loss for RCNN, two different losses, each for one branch, are used for weight updating. The first loss is for class prediction, which can be calculated as in Equations (9)-(11). \[\text{LOS\"{S}class}(\text{P},\text{T})=-\text{log PT} \tag{9}\]  
where log is a loss for true class T, and the second loss is for bounding box regression, as expressed in Equation (10). \[\text{Lloc}(\text{bbpred},\text{T})=\sum\text{SMOOTHloc}(\text{bbpredi}-\text{ Ti}) \tag{10}\]  
where the notation \"smoothloc\" is represented as Equation (11). \[\text{SMOOTHloc}\left(\text{x}\right)=\left\{ \begin{aligned} & 0.5x*x\ if\ |x|<1\\ &|x|-0.5\ otherwise\end{aligned} \right. \tag{11}\]  
where bbpred is a predicted set of bounding boxes such as {bbpredx, bbpredy, bbpredw, bbpredh}; the proposed FRCNN architecture is given in Figure 4.  
The algorithm of the proposed method FRCNN is structured below. It has procedure description, input, and output, and it is presented as Algorithm 1.