2022.11.13 第三十次周报

目录

前言

文献阅读

题目

作者

背景

存在的问题

提出的思路

技术上的困难

解决办法

VGGNets

扫描二维码关注公众号,回复: 14683534 查看本文章

网络结构

代码实现

主要贡献

ResNets

残差学习

网络结构

代码实现

总结


前言

This week I read a paper on an interoperable blockchain platform based on blockchain.Replacing cloud computing with blockchain is used to ensure IoT data integrity in smart cities.In deep learning, the VGG network model and the ResNets model were learned, and simple code was reproduced.

本周阅读了一篇基于区块链的一个可互操作的区块链平台的论文。用区块链代替云计算,用于确保智慧城市中的物联网数据完整性。在深度学习上,学习了VGG网络模型和ResNets模型,以及复现简单的代码。

文献阅读

--Journal of Industrial Information Integration,
Volume 30,
2022,
100408,
ISSN 2452-414X,
https://doi.org/10.1016/j.jii.2022.100408.

题目

Blockchain-of-blockchains: An interoperable blockchain platform for ensuring IoT data integrity in smart city

作者

Mohammad Saidur Rahman, M.A.P. Chamikara, Ibrahim Khalil, Abdelaziz Bouras

背景

智慧城市主要是利用现代技术有效管理资源、资产和服务的城市区域。在智慧城市中部署了多个传感器和物联网(IoT)设备,用于与不同关键基础设施相关的远程监控和数据收集。然后,收集的数据用于规划所需的维护任务,以确保为公民提供高质量的服务。虽然物联网设备可以在智慧城市中实现实时数据收集,但智慧城市整体治理的复杂性增加,大多数传感器和物联网设备的存储和处理能力有限。因此,持久性数据存储和将来使用需要单独的数据存储。云计算是一项突出的技术,用于为智慧城市中的传感器和物联网数据提供第三方存储和处理服务。

存在的问题

此外,远程收集的IIoT数据不可信。攻击者可以在物理区域中部署未经授权的传感器或物联网设备,并生成虚假数据。除此之外,攻击者还可以破坏部署在不同智慧城市组织中的传感器或物联网设备,并操纵数据以中断流畅的服务。现有的基于云的平台无法确保收集数据的可信度。

一般来说,智慧城市涉及多个组织,这些组织具有明确定义的运营结构层次结构。为了执行维护任务,维护服务提供商需要获得智慧城市治理层次结构不同级别的各个机构的批准。一旦检查了维护要求的有效性,就会提供维护任务的批准。在智慧城市的基于云的平台中,数据无法完全验证。因此,无法验证维护任务的实际必要性。一旦一个或多个机构根据虚假数据给予批准,相应的机构就可以篡改云中的数据,并且可以拒绝批准。因此,云无法确保信任。此外,不同的传感器和物联网设备具有不同的数据格式。因此,应将数据转换为统一的格式,以避免数据互操作性问题。

提出的思路

区块链是一项有前途的技术,可以被认为是保护数据免受智慧城市应用变化的可行解决方案。区块链技术引入了透明和分散的分布式账本。区块链代表了一种记录交易或任何数字交互的方式,这些交易或任何数字交互安全、透明、高度抗中断、可审计且高效。这些功能鼓励智慧城市应用将其IIoT网络与区块链技术相结合。传感器、物联网和区块链技术的组合提供了一种可验证、安全和强大的机制,用于存储和管理由连接的智能设备生成或处理的数据。

技术上的困难

1.现有的基于云的智能城市集中式IIoT数据管理流程不受信任。

2.传感器设备和物联网可能会被攻击者破坏,以生成虚假数据并破坏智慧城市的管理任务。

3.基于区块链的智慧城市IIoT数据信任管理系统引发了区块链网络之间的互操作性问题。智慧城市中的不同管理机构可能拥有不同类型的私有区块链平台。

4.需要一个通用的虚拟区块链平台来引入来自智慧城市不同管理机构的所有私有区块链网络。

解决办法

