Aiming at the problem of being unable to meet some high computing power, high-precision applications due to the limited capacity of underwater sensor nodes, and the difficulty of low computation power, in this paper, we introduce the edge servers, known as base stations for underwater sensor nodes, and propose a scheme to process the computational tasks based on coalition game theory. This scheme provides functions such as cooperation among different base stations within the coalition, the smart division of tasks, and efficient computational offloading. In order to reduce the complexity of the algorithm, the artificial neural network model is introduced into the method. Each task is divided into sub-parts and fed to an artificial neural network for training, testing, and validation. In addition, the scheme delivers the computed task from base stations back to sink nodes via a shortened path to enhance the service reliability. Due to the mobility of the base station in the ocean, our proposed scheme takes into account the dynamic environment at the same time. The simulation results show that, compared with the existing state-of-the-art methods, the success rate of our proposed approach improves by 30% compared with the Greedy method. The total service time of our proposed approach decreases by 12.6% compared with the Greedy method and 31.2% compared with the Always-Migrate method.