Overfitting (i.e. optimization) may be more effective if it is performed on an image- block level. So, there will be as many optimized networks as there are blocks in the image. A baseline network is assumed to be available, which has been trained on a large dataset. This baseline network is overfitted to the first block of the image. For subsequent blocks, the overfitting is performed by starting from the neural network overfitted on the neighboring blocks. This will speed up the overfitting process as it may require much less training iterations than if started from the baseline network. However, it is possible that the baseline network is better to act as a starting neural network in some situations, thus multiple evaluation strategies are introduced for selecting the starting neural network. An initial network to be overfitted can be one of the already overfitted ones for neighboring blocks, without combining their weights. So, each of the previously- overfitted networks may be overfitted on the current block and then evaluated to determine the best performing network. According to an embodiment, for at least one of the previously-overfitted networks, the multiple weight versions obtained at different training iterations during the previous overfitting process may be stored (e.g., every 100 iterations). Each of such weight versions may be referred to as an intermediate version of a neural network. Then, overfitting on the current block may be done on a plurality of network versions previously-overfitted on the at least one neighboring block. Finally, a comparison of the plurality of overfitted networks may be performed. This comparison may include the network(s) overfitted from baseline, the network(s) overfitted from previously-overfitted network(s) on neighboring blocks, the network(s) overfitted from intermediate version(s) of previously- overfitted networks(s) on neighboring blocks, and network(s) overfitted from a combination of previously-overfitted on neighboring blocks Regarding the second embodiment, the neural decoder network overfitting process may be performed at the encoder side, where the neural decoder network is overfitted to one block of every N blocks. If this overfitting results into a much improved PSNR (Peak Signal-to-Noise Ratio) for the considered block and for its neighbors compared to the bitrate increase caused by sending the necessary additional data to the decoder’s side, then also the decoder’s side uses the overfitted neural network.