Using DUCK-Net for polyp image segmentation

This paper presents a novel supervised convolutional neural network architecture, “DUCK-Net”, capable of effectively learning and generalizing from small amounts of medical images to perform accurate segmentation tasks. Our model utilizes an encoder-decoder structure with a residual downsampling mechanism and a custom convolutional block to capture and process image information at multiple resolutions in the encoder segment. We employ data augmentation techniques to enrich the training set, thus increasing our model's performance. While our architecture is versatile and applicable to various segmentation tasks, in this study, we demonstrate its capabilities specifically for polyp segmentation in colonoscopy images. We evaluate the performance of our method on several popular benchmark datasets for polyp segmentation, Kvasir-SEG, CVC-ClinicDB, CVC-ColonDB, and ETIS-LARIBPOLYPDB showing that it achieves state-of-the-art results in terms of mean Dice coefficient, Jaccard index, Precision, Recall, and Accuracy. Our approach demonstrates strong generalization capabilities, achieving excellent performance even with limited training data.


Introduction
Colorectal cancer (CRC) is a leading cause of cancer mortality globally [1].Most colorectal cancers evolve from adenomatous polyps, making early detection and removal of polyps critical for CRC prevention and treatment [2].Colonoscopy is the gold standard for detecting and removing polyps before they develop into CRC [3].However, accurately identifying and segmenting polyps during colonoscopy is a complex task due to the diversity of polyps in terms of shape, size, and texture.This can lead to missed or misdiagnosed polyps, which can seriously harm patient health.
Machine learning (ML) algorithms, particularly convolutional neural networks (CNNs), have shown promising results in medical image segmentation and have been applied to polyp detection and segmentation [4,5].While deep learning (DL) algorithms can achieve high precision, they typically require large amounts of labeled data [6,38,39], which can be costly and time-consuming to obtain [40].
In an effort to improve the accuracy and efficiency of polyp segmentation, researchers have developed various deep learning (DL) architectures that employ different techniques to address this complex task.Examples of DL architectures used for polyp segmentation include U-Net [7], FCN [8], and their variants, such as U-Net++ [9], Modified U-Net (mU-Net) [41], ResUNet++ [10], and H-DenseUNet [11].While these methods can achieve precise segmentation results, their performance may be less robust when faced with a wide range of polyp characteristics.
In this study, we present a novel supervised convolutional neural network architecture for image segmentation that uses the encoder-decoder structure of the U-Net [7] architecture with some significant differences.The key feature of our architecture is the combination between our custom-designed convolutional block and the residual downsampling.The convolutional block enables our model to accurately locate and predict the borders of polyps with a small margin of error.By incorporating residual downsampling, the model can utilize initial image information at each resolution level in the encoder segment, further improving its performance.Also, we have used DeepLabV3 atrous convolutions [12] for capturing spacial information and the residual block of ResUNet++ [10] for enhanced feature extraction.
The main contributions of this paper are: • Our custom-built convolutional block, DUCK (Deep Understanding Convolutional Kernel), allows more in-depth feature selection, enabling the model to locate the polyp target accurately and correctly predict its borders.
• Our method uses residual downsampling, which allows it to use the initial image information at each resolution level in the encoder segment.This way, the network always has the original field of view alongside the processed input image.
• Our model does not use external modules and was only trained on the target dataset (no pre-training of any kind) • Our method accurately identifies polyps regardless of number, shape, size, and texture.
• Extensive experiments prove that our method achieves good performance and leads existing methods on several benchmark datasets.

