CNN卷积算法的改进

改进有:空洞卷积、可变形卷积

(1)空洞卷积:对于像素要求不严格的任务,感受野相当于普通3*3卷积的两层的效果。

CNN卷积算法的改进_第1张图片

代码实现:

def DilatedCNN(x):

        length=len(x,filter)

        sum=0

        if length<5:

               return 0

        if (length-3)%2==0:

               for I in range(length+1):

                      x[length][i]=0

                      x[i][length]=0

        next_length=(length-3)/2

        for i in range(next_length):

               for j in range(next_length):

                      for k in range(3):

                             for n in range(3):

                                    sum+=x[i+2k][j+2n]*filter[k][n]

                      y[i][j]=sum

                      sum=0

        return y

(2)可变形卷积

          1)对于像素分布不是等距或者是立体像素分布的情况下,采用最邻近的n个点卷积的计算方式;

          2)对于平面均匀分布的像素点,卷积点在原先的基础上做了微调

CNN卷积算法的改进_第2张图片

还有一种卷积区域随机变化的可变形卷积:

代码实现如下:

def DeformableCNN(x):

        length=len(x,filter)

        sum=0

        if length<5:

               return 0

        if (length-3)%2==0:

               for I in range(length+1):

                      x[length][i]=0

                      x[i][length]=0

        next_length=(length-3)/2

        for i in range(next_length):

               for j in range(next_length):

                      for k in range(3):

                             for n in range(3):

                                    row=shuffle[0,1,2,3,4] //0-4的数随机排序

                                    col= shuffle[0,1,2,3,4]  //0-4的数随机排序

                                    sum+=x[i+row[k]][j+col[n]]*filter[k][n]

                      y[i][j]=sum

                      sum=0

        return y

(3)反卷积:即卷积的逆过程。

我设计的DeformableCNN发表了一篇论文,还未出版:A  Modulation Classification Method Based on Deformable Convolutional Neural Networks for Broadband Satellite Communication Systems

你可能感兴趣的:(CNN卷积算法的改进)