## 1 Introduction
In the case of port waters, satellite images cannot be used due to poor image resolution, and a monitoring system tailored to smaller scales has to be generated. Specifically, a computer vision system, supported by \"in situ\" mounted camera images would be a robust alternative for water pollution monitoring at ports. This system would allow continuous and low-cost monitoring of surface water pollution, addressing the limitations of traditional observational techniques. In addition, it would constitute a leap forward in the digitalization of ports through the practical application of artificial intelligence technology in coastal infrastructures at limited cost. It is important to note that the aim of this novel monitoring system is not only to give warnings for each discharge so that immediate action can be taken, especially in particularly relevant episodes that generate a significant risk for health or navigation, but also to obtain knowledge about the discharges that threaten the port waters where and when they happen or if they are related to specific operations. In consequence, computer vision, combined with traditional or Artificial Intelligence based analysis, may provide operational knowledge in specific port areas and facilities, thus allowing development of adequate environmental management strategies. Computer vision techniques can be classified according to the problem considered [22]. There are several classifications and the set of problems considered has grown in recent times, but Image Classification is one of the most common applications and, in consequence, is very promising in port environmental management [23]. Image Classification involves assigning a label to an entire image; the labels (i.e., the categories in which images were classified) that should be considered in the context of port environmental management systems are three: clean water, pollution (spill) or floating waste (waste). One of the most important requirements for the implementation of computer vision systems is the generation of a database of tagged images that can be used to train the algorithm. In this respect, it is important to take into account that gathering a significant database of images of spills can be time consuming, as they can only be achieved by installing cameras in the port to record images of eventual spills. Thus, images will be incorporated to the database progressively, and the question arises in terms of how many images--and image types--are required to train the algorithm to achieve an adequate level of confidence on the system. Specifically, it is important to determine whether it is preferable to train the algorithm with all images available even when the number of images in each category is different, or whether optimal results will be obtained only when there is an equal number of images in each category. In the first scenario, the least common class will be underrepresented, potentially affecting proper system performance, and in the second, the number of images to be gathered increases, and consequently so does the time required to achieve a working system. In addition to image requirements, computer vision systems are evaluated according to specific performance metrics. Four of the most common metrics are Accuracy, Precision, Recall and F1-score [24; 25]. However, the Accuracy metric does not provide a relevant metric for a port environmental management system because clean water images will be significantly more abundant than waste and spill ones; here Accuracy will provide mostly a measure of how many times clean water is correctly predicted. However, preliminary designs of computer vision systems for port environmental management suggest the need to generate correct alarms on spill and waste instances. Thus, an alternative metric needs to be put forward in order to compare trained algorithms with a set of images that are not evenly distributed between categories, as will be the case in the current application.