Convolutional Neural Networks
Automatic polyp segmentation is crucial in clinical practice to reduce cancer mortality rates.Medical image segmentation tasks usually employ convolutional neural networks, and several widely utilized architectures have been applied to this problem.
One such architecture is U-Net [7], an encoder-decoder model developed initially for biomedical image segmentation.U-Net exhibits the advantage of being relatively simple and efficient while still achieving good performance on various medical image segmentation tasks.However, it may struggle with more complex or varied input images, and alternative methods may be more suitable in these cases.
PraNet [32] is a CNN architecture specifically designed for automatic polyp segmentation in colonoscopy images.It employs a parallel partial decoder to extract high-level features from the images and generate a global map as initial guidance for the following processing steps.Furthermore, it utilizes a reverse attention module to mine boundary cues, which helps to establish the relationship between different regions of the images and their boundaries.PraNet also incorporates a recurrent cooperation mechanism to correct misaligned predictions and improve segmentation accuracy.The results of the evaluations indicate that PraNet significantly improves the segmentation accuracy and has an advantage in terms of real-time processing efficiency, reaching a speed of about 50 frames per second.
DeepLabV3+ [13] is an extension of the DeepLabV3 [12] architecture for semantic image segmentation.It employs atrous convolutions, which allow for a dilated field of view and the extraction of features at multiple scales to improve the capture of long-range contextual dependencies.This approach enables the more accurate segmentation of objects with complex shapes or large-scale variations but also requires more computation and may be slower to train and infer.
HRNetV2 [14,15] is a CNN architecture for human pose estimation that utilizes a fully connected style-like architecture to share multi-scale information between layers at different resolutions.This architecture can improve performance on small or blurry objects but may be more prone to overfitting and require more data to achieve good performance.
Other CNNs designed explicitly for automatic polyp segmentation include ResUNet [16], which incorporates residual blocks to enhance location information for polyps, and HarDNet-DFUS [17], which combines a custom-built encoder block called HarDBlock with the decoder of Lawin Transformer to improve accuracy and inference speed.ResUNet can leverage the powerful expressive capacity of residual blocks but may require more data and computation to achieve good performance.HarDNet-DFUS is designed with real-time prediction in mind but may sacrifice some accuracy in favor of faster inference.
ColonFormer [18] utilizes attention mechanisms in the encoder and includes a refinement module with attention on the x and y axis at different resolutions to achieve a more refined output while maintaining a decoder similar to the classical U-Net.Attention mechanisms can be effective for handling large or complex input images but may require more computation and be more challenging to optimize than other methods.
MSRF-Net [21] is a CNN architecture specifically designed for medical image segmentation.It utilizes a unique Dual-Scale Dense Fusion (DSDF) block to exchange multi-scale features with varying receptive fields, allowing the preservation of resolution and improved information flow.The MSRF sub-network then employs a series of these DSDF blocks to perform multi-scale fusion, enabling the propagation of high-level and low-level features for accurate segmentation.However, one limitation of this method is that it may not perform well on low-contrast images.

Transformers
While the previously mentioned methods have achieved good results for automatic polyp segmentation, other approaches that utilize transformers in the encoder perform particularly well on this task.These models typically use a pre-trained vision transformer as an encoder trained on a large dataset, such as ImageNet [22], to extract relevant features from the input image.These features are then fed to the decoder, which processes multi-scale features and combines them into a single, final output.Examples of such approaches include FCN-Transformer [19] and SSFormer-L [20], which have achieved state-of-the-art (SOTA) performance on the Kvasir Segmentation Dataset at the time of their release.
The use of Transformers has gained traction in the field of Computer Vision (CV) in the past years, as they have been widely used in the field of Natural Language Processing (NLP) and have shown spectacular results in retaining the global context of the subject at hand.Vision-Transformers (ViT) [34], like their NLP counterparts, make use of a mechanism called Attention [33], which aggregates global context to extract relevant information from large image patches.
While ViTs [34] seem to perform well in the CV field, traditional CNN methods, like the EfficientNetV2 [35], outperformed them in popular image classifications datasets, such as ImageNet [22] or CIFAR-10 [36], proving that more efficient CNN methods can still be developed.
As such, our proposed method explores the benefits of traditional CNNs over ViT-based architectures in biomedical image segmentation and how they can still yield substantial improvements in the accuracy metrics.
Overall, this field is an active area of research, with various approaches being proposed and evaluated.Thus, further research is needed to determine the models' optimal design and training strategies.It is essential to carefully consider the trade-offs between accuracy, computational efficiency, and other performance metrics when selecting a method for a specific application.

