【Tensorflow tf 掏粪记录】笔记二——用SVM打造全连接神经网络识别MNIST数据集

本文主要是介绍【Tensorflow tf 掏粪记录】笔记二——用SVM打造全连接神经网络识别MNIST数据集,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

由于我个人的原因,在写了第一篇tensorflow安装教程后就暂停了更新博客。可是我并没有停止前进的步伐,因为我习惯了做书面的笔记了。可是书面笔记,容易破损啊啊啊啊!!!


在深度学习中,入门的项目是MNIST数据集的分类识别。就好比我们学各种编程语言时候的Hello World!

下载MNIST数据集


从这里下载MNIST数据集。点击如下图所示按钮下载:
训练图片,训练标签,测试图片,测试标签
这里写图片描述
入门级别数据集,不大才11MB。很快就下载好了。

当然我们也可以用如下代码在程序中下载,不过我当时做的项目中没有用此方法。

from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets( 'MNIST_data' )

在这个项目里,我并没有用多少tensorflow提供的API接口来实现,更多是用tf的运算来实现整个神经网络。(真的累)

开车先造轮(加载MNIST数据)


想代码跑起来,轮子必不可少。读取数据方面的轮子是参考一个关于MNIST开源的项目写的。

调包

首先调包。(每个程序猿都是一名合格的调包侠)

import math
import numpy as np
import h5py
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.python.framework import ops
from LoadData import DataUtils

数据的处理

读取数据

def main():
trainFile_x = 'D:/PycharmProjects/MNIST/MNIST_data/train-images.idx3-ubyte'    # 读取训练集文件,后面为训练集的存放地址trainFile_y = 'D:/PycharmProjects/MNIST/MNIST_data/train-labels.idx1-ubyte'    # 读取训练集标签文件,后面为训练集标签的存放地址testFile_x = 'D:/PycharmProjects/MNIST/MNIST_data/t10k-images.idx3-ubyte'    # 读取测试集文件,后面为测试集的存放地址testFile_y = 'D:/PycharmProjects/MNIST/MNIST_data/t10k-labels.idx1-ubyte'    # 读取测试集标签文件,后面为测试集标签的存放地址train_X = DataUtils( fileName = trainFile_x ).getImage()    # 获取训练集train_Y = DataUtils( fileName = trainFile_y ).getLabel()    # 获取训练集标签test_X = DataUtils( testFile_x ).getImage()    # 获取测试集test_Y = DataUtils( testFile_y ).getLabel()    # 获取测试集标签return train_X, train_Y, test_X, test_Y

one_hot_matrix

把训练集与测试集的标签按指定的个数大小进行tf.one_hot()
处理。

def one_hot_matrix( labels, C ):C = tf.constant( C, name = "C" )one_hot_matrix = tf.one_hot( labels, C, axis = 0 )one_hot = sess.run( one_hot_matrix )return one_hot

数组的转置

我们要把训练集与测试集转置下,因为我个人喜欢一张图片放为一个列。
同时我们也对标签进行了one_hot_matrix()处理

def fit_data():train_X, train_Y, test_X, test_Y = main()train_X, test_X, = train_X.T, test_X.T'''--------进行one_hot处理--------'''train_Y = one_hot_matrix( train_Y, 10 )test_Y = one_hot_matrix( test_Y, 10 )

随机mini_batches

def random_mini_batches( X, Y, mini_batch_size ):m = X.shape[1]    # 获取MNIST数据集中的训练集的个数mini_batches = []'''-------实现随机操作--------'''permutation = list( np.random.permutation( m ) )shuffled_X = X[:, permutation]shuffled_Y = Y[:, permutation]'''--------进行mini_batches分配--------'''num_complete_minibatches = math.floor( m / mini_batch_size )for k in range( 0, num_complete_minibatches ):mini_batch_X = shuffled_X[:, k * mini_batch_size : mini_batch_size * ( k + 1 )]mini_batch_Y = shuffled_Y[:, k * mini_batch_size : mini_batch_size * ( k + 1 )]mini_batch = ( mini_batch_X, mini_batch_Y )mini_batches.append( mini_batch )'''--------把剩下的训练集分到一个batch中--------'''if m % mini_batch_size != 0:mini_batch_X = shuffled_X[:, mini_batch_size * num_complete_minibatches : m]mini_batch_Y = shuffled_Y[:, mini_batch_size * num_complete_minibatches : m]'''--------把对应的训练集测试集按元组组成mini_batch并放入mini_batches中--------'''mini_batch = ( mini_batch_X, mini_batch_Y )mini_batches.append( mini_batch )return mini_batches

