Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Gans

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 17

ADVANCED GENERATIVE ADVERSIAL

NETWORKS USING STREAM LIT

A Micro Project Report

Submitted by

GADIKOTA VENKATA RAJESWAR REDDY


Reg.no: 99220040504

B.Tech – COMPUTER SCIENCE AND ENGINEERING,


DATA ANALYTICS

Kalasalingam Academy of Research and Education


(Deemed to be University)
Anand Nagar, Krishnankoil - 626126
March 2024
SCHOOL OF COMPUTING

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

BONAFIDE CERTIFICATE

Bonafide record of the work done by GADIKOTA VENKATA RAJESWAR REDDY –


99220040504 in partial fulfil-ment of requirements for award of the degree of Bachelor of
Technology in Specialization of the Computer Science and Engineering, during the Academic
Year IV Semester (2023-24).

Dr.M.K.Nagarajan Mr. N.R.Sathis Kumar


Project Guide Faculty Incharge
Assistant professor Assistant Professor

School Of Computing School Of Computing


Kalasalingam Academy of Kalasalingam Academy of
Research and Education Research and Education
Krishnan kovil - 626126 Krishnan kovil - 626126

Dr. R. Sumathi
Evaluator
Assistant Professor
School Of Computing
Kalasalingam Academy of Research
And Education
Krishnankoil - 626126

i
Abstract

Generative Adversarial Networks (GANs) have revolutionized the field of artificial


intelligence by enabling the creation of highly realistic images, videos, and other data.

Hyperparameter Tuning: A user-friendly interface for adjusting GAN hyperparameters, such


as the learning rate, batch size, and network architecture.

Real-Time Visualization: Real-time visualization of the generated images during training,


enabling users to monitor the progress and identify potential issues.

Model Evaluation Metrics: Built-in metrics for evaluating the quality of the generated
images, such as Inception Score (IS) and Fréchet Inception Distance (FID).

Pre-Trained Models: A library of pre-trained AGAN models for various image generation
tasks, allowing users to quickly get started with GAN training.

ii
Contents

1 INTRODUCTION

1.1 Brief overview of GANs using stream lit 1


1.2 Importance and Application 1
1.2.1 Goals of the project 2
2 System Study

2.1 Literature Survey 3


2.2 Proposed work 4
3 Implementation

3.1 Stream lit and multi-domain combination 4


3.2 Multi domain chatbot 4
3.3 Combining GANs and Stream lit chatbot 4
4 Experimental Analysis

4.1 Methodology 5
4.1.1
GAN Architecture 5
4.1.2
Stream lit Application 5
4.1.3
Experimental Setup 5
4.1.4
Evaluation Metrics 5
5 System Specification
5.1 Hardware Requirements 6
5.2 Software Requirements 6
5.3 Network Architecture 6
5.3.1 Training Data and Parameters 6
5.3.2 Deployment 6
5.4 Additional Considerations 6
6 Output and Result 7-9
7 Conclusion 10
8 References 11
9 Certifications 12

iii
List of Figures

6.1 Input of content summarizer 8

6.2 Output of content summarizer 8

6.3 Input of multi-model Chat bot 9

6.4 Output of multi-model Chat bot 9

9.1 Certificate 12

iv
Chapter 1
Introduction
1.1 Brief overview of GANs using stream lit:

A family of deep learning models called Generative Adversarial Networks (GANs) is able to
produce new data based on a given distribution.While the discriminator network attempts to
discern between data generated by the generator and data created by the generator, the
generator network generates new data. Text, video, and image generation are just a few of the
many types of data that GANs have produced. But they can be challenging to train, and the
outcomes are frequently unpredictable. A Python package called Streamlit simplifies the
development and implementation of interactive web apps. Web applications that let users
explore and engage with GANs can be made with it.

1.2 Importance and Application

Advanced GANs are a powerful class of generative models that have revolutionized the field
of computer vision and image processing. They have numerous applications across various
domains, including:

Image generation: GANs can generate realistic and diverse images from scratch, opening up
possibilities for creating new content, enhancing existing images, and exploring novel artistic
styles.

Image editing: GANs can be used to carry out image editing operations including super-
resolution, colorization, and style transfer, enabling sophisticated image restoration and
manipulation.
Data augmentation: To enhance training datasets and boost the effectiveness of machine
learning models, GANs can provide synthetic data that is comparable to real data.

Domain adaptation: GANs can be used to modify models that were trained in one domain so
that they function effectively in another, facilitating the transfer of knowledge across domains
and improving the generalization of models.

1
1.2.1 Goals of Project:

1. Creating an image editor based on a GAN that enables real-time image manipulation.
2. Developing a GAN-based video generator that can produce original, lifelike videos.
3. Developing a natural language generator based on GANs that can produce text that
resembles that of a human.
4. Investigating novel uses for GANs, like creating artificial intelligence and resolving
inverse issues.

2
Chapter 2
System Study
2.1 Literature Survey

GAN research has been booming in the last several years, and this has resulted in major
advances in the field. Here are a few significant advances in the literature:

1. Improved Architectures: Researchers have proposed new architectures for GANs