Methodology
The proposed polyp segmentation solution consists of two novel main components.The first is a novel convolutional block called DUCK that uses six variations of convolutional blocks in parallel to allow the network to train whichever it deems best.While the novel convolutional block allows the network to train the most critical parts precisely, one drawback is that it crushes fine details for the subsequent layers.The second novel contribution keeps the low-level details by adding a secondary U-Net [7] downscaling layer that does not process the image, so it keeps the low-level details intact.We will present each in detail, explaining the high-level architecture and the convolutional blocks.

Model architecture
Our proposed architecture (Figure 1) uses the encoder-decoder formula of the U-net [7] architecture with three significant differences.
Firstly, we replace the pair of 3x3 convolutional blocks classically used by U-Net [7] with our novel DUCK block at each step except the last one.This allows the model to capture more details at each step while sacrificing finer low-level details.The exact details of the block and the explanation behind how it works are detailed below.For the last downsampling part, we chose to go with four Residual Blocks [10] because the image size after being downscaled five times is 11 ( 352 2 5 ), which is smaller than the largest simulated kernel size of the DUCK.Thus, it would not be able to take full advantage at such a small scale.
Secondly, to address the issues caused by the novel block, such as losing fine details, we have implemented a secondary downscaling layer that does not implement any convolutional processing.The output from each step of this layer is then fed into the main downscaling layer using addition.We employ 2D 2x2 convolutions with strides of 2 to downscale the image.This behaves better than max pooling as the model can learn the essential parts to keep.
Lastly, we used addition instead of concatenation every time we combined two outputs, similar to LinkNet [37], as we observed that it produces better results using less memory and computational resources.This also means that at each step, we need to have half of the number of parameters on the upscaling part to match the output size of the downscaling part.

Block components
The Residual block (Figure 2), first introduced in ResUNet++ paper [10], is the first component in our novel DUCK.Its purpose is to understand the small details that make a polyp.While using multiple small convolutions is usually a good idea, having too many can mean that the network has difficulty training and understanding what features to look for.We use combinations of one, two, and three Residual blocks to simulate kernel sizes of 5x5, 9x9, and 13x13.
Our novel Midscope (Figure 3) and Widescope (Figure 4) blocks use dilated convolutions to reduce the parameters needed to simulate larger kernels while allowing the network to understand higher-level features better.They work by spreading the nine cells that would typically be in a 3x3 kernel over a larger area.These two blocks aim to learn prominent features that only require a little attention to detail, as the dilation effect has the side The Separated block (Figure 5) is our third way of simulating big kernels.The main idea behind it is that combining a 1xN kernel with an Nx1 kernel results in a behavior similar to an NxN kernel.However, this method encounters a drawback related to the concept known as "diagonality".Essentially, diagonality implies the capacity of a convolutional layer to capture and sustain spatial details linked to diagonal patterns in an image, a feature intrinsic to the structure of a conventional NxN convolutional kernel.It retains these diagonal elements owing to its bidimensional characteristics, enabling it to capture spatial connections in both vertical and horizontal directions, which also encompasses diagonal aspects.Yet, the distinctive processing approach of separable convolutions (1xN followed by Nx1), where filters operate on one dimension at a time, potentially obstructs their capacity to efficiently encode diagonal features.This leads to the so-called "loss of diagonality".Such diagonal relationships can prove useful for detecting specific intricate patterns or shapes within an image, hence the other blocks are designed to compensate.6) is our novel convolutional block that combines the previously mentioned blocks, all used in parallel so that the network can use the behavior it deems best at each step.The idea behind it is that it has a wide variety of kernel sizes simulated in three different ways.This means that the network can decide how to compensate for the drawbacks of one way to simulate a kernel over another.Having a variety of kernel sizes means it can find the general area of the target while also finding the edges correctly.We incorporated a one-two-three combination of residual blocks based on empirical observations suggesting no significant performance gains from multiple instances of Midscope, Widescope, and Separable blocks.Essentially, the computational resources required for these additions did not justify the marginal improvements in results.The result is a novel block that searches for low-level and high-level features simultaneously with auspicious results.