初始化参数

def initialize_parameters():'''--------初始化第一层神经网络--------'''W1 = tf.get_variable( "W1", [40, 784], initializer = tf.contrib.layers.xavier_initializer() )b1 = tf.get_variable( "b1", [40, 1], initializer = tf.zeros_initializer() )'''--------初始化第二层神经网络--------'''W2 = tf.get_variable( "W2", [20, 40], initializer = tf.contrib.layers.xavier_initializer() )b2 = tf.get_variable( "b2", [20, 1], initializer = tf.zeros_initializer() )'''--------初始化第三层神经网络--------'''W3 = tf.get_variable( "W3", [10, 20], initializer = tf.contrib.layers.xavier_initializer() )b3 = tf.get_variable( "b3", [10, 1], initializer = tf.zeros_initializer() )'''-------列了个参数表--------'''parameters = {"W1" : W1,"b1" : b1,"W2" : W2,"b2" : b2,"W3" : W3,"b3" : b3}return parameters

我初始化了3层40深的全连接神经网络,当时闹着玩的,初始化如此奇葩的全连接神经网络。结果训练结果还不错,没出现过拟合的情况。在这里我还列了个map方便自己以后调用参数。

向前传播

我是手撸SVM来实现的神经网络。
因为感觉用tf封装好的tf.layers.dense() 太简单了。
这里用relu激活函数并且实现了3层神经元的计算。

def forward_propagation( X, parameters ):'''--------读表--------'''W1 = parameters['W1']b1 = parameters['b1']W2 = parameters['W2']b2 = parameters['b2']W3 = parameters['W3']b3 = parameters['b3']'''--------实现神经元的计算--------'''Z1 = tf.matmul( W1, X ) + b1A1 = tf.nn.relu( Z1 )Z2 = tf.matmul( W2, A1 ) + b2A2 = tf.nn.relu( Z2 )Z3 = tf.matmul( W3, A2 ) + b3return Z3

计算损失

这里我用的是tf的tf.nn.softmax_cross_entropy_with_logits(logits, labels) 来计算训练时的生成的结果与标签的误差。

def compute_cost( Z3, Y ):logits = tf.transpose( Z3 )labels = tf.transpose( Y )'''--------损失计算--------'''cost = tf.reduce_mean( tf.nn.softmax_cross_entropy_with_logits( logits = logits, labels = labels ) )return cost

训练的代码


我们每100epoch输出一次Cost,每5epoch记录一次Cost,最后用训练好的模型跑一遍测试集和训练集,来得出对不同数据集的准确率。

def model( train_X, train_Y, test_X, test_Y, learning_rate = 0.0001, num_epochs = 300, minibatch_size = 32, print_cost = True ):ops.reset_default_graph()( n_x, m ) = train_X.shapen_y = train_Y.shape[0]costs = []X, Y = create_placeholeers( n_x, n_y )parameters = initialize_parameters()Z3 = forward_propagation( X, parameters )cost = compute_cost( Z3, Y )'''--------用Adam正则化--------'''optimizer = tf.train.AdamOptimizer( learning_rate = learning_rate ).minimize( cost )init = tf.global_variables_initializer()with tf.Session() as sess:sess.run( init )for epoch in range( num_epochs ):epoch_cost = 0num_minibatches = int( m / minibatch_size )minibatches = random_mini_batches( train_X, train_Y, minibatch_size )for minibatch in minibatches:( minibatch_X, minibatch_Y ) = minibatch_, minibatch_cost = sess.run( [optimizer, cost], feed_dict = {X : minibatch_X, Y : minibatch_Y})epoch_cost += minibatch_cost / num_minibatches   #全局成本行函数if print_cost == True and epoch % 100 == 0:print ( "Cost after epoch %i: %f" % ( epoch, epoch_cost ) )if print_cost == True and epoch % 5 == 0:costs.append( epoch_cost )plt.plot( np.squeeze( costs ) )plt.ylabel( "cost" )plt.xlabel( "iteration ( per tens)" )plt.title( "Learning rate = " + str( learning_rate ) )plt.show()parameters = sess.run( parameters )print ( "Parameters have been trained" )correct_prediction = tf.equal( tf.argmax( Z3 ), tf.argmax( Y ) )accuracy = tf.reduce_mean( tf.cast( correct_prediction, "float" ) )print( "Train Accuracy:", accuracy.eval( {X : train_X, Y : train_Y} ) )print( "Test Accuracy:", accuracy.eval( {X : test_X, Y : test_Y} ) )sess.close()return parameters