that enhance their performance and stability. These include Deep Convolutional
GANs (DCGANs), Wasserstein GANs (WGANs), and Spectral Normalization GANs
(SNGANs).

2. Progressive Growing of GANs (ProGANs): ProGANs introduce a novel training


strategy that involves progressively increasing the resolution of the generated images,
resulting in improved image quality.

3. StyleGAN and StyleGAN2: StyleGAN and StyleGAN2 are advanced GAN


architectures that excel at generating high-resolution and diverse images. They
provide extract control over the content and design of the output images.

4. Conditional GANs: Conditional GANs (cGANs) extend GANs to generate data


conditioned on additional information, such as labels or attributes. This enables the
generation of images with specific characteristics or variations.

2.2 Proposed Work

This is a suggested procedure for building a sophisticated generative adversarial network with
Streamlit:

 Install the necessary libraries. You can install Streamlit and the other necessary
libraries using the pip package manager.
 Create a new Streamlit app. You can create a new Streamlit app by creating a new
Python file and importing the Streamlit library.
 Load the dataset. You can load the dataset of images into your Streamlit app using the
st.file_uploader widget.
 Create the GAN model. You can create the GAN model using the
keras.models.Sequential class.
 Train the GAN model. You can train the GAN model using the model.fit method.
 Generate new images. You can generate new images using the model.predict method.
 Display the generated images. You can display the generated images using the
st.image widget.

3
Chapter 3
Implementation
3.1 Streamlit and Multidomain Combination

• Create a GAN: Creating a GAN is the initial stage. A multitude of frameworks, including
PyTorch and TensorFlow, can be used for this. A GAN can be trained on any dataset after it
has been built.

• Use Streamlit to deploy the GAN: After a GAN has been trained, it may be used in
Streamlit. By doing this, you'll be able to develop a web application that uses the dataset to
produce new data.

• Integrate the Multi-Domain Chatbot: Adding a multi-domain chatbot to your Streamlit


application is the next step. This will enable users to ask inquiries concerning the generated
data or the GAN itself.

3.2 Multi-Domain Chatbot

A chatbot that can handle a broad range of subjects and inquiries is known as a multi-domain
chatbot. It is able to produce natural language answers to user inquiries and is usually trained
on a sizable dataset of text and code.

3.3 Combining GANs, Streamlit, and a Multi-Domain Chatbot:

A robust and adaptable web application that can produce fresh data, respond to user inquiries,
and perform a variety of activities can be made using GANs, Streamlit, and a multi-domain
chatbot.

4
Chapter 4
Experimental Analysis
Generative Adversarial Networks (GANs) have become extremely effective tools for a
variety of image-to-image translation problems, as well as for producing realistic synthetic
data. The purpose of this experimental investigation is to investigate the potential of
sophisticated GAN architectures through the use of a multi-domain chatbot and Streamlit, a
Python-based framework for creating interactive web applications.

4.1 Methodology

4.1.1 GAN Architectures:

StyleGAN2: A state-of-the-art GAN architecture known for its ability to generate high-
fidelity images with controllable styles.
BigGAN: A large-scale GAN designed to generate high-resolution and diverse images.
Pix2PixHD: A GAN specifically tailored for high-definition image-to-image translation
tasks.

4.1.2 Streamlit Application:

Developed a user-friendly web interface using Streamlit to showcase the GANs.Integrated


image upload, generation, and download functionality.Provided interactive controls for
adjusting GAN parameters and visualizing results.

4.1.3 Experimental Setup:

Used a dataset of high-resolution images covering various domains (e.g., faces, landscapes,
objects). Trained the GANs on the dataset using state-of-the-art training techniques.Deployed
the GANs and chatbot on a cloud-based Streamlit application.

4.1.4 Evaluation Metrics:

FID (Fréchet Inception Distance): Measures the similarity between real and generated
images.
Diversity: Assesses the variety and uniqueness of generated images.
User Perception: Collected subjective feedback from users on the realism and quality of
generated images.

5
Chapter 5
System Specification
System Specifications for Advanced Generative Adversarial Networks using Streamlit and
Multi-Domain Chatbot.

5.1 Hardware Requirements:

GPU: NVIDIA GeForce RTX 3090 or higher (recommended)


RAM: 64GB or more (recommended)
CPU: Intel Core i7 or AMD Ryzen 7 (minimum)
Storage: SSD with at least 500GB free space

5.2 Software Requirements:

Operating System: Ubuntu 20.04 or later, Windows 10 or later, macOS Catalina or later
Python: 3.8 or later
PyTorch: 1.10 or later
Streamlit: 1.12 or later
Multi-Domain Chatbot: Rasa 2.0 or later
Other Libraries: numpy, pandas, matplotlib, seaborn

5.3 Network Architecture:

Generator: StyleGAN2 or similar architecture


Discriminator: BigGAN or similar architecture

5.3.1 Training Data and Parameters:

Large dataset of high-resolution images. Captions or labels for the images (for multi-domain
chatbot)
Batch Size: 16-32
Learning Rate: 2e-4 to 1e-3
Number of Epochs: 100-200

