国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

【Tensorflow深度學(xué)習(xí)】實(shí)現(xiàn)手寫字體識(shí)別、預(yù)測實(shí)戰(zhàn)(附源碼和數(shù)據(jù)集 超詳細(xì))

這篇具有很好參考價(jià)值的文章主要介紹了【Tensorflow深度學(xué)習(xí)】實(shí)現(xiàn)手寫字體識(shí)別、預(yù)測實(shí)戰(zhàn)(附源碼和數(shù)據(jù)集 超詳細(xì))。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

需要源碼和數(shù)據(jù)集請(qǐng)點(diǎn)贊關(guān)注收藏后評(píng)論區(qū)留言私信~~~

一、數(shù)據(jù)集簡介

下面用到的數(shù)據(jù)集基于IAM數(shù)據(jù)集的英文手寫字體自動(dòng)識(shí)別應(yīng)用,IAM數(shù)據(jù)庫主要包含手寫的英文文本,可用于訓(xùn)練和測試手寫文本識(shí)別以及執(zhí)行作者的識(shí)別和驗(yàn)證,該數(shù)據(jù)庫在ICDAR1999首次發(fā)布,并據(jù)此開發(fā)了基于隱馬爾可夫模型的手寫句子識(shí)別系統(tǒng),并于ICPR2000發(fā)布,IAM包含不受約束的手寫文本,以300dpi的分辨率掃描并保存為具有256級(jí)灰度的PNG圖像,IAM手寫數(shù)據(jù)庫目前最新的版本為3.0,其主要結(jié)構(gòu)如下

約700位作家貢獻(xiàn)筆跡樣本

超過1500頁掃描文本

約6000個(gè)獨(dú)立標(biāo)記的句子

超過一萬行獨(dú)立標(biāo)記的文本

超過十萬個(gè)獨(dú)立標(biāo)記的空間

展示如下 有許多張手寫照片?

?【Tensorflow深度學(xué)習(xí)】實(shí)現(xiàn)手寫字體識(shí)別、預(yù)測實(shí)戰(zhàn)(附源碼和數(shù)據(jù)集 超詳細(xì))

?【Tensorflow深度學(xué)習(xí)】實(shí)現(xiàn)手寫字體識(shí)別、預(yù)測實(shí)戰(zhàn)(附源碼和數(shù)據(jù)集 超詳細(xì))

二、實(shí)現(xiàn)步驟?

1:數(shù)據(jù)清洗

刪除文件中備注說明以及錯(cuò)誤結(jié)果,統(tǒng)計(jì)正確筆跡圖形的數(shù)量,最后將整理后的數(shù)據(jù)進(jìn)行隨機(jī)無序化處理

2:樣本分類

接下來對(duì)數(shù)據(jù)進(jìn)行分類 按照8:1:1的比例將樣本數(shù)據(jù)集分為三類數(shù)據(jù)集,分別是訓(xùn)練數(shù)據(jù)集 驗(yàn)證數(shù)據(jù)集和測試數(shù)據(jù)集,針對(duì)訓(xùn)練數(shù)據(jù)集進(jìn)行訓(xùn)練可以獲得模型,而測試數(shù)據(jù)集主要用于測試模型的有效性

3:實(shí)現(xiàn)字符和數(shù)字映射

利用Tensorflow庫的Keras包的StringLookup函數(shù)實(shí)現(xiàn)從字符到數(shù)字的映射 主要參數(shù)說明如下

max_tokens:單詞大小的最大值

num_oov_indices:out of vocabulary的大小

mask_token:表示屏蔽輸入的大小

oov_token:僅當(dāng)invert為True時(shí)使用 OOV索引的返回值 默認(rèn)為UNK

4:進(jìn)行卷積變化?

通過Conv2D函數(shù)實(shí)現(xiàn)二維卷積變換 主要參數(shù)說明如下

filters:整數(shù)值 代表輸出空間的維度

kernel_size:一個(gè)整數(shù)或元組列表 指定卷積窗口的高度和寬度

strides:一個(gè)整數(shù)或元組列表 指定卷積沿高度和寬度的步幅

padding:輸出圖像的填充方式

activation:激活函數(shù)

三、效果展示?

讀取部分手寫樣本的真實(shí)文本信息如下

【Tensorflow深度學(xué)習(xí)】實(shí)現(xiàn)手寫字體識(shí)別、預(yù)測實(shí)戰(zhàn)(附源碼和數(shù)據(jù)集 超詳細(xì))