Model evaluation
Accurate evaluation is crucial for determining the effectiveness of various neural network architectures.Several metrics have been proposed for this purpose, and we have chosen to focus on five of the most widely used: the Dice Coefficient, Jaccard Index, Precision, Recall, and Accuracy.
1.The Dice Coefficient, also known as the F1 score, is a measure of the overlap between two sets, with a range of 0 to 1.A value of 1 indicates a perfect overlap, while 0 indicates no overlap.
2. The Jaccard Index, similar to the Dice Coefficient, measures the overlap between two sets but is expressed as a ratio of the size of the intersection to the size of the union of the sets.3. Precision is a measure of the positive predictive value of a classifier or the proportion of true positive predictions among all positive predictions.4. Recall, also known as sensitivity or true positive rate, measures the proportion of true positive predictions among all actual positive instances.5. Accuracy is the overall correct classification rate or the proportion of correct predictions made by the classifier out of all predictions made.

𝐴𝑐𝑐𝑢𝑟𝑎𝑐𝑦 = 𝑇𝑃 + 𝑇𝑁 𝑇𝑃 + 𝑇𝑁 + 𝐹𝑃 + 𝐹𝑁
(5) The Dice loss is a loss function commonly used in medical image segmentation tasks.It uses the Dice Coefficient, which measures the overlap between two sets.In the context of image segmentation, the Dice loss can be used to penalize the model for incorrect or incomplete segmentation of objects in the image.
Using the Dice loss for medical image segmentation has several benefits: 1.The Dice Coefficient is widely used to evaluate the performance of image segmentation models, so using the Dice loss helps optimize the model for this metric.2. The Dice loss can handle class imbalance, which is often a concern in medical image segmentation, where some classes may be much more prevalent than others.3. The Dice loss is differentiable, which allows it to be used in conjunction with gradient-based optimization algorithms.
The Dice loss is calculated as follows:

Experiments Implementation details
To ensure fairness and reproducibility in our comparisons, we used identical training, validation, and testing sets for all models evaluated in our study.Specifically, each dataset was randomly split into three subsets: training, validation, and testing, with an 80:10:10 percent ratio.The motivation behind choosing a random data split was to ensure that the selection process was unbiased and that the comparison across different models was as fair as possible.We provide the split datasets in the "Data Availability" section so our results are easily reproducible.
We designed our experimental setup to validate our model's state-of-the-art performance on unseen data while showcasing its ability to generalize across different contexts.First, we conducted tests on each dataset independently and compared our model's performance with the other methods.Then, to prove the generalization capabilities of our model, we trained the model on one dataset and tested it on another, namely the Kvasir-SEG [28] and CVC-ClinicDB [29] datasets and vice versa.This way, we could effectively gauge its adaptability and predictive accuracy on novel, unseen data.This cross-dataset testing yielded strong results, emphasizing our model's generalization capabilities, even in the absence of any extra pre-training data.
We trained our model to predict binary segmentation maps for RGB images.To reduce the computational cost, the images are rescaled to 352 x 352 pixels.This convention was set by several published papers [18,19,20,32].Due to the aliasing issues with rescaling images [23], we used a Lanczos filter [26] to preserve the quality.We used the RMSprop [24] optimizer, with a learning rate of 0.0001.We trained our model with a batch size of 4 for 600 epochs.We used Tensorflow [25] as our framework to implement the architecture and trained the model using an NVIDIA A100 GPU.