用训练好的模型进行指定类型输出


这里我们用指定的数据集X1,希望从模型中得出属于index列的图片的数字
其中输出的Machine是机器识别图像预测的数字,Y为数据集带的标签

def predict( parameters, X1, index ):X, Y = create_placeholeers(X1.shape[0], 0)Z3 = forward_propagation(X, parameters)perdictions = tf.argmax(Z3[:, index])with tf.Session() as sess:print("Machine:", perdictions.eval( {X : X1} ) )

运行后会有如下图所示的cost显示
这里写图片描述
这里写图片描述
这里写图片描述

损失函数


这里写图片描述

完整代码


LoadData.py 代码

import numpy as np
import struct
import matplotlib.pyplot as plt
import osclass DataUtils( object ):def __init__( self, fileName = None, outPath = None ):self._fileName = fileNameself._outPath = outPathself._tag = '>'self._twoBytes = 'II'self._fourBytes = 'IIII'self._pictureBytes = '784B'self._labelBytes = '1B'self._twoBytes2 = self._tag + self._twoBytesself._fourBytes2 = self._tag + self._fourBytes    #>IIII’指的是使用大端法读取4个unsinged int 32 bit integerself._pictureBytes2 = self._tag + self._pictureBytes    #>784B’指的是使用大端法读取784个unsigned byteself._labelBytes2 = self._tag + self._labelBytesdef getImage( self ):"""将MNIST的二进制文件转换成新书特征数据"""binFile = open( self._fileName, 'rb' )    #以二进制的方式打开文件buffer = binFile.read()binFile.close()index = 0numMagic, numImages, numRows, numColumns = struct.unpack_from( self._fourBytes2, buffer, index )index += struct.calcsize( self._fourBytes )images = []for i in range( numImages ):imageValue = struct.unpack_from( self._pictureBytes2, buffer, index )     #struct.unpack_from( fmt, buffer, offser )从offset位置开始解包buffer,按照fmt格式输出index += struct.calcsize( self._pictureBytes2 )imageValue = list( imageValue )for j in range( len( imageValue ) ):if imageValue[j] > 1:imageValue[j] = 1images.append( imageValue )return np.array( images )def getLabel( self ):"""将MNIST中label二进制文件转化成对应的label数字特征"""binFile = open( self._fileName, 'rb' )buffer = binFile.read()binFile.close()index = 0magic, numItems = struct.unpack_from( self._twoBytes2, buffer, index )index += struct.calcsize( self._twoBytes2 )labels = [];for x in range( numItems ):im = struct.unpack_from( self._labelBytes2, buffer, index )index += struct.calcsize( self._labelBytes2 )labels.append( im[0] )return np.array( labels )def outImage( self, arrX, arrY ):"""根据生成的特征和数字标号,输出png图像"""m, n = np.shape( arrX )# 每张图是28 * 28 = 784bytefor i in range( 1 ):image = np.array( arrX[i] )image = image.reshape( 28, 28 )outFile = str( i ) + "_" + str( arrY[ i ] ) + '.png'plt.figure()plt.imshow( image, cmap = 'binary' ) #将图片黑白显示
plt.savefig( self._outPath + '/' + outFile )

Util.py 代码

