Category Machine Learning

135. UNet

Unet may be one of the most basic researches on segmentation tasks. It consists of 3 parts: Encoding Phase (Apply Convolutions to classify object) -> Bridge -> Decoding Phase(Restore information so that the output would be 388×388). During the final…

134. HRNet

HRNet was a research done by Microsoft which lead to higher performance compared with state-of-the-art architectures. Traditional segmentation models utilize skip connections in order to recover spatial information from previous layers. The problem with this method is that it can’t…

133. FCN Upscaling

In order to classify images more precisely, the traditional way is to apply convolution and pooling to lower the dimension of the input so that the model can understand more complex features. This is ok for classification tasks because you…

132. Attention UNet

Attention Unet highlights only relevant activations during training. This can not only perform better when the target you want to detect is relatively tiny compared to the size of the picture, but it can also reduce unnecessary computations. The overall…

128. Tensorboard with Pytorch

Here is one way to visualize your model’s training process using tensorboard with Pytorch #Inside Code for Training from torch.utils.tensorboard import SummaryWriter() tb = SummaryWriter() #Add Metrics you want to evaluate tb.add_scalar(‘Loss’,loss,epoch) tb.add_scalar(‘Accuracy’,accuracy,epoch) tb.add_scalar(‘F1Score’,fa_score,epoch) To start a tensorboard server go…

126. ArgMax Function

Argmax compares pixels in the same position across channels, and acquires the index of the highest channel. This can be useful for semantic segmentation. Semantic segmentation models outputs the same width and height as the input image and creates a…

125. Converting Arrays To Tensors

There are several ways to convert arrays to torch tensors. import torch import numpy as np data = np.array([1,2,3,4,5,6]) option1 = torch.Tensor(arr) option2 = torch.tensor(arr) option3 = torch.as_tensor(arr) option4 = torch.from_numpy(arr) Option Description 1 Make a Copy and convert array…