Safe distance reminder system on ship against port for the standing process using image processing

Since ancient times, Indonesia has been known as a country that conducts trading activities. However, the number of accidents when the ship is about to dock is an indication of the need to improve the marine transportation system. The factors that cause accidents include human, technical and weather errors. Seeing these conditions and also related to the increasingly rapid development of technology, modern solutions for detecting objects using cameras can be developed. By using a PC as a video processor from a camera that works in real time and can classify several ship objects using the Convolutional Neural Network (CNN) method. As well as being able to estimate the distance of the object where the ship must turn off the engine before docked with the camera using Stereo Vision. and the results of the algorithm processing can be translated into a signal that will be sent to the harbormaster and also the ship that will dock as an output. Then the ship that will dock can find out the distance where the ship has to turn off the engine through the signal sent or siren. The average total accuracy of the system which is able to detect ships is 97.15%.


Introduction
Indonesia is the biggest archipelago country in the world. Since ancient times, Indonesia has been known as a country that has carried out many trade activities with water routes. Along with the times, now the world of world shipping is experiencing rapid development. Trade using sea transportation services is an option because the costs are cheaper or lower than other transportation services. The Port of Tanjung Perak is one of the gateways for sea transportation for eastern Indonesia, acting as a center for collectors and distributors of goods from Eastern Indonesia, particularly from East Java Province.
One of the facilities at the terminal is a pier, where the dock is a place to dock and unload ships. The jetty at the terminals at Tanjung Perak Port in Surabaya has different sizes. If the dock available at a terminal is longer than the other terminal, then the terminal can accommodate more ships than other terminals. The depth must not be less than 1.15 times the maximum draft of the largest vessel and must not be more than 100 m (Graillot, A., 1983). But the size of the ship also affects the number of ships that will moor at the dock. If ships with large sizes moor at the terminal, the terminal can only accommodate a small number of ships. So there are two important things that become the benchmark for ships that will moor, namely the length of the pier and the size of the ship. If the ship to be moored does not have a dock that matches the size of the ship, then the ship must wait. This will result in queues for ships afterwards and can also be the cause of ships colliding. With the conditions and technological developments as above, the authors have the idea to create a tool to detect objects that will enter the dock using video processing which is supported using Stereo Vision. This prototype uses a camera to detect moving objects and monitor the boundaries of the area. Personal Computer (PC) is used to process images captured by cameras that can detect and classify a ship or moving object using the Convolutional Neural Network (CNN) method. So that the prototype can maximize the performance of the harbormaster in order to facilitate the work of the process of getting in and out of the ship at the dock can be optimal and minimize the occurrence of accidents.

System Design
Convolutional Neural network is an architectural extension of feed forward artificial neural network with a larger number of layers. The CNN architecture is determined by the number of layers, the number of maps in each layer, the size of the kernel, the size of the subsampling windows, and how they are connected to each other. In Figure 2   Dataset is an object that represents data and relations that have been created in storage. A dataset can be called a database, because it has the same structure. The dataset in this study is taken from several examples of several images that have been stored in the laptop storage space. And the dataset is used for object classification. the more input the dataset will make the higher the classification results and the heavier the laptop runs.

CNN Architechture.
This final project is focused on getting an object detection system with a camera. In addition, the main objective of this study is to obtain a classification result from the CNN process. In the CNN process in general, this process has 3 stages, namely pre-processing, processing, and classifying.

Euclidean Distance Method.
Euclidean Distance method is a method related to distance calculation. This concept was introduced by a mathematician named Euclid of Alexandria around 300 B.C.E (Wikipedia, n.d.-c). The principle of the Euclidean method is to find the proximity of the distance value between two variables. The following is the formula for measuring the distance of Euclidean Distance.
The formula above is a formula used to find distance values based on two coordinate points based on sources (Adiwilaga, 2014). Based on this formula, the data from the known ship distance values will then be compared to get the closest value to the ship.