import math
import numpy as np
import h5py
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.python.framework import ops
from LoadData import DataUtilssess = tf.InteractiveSession()def main():trainFile_x = 'D:/PycharmProjects/MNIST/MNIST_data/train-images.idx3-ubyte'trainFile_y = 'D:/PycharmProjects/MNIST/MNIST_data/train-labels.idx1-ubyte'testFile_x = 'D:/PycharmProjects/MNIST/MNIST_data/t10k-images.idx3-ubyte'testFile_y = 'D:/PycharmProjects/MNIST/MNIST_data/t10k-labels.idx1-ubyte'train_X = DataUtils( fileName = trainFile_x ).getImage()train_Y = DataUtils( fileName = trainFile_y ).getLabel()test_X = DataUtils( testFile_x ).getImage()test_Y = DataUtils( testFile_y ).getLabel()return train_X, train_Y, test_X, test_Ydef data_test():# Loading the datasettrain_X, train_Y, test_X, test_Y = fit_data()print(train_X.shape, train_Y.shape, test_X.shape, test_Y.shape)index = 0image = train_X[:, index]print( image.shape )image = image.reshape(28, -1)print( image.shape )plt.imshow( image )plt.show()print( "Y = " + str( np.squeeze( train_Y[:, index] ) ) )print( "Y = " + str( np.argmax( train_Y[:, index] ) ) )def fit_data():train_X, train_Y, test_X, test_Y = main()train_X, test_X, = train_X.T, test_X.Ttrain_Y = one_hot_matrix( train_Y, 10 )test_Y = one_hot_matrix( test_Y, 10 )print ( train_X.shape, train_Y.shape, test_X.shape, test_Y.shape )return train_X, train_Y, test_X, test_Ydef one_hot_matrix( labels, C ):C = tf.constant( C, name = "C" )one_hot_matrix = tf.one_hot( labels, C, axis = 0 )one_hot = sess.run( one_hot_matrix )return one_hotdef create_placeholeers( n_x, n_y ):X = tf.placeholder( tf.float32, [n_x, None] )Y = tf.placeholder( tf.float32, [n_y, None] )return X, Ydef initialize_parameters():W1 = tf.get_variable( "W1", [40, 784], initializer = tf.contrib.layers.xavier_initializer() )b1 = tf.get_variable( "b1", [40, 1], initializer = tf.zeros_initializer() )W2 = tf.get_variable( "W2", [20, 40], initializer = tf.contrib.layers.xavier_initializer() )b2 = tf.get_variable( "b2", [20, 1], initializer = tf.zeros_initializer() )W3 = tf.get_variable( "W3", [10, 20], initializer = tf.contrib.layers.xavier_initializer() )b3 = tf.get_variable( "b3", [10, 1], initializer = tf.zeros_initializer() )parameters = {"W1" : W1,"b1" : b1,"W2" : W2,"b2" : b2,"W3" : W3,"b3" : b3}return parametersdef forward_propagation( X, parameters ):W1 = parameters['W1']b1 = parameters['b1']W2 = parameters['W2']b2 = parameters['b2']W3 = parameters['W3']b3 = parameters['b3']Z1 = tf.matmul( W1, X ) + b1A1 = tf.nn.relu( Z1 )Z2 = tf.matmul( W2, A1 ) + b2A2 = tf.nn.relu( Z2 )Z3 = tf.matmul( W3, A2 ) + b3return Z3def compute_cost( Z3, Y ):logits = tf.transpose( Z3 )labels = tf.transpose( Y )cost = tf.reduce_mean( tf.nn.softmax_cross_entropy_with_logits( logits = logits, labels = labels ) )return costdef model( train_X, train_Y, test_X, test_Y, learning_rate = 0.0001, num_epochs = 300, minibatch_size = 32, print_cost = True ):ops.reset_default_graph()( n_x, m ) = train_X.shapen_y = train_Y.shape[0]costs = []X, Y = create_placeholeers( n_x, n_y )parameters = initialize_parameters()Z3 = forward_propagation( X, parameters )cost = compute_cost( Z3, Y )optimizer = tf.train.AdamOptimizer( learning_rate = learning_rate ).minimize( cost )init = tf.global_variables_initializer()with tf.Session() as sess:sess.run( init )for epoch in range( num_epochs ):epoch_cost = 0num_minibatches = int( m / minibatch_size )minibatches = random_mini_batches( train_X, train_Y, minibatch_size )for minibatch in minibatches:( minibatch_X, minibatch_Y ) = minibatch_, minibatch_cost = sess.run( [optimizer, cost], feed_dict = {X : minibatch_X, Y : minibatch_Y})epoch_cost += minibatch_cost / num_minibatches   #全局成本行函数if print_cost == True and epoch % 100 == 0:print ( "Cost after epoch %i: %f" % ( epoch, epoch_cost ) )if print_cost == True and epoch % 5 == 0:costs.append( epoch_cost )plt.plot( np.squeeze( costs ) )plt.ylabel( "cost" )plt.xlabel( "iteration ( per tens)" )plt.title( "Learning rate = " + str( learning_rate ) )plt.show()parameters = sess.run( parameters )print ( "Parameters have been trained" )correct_prediction = tf.equal( tf.argmax( Z3 ), tf.argmax( Y ) )accuracy = tf.reduce_mean( tf.cast( correct_prediction, "float" ) )print( "Train Accuracy:", accuracy.eval( {X : train_X, Y : train_Y} ) )print( "Test Accuracy:", accuracy.eval( {X : test_X, Y : test_Y} ) )sess.close()return parametersdef random_mini_batches( X, Y, mini_batch_size ):m = X.shape[1]mini_batches = []permutation = list( np.random.permutation( m ) )shuffled_X = X[:, permutation]shuffled_Y = Y[:, permutation]num_complete_minibatches = math.floor( m / mini_batch_size )for k in range( 0, num_complete_minibatches ):mini_batch_X = shuffled_X[:, k * mini_batch_size : mini_batch_size * ( k + 1 )]mini_batch_Y = shuffled_Y[:, k * mini_batch_size : mini_batch_size * ( k + 1 )]mini_batch = ( mini_batch_X, mini_batch_Y )mini_batches.append( mini_batch )if m % mini_batch_size != 0:mini_batch_X = shuffled_X[:, mini_batch_size * num_complete_minibatches : m]mini_batch_Y = shuffled_Y[:, mini_batch_size * num_complete_minibatches : m]mini_batch = ( mini_batch_X, mini_batch_Y )mini_batches.append( mini_batch )return mini_batchesdef predict( parameters, X1, index ):X, Y = create_placeholeers(X1.shape[0], 0)Z3 = forward_propagation(X, parameters)perdictions = tf.argmax(Z3[:, index])with tf.Session() as sess:print("Machine:", perdictions.eval( {X : X1} ) )def print_iamge( X, Y, index ):image = X[:, index]image = image.reshape( 28, -1 )plt.imshow(image)plt.show()print("Y = " + str( np.argmax( Y[:, index] ) ) )# init = tf.global_variables_initializer()
# sess.run(init)
# train_X, train_Y, test_X, test_Y = fit_data()
# predict( initialize_parameters(), test_X, 0 )
# print_iamge( test_X, test_Y, 6 )

