Gen-AI company, Devnagri raises Undisclosed amount in a Pre-Series A by IPV

Devnagri, a Gen-AI company that personalizes business communication for non-English speakers raised an undisclosed amount in a Pre-Series A Round led by Inflection Point Ventures. Funds will be allocated to marketing, sales, technology scaling, R&D, infrastructure and administrative expenses. Devnagri specializes in personalizing business communication to cater to non-English speakers, making it hyper-local and more […]

Cohere Announces Layoffs Following $500 Million Funding Round

Generative AI startup Cohere has surprisingly announced layoffs of its 20 employees just after a day of successfully securing a $500 million in Series D funding. Its current valuation is $5.5 billion and the job cuts are 5% of its 400-person workforce. However, the step highlights complex and contradictory dynamics of startups and tech industry. […]

Cost Comparison: Long-Term Expenses of Microsoft 365 vs. Office 2021

While no one doubts that Microsoft 365 has more to offer than Office 2021, one of the main concerns, when it comes to the comparison of the two, is what is the cost-effectiveness of  these two platforms.  You see, comparing the total value between these two platforms is almost like comparing whether you’ll get more […]

Comparing ANN and CNN on CIFAR-10: A Comprehensive Analysis

Are you curious about how different neural networks stack up against each other? In this blog, we dive into an exciting comparison between Artificial Neural Networks (ANN) and Convolutional Neural Networks (CNN) using the popular CIFAR-10 dataset. We’ll break down the key concepts, architectural differences, and real-world applications of ANNs and CNNs. Join us as we uncover which model reigns supreme for image classification tasks and why. Let’s get started!

Dataset Overview

The CIFAR-10 dataset is a widely-used dataset for machine learning and computer vision tasks. It consists of 60,000 32×32 color images in 10 different classes, with 50,000 training images and 10,000 test images. The classes are airplanes, cars, birds, cats, deer, dogs, frogs, horses, ships, and trucks. This blog explores the performance of Artificial Neural Networks (ANN) and Convolutional Neural Networks (CNN) on the CIFAR-10 dataset.

Sample dataset

What is ANN?

Artificial Neural Networks (ANN) are computational models inspired by the human brain. They consist of interconnected groups of artificial neurons (nodes) that process information using a connectionist approach. ANNs are used for a variety of tasks, including classification, regression, and pattern recognition.

Principles of ANN

  • Layers: ANNs consist of input, hidden, and output layers.
  • Neurons: Each layer has multiple neurons that process inputs and produce outputs.
  • Activation Functions: Functions like ReLU or Sigmoid introduce non-linearity, enabling the network to learn complex patterns.
  • Backpropagation: The learning process involves adjusting weights based on the error gradient.

ANN Architecture

ANN = models.Sequential([
layers.Flatten(input_shape=(32, 32, 3)),
layers.Dense(3000, activation='relu'),
layers.Dense(1000, activation='relu'),
layers.Dense(10, activation='sigmoid')
])
ANN.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'

What is CNN?

Convolutional Neural Networks (CNN) are specialized ANNs designed for processing structured grid data, like images. They are particularly effective for tasks involving spatial hierarchies, such as image classification and object detection.

Principles of CNN

  • Convolutional Layers: These layers apply convolutional filters to the input to extract features.
  • Pooling Layers: Pooling layers reduce the spatial dimensions, retaining important information while reducing computational load.
  • Fully Connected Layers: After convolutional and pooling layers, fully connected layers are used to make final predictions.

CNN Architecture

CNN = models.Sequential([
layers.Conv2D(input_shape=(32, 32, 3), filters=32, kernel_size=(3, 3), activation='relu'),
layers.MaxPooling2D((2, 2)),
layers.Conv2D(filters=64, kernel_size=(3, 3), activation='relu'),
layers.MaxPooling2D((2, 2)),
layers.Flatten(),
layers.Dense(2000, activation='relu'),
layers.Dense(1000, activation='relu'),
layers.Dense(10, activation='softmax')
])
CNN.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'])

Training and Evaluation

Both models were trained for 10 epochs on the CIFAR-10 dataset. The ANN model uses dense layers and is simpler, while the CNN model uses convolutional and pooling layers, making it more complex and suitable for image data.

ANN.fit(X_train, y_train, epochs=10)
ANN.evaluate(X_test, y_test)

CNN.fit(X_train, y_train, epochs=10)
CNN.evaluate(X_test, y_test)
Training ANN Model
Training CNN Model

Results Comparison

The evaluation results for both models show the accuracy and loss on the test data.

ANN Evaluation

  • Accuracy: 0.4960
  • Loss: 1.4678
Test Data Evaluation for ANN Model

CNN Evaluation

  • Accuracy: 0.7032
  • Loss: 0.8321
Test Data Evaluation for CNN Model

The CNN significantly outperforms the ANN in terms of accuracy and loss.

Confusion Matrices and Classification Reports

To further analyze the models’ performance, confusion matrices and classification reports were generated.

ANN Confusion Matrix and Report