訓(xùn)練結(jié)束后 得到訓(xùn)練模型 導(dǎo)入測試手寫文本數(shù)據(jù) 進(jìn)行手寫筆跡預(yù)測 部分結(jié)果如下

【Tensorflow深度學(xué)習(xí)】實(shí)現(xiàn)手寫字體識(shí)別、預(yù)測實(shí)戰(zhàn)(附源碼和數(shù)據(jù)集 超詳細(xì))

?

四、結(jié)果總結(jié)?

觀察預(yù)測結(jié)果可知,基于均值池化以及訓(xùn)練過程預(yù)警極值,大部分的英文字符能夠得到準(zhǔn)確的預(yù)測判定,訓(xùn)練的精度持續(xù)得到改善,損失值控制在比較合理的區(qū)間內(nèi),沒有發(fā)生預(yù)測準(zhǔn)確度連續(xù)多次無法改進(jìn)的場景,模型穩(wěn)定性較好

五、代碼

部分代碼如下 需要全部代碼請(qǐng)點(diǎn)贊關(guān)注收藏后評(píng)論區(qū)留言私信~~~



from tensorflow.keras.layers.experimental.preprocessing import StringLookup
from tensorflow import keras


import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
import os
plt.rcParams['font.family'] = ['Microsoft YaHei']

np.random.seed(0)
tf.random.set_seed(0)


# ## 切分?jǐn)?shù)據(jù)

# In[ ]:


corpus_read = open("data/words.txt", "r").readlines()
corpus = []
length_corpus=0
for word in corpus_read:
    if lit(" ")[1] == "ok"):
        corpus.append(word)
np.random.shuffle(corpus)
length_corpus=len(corpus)
print(length_corpus)
corpus[400:405]


# 劃分?jǐn)?shù)據(jù),按照 80:10:10 比例分配給訓(xùn)練:有效:測試   數(shù)據(jù)

# In[ ]:


train_flag = int(0.8 * len(corpus))
test_flag = int(0.9 * len(corpus))

train_data = corpus[:train_flag]
validation_data = corpus[train_flag:test_flag]
test_data = corpus[test_flag:]

train_data_len=len(train_data)
validation_data_len=len(validation_data)
test_data_len=len(test_data)

print("訓(xùn)練樣本大小:", train_data_len)
print("驗(yàn)證樣本大小:", validation_data_len)
print("測試樣本大小:",test_data_len )


# In[ ]:


image_direct = "data\images"


def retrieve_image_info(data):
    image_location = []
    sample = []
    for (i, corpus_row) in enumerate(data):
        corpus_strip = corpus_row.strip()
        corpus_strip = corpus_strip.split(" ")
        image_name = corpus_strip[0]
        leve1 = image_name.split("-")[0]
        leve2 = image_name.split("-")[1]
        image_location_detail = os.path.join(
            image_direct, leve1, leve1 + "-" + leve2, image_name + ".png"
        )
        if os.path.getsize(image_location_detail) >0 :
            image_location.append(image_location_detail)
            sample.append(corpus_row.split("\n")[0])
    print("手寫圖像路徑:",image_location[0],"手寫文本信息:",sample[0])

    return image_location, sample


train_image, train_tag = retrieve_image_info(train_data)
validation_image, validation_tag = retrieve_image_info(validation_data)
test_image, test_tag = retrieve_image_info(test_data)


# In[ ]:


# 查找訓(xùn)練數(shù)據(jù)詞匯最大長度
train_tag_extract = []
vocab = set()
max_len = 0

for tag in train_tag:
    tag = tag.split(" ")[-1].strip()
    for i in tag:
        vocab.add(i)

    max_len = max(max_len, len(tag))
    train_tag_extract.append(tag)

print("最大長度: ", max_len)
print("單詞大小: ", len(vocab))
print("單詞內(nèi)容: ", vocab)


train_tag_extract[40:45]


# In[ ]:


print(train_tag[50:54])
print(validation_tag[10:14])
print(test_tag[80:84])

def extract_tag_info(tags):
    extract_tag = []
    for tag in tags:
        tag = tag.split(" ")[-1].strip()
        extract_tag.append(tag)
    return extract_tag


train_tag_tune = extract_tag_info(train_tag)
validation_tag_tune = extract_tag_info(validation_tag)
test_tag_tune = extract_tag_info(test_tag)

print(train_tag_tune[50:54])
print(validation_tag_tune[10:14])
print(test_tag_tune[80:84])