MNIST.py代码

from Util import  fit_data, model, predict, print_iamgetrain_X, train_Y, test_X, test_Y = fit_data()
parameters = model( train_X, train_Y, test_X, test_Y )
predict( parameters, test_X, 6 )
print_iamge( test_X, test_Y, 6 )

项目代码


https://github.com/IronMastiff/MNIST

参考资料


https://www.coursera.org/specializations/deep-learning

这篇关于【Tensorflow tf 掏粪记录】笔记二——用SVM打造全连接神经网络识别MNIST数据集的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/409770

相关文章

大模型研发全揭秘:客服工单数据标注的完整攻略

在人工智能(AI)领域,数据标注是模型训练过程中至关重要的一步。无论你是新手还是有经验的从业者,掌握数据标注的技术细节和常见问题的解决方案都能为你的AI项目增添不少价值。在电信运营商的客服系统中,工单数据是客户问题和解决方案的重要记录。通过对这些工单数据进行有效标注,不仅能够帮助提升客服自动化系统的智能化水平,还能优化客户服务流程,提高客户满意度。本文将详细介绍如何在电信运营商客服工单的背景下进行

基于MySQL Binlog的Elasticsearch数据同步实践

一、为什么要做 随着马蜂窝的逐渐发展,我们的业务数据越来越多,单纯使用 MySQL 已经不能满足我们的数据查询需求,例如对于商品、订单等数据的多维度检索。 使用 Elasticsearch 存储业务数据可以很好的解决我们业务中的搜索需求。而数据进行异构存储后,随之而来的就是数据同步的问题。 二、现有方法及问题 对于数据同步,我们目前的解决方案是建立数据中间表。把需要检索的业务数据,统一放到一张M

