## 2 Materials and Methods
### Method
Another problem is that most grid cells in the image do not have objects, because the background area is larger than the foreground area. If there is no object in the grid cell, it has a \(confidence\ score=0\). As a result, most grid cells are forced to learn to become \(confidence\ score=0\). This leads to an imbalance in the model. To improve this, we increased the weight of the loss for the bounding box coordinate when the object exists, and we decreased the weight for the bounding box's confidence loss when the object does not exist. This means increasing the weight of localization loss between localization loss and classification loss, and increasing the weight of the confidence loss of the grid cell when the object exists rather than the confidence loss of the grid cell without the object. To do this, we used two parameters \(\lambda_{coord}\) and \(\lambda_{noobj}\). \(\lambda_{coord}\) is a balancing parameter for the loss of coordinates \((x,w,y,h)\) and for balance with other losses. \(\lambda_{noobj}\) is a balancing parameter for balancing between a box with an object and a box without an object [12]. We set \(\lambda_{coord}\ =\ 5\), and \(\lambda_{noobj}\ =\ 0.5\). SSE has another problem. SSE calculates loss with the same weight for both large bounding boxes and small bounding boxes. However, a small bounding box is more sensitive to smaller positional changes than a large bounding box. This is because the bounding box that surrounds the small object is out of the small object with just a little movement. To improve this, a square root was taken for the width and height of the bounding box. This is because, as the width and height increase, the rate of increase decreases, which reduces the weight for loss. YOLO predicts multiple bounding boxes per grid cell. During the training phase, one bounding box predictor must be responsible for one object. That is, you must match one bounding box per object. Therefore, you must select only one of several bounding boxes. To do this, the one with the largest IOU must be selected, with the ground-truth bounding box surrounding the actual object among the bounding boxes predicted. The largest IOU with ground-truth bounding box means the best wrapping of objects. This trained bounding box predictor is good at predicting specific sizes, aspect ratios, and classes of objects [12]. Equation (4) is a loss function that can be used for network learning [12]. \(\mathbb{I}_{i}^{obj}\) means that an object exists within the grid cell \(i\). This value is \(1\) if the object exists, and \(0\) if it does not exist. \(\mathbb{I}_{i}^{obj}\) indicates whether the \(j\)th bounding box predictor of grid cell \(i\) is used. The first term in Equation (4) calculates the loss of x and y for bounding box predictor \(j\) of grid cell i where the object exists. The second term in Equation (4) calculates the loss of \(w\) and \(h\) for grid cell \(i\) where the object exists. Small bounding boxes are more sensitive to smaller positional changes than large bounding boxes. The bounding box that surrounds the large object still wraps around the large object well, but the bounding box that surrounds the small object moves away from the small object. To improve this, a square root is calculated for the width and height of the bounding box. This is because taking a square root for width and height decreases the increase rate as the width and height increases, reducing the weight on loss. The third term of Equation (4) calculates the loss of the confidence score for the bounding box predictor \(j\) of the grid cell \(i\) where the object exists (\(C_{i}=1\)). The fourth term of Equation (4) calculates the loss of the confidence score for the bounding box predictor \(j\) of the grid cell \(i\) where the object does not exist (\(C_{i}\)= 0). The last term in Equation (4) calculates the loss of conditional class probability for grid cell \(i\) where the object exists [12]. (\(p_{i}(c)=1\) if class c is correct, otherwise: \(\dot{p}_{i}(c)=0\)). \[