复合火焰探测传感器_基于卷积神经网络的火焰判别

  1.   背景介绍

       火灾是一种常见的灾害,一旦发生火灾,人们的生命财产安全便会受到极大的威胁,在火灾发生早期进行火灾识别并及时报警,对于保护人们的生命财产安全具有积极意义。长期以来,人们使用各种感温型、感烟型和感光型探测器采集数据,判断火灾是否发生。然而受限于传感器的安装位置及探测有效距离,其探测范围受到制约,且传感器判断信息单一,易受到环境光照、温度湿度以及气流等干扰,进而产生误报、漏报等情况,可靠性和稳定性难以保证。此外,火灾产生的温度、烟雾、辐射等参量的传播需要时间,火灾蔓延的速度极快,传统的火灾探测系统完全不能满足火灾预防要求。本文主要利用caffe深度学习框架,从互联网上收集火焰与非火焰图像,然后送入卷积神经网络进行训练,之后对于给定的火焰图像,首先采用火焰分割的经验阈值分割与提取火焰候选区域,然后利用预先训练的深度学习模型进一步对疑似的火焰区域进行判别,排除干扰的火焰区域。

 2.  训练环境介绍

 2.1 windows caffe框架

    github网址:https://github.com/happynear/caffe-windows

2.2 Visual Studio 2013 C++,可以编译成CPU或者GPU版本进行训练和测试

2.3 Python 2.7

2.4 第三方库:

    百度网盘:https://pan.baidu.com/s/1ZTp8iWszMPrZ718w_UCZ5Q

3.  训练过程显示

3.1 myfire_solver.prototxt

net: "examples/myfire/myfire_train_test.prototxt"

test_iter: 10

test_interval: 50

base_lr: 0.001

lr_policy: "step"

gamma: 0.1

stepsize: 400

momentum: 0.9

weight_decay: 0.004

display: 10

max_iter: 2000

snapshot: 2000

snapshot_prefix: "examples/myfire/AlexNet"

solver_mode: CPU

3.2 myfire_train_test.prototxt

name: "myfire"

layer {

  name: "data"

  type: "Data"

  top: "data"

  top: "label"

  include {

    phase: TRAIN

  }

  transform_param {

    mean_file: "examples/myfire/mean.binaryproto"

  }

  data_param {

    source: "examples/myfire/data/lmdb/fire_train_lmdb"

    batch_size: 16

    backend: LMDB

  }

}

layer {

  name: "cifar"

  type: "Data"

  top: "data"

  top: "label"

  include {

    phase: TEST

  }

  transform_param {

    mean_file: "examples/myfire/mean.binaryproto"

  }

  data_param {

    source: "examples/myfire/data/lmdb/fire_val_lmdb"

    batch_size: 4

    backend: LMDB

  }

}

layer {

  name: "conv1"

  type: "Convolution"

  bottom: "data"

  top: "conv1"

  param {

    lr_mult: 1

  }

  param {

    lr_mult: 2

  }

  convolution_param {

    num_output: 32

    pad: 2

    kernel_size: 5

    stride: 1

    weight_filler {

      type: "gaussian"

      std: 0.0001

    }

    bias_filler {

      type: "constant"

    }

  }

}

layer {

  name: "pool1"

  type: "Pooling"

  bottom: "conv1"

  top: "pool1"

  pooling_param {

    pool: MAX

    kernel_size: 3

    stride: 2

  }

}

layer {

  name: "relu1"

  type: "ReLU"

  bottom: "pool1"

  top: "pool1"

}

layer {

  name: "conv2"

  type: "Convolution"

  bottom: "pool1"

  top: "conv2"

  param {

    lr_mult: 1

  }

  param {

    lr_mult: 2

  }

  convolution_param {

    num_output: 32

    pad: 2

    kernel_size: 5

    stride: 1

    weight_filler {

      type: "gaussian"

      std: 0.01

    }

    bias_filler {

      type: "constant"

    }

  }

}

layer {

  name: "relu2"

  type: "ReLU"

  bottom: "conv2"

  top: "conv2"

}

layer {

  name: "pool2"

  type: "Pooling"

  bottom: "conv2"

  top: "pool2"

  pooling_param {

    pool: AVE

    kernel_size: 3

    stride: 2

  }

}

layer {

  name: "conv3"

  type: "Convolution"

  bottom: "pool2"

  top: "conv3"

  param {

    lr_mult: 1

  }

  param {

    lr_mult: 2

  }

  convolution_param {

    num_output: 64

    pad: 2

    kernel_size: 5

    stride: 1

    weight_filler {

      type: "gaussian"

      std: 0.01

    }

    bias_filler {

      type: "constant"

    }

  }

}

layer {

  name: "relu3"

  type: "ReLU"

  bottom: "conv3"

  top: "conv3"

}

layer {

  name: "pool3"

  type: "Pooling"

  bottom: "conv3"

  top: "pool3"

  pooling_param {

    pool: AVE

    kernel_size: 3

    stride: 2

  }

}

layer {

  name: "ip1"

  type: "InnerProduct"

  bottom: "pool3"

  top: "ip1"

  param {

    lr_mult: 1

  }

  param {

    lr_mult: 2

  }

  inner_product_param {

    num_output: 64

    weight_filler {

      type: "gaussian"

      std: 0.1

    }

    bias_filler {

      type: "constant"

    }

  }

}

layer {

  name: "ip2"

  type: "InnerProduct"

  bottom: "ip1"

  top: "ip2"

  param {

    lr_mult: 1

  }

  param {

    lr_mult: 2

  }

  inner_product_param {

    num_output: 2

    weight_filler {

      type: "gaussian"

      std: 0.1

    }

    bias_filler {

      type: "constant"

    }

  }

}

layer {

  name: "accuracy"

  type: "Accuracy"

  bottom: "ip2"

  bottom: "label"

  top: "accuracy"

  include {

    phase: TEST

  }

}

layer {

  name: "loss"

  type: "SoftmaxWithLoss"

  bottom: "ip2"

  bottom: "label"

  top: "loss"

}

3.3 训练和单个图像测试结果

a6230eea3b6e5c90c6043f1afcffbf59.png

b755185fed8db5998b4074220ce6ed0a.png

4.  Visual Studio C++使用Dnn调用caffe模型

67227649f993a34ee0aa3123a83608b9.png

26f4edf63465db246fa5bde5ed05a795.png

4ca559bae6686d62e495f2fb6d066209.png

94480d7d720f7797abf94128a45b2e54.png

d0f486018065dcfe599f00ae256b4263.png

8f037f43b77d207090a8635d78a2ec75.png

5fd7cf1f8bc3ded47446c43d7a30333c.png

00428bd0a1114a254a04facfec862c0a.png

e807e80319335d29e552c26ac12f7927.png

5295018e7fb34dc3baf449b28a12298b.png

1f4a4b84ce2eb3673b66741519ba86fb.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值