Sure ptrblck
Below is the code.
import fastai
from fastai import *
from fastai.vision import *

path = pathlib.Path('E:\dataset')
path

bs = 8
data = ImageDataBunch.from_folder(path=path,bs=bs,ds_tfms=get_transforms(),size=224,valid_pct=0.3)
data.normalize(imagenet_stats)

class SegmentationCrossEntropyLoss(nn.Module):
    def __init__(self):
        super(SegmentationCrossEntropyLoss, self).__init__()
        
    def forward(self, preds, targets):
        loss = nn.functional.binary_cross_entropy_with_logits(preds, targets.float())
        return loss

class BuildingSegmenterNet(nn.Module):
    def __init__(self):
        super(BuildingSegmenterNet, self).__init__()
        self.seq1 = nn.Sequential(
            nn.Conv2d(3, 16, (5,5)),
            nn.MaxPool2d((2,2))
        )
        self.seq2 = nn.Sequential(
            nn.Linear((254016), 512),
            nn.ReLU()
        )
        self.dropout1 = nn.Dropout(0.33)
        self.seq3 = nn.Sequential(
            nn.Linear(512, 128),
            nn.ReLU()
        )
        self.seq4 = nn.Sequential(
            nn.Linear(128, 128),
            nn.ReLU()
        )
        self.seq5 = nn.Sequential(
            nn.Linear(128, 512),
            nn.ReLU()
        )
        self.seq6 = nn.Sequential(
            nn.Linear(512, 256*256),
            nn.ReLU()
        )
        self.seq7 = nn.Sequential(
            nn.Conv2d(1, 1, (3,3), padding = 1),
            nn.Sigmoid()
        )
    def forward(self, x):
        x = self.seq1(x)
        x = x.view(x.size(0), -1)
        x = self.seq2(x)
        x = self.seq3(x)
        x = self.dropout1(x)
        x = self.seq4(x)
        x = self.seq5(x)
        x = self.seq6(x)
        x = x.view(-1, 1, 256, 256)
        x = self.seq7(x)
        return x

learn = Learner(data = data, model=BuildingSegmenterNet(), loss_func = SegmentationCrossEntropyLoss(), metrics = accuracy)

learn.fit_one_cycle(2)