# In[ ]:


AUTOTUNE = tf.data.AUTOTUNE

# 映射單詞到數(shù)字
string_to_no = StringLookup(vocabulary=list(vocab),  invert=False)

# 映射數(shù)字到單詞
no_map_string = StringLookup(
    vocabulary=string_to_no.get_vocabulary(),  invert=True)


# In[ ]:


def distortion_free_resize(image, img_size):
    w, h = img_size
    image = tf.image.resize(image, size=(h, w), preserve_aspect_ratio=True, antialias=False, name=None)

    # 計(jì)算填充區(qū)域大小
    pad_height = h - tf.shape(image)[0]
    pad_width = w - tf.shape(image)[1]

   
    if pad_height % 2 != 0:
        height = pad_height // 2
        pad_height_top = height + 1
        pad_height_bottom = height
    else:
        pad_height_top = pad_height_bottom = pad_height // 2

    if pad_width % 2 != 0:
        width = pad_width // 2
        pad_width_left = width + 1
        pad_width_right = width
    else:
        pad_width_left = pad_width_right = pad_width // 2

    image = tf.pad(
        image,
        paddings=[
            [pad_height_top, pad_height_bottom],
            [pad_width_left, pad_width_right],
            [0, 0],
        ],
    )

    image = tf.transpose(image, perm=[1, 0, 2])
    image = tf.image.flip_left_right(image)
    return image


# In[ ]:


batch_size = 64
padding_token = 99
image_width = 128
image_height = 32


def preprocess_image(image_path, img_size=(image_width, image_height)):
    image = tf.io.read_file(image_path)
    image = tf.image.decode_png(image, 1)
    image = distortion_free_resize(image, img_size)
    image = tf.cast(image, tf.float32) / 255.0
    return image


def vectorize_tag(tag):
    tag = string_to_no(tf.strings.unicode_split(tag, input_encoding="UTF-8"))
    length = tf.shape(tag)[0]
    pad_amount = max_len - length
    tag = tf.pad(tag, paddings=[[0, pad_amount]], constant_values=padding_token)
    return tag


def process_images_tags(image_path, tag):
    image = preprocess_image(image_path)
    tag = vectorize_tag(tag)
    return {"image": image, "tag": tag}


def prepare_dataset(image_paths, tags):
    dataset = tf.data.Dataset.from_tensor_slices((image_paths, tags)).map(
        process_images_tags, num_parallel_calls=AUTOTUNE
    )
    return dataset.batch(batch_size).cache().prefetch(AUTOTUNE)


# In[ ]:


train_final = prepare_dataset(train_image, train_tag_extract )
validation_final = prepare_dataset(validation_image, validation_tag_tune )
test_final = prepare_dataset(test_image, test_tag_tune )
print(train_final.take(1))
print(train_final)


# In[ ]:


plt.rcParams['font.family'] = ['Microsoft YaHei']

