Medical image segmentation is a critical and demanding step in medical image processing, which provides a solid foundation for subsequent medical image data extraction and analysis. Multi-threshold image segmentation, one of the most commonly used and specialized image segmentation techniques, limits its application to medical images because it requires demanding computational performance and is difficult to produce satisfactory segmentation results. To overcome the above problems, an ameliorated Fick's law algorithm (MsFLA) for multi-threshold image segmentation is developed in this paper. First, an optimized sine–cosine strategy is introduced to extend the molecular diffusion process to alleviate the problem of easily falling into local optima, thus improving the convergence accuracy of the Fick's law algorithm (FLA). Secondly, the introduction of local minimal value avoidance enriches the individual molecular information and enhances the local search ability, thus improving computational accuracy. In addition, the optimal neighborhood learning strategy is added to ensure a more careful and reasonable reliance on the optimal solution, thus reducing the chance of convergence of a local solution. The efficient optimization capability of MsFLA is comprehensively validated by comparing MsFLA with the original FLA and other algorithms in 23 classical benchmark functions. Finally, MsFLA is applied to image segmentation of grayscale images of COVID-19 and brain and color images of Lung and Colon cancer histopathology by using Cross entropy to validate its segmentation capability. The experimental results show that the MsFLA obtains the best segmentation results in three medical image cases compared to other comparison algorithms, which indicates that MsFLA can effectively solve the multi-threshold medical image segmentation problem.Graphical abstract