GPS Testing Result
GPS testing, using ublox neo M8N GPS and Mobile GPS to find out the error value or difference obtained. Here are the points taken from the neo M8N GPS and Mobile GPS. The data used in this research is data obtained directly from the GPS device. The microcontroller will receive laTitude and longitude data in the form of a decimal degree. From the latitude and longitude data will be processed into the length of the distance in kilometers. Where the authors here process the data using the Euclidean Distance Method.

MobileNet Extracion Features
MobileNet SSD consists of 13 layer blocks which contain a depthwise separable convolution layer.

Evaluation Training
The training process is a process in which the processor learns the features of the input data so that the resulting system can recognize the specified object. In this study, the training process was carried out up to 40,000 steps and the network used was Mobilenet SSD. To be more optimal, the training process using a PC with an NVIDIA GeForce GTX 950 M GPU and the total time spent completing 40,000 steps is 8 hours. As previously explained, In this architecture, the author uses a multistep learning rate type with a step in the 20,000 and 40,000 iterations. In the 0-20,000 iteration, the initial learning rate used is 0.0005. Then in the iteration of 20,000 -40,000 the learning rate value changes to 0.00025 because it is multiplied by the value .

Figure 11. Changes in learning rate value against iteration
The initial learning rate value cannot be too small, because it will make the learning model not comprehensive in the initial phases. It is better if the learning rate value also decreases with the increase in iterations. Figure 11. shows the change in the value of the learning rate with respect to iterations. By using a configuration matrix, precision, recall, and accuracy values can be obtained. In this project, the ship detection model is evaluated to obtain precision and recall values. In finding the precision and recall values, there are 4 parameters that must be fulfilled, namely true positive, true negative, false positive, and false negative. In this case, true positive is the prediction indicating Ship and groundtruth also indicating Ship. True negative does not predict Ship and groundtruth also does not indicate Ship. False positives are Ship's predictions but groundtruth doesn't show Ship. And false negative is not predicting the ship, but the groundtruth shows the ship.
The precision and recall values are calculated for all test data, which is about 530 images. From 530 images, it will produce mAP (Mean Average Precision), which is the average precision value of all test data. The mAP value on this ship detection model is 92.15%.

Vessel Detection Test Results
Ship detection testing is carried out to assess the system's ability to recognize objects in the form of ships. In this test, the confidence value will be obtained, which is the percentage of the model's prediction on the object of the ship. Table 3. Graph of precision-Recall of model validation From the table above, it can be seen that the system's ability to detect ships is quite good, with an average confidence of above 90%.

Ships Detection Test Results from Various Distances
The second test is to vary the distance between the object and the camera when taking pictures. The variations in the distance used are 1 meter, 2 meters, 3 meters, 4 meters and 5 meters. This is done to From the table we can see that the system's optimal ability to detect ships is at a distance of 1 to 3 meters. This is evidenced by the confidence value that reaches more than 90%. At a distance of 2 meters, the system's ability to detect ships began to decline as evidenced by the decrease in the system's percentage of detecting ships. This can be due to the lack of variation in training data from various distances.

3.1.6.
Testing On Real Time Video After testing the system integration from the input in the form of an image. The next test is to calculate the fps (frames per second) from the input in the form of real time video. The fps test results from real time video can be seen in table 5.
From the table 5, the test results are obtained through real time video. From a total of 5 tests in the table, the system can recognize 3 ships with an accuracy above 90% and 2 ships with an accuracy be- The results of the matrix evaluation for the ship detection model in the form of mAP (Mean Average Precision) of 92.15% were tested on 530 images. 3. The overall evaluation result of the ship recognition system is 78.9%, where the system is able to recognize ships with a level of truth of 78 per 100 characters. 4. The system can be implemented in real time and the computation rate in one frame is 9.31 frames per second. 5. The optimal distance between the camera and the object is under 5 meters.