关于数据埋点,你需要了解这些基本知识

产品汪每天都在和数据打交道,你知道数据来自哪里吗? 移动app端内的用户行为数据大多来自埋点,了解一些埋点知识,能和数据分析师、技术侃大山,参与到前期的数据采集,更重要是让最终的埋点数据能为我所用,否则可怜巴巴等上几个月是常有的事。   埋点类型 根据埋点方式,可以区分为: 手动埋点半自动埋点全自动埋点 秉承“任何事物都有两面性”的道理:自动程度高的,能解决通用统计,便于统一化管理,但个性化定

W外链微信推广短连接怎么做?

制作微信推广链接的难点分析 一、内容创作难度 制作微信推广链接时,首先需要创作有吸引力的内容。这不仅要求内容本身有趣、有价值,还要能够激起人们的分享欲望。对于许多企业和个人来说,尤其是那些缺乏创意和写作能力的人来说,这是制作微信推广链接的一大难点。 二、精准定位难度 微信用户群体庞大,不同用户的需求和兴趣各异。因此,制作推广链接时需要精准定位目标受众,以便更有效地吸引他们点击并分享链接

使用SecondaryNameNode恢复NameNode的数据

1)需求: NameNode进程挂了并且存储的数据也丢失了,如何恢复NameNode 此种方式恢复的数据可能存在小部分数据的丢失。 2)故障模拟 (1)kill -9 NameNode进程 [lytfly@hadoop102 current]$ kill -9 19886 (2)删除NameNode存储的数据(/opt/module/hadoop-3.1.4/data/tmp/dfs/na

异构存储(冷热数据分离)

异构存储主要解决不同的数据,存储在不同类型的硬盘中,达到最佳性能的问题。 异构存储Shell操作 (1)查看当前有哪些存储策略可以用 [lytfly@hadoop102 hadoop-3.1.4]$ hdfs storagepolicies -listPolicies (2)为指定路径(数据存储目录)设置指定的存储策略 hdfs storagepolicies -setStoragePo

Hadoop集群数据均衡之磁盘间数据均衡

生产环境,由于硬盘空间不足,往往需要增加一块硬盘。刚加载的硬盘没有数据时,可以执行磁盘数据均衡命令。(Hadoop3.x新特性) plan后面带的节点的名字必须是已经存在的,并且是需要均衡的节点。 如果节点不存在,会报如下错误: 如果节点只有一个硬盘的话,不会创建均衡计划: (1)生成均衡计划 hdfs diskbalancer -plan hadoop102 (2)执行均衡计划 hd

阿里开源语音识别SenseVoiceWindows环境部署

SenseVoice介绍 SenseVoice 专注于高精度多语言语音识别、情感辨识和音频事件检测多语言识别: 采用超过 40 万小时数据训练,支持超过 50 种语言,识别效果上优于 Whisper 模型。富文本识别:具备优秀的情感识别,能够在测试数据上达到和超过目前最佳情感识别模型的效果。支持声音事件检测能力,支持音乐、掌声、笑声、哭声、咳嗽、喷嚏等多种常见人机交互事件进行检测。高效推

【Prometheus】PromQL向量匹配实现不同标签的向量数据进行运算

✨✨ 欢迎大家来到景天科技苑✨✨ 🎈🎈 养成好习惯,先赞后看哦~🎈🎈 🏆 作者简介:景天科技苑 🏆《头衔》:大厂架构师,华为云开发者社区专家博主,阿里云开发者社区专家博主,CSDN全栈领域优质创作者,掘金优秀博主,51CTO博客专家等。 🏆《博客》:Python全栈,前后端开发,小程序开发,人工智能,js逆向,App逆向,网络系统安全,数据分析,Django,fastapi

烟火目标检测数据集 7800张 烟火检测 带标注 voc yolo

一个包含7800张带标注图像的数据集,专门用于烟火目标检测,是一个非常有价值的资源,尤其对于那些致力于公共安全、事件管理和烟花表演监控等领域的人士而言。下面是对此数据集的一个详细介绍: 数据集名称:烟火目标检测数据集 数据集规模: 图片数量:7800张类别:主要包含烟火类目标,可能还包括其他相关类别,如烟火发射装置、背景等。格式:图像文件通常为JPEG或PNG格式;标注文件可能为X