Data augmentation
We implemented data augmentation on the training set, significantly improving the model's generalization capabilities to the point where regularization techniques such as dropout were unnecessary.The library used to implement the augmentations is Albumenations [27].This involved randomly applying transformations to the training images, resulting in significantly different variations from the original images and helping the model better generalize to unseen data.
Before each epoch, we randomly augmented the training input using augmentations inspired by previous work [19] but modified to fit the specific needs of our model.The augmentation techniques we used are: Out of these augmentations, the color jitter was applied only to the image, while the rest were applied consistently to both the image and the corresponding segmentation map.
• The Kvasir-SEG dataset [28] contains 1000 polyp images and their corresponding ground truth, with different resolutions ranging from 332 x 487 to 1920 x 1072 pixels; • The CVC-ClinicDB dataset [29] contains 612 polyp images and their corresponding ground truth, with a resolution of 384 x 288 pixels; • The ETIS-LARIBPOLYPDB dataset [31] contains 196 polyp images and their corresponding ground truth, with a resolution of 1255 x 966 pixels; • The CVC-ColonDB dataset [30] contains 380 polyp images and their corresponding ground truth, with a resolution of 574 x 500 pixels;

Results
The tables below show the comparison of different methods using mean Dice, Jaccard index, Precision, Recall, and Accuracy metrics.We also included the calculation of standard deviation (SD) in our analysis to strengthen our evaluation of model performance.This measure provides insight into the variability of the used metrics among different models, thus giving us an understanding of the potential range of performance when employing these methods.This statistical perspective complements the raw performance figures, offering a more comprehensive view of the model's performance consistency and reliability.
To ensure a fair comparison, we utilized image augmentations for the base U-Net [7] model.These augmentations were consistent with those used in our model.Also, to provide a clearer understanding of the results, we included information in the tables regarding which methods were pre-trained.

Ablation studies
In this part, the goal was to assess the efficiency of the proposed DUCK block compared to a standard convolutional block in a controlled, like-for-like test setup.Table 7 provides a comprehensive summary of the results derived from the ablation studies conducted.The performance of the novel DUCK block was compared with a simple convolutional block in the context of the DUCK-Net architecture, using the Kvasir-SEG dataset.As shown in Table 7, the DUCK block consistently outperformed the simple convolutional block across all tested performance metrics.This advantage was evident in both the 17 and 34 filter size models.These findings indicate that the DUCK block significantly enhances DUCK-Net's performance, leading to more precise and accurate results.This analysis supports the utility of integrating the DUCK block within the DUCK-Net architecture for applications that demand high-performing convolutional blocks.

