CNN Image Recognition Experiment

The cover image was generated by ChatGPT.
The year 2023 marked the rapid rise of generative artificial intelligence. From large language models to a wide range of AI-powered applications, artificial intelligence gradually became part of everyday life, making deep learning one of the most prominent and widely discussed technologies of the year.
For me, 2023 also marked the beginning of my journey into the world of deep learning, as I built and experimented with my first deep learning models.
Deep Learning and Neural Networks
Before starting the implementation, I spent some time learning the fundamental concepts of deep learning.
Deep Learning is a branch of Machine Learning, with its foundation built upon Artificial Neural Networks (ANNs). Through the computation of large amounts of data and multiple layers of neurons, models can gradually learn features within the data and perform tasks such as classification, recognition, and prediction.
At that time, I was still unfamiliar with these concepts. Therefore, I began by learning the basic architecture of neural networks, understanding how information is transmitted between the input layer, hidden layers, and output layer through weights and activation functions.
Looking back today, these concepts may seem like fundamental introductory knowledge in deep learning. However, at that time, they represented an important first step in my journey into the field of artificial intelligence.
Convolutional Neural Networks
After understanding the fundamentals of neural networks, I began exploring Convolutional Neural Networks (CNNs). CNNs are among the most representative models currently used in image recognition. They mainly extract features from images through two key operations: convolution and pooling, and then pass the extracted features to subsequent neural network layers for classification.
At that time, my understanding of convolution was roughly that an image is scanned step by step using a fixed-size window, and a set of convolutional kernels is applied to perform calculations in order to obtain feature information from different locations. Pooling, on the other hand, preserves the most representative information within each window, such as the maximum value, to reduce the data dimensionality while lowering the computational cost of subsequent models. Although I did not deeply study the mathematical derivations at that stage, through reading tutorials and watching animated visualizations, I was able to understand the general workflow of CNNs.
For a more in-depth explanation of the principles behind convolutional neural networks, you can refer to How do Convolutional Neural Networks work?.
Implementation and Experimentation
After understanding the basic concepts, I began attempting to write my first deep learning program. Looking back at the basic C++ syntax I learned in high school and the Python programming experience I gained during university, programming itself was not unfamiliar to me. However, when I actually started using deep learning frameworks, I still needed to adapt to many new concepts, such as data preprocessing, model construction, training procedures, and parameter tuning.
The implementation and learning process mainly followed the playlist Deep Learning - Neural Networks published by 容噗玩Data. Through this series, I gradually learned deep learning concepts starting from the fundamentals of neural networks.
In addition to introducing the basic concepts of neural networks, the course also covered topics including data processing, DNN, CNN, RNN, and LSTM. For someone who was just beginning to explore deep learning, it was a comprehensive and easy-to-understand learning resource.
As the course progressed, I followed the video tutorials to complete several examples and attempted to incorporate my own modifications and adjustments. Looking back at these projects now, the program structure was still quite simple. However, for me at that time, it represented the first time I had successfully completed a deep learning project capable of training a model.
The following are the source codes I kept from that period, which were implemented based on the tutorials and modified to some extent.
- For model training:
| |
- For prediction:
| |
Implementation Results
To test whether the model could recognize different types of images, I used typhoon data from Historical Typhoon Data Download for Taiwan as the testing dataset.
After training the CNN model, it outputs the Training Loss and the Confusion Matrix, which is used to evaluate the classification performance.
Through the training process described above, we can obtain the prediction results for new images as follows:
Conclusion
Looking back at this project, there are still many aspects that could be improved. For example, the model architecture, data preprocessing methods, hyperparameter settings, and the scale and quality of the dataset could all have a significant impact on the final recognition performance.
If I have the opportunity to improve this project in the future, I would start by refining the model structure, attempting to improve or replace the current architecture. I would also reorganize the program structure to make the overall workflow easier to maintain and extend. In addition, I would enhance the evaluation of prediction results by adding confusion matrices and incorporating more model evaluation metrics.
Although this was only a simple experiment, it became my starting point for exploring deep learning and laid the foundation for my future learning of other models.
References
- 人工智慧熱潮. (December 6, 2025). Wikipedia, The Free Encyclopedia. Retrieved from https://zh.wikipedia.org/zh-tw/人工智能热潮
- 深度學習. (April 28, 2026). Wikipedia, The Free Encyclopedia. Retrieved from https://zh.wikipedia.org/zh-tw/深度学习
- 卷積神經網路. (May 28, 2026). Wikipedia, The Free Encyclopedia. Retrieved from https://zh.wikipedia.org/zh-tw/卷积神经网络
- 容噗玩Data. (January 25, 2025). 深度學習-神經網路. YouTube. Retrieved from https://www.youtube.com/playlist?list=PL68v9oqhwEhg8ynlgz-3S6_pPKYhIRIg3
- Brandon. (August 18, 2016). 卷積神經網路的運作原理. 資料科學・機器・人. Retrieved from https://brohrer.mcknote.com/zh-Hant/how_machine_learning_works/how_convolutional_neural_networks_work.html
- Brandon Rohrer. (August 18, 2016). How do Convolutional Neural Networks work? Brandon Rohrer’s blog. Retrieved from https://brandonrohrer.com/how_convolutional_neural_networks_work.html




![[Thought] Historical Earthquake Locations Around Taiwan](https://Josh-test-lab.github.io/posts/Historical%20Earthquake%20Locations%20Around%20Taiwan/cover%20image.webp)


![[Forbidden City Project] Building the Forbidden City in Minecraft](https://raw.githubusercontent.com/Josh-test-lab/website-assets-repository/refs/heads/main/posts/Forbidden%20City%20Project/cover%20image.png)