5.3.2 Deployment:

Web Server: Apache, Nginx, or Gunicorn


Cloud Platform: AWS EC2, Google Cloud Compute Engine, or Azure Virtual Machines
5.4 Additional Considerations:

For optimal performance, use a dedicated GPU server. Monitor training progress and adjust
hyperparameters as needed. Use a data augmentation pipeline to enhance the training data.

6
Chapter 6

Output and Result

import streamlit as st
import os
import google.generativeai as genai
import csv
import pandas as pd
from PIL import Image

# Load environment variables


try:
from dotenv import load_dotenv
load_dotenv()
except ImportError:
st.warning("dotenv module not found. Please make sure to install it using 'pip install
python-dotenv'.")

# Define the path to the CSV file


csv_file_path = 'question_history.csv'

# Function to store questions in CSV file


def store_question(question):
try:
current_time = datetime.now()
expiration_time = current_time + timedelta(days=7) # Auto delete after a week

# Format the data (question, expiration time)


data = [question, expiration_time.strftime('%Y-%m-%d')]

# Append the data to the CSV file


with open(csv_file_path, mode='a', newline='') as file:
writer = csv.writer(file)
writer.writerow(data)
except Exception as e:
st.error(f"An error occurred while storing the question: {e}")

7
RESULT

Figure 6..1 Input of content summarizer

Figure 6.2 Output of content summarizer

8
Figure 6.3 Input of multimodel chatbot

Figure 6.4 Output of multimodel chatbot

9
Chapter 7

Conclusion

The integration of advanced GANs with Streamlit and multi-domain chatbots has opened up
exciting possibilities for developing sophisticated AI applications. This combination enables
the creation of visually stunning and interactive interfaces that can engage users in immersive
experiences.

Key Benefits of Using GANs with Streamlit and Chatbots:Enhanced Visualizations: GANs
generate realistic images and videos that can significantly enhance the user experience. This
capability can be utilized to create dynamic data visualizations, realistic simulations, and
immersive art installations.

Interactive User Interfaces: An easy-to-use platform for creating interactive web apps is
offered by Streamlit. Developers can design interfaces that let users engage with and modify
generated content by fusing Streamlit with GANs. Users can do this to modify their
experiences, explore data, and come up with new ideas.

Multi-Domain Chatbots: Multi-domain chatbots are capable of managing discussions on a


variety of subjects. These chatbots may produce thoughtful, contextually-relevant responses
by integrating GANs, which improves user engagement and yields useful data.

Improved Data Analytics: Generating synthetic data that mimics real-world data is possible
using GANs. By using this synthetic data, machine learning models can be trained more
effectively and with less need for costly, large-scale real-world datasets.

Future Directions:The integration of GANs with Streamlit and multi-domain chatbots is a


rapidly evolving field with immense potential.
Future research directions include:

 Generative Models for Complex Data: Exploring GANs that can generate more
complex and structured data, such as 3D models, music, and natural language text.
 Real-Time Generation: Developing GANs that can generate content in real-time,
enabling interactive applications with near-instantaneous response times.
 Ethical Considerations: Addressing ethical implications of using GANs to generate
potentially biased or harmful content, and developing guidelines for responsible AI
development.

In conclusion, the combination of advanced GANs with Streamlit and multi-


domain chatbots empowers developers to create innovative AI applications that offer
immersive user experiences, enhanced data analytics capabilities, and the potential to
transform various industries.

10
Chapter 8

Reference

Goodfellow et al. (2014) Generative Adversarial Networks: https://arxiv.org/abs/1406.2661

Radford, Metz, and Chintala (2016) Unsupervised Representation Learning with Deep
Convolutional Generative Adversarial Networks: https://arxiv.org/abs/1511.06434

Liu and Tuzel (2016) describe Coupled Generative Adversarial Networks at


https://arxiv.org/abs/1606.07536

(Karras, Aila, Laine, and Lehtinen, 2018): https://arxiv.org/abs/1710.10196 Progressive


Growing of GANs for Improved Quality, Stability, and Variation

Karras, Laine, and Aila (2019) present a style-based generator architecture for generative
adversarial networks. [arxiv.org/abs/1812.04948]

The Unusual Effectiveness of Averaging in GAN Training (Yazici et al., 2019):


https://arxiv.org/abs/1806.04498v2

(Karras, Aila, Laine, and Lehtinen, 2018): https://arxiv.org/abs/1710.10196 Progressive


Growing of GANs for Improved Quality, Stability, and Variation

StyleGAN - Official TensorFlow Implementation (Karras et al., 2019):


https://github.com/NVlabs/stylegan

StyleGAN Faces Training (Branwen, 2019): https://www.gwern.net/images/gan/2019-03-16-


stylegan-facestraining.mp4

Facebook AI Proposes Group Normalization Alternative to Batch Normalization (Peng,


2018): https://medium.com/syncedreview/facebook-ai-proposes-group-normalization-
alternative-to-batch-normalization-fb0699bffae7

11
Chapter 9

Certification

Figure 9,.1 Certificate

12

You might also like