日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

python毕业设计 深度学习卫星遥感图像检测与识别 opencv 目标检测

發布時間:2024/1/18 python 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python毕业设计 深度学习卫星遥感图像检测与识别 opencv 目标检测 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

文章目錄

  • 0 前言
  • 1 課題背景
  • 2 實現效果
  • 3 Yolov5算法
  • 4 數據處理和訓練


0 前言

🔥 這兩年開始畢業設計和畢業答辯的要求和難度不斷提升,傳統的畢設題目缺少創新和亮點,往往達不到畢業答辯的要求,這兩年不斷有學弟學妹告訴學長自己做的項目系統達不到老師的要求。

為了大家能夠順利以及最少的精力通過畢設,學長分享優質畢業設計項目,今天要分享的是

🚩 **深度學習衛星遙感圖像檢測與識別 **

🥇學長這里給一個題目綜合評分(每項滿分5分)

  • 難度系數:3分
  • 工作量:3分
  • 創新點:5分

選題指導,項目分享:

https://gitee.com/yaa-dc/warehouse-1/blob/master/python/README.md

1 課題背景

近年來,世界各國大力發展航空航天事業,衛星圖像的目標檢測在各行各業的應用得到了快速的發展,特別是軍事偵查、海洋船舶和漁業管理等領域。由于衛星圖像中有價值的信息極少,衛星圖像數據規模巨大,這迫切需要智能輔助工具幫助相關從業人員從衛星圖像中高效獲取精確直觀的信息。
本文利用深度學習技術,基于Yolov5算法框架實現衛星圖像目標檢測問題。

2 實現效果

實現效果如下:可以看出對船只、飛機等識別效果還是很好的。




3 Yolov5算法

簡介
下圖所示為 YOLOv5 的網絡結構圖,分為輸入端,Backbone,Neck 和 Prediction 四個部分。其中,
輸入端包括 Mosaic 數據增強、自適應圖片縮放、自適應錨框計算,Backbone 包括 Focus 結構、CSP
結 構,Neck 包 括 FPN+PAN 結 構,Prediction 包 括GIOU_Loss 結構。

相關代碼

class Yolo(object):def __init__(self, weights_file, verbose=True):self.verbose = verbose# detection paramsself.S = 7 # cell sizeself.B = 2 # boxes_per_cellself.classes = ["aeroplane", "bicycle", "bird", "boat", "bottle","bus", "car", "cat", "chair", "cow", "diningtable","dog", "horse", "motorbike", "person", "pottedplant","sheep", "sofa", "train","tvmonitor"]self.C = len(self.classes) # number of classes# offset for box center (top left point of each cell)self.x_offset = np.transpose(np.reshape(np.array([np.arange(self.S)]*self.S*self.B),[self.B, self.S, self.S]), [1, 2, 0])self.y_offset = np.transpose(self.x_offset, [1, 0, 2])self.threshold = 0.2 # confidence scores threholdself.iou_threshold = 0.4# the maximum number of boxes to be selected by non max suppressionself.max_output_size = 10self.sess = tf.Session()self._build_net()self._build_detector()self._load_weights(weights_file)

4 數據處理和訓練

數據集
本項目使用 DOTA 數據集,原數據集中待檢測的目標如下

原數據集中的標簽如下

圖像分割和尺寸調整
YOLO 模型的圖像輸入尺寸是固定的,由于原數據集中的圖像尺寸不一,我們將原數據集中的圖像按目標分布的位置分割成一個個包含目標的子圖,并將每個子圖尺寸調整為 1024×1024。分割前后的圖像如所示。
分割前

分割后

模型訓練
在 yolov5/ 目錄,運行 train.py 文件開始訓練:

python train.py --weight weights/yolov5s.pt --batch 16 --epochs 100 --cache

其中的參數說明:

  • weight:使用的預訓練權重,這里示范使用的是 yolov5s 模型的預訓練權重
  • batch:mini-batch 的大小,這里使用 16
  • epochs:訓練的迭代次數,這里我們訓練 100 個 epoch
  • cache:使用數據緩存,加速訓練進程

相關代碼

#部分代碼 def train(hyp, opt, device, tb_writer=None):logger.info(f'Hyperparameters {hyp}')log_dir = Path(tb_writer.log_dir) if tb_writer else Path(opt.logdir) / 'evolve' # logging directorywdir = log_dir / 'weights' # weights directoryos.makedirs(wdir, exist_ok=True)last = wdir / 'last.pt'best = wdir / 'best.pt'results_file = str(log_dir / 'results.txt')epochs, batch_size, total_batch_size, weights, rank = \opt.epochs, opt.batch_size, opt.total_batch_size, opt.weights, opt.global_rank# Save run settingswith open(log_dir / 'hyp.yaml', 'w') as f:yaml.dump(hyp, f, sort_keys=False)with open(log_dir / 'opt.yaml', 'w') as f:yaml.dump(vars(opt), f, sort_keys=False)# Configurecuda = device.type != 'cpu'init_seeds(2 + rank)with open(opt.data) as f:data_dict = yaml.load(f, Loader=yaml.FullLoader) # data dictwith torch_distributed_zero_first(rank):check_dataset(data_dict) # checktrain_path = data_dict['train']test_path = data_dict['val']nc, names = (1, ['item']) if opt.single_cls else (int(data_dict['nc']), data_dict['names']) # number classes, namesassert len(names) == nc, '%g names found for nc=%g dataset in %s' % (len(names), nc, opt.data) # check# Modelpretrained = weights.endswith('.pt')if pretrained:with torch_distributed_zero_first(rank):attempt_download(weights) # download if not found locallyckpt = torch.load(weights, map_location=device) # load checkpointif 'anchors' in hyp and hyp['anchors']:ckpt['model'].yaml['anchors'] = round(hyp['anchors']) # force autoanchormodel = Model(opt.cfg or ckpt['model'].yaml, ch=3, nc=nc).to(device) # createexclude = ['anchor'] if opt.cfg else [] # exclude keysstate_dict = ckpt['model'].float().state_dict() # to FP32state_dict = intersect_dicts(state_dict, model.state_dict(), exclude=exclude) # intersectmodel.load_state_dict(state_dict, strict=False) # loadlogger.info('Transferred %g/%g items from %s' % (len(state_dict), len(model.state_dict()), weights)) # reportelse:model = Model(opt.cfg, ch=3, nc=nc).to(device) # create# Freezefreeze = ['', ] # parameter names to freeze (full or partial)if any(freeze):for k, v in model.named_parameters():if any(x in k for x in freeze):print('freezing %s' % k)v.requires_grad = False# Optimizernbs = 64 # nominal batch sizeaccumulate = max(round(nbs / total_batch_size), 1) # accumulate loss before optimizinghyp['weight_decay'] *= total_batch_size * accumulate / nbs # scale weight_decaypg0, pg1, pg2 = [], [], [] # optimizer parameter groupsfor k, v in model.named_parameters():v.requires_grad = Trueif '.bias' in k:pg2.append(v) # biaseselif '.weight' in k and '.bn' not in k:pg1.append(v) # apply weight decayelse:pg0.append(v) # all else

訓練開始時的日志信息

選題指導,項目分享:

https://gitee.com/yaa-dc/warehouse-1/blob/master/python/README.md

總結

以上是生活随笔為你收集整理的python毕业设计 深度学习卫星遥感图像检测与识别 opencv 目标检测的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。