for data in train_final.take(1):
    images, tags = data["image"], data["tag"]

    _, ax = plt.subplots(4, 4, figsize=(15, 8))

    for i in range(16):
        img = images[i]
        img = tf.image.flip_left_right(img)
        img = tf.transpose(img, perm=[1, 0, 2])
        img = (img * 255.0).numpy().clip(0, 255).astype(np.uint8)
        img = img[:, :, 0]

        
        tag = tags[i]
        indices = tf.gather(tag, tf.where(tf.math.not_equal(tag, padding_token)))
       
        tag = tf.strings.reduce_join(no_map_string(indices))
        tag = tag.numpy().decode("utf-8")

        ax[i // 4, i % 4].imshow(img)
        ax[i // 4, i % 4].set_title(u"真實(shí)文本:%s"%tag)
        ax[i // 4, i % 4].axis("on")


plt.show()


# In[ ]:


class CTCLoss(keras.layers.Layer):

    def call(self, y_true, y_pred):
        batch_len = tf.cast(tf.shape(y_true)[0], dtype="int64")
        input_length = tf.cast(tf.shape(y_pred)[1], dtype="int64")
        tag_length = tf.cast(tf.shape(y_true)[1], dtype="int64")

        input_length = input_length * tf.ones(shape=(batch_len, 1), dtype="int64")
        tag_length = tag_length * tf.ones(shape=(batch_len, 1), dtype="int64")
               
        loss = keras.backend.ctc_batch_cost(y_true, y_pred, input_length, tag_length)
        self.add_loss(loss)
        
        return loss


def generate_model():
    # Inputs to the model
    input_img = keras.Input(shape=(image_width, image_height, 1), name="image")
    tags = keras.layers.Input(name="tag", shape=(None,))

    # First conv block.
    t = keras.layers.Conv2D(
        filters=32,
        kernel_size=(3, 3),
        activation="relu",
        kernel_initializer="he_normal",
        padding="same",
        name="ConvolutionLayer1")(input_img)
    t = keras.layers.AveragePooling2D((2, 2), name="AveragePooling_one")(t)

    # Second conv block.
    t = keras.layers.Conv2D(
        filters=64,
        kernel_size=(3, 3),
        activation="relu",
        kernel_initializer="he_normal",
        padding="same",
        name="ConvolutionLayer2")(t)
    t = keras.layers.AveragePooling2D((2, 2), name="AveragePooling_two")(t)
    

    #re_shape = (t,[(image_width // 4), -1])
    #tf.dtypes.cast(t, tf.int32)
    re_shape = ((image_width // 4), (image_height // 4) * 64)
    t = keras.layers.Reshape(target_shape=re_shape, name="reshape")(t)
    t = keras.layers.Dense(64, activation="relu", name="denseone",use_bias=False,
    kernel_initializer='glorot_uniform',
    bias_initializer='zeros')(t)
    t = keras.layers.Dropout(0.4)(t)

    # RNNs.
    t = keras.layers.Bidirectional(
        keras.layers.LSTM(128, return_sequences=True, dropout=0.4)
    )(t)

    t = keras.layers.Bidirectional(
        keras.layers.LSTM(64, return_sequences=True, dropout=0.4)
    )(t)
    
    


    t = keras.layers.Dense(
        len(string_to_no.get_vocabulary())+2, activation="softmax", name="densetwo"
    )(t)

    # Add CTC layer for calculating CTC loss at each step.
    output = CTCLoss(name="ctc_loss")(tags, t)

    # Define the model.
    model = keras.models.Model(
        inputs=[input_img, tags], outputs=output, name="handwriting"
    )
    # Optimizer.
    
    # Compile the model and return.
    model.compile(optimizer=keras.optimizers.Adam())
    
    
    
    
    
    return model


# Get the model.
model = generate_model()
model.summary()


# In[ ]:


validation_images = []
validation_tags = []

for batch in validation_final: 
    validation_images.append(batch["image"])
    validation_tags.append(batch["tag"])


# In[ ]:


#epochs = 20 

model = generate_model()
  
prediction_model = keras.models.Model(
    model.get_layer(name="image").input, model.get_layer(name="densetwo").output)
#edit_distance_callback = EarlyStoppingAtLoss()


epochs = 60
early_stopping_patience = 10
# Add early stopping
early_stopping = keras.callbacks.EarlyStopping(
    monitor="val_loss", patience=early_stopping_patience, restore_best_weights=True
)

# Train the model.
history = model.fit(
    train_final,
    validation_data=validation_final,
    epochs=60,callbacks=[early_stopping]
)


# ## Inference

# In[ ]:


plt.rcParams['font.family'] = ['Microsoft YaHei']
# A utility function to decode the output of the network.
def handwriting_prediction(pred):
    input_len = np.ones(pred.shape[0]) * pred.shape[1]
  = []
    for j in results:
        j = tf.gather(j, tf.where(tf.math.not_equal(j, -1)))
        j = tf.strings.reduce_join(no_map_string(j)).numpy().decode("utf-8")
        output_text.append(j)
    return output_text


#  Let's check results on some test samples.
for test in test_final.take(1):
    test_images = test["image"]
    _, ax = plt.subplots(4, 4, figsize=(15, 8))

    predit = prediction_model.predict(test_images)
    predit_text = handwriting_prediction(predit)

    for k in range(16):
        img = test_images[k]
        img = tf.image.flip_left_right(img)
        img = tf.transpose(img, perm=[1, 0, 2])
        img = (img * 255.0).numpy().clip(0, 255).astype(np.uint8)
        img = img[:, :, 0]

        title = f"預(yù)測結(jié)果: {predit_text[k]}"
     

# In[ ]:




創(chuàng)作不易 覺得有幫助請(qǐng)點(diǎn)贊關(guān)注收藏~~~文章來源地址http://www.zghlxwxcb.cn/news/detail-403300.html

到了這里,關(guān)于【Tensorflow深度學(xué)習(xí)】實(shí)現(xiàn)手寫字體識(shí)別、預(yù)測實(shí)戰(zhàn)(附源碼和數(shù)據(jù)集 超詳細(xì))的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • (九)人工智能應(yīng)用--深度學(xué)習(xí)原理與實(shí)戰(zhàn)--前饋神經(jīng)網(wǎng)絡(luò)實(shí)現(xiàn)MNST手寫數(shù)字識(shí)別

    (九)人工智能應(yīng)用--深度學(xué)習(xí)原理與實(shí)戰(zhàn)--前饋神經(jīng)網(wǎng)絡(luò)實(shí)現(xiàn)MNST手寫數(shù)字識(shí)別

    目標(biāo): 識(shí)別手寫體的數(shù)字,如圖所示: 學(xué)習(xí)內(nèi)容: 1、掌握MNIST數(shù)據(jù)集的加載和查看方法 2、熟練掌握Keras建立前饋神經(jīng)網(wǎng)絡(luò)的步驟【重點(diǎn)】 3、掌握模型的編譯及擬合方法的使用,理解參數(shù)含義【重點(diǎn)】 4、掌握模型的評(píng)估方法 5、掌握模型的預(yù)測方法 6、掌握自定義圖片的處理與

    2024年02月13日
    瀏覽(39)
  • CNN卷積神經(jīng)網(wǎng)絡(luò)實(shí)現(xiàn)手寫數(shù)字識(shí)別(基于tensorflow)

    CNN卷積神經(jīng)網(wǎng)絡(luò)實(shí)現(xiàn)手寫數(shù)字識(shí)別(基于tensorflow)

    卷積網(wǎng)絡(luò)的 核心思想 是將: 局部感受野 權(quán)值共享(或者權(quán)值復(fù)制) 時(shí)間或空間亞采樣 卷積神經(jīng)網(wǎng)絡(luò) (Convolutional Neural Networks,簡稱: CNN )是深度學(xué)習(xí)當(dāng)中一個(gè)非常重要的神經(jīng)網(wǎng)絡(luò)結(jié)構(gòu)。它主要用于用在 圖像圖片處理 , 視頻處理 , 音頻處理 以及 自然語言處理 等等。

    2024年02月11日
    瀏覽(23)
  • 跟姥爺深度學(xué)習(xí)1 淺用tensorflow做個(gè)天氣預(yù)測

    跟姥爺深度學(xué)習(xí)1 淺用tensorflow做個(gè)天氣預(yù)測

    (說明下,本篇的源碼有點(diǎn)問題導(dǎo)致預(yù)測的溫度有問題,請(qǐng)繼續(xù)往后面的章節(jié)看,有原因和解決辦法) 一、 前言 最近人工智能、深度學(xué)習(xí)又火了,我感覺還是有必要研究一下。三年前淺學(xué)了一下原理沒深入研究框架,三年后感覺各種框架都成熟了,現(xiàn)成的教程也豐富了,所

    2023年04月16日
    瀏覽(23)
  • 深度學(xué)習(xí)(六):paddleOCR理解及識(shí)別手寫體,手寫公式,表格

    深度學(xué)習(xí)(六):paddleOCR理解及識(shí)別手寫體,手寫公式,表格

    光學(xué)字符識(shí)別(Optical Character Recognition, OCR),ORC是指對(duì)包含文本資料的圖像文件進(jìn)行分析識(shí)別處理,獲取文字及版面信息的技術(shù),檢測圖像中的文本資料,并且識(shí)別出文本的內(nèi)容。 那么有哪些應(yīng)用場景呢? 其實(shí)我們?nèi)粘I钪刑幪幎加衞cr的影子,比如在疫情期間身份證識(shí)別

    2024年02月05日
    瀏覽(39)
  • 【深度學(xué)習(xí)】2-4 神經(jīng)網(wǎng)絡(luò)-手寫數(shù)字識(shí)別

    在實(shí)現(xiàn)對(duì)手寫數(shù)字圖像的分類,可以先假設(shè)學(xué)習(xí)已經(jīng)全部結(jié)束,我們使用學(xué)習(xí)到的參數(shù),先實(shí)現(xiàn)神經(jīng)網(wǎng)絡(luò)的“推理處理”。該處理也稱為神經(jīng)網(wǎng)絡(luò)的 前向傳播 。 和求解機(jī)器學(xué)習(xí)問題的步驟(分成學(xué)習(xí)和推理兩個(gè)階段進(jìn)行)一樣 使用神經(jīng)網(wǎng)絡(luò)解決問題時(shí),也需要 首先使用訓(xùn)練數(shù)

    2024年02月09日
    瀏覽(23)
  • [深度學(xué)習(xí)實(shí)戰(zhàn)]基于PyTorch的深度學(xué)習(xí)實(shí)戰(zhàn)(下)[Mnist手寫數(shù)字圖像識(shí)別]

    [深度學(xué)習(xí)實(shí)戰(zhàn)]基于PyTorch的深度學(xué)習(xí)實(shí)戰(zhàn)(下)[Mnist手寫數(shù)字圖像識(shí)別]

    PyTorch——開源的Python機(jī)器學(xué)習(xí)庫 ??首先感謝所有點(diǎn)開本文的朋友們!基于PyTorch的深度學(xué)習(xí)實(shí)戰(zhàn)可能要告一段落了。本想著再寫幾篇關(guān)于 PyTorch神經(jīng)網(wǎng)絡(luò)深度學(xué)習(xí) 的文章來著,可無奈項(xiàng)目時(shí)間緊任務(wù)重,要求 短時(shí)間內(nèi)出圖并做好參數(shù)擬合 。所以只得轉(zhuǎn)戰(zhàn) Matlab 編程,框架舊

    2024年02月16日
    瀏覽(29)
  • 深度學(xué)習(xí)篇之tensorflow(2) ---圖像識(shí)別

    深度學(xué)習(xí)篇之tensorflow(2) ---圖像識(shí)別

    研究圖像識(shí)別離不開兩樣?xùn)|西:第一,大量的樣本數(shù)據(jù);第二,好的算法。從某種意義上來說,數(shù)據(jù)比算法更重要,算法只是決定了圖像識(shí)別的準(zhǔn)確率,但如果沒有樣本數(shù)據(jù),圖像識(shí)別就無從談起了。 圖像識(shí)別的關(guān)鍵:特征 和特征之間的相對(duì)位置。 首先是特征,我們記住一

    2024年02月08日
    瀏覽(39)
  • python與深度學(xué)習(xí)(一):ANN和手寫數(shù)字識(shí)別

    python與深度學(xué)習(xí)(一):ANN和手寫數(shù)字識(shí)別

    神經(jīng)網(wǎng)絡(luò)是學(xué)者通過對(duì)生物神經(jīng)元的研究,提出了模擬生物神經(jīng)元機(jī)制的人工神經(jīng)網(wǎng)絡(luò)的數(shù)學(xué)模型,生物神經(jīng)元的模型抽象為如圖所示的數(shù)學(xué)結(jié)構(gòu)。 神經(jīng)元輸入向量?? = [??1, ????2, ??3, … , ????]T,經(jīng)過函數(shù)映射:??: ?? → ??后得到輸出??。 考慮一種簡化的情況,

    2024年02月16日
    瀏覽(17)
  • python與深度學(xué)習(xí)(六):CNN和手寫數(shù)字識(shí)別二

    python與深度學(xué)習(xí)(六):CNN和手寫數(shù)字識(shí)別二

    本篇文章是對(duì)上篇文章訓(xùn)練的模型進(jìn)行測試。首先是將訓(xùn)練好的模型進(jìn)行重新加載,然后采用opencv對(duì)圖片進(jìn)行加載,最后將加載好的圖片輸送給模型并且顯示結(jié)果。 在這里導(dǎo)入需要的第三方庫如cv2,如果沒有,則需要自行下載。 把MNIST數(shù)據(jù)集進(jìn)行加載,并且把訓(xùn)練好的模型也

    2024年02月15日
    瀏覽(25)
  • 從手寫數(shù)字識(shí)別入門深度學(xué)習(xí)丨MNIST數(shù)據(jù)集詳解

    從手寫數(shù)字識(shí)別入門深度學(xué)習(xí)丨MNIST數(shù)據(jù)集詳解

    就像無數(shù)人從敲下“Hello World”開始代碼之旅一樣,許多研究員從“MNIST數(shù)據(jù)集”開啟了人工智能的探索之路。 MNIST數(shù)據(jù)集(Mixed National Institute of Standards and Technology database)是一個(gè)用來訓(xùn)練各種圖像處理系統(tǒng)的二進(jìn)制圖像數(shù)據(jù)集,廣泛應(yīng)用于機(jī)器學(xué)習(xí)中的訓(xùn)練和測試。 作為一

    2024年02月03日
    瀏覽(21)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包