y_pred_ann = ANN.predict(X_test)
y_pred_labels_ann = [np.argmax(i) for i in y_pred_ann]
plot_confusion_matrix(y_test, y_pred_labels_ann, "Confusion Matrix for ANN")
print("Classification Report for ANN:")
print(classification_report(y_test, y_pred_labels_ann))

CNN Confusion Matrix and Report

y_pred_cnn = CNN.predict(X_test)
y_pred_labels_cnn = [np.argmax(i) for i in y_pred_cnn]
plot_confusion_matrix(y_test, y_pred_labels_cnn, "Confusion Matrix for CNN")
print("Classification Report for CNN:")
print(classification_report(y_test, y_pred_labels_cnn))

Conclusion

The CNN model outperforms the ANN model on the CIFAR-10 dataset due to its ability to capture spatial hierarchies and local patterns in the image data. While ANNs are powerful for general tasks, CNNs are specifically designed for image-related tasks, making them more effective for this application.

In summary, for image classification tasks like those in the CIFAR-10 dataset, CNNs offer a significant performance advantage over ANNs due to their specialized architecture tailored for processing visual data.

This brings us to the end of this article. I hope you have understood everything clearly. Make sure you practice as much as possible.

If you wish to check out more resources related to Data Science, Machine Learning and Deep Learning you can refer to my Github account.

You can connect with me on LinkedIn — RAVJOT SINGH.

P.S. Claps and follows are highly appreciated.


Comparing ANN and CNN on CIFAR-10: A Comprehensive Analysis was originally published in Becoming Human: Artificial Intelligence Magazine on Medium, where people are continuing the conversation by highlighting and responding to this story.

India’s Startup Scene Gets a Boost with Angel Tax Abolition, IT Minister Declares

India’s startup ecosystem is expanding at a rapid pace. It needs to be accelerated further to rank well in the global landscape. This is the reason the government announced abolition of the angel tax in its Union Budget 2024-25. Union Finance Minister Nirmala Sitharaman placed the budget on Tuesday in the Lok Sabha. Angel tax […]

The Impact of AI on Inventory Control and Order Fulfillment

As industries adopt artificial intelligence (AI) across their operational strategies, inventory control and order fulfillment are undergoing substantial changes. A survey reveals that more than 75% of industry professionals expect AI to significantly alter the competitive dynamics of their fields within three years.  Given AI’s capability to simplify complex operations and enhance decision-making, we will […]

How Technology is Revolutionising Hearing Solutions

Digital transformation has become a priority across many sectors and industries, including healthcare. As such, a previous post highlighted how artificial intelligence is redefining health service delivery and patient outcomes.  Notable examples of AI in healthcare include the use of AI algorithms and machine learning techniques for real-time monitoring and clinical decision support. In the […]

How To Create Immersive 3D Worlds Using Procedural Generation

Procedural generation for constructing open-ended and dynamic 3D worlds is an exciting task that puts a lot of power into the hands of content creators and allows them to generate very realistic environments and terrains with little effort. Procedural generation entails using algorithms to create content algorithmically, providing a unique experience every time, unlike other […]

Blockchain Security Firm Veridise Highlights Higher Risk in ZK Audits

Blockchain security has always been a focus for developers. Blockchain security firm Veridise lately revealed that audits of zero-knowledge (ZK) projects may uncover critical issues. It highlights a crucial aspect of the evolving landscape of the technology and its associated risks. Veridise analysed 1,605 vulnerability findings from its last 100 audits. It found that the […]

Medical Image Denoising with CNN

In this article, I will discuss different approaches to CT image denoising with CNN and some traditional approaches as well.

Photo by Daniel Öberg on Unsplash

Denoising CT images with Convolutional Neural Networks (CNNs) represents a significant advancement in medical imaging technology. CT (Computed Tomography) scans are invaluable for diagnosing and monitoring various medical conditions, but they often suffer from noise due to low-dose radiation used to minimize patient exposure. This noise can obscure important details and affect diagnostic accuracy. CNNs, a class of deep-learning neural networks, have proven exceptionally effective in addressing this issue. These networks are trained on large datasets of noisy and clean images, learning to identify and eliminate noise while preserving critical anatomical details. To get more ideas on how to do the denoising in CT images for image quality improvement you can read this paper, which contains lots of information and hands-on example implementation with dataset.

The process involves passing the noisy CT images through multiple layers of the CNN, each designed to extract features and reduce noise incrementally. As a result, the output images are clearer, allowing for more precise diagnoses. Moreover, CNN-based denoising operates faster than traditional methods, enabling real-time processing in clinical settings. This technology not only enhances the quality of medical imaging but also has the potential to significantly improve patient outcomes by aiding in early and accurate disease detection.

In the suggested paper you can find all types of necessary datasets and lots of reference works for medical image denoising tasks.


Medical Image Denoising with CNN was originally published in Becoming Human: Artificial Intelligence Magazine on Medium, where people are continuing the conversation by highlighting and responding to this story.