在本文中,我们提出了一种基于区块链的新方法,为不同组织的安全性、信任性和数据异构性提供解决方案。与现有的区块链方法不同,我们的方法采用了一种名为区块链区块链(BoB)的新概念。BoB是一个区块链树结构。在所提出的机制中,区块链的层次结构将管理连接到智慧城市中不同组织的私有区块链通信之间的安全性,信任和异构性问题。我们的方法提供了一个不太复杂的分布式账本实现,并提供了一个简化的共识机制来管理数据。组织可以通过私有区块链维护组内数据的完整性和信任。我们实现了一个测试平台,模拟所提出的方法,以使用Ethermint[20]和Hyperledger Fabric[21]来评估性能。Hyperledger Fabric用于为智慧城市中的每个组织创建一个私有区块链。生成的物联网数据被发送到这个私有区块链,用于本地防篡改存储。基于Ethermint的联盟网络旨在提供所有私有区块链网络之间的数据互操作性。

VGGNets

网络结构

论文中一共提供了6种网络配置,层数从浅到深分别为11层、13层、16层和19层。其中11层时,主要比较了Local Response Normalisation(LRN)的作用,结果是LRN并没有提升网络性能。除了网络结构的变化,VGGNet从原理上和传统的CNN模型并没有太大区别,都是采用同样的训练Pipeline。

代码实现

from keras.layers import Input
from keras.layers import Conv2D, MaxPool2D, Dense, Flatten, Dropout
from keras.models import Model
from keras import optimizers
from keras.utils import plot_model
 
 
def vgg13(input_shape=(224,224,3), nclass=1000):
    """
    build vgg13 model using keras with TensorFlow backend.
    :param input_shape: input shape of network, default as (224,224,3)
    :param nclass: numbers of class(output shape of network), default as 1000
    :return: vgg13 model
    """
    input_ = Input(shape=input_shape)
 
    x = Conv2D(64, kernel_size=(3, 3), strides=(1, 1), padding='same', activation='relu')(input_)
    x = Conv2D(64, kernel_size=(3, 3), strides=(1, 1), padding='same', activation='relu')(x)
    x = MaxPool2D(pool_size=(2, 2), strides=(2, 2), padding='same')(x)
 
    x = Conv2D(128, kernel_size=(3, 3), strides=(1, 1), padding='same', activation='relu')(x)
    x = Conv2D(128, kernel_size=(3, 3), strides=(1, 1), padding='same', activation='relu')(x)
    x = MaxPool2D(pool_size=(2, 2), strides=(2, 2), padding='same')(x)
 
    x = Conv2D(256, kernel_size=(3, 3), strides=(1, 1), padding='same', activation='relu')(x)
    x = Conv2D(256, kernel_size=(3, 3), strides=(1, 1), padding='same', activation='relu')(x)
    x = MaxPool2D(pool_size=(2, 2), strides=(2, 2), padding='same')(x)
 
    x = Conv2D(512, kernel_size=(3, 3), strides=(1, 1), padding='same', activation='relu')(x)
    x = Conv2D(512, kernel_size=(3, 3), strides=(1, 1), padding='same', activation='relu')(x)
    x = MaxPool2D(pool_size=(2, 2), strides=(2, 2), padding='same')(x)
 
    x = Conv2D(512, kernel_size=(3, 3), strides=(1, 1), padding='same', activation='relu')(x)
    x = Conv2D(512, kernel_size=(3, 3), strides=(1, 1), padding='same', activation='relu')(x)
    x = MaxPool2D(pool_size=(2, 2), strides=(2, 2), padding='same')(x)
 
    x = Flatten()(x)
    x = Dense(4096, activation='relu')(x)
    x = Dropout(0.5)(x)
    x = Dense(4096, activation='relu')(x)
    x = Dropout(0.5)(x)
    output_ = Dense(nclass, activation='softmax')(x)
 
    model = Model(inputs=input_, outputs=output_)
    model.summary()
 
    opti_sgd = optimizers.sgd(lr=0.01, momentum=0.9, nesterov=True)
 
    model.compile(loss='categorical_crossentropy', optimizer=opti_sgd, metrics=['accuracy'])
 
    return model
 
if __name__ == '__main__':
    model = vgg13()
    plot_model(model, 'vgg13.png')  # 保存模型图

主要贡献

1. 使用3x3小卷积核。

2. 增加网络深度。

ResNets

残差学习

提问:为什么残差学习可以解决“网络加深准确率下降”的问题? 