Discussion
Supervised learning has proven to be effective for many tasks in the medical image domain, such as classification, detection, and segmentation.Advances in this field have been crucial for improving medical care, and developing high-performing models has played a central role in these advancements.Hence, developing methods that require minimal annotated data can be of great benefit to the clinical community.
This work presents a state-of-the-art (SOTA) model for automatic polyp segmentation in colonoscopy images.Through experiments, we demonstrate that our model outperforms existing models on various benchmarks, particularly in generalizability and handling polyps of varying shapes, sizes, and textures.This contributed to the automated Tables 1, 2, 3, and 4 show our experimental results on the SOTA polyp segmentation datasets Kvasir-SEG [28], CVC-ClinicDB [29], ETIS-LaribPolypDB [31], and CVC-ColonDB [30].Our model outperforms all other architectures, highlighting its ability to learn key polyp features from small amounts of data.At the same time, Tables 5 and 6 show its capacity to generalize one dataset and apply it to a different one on Kvasir-SEG [28] and CVC-ClinicDB [29].Even though it shows excellent results, it does not achieve SOTA results as FCN-Transformer [19] has the advantage of having extra training data (pre-training), which helps it generalize features in a less dataset-specific way.Furthermore, our model's capacity to handle real-world scenarios was demonstrated through the use of multiple datasets containing images that vary significantly from one another.These datasets include images from international patients with different backgrounds, representing a wide range of scenarios that our model could encounter in real-world applications.
Table 7 shows our results of the ablation studies conducted for the proposed DUCK block.Its consistent outperformance compared to a simple convolutional block supports the hypothesis that this novel structure enhances the effectiveness of image segmentation tasks.Future research might build on this foundation, exploring how the DUCK block performs in other architectures and tasks to further validate and leverage its advantages.PraNet [32] U-Net [7] In Figure 7 we show three examples of polyp images from the Kvasir-SEG [28] test set, and we compare the predictions of our novel architecture "DUCK-Net", which was evaluated across different model sizes (17 and 34 filter size), to other existing architectures: FCB-Transformer [19], HarDNet-DFUS [17], HRNetV2 [14,15], MSRF-Net [21], PraNet [32], and U-Net [7].
Regarding the computational complexity implications of integrating additional convolutional blocks within the DUCK block structure, we have to consider two main factors: computational cost and memory usage.Each new block means the network has to do more operations.For instance, a conventional convolutional layer with a kernel size of NxN has a computational complexity of O(N 2 ).Furthermore, the residual blocks in DUCK would require the network to perform addition operations and potentially more non-linear operations such as sigmoid activation.On the other hand, memory usage also grows with the addition of each convolutional block.Every layer within a deep learning model must store its weights, gradients, and neuron activations, meaning that as more blocks are added, the model requires more memory to store these quantities during training and inference.These complexity considerations are why optimizations like dilated convolutions and separable convolutions are used, as they can provide similar representational power to standard convolutions but with fewer parameters and thus less computational cost.Ultimately, while using more blocks in DUCK will lead to more computational complexity, the advantage is that it allows the network to capture features at different scales and compensate for the drawbacks of different types of convolutions, which could improve the model's performance on complex tasks.Nevertheless, these benefits must be balanced against the increased resource requirements, particularly when deploying the model in resource-constrained environments.
While the model generally exhibits a high level of prediction accuracy, we have observed some limitations in its performance when dealing with polyps whose colors blend in with the background, resulting in indistinct borders.Further investigation is needed to address this issue and enhance the model's ability to locate and predict the borders of such polyps accurately.

Conclusion
Based on the results presented in this paper, the DUCK-Net supervised convolutional neural network architecture can achieve state-of-the-art performance in polyp segmentation tasks in colonoscopy images.The model's encoder-decoder structure with a residual downsampling mechanism and custom convolutional block allows it to capture and process image information at multiple resolutions effectively.At the same time, data augmentation techniques help improve its overall performance.The DUCK-Net model demonstrates strong generalization capabilities and can achieve excellent results even with limited training data.Overall, the DUCK-Net architecture shows great potential for use in various segmentation tasks and warrants further investigation.

Figure 6 .
Figure 6.DUCK block DUCK (Figure6) is our novel convolutional block that combines the previously mentioned blocks, all used in parallel so that the network can use the behavior it deems best at each step.The idea behind it is that it has a wide variety of kernel sizes simulated in three different ways.This means that the network can decide how to compensate for the drawbacks of one way to simulate a kernel over another.Having a variety of kernel sizes means it can find the general area of the target while also finding the edges correctly.We incorporated a one-two-three combination of residual blocks based on empirical observations suggesting no significant performance gains from multiple instances of Midscope, Widescope, and Separable blocks.Essentially, the computational resources required for these additions did not justify the marginal improvements in results.The result is a novel block that searches for low-level and high-level features simultaneously with auspicious results.

Figure 7 .
Figure 7.Comparison of predicted polyp masks

Table 1 .
Segmentation accuracy (Dice coefficient, Jaccard index, Accuracy, Recall and Precision) on the Kvasir-SEG dataset

Table 5 .
Segmentation accuracy (Dice coefficient, Jaccard index, Accuracy, Recall and Precision) on the CVC-ClinicDB dataset, the models being trained on the Kvasir-SEG dataset

Table 6 .
Segmentation accuracy (Dice coefficient, Jaccard index, Accuracy, Recall and Precision) on the Kvasir-SEG dataset, the models being trained on the CVC-ClinicDB dataset

Table 7 .
Ablation studies results (Dice coefficient, Jaccard index, Accuracy, Recall and Precision) on the Kvasir-SEG dataset