对于一个神经网络模型,如果该模型是最优的,那么训练就很容易将residual mapping优化到0,此时只剩下identity mapping,那么无论怎么增加深度,理论上网络会一直处于最优状态。因为相当于后面所有增加的网络都会沿着identity mapping(自身)进行信息传输,可以理解为最优网络后面的层数都是废掉的(不具备特征提取的能力),实际上没起什么作用。这样,网络的性能也就不会随着深度的增加而降低了。

网络结构

代码实现

from keras.layers import Input
from keras.layers import Conv2D, MaxPool2D, Dense, BatchNormalization, Activation, add, GlobalAvgPool2D
from keras.models import Model
from keras import regularizers
from keras.utils import plot_model
from keras import backend as K
 
 
def conv2d_bn(x, nb_filter, kernel_size, strides=(1, 1), padding='same'):
    """
    conv2d -> batch normalization -> relu activation
    """
    x = Conv2D(nb_filter, kernel_size=kernel_size,
                          strides=strides,
                          padding=padding,
                          kernel_regularizer=regularizers.l2(0.0001))(x)
    x = BatchNormalization()(x)
    x = Activation('relu')(x)
    return x
 
 
def shortcut(input, residual):
    """
    shortcut连接,也就是identity mapping部分。
    """
 
    input_shape = K.int_shape(input)
    residual_shape = K.int_shape(residual)
    stride_height = int(round(input_shape[1] / residual_shape[1]))
    stride_width = int(round(input_shape[2] / residual_shape[2]))
    equal_channels = input_shape[3] == residual_shape[3]
 
    identity = input
    # 如果维度不同,则使用1x1卷积进行调整
    if stride_width > 1 or stride_height > 1 or not equal_channels:
        identity = Conv2D(filters=residual_shape[3],
                           kernel_size=(1, 1),
                           strides=(stride_width, stride_height),
                           padding="valid",
                           kernel_regularizer=regularizers.l2(0.0001))(input)
 
    return add([identity, residual])
 
 
def basic_block(nb_filter, strides=(1, 1)):
    """
    基本的ResNet building block,适用于ResNet-18和ResNet-34.
    """
    def f(input):
 
        conv1 = conv2d_bn(input, nb_filter, kernel_size=(3, 3), strides=strides)
        residual = conv2d_bn(conv1, nb_filter, kernel_size=(3, 3))
 
        return shortcut(input, residual)
 
    return f
 
 
def residual_block(nb_filter, repetitions, is_first_layer=False):
    """
    构建每层的residual模块,对应论文参数统计表中的conv2_x -> conv5_x
    """
    def f(input):
        for i in range(repetitions):
            strides = (1, 1)
            if i == 0 and not is_first_layer:
                strides = (2, 2)
            input = basic_block(nb_filter, strides)(input)
        return input
 
    return f
 
 
def resnet_18(input_shape=(224,224,3), nclass=1000):
    """
    build resnet-18 model using keras with TensorFlow backend.
    :param input_shape: input shape of network, default as (224,224,3)
    :param nclass: numbers of class(output shape of network), default as 1000
    :return: resnet-18 model
    """
    input_ = Input(shape=input_shape)
 
    conv1 = conv2d_bn(input_, 64, kernel_size=(7, 7), strides=(2, 2))
    pool1 = MaxPool2D(pool_size=(3, 3), strides=(2, 2), padding='same')(conv1)
 
    conv2 = residual_block(64, 2, is_first_layer=True)(pool1)
    conv3 = residual_block(128, 2, is_first_layer=True)(conv2)
    conv4 = residual_block(256, 2, is_first_layer=True)(conv3)
    conv5 = residual_block(512, 2, is_first_layer=True)(conv4)
 
    pool2 = GlobalAvgPool2D()(conv5)
    output_ = Dense(nclass, activation='softmax')(pool2)
 
    model = Model(inputs=input_, outputs=output_)
    model.summary()
 
    return model
 
if __name__ == '__main__':
    model = resnet_18()
    plot_model(model, 'ResNet-18.png')  # 保存模型图

总结

在CNN的学习中,掌握了简单的手写数字识别。对于CNN基础网络框架有了系统的认识。除此之外,对于CNN的变形模型,例如AlexNets,VGGNets,ResNets等展开研究。下周开始就进入RNN的系统学习。

猜你喜欢

转载自blog.csdn.net/weixin_43971717/article/details/127829208
今日推荐