Abhinav Srivastava
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
Image Recognition on a multi-server architecture === Finn Jensen (fjensen@bu.edu) Abhinav Srivastava (sabhinav@bu.edu) GitHub Link : [https://github.com/AbhinavMir/miniproject](https://github.com/AbhinavMir/miniproject) GENI Link: [urn:publicid:IDN+ch.geni.net:CS655-Fall2022+slice+Miniproject](urn:publicid:IDN+ch.geni.net:CS655-Fall2022+slice+Miniproject) Slice: MiniProject ## Introduction / Problem Statement Google ImageNet is a large-scale image dataset created by Google that contains millions of labeled images. It is used by researchers and developers to train their machine learning models for computer vision tasks such as image classification, object detection, and segmentation. ImageNet contains 14 million labeled images in over 22 thousand categories. The dataset is organized into a hierarchy of concepts, such as animals, plants, objects, scenes, and so on. Each image is labeled with a unique identifier and associated with a set of labels that describe the image. The dataset is divided into a training set for training machine learning models and a validation set for evaluating the accuracy of the model. Google ImageNet is an invaluable resource for machine learning researchers, as it provides a large set of labeled images that can be used to train models quickly and accurately. It is also useful to developers who need to create applications that can recognize objects in images. ## Experimental Methodology We used three servers, and a router and a client. The client is connected to the router which is then in turn connected to the clients. The topology of the network is as follows. <a href="https://ibb.co/9bqpB9v"><img src="https://i.ibb.co/n7Dw4s0/Screenshot-2022-12-08-at-10-46-41-PM.png" alt="Screenshot-2022-12-08-at-10-46-41-PM" border="0"></a> We used previous knowledge to configure our systems, and initially considered NGROK, but ended up using native solutions. A load balancer is used to increase capacity, reliability, and performance of applications by distributing incoming traffic across multiple servers, or resources. This process is known as load balancing. By distributing the workload among multiple resources, a load balancer can improve the overall efficiency of an application and reduce the risk of downtime due to resource overload. Additionally, a load balancer can provide a single point of access to multiple servers, making applications more secure and easier to manage. From the client, all traffic is routed to the loadbalancer on router server. The loadbalancer pings all three servers to check for status code. A `503` means the server is busy and we must send to another server. We use a mempool-like folder on the router to store the images. A background service picks the images and sends it to a free server. Once processed, the image is then deleted. All data regarding the server is stored in a CSV. Initially we used a database (SQLite), but ran into some errors w.r.t concurrency. The user can navigate to `http://128.95.190.66:5000/results` to view the results for any image uploaded from their IP address. ## Model Selection and Optimzation The model selected for this project is the Vision Transformer to be exact the base-path16-224 version that can be found on Hugging Face. Vision Transformer (ViT) model pre-trained on ImageNet-21k (14 million images, 21,843 classes) at resolution 224x224, and fine-tuned on ImageNet 2012 (1 million images, 1,000 classes) at resolution 224x224. This model was not the first choice but was rather choosen due to the constraints put forth by the GENI server hardward. Any models that were large, and had a more diverse set of possible predictions, resulted in Out of Memory errors leading to the server to kill the process, so ViT was choosen because of its much smaller size even if it is less accurate than other models. The size of an image can affect the computation time of imageNet in a few different ways. First, a larger image will have more pixels, which means that there will be more data to process. This can increase the amount of time it takes to run imageNet on the image. Additionally, if the image is very large, it may need to be resized in order to fit within the constraints of the imageNet model. This resizing process can also add to the computation time. However, it's important to note that the impact of image size on computation time can vary depending on the specific hardware and software being used. ## Results ### Usage Instructions If you're storing your private key in ~/.ssh, it makes sense to `chmod 400 ~/.ssh/id_geni_ssh_rsa` to prevent others from reading it. This also prevents ssh from complaining about the key being world-readable. Public Addresses are provided below. Client can be accessed at [http://128.95.190.66:5000](http://128.95.190.66:5000) ``` server-0 (128.95.190.67:5000) server-1 (128.95.190.68:5000) server-2 (128.95.190.69:5000) router (128.95.190.66:5000) client (128.95.190.64:5000) ``` We only used public IP on servers for ease of testing, but internally, we used non-public IPs for safety reasons. Ideally, we'd have no public ports, but for use of postman and other services, we kept it open. To launch Imagenet Server Connect to server-N on which Anaconda and the needed python packages along with app.py are located launch Anaconda ``` source ~/anaconda3/bin/activate ``` Then launch Flask Server ``` python -m flask run --host=0.0.0.0 ``` Screenshot of Web based User Interface ![](https://i.imgur.com/25u3g9p.jpg) Image fed to ImageNet ![](https://i.imgur.com/QVr9VzR.jpg) Screenshot of loadbearer handling the posted image from user ![](https://i.imgur.com/kLHeBuN.jpg) Results of Image processing and extra data from loadbear ![](https://i.imgur.com/BXlErQY.jpg) ### Analysis Based on the information gathered, it appears that the dataset contains the size of an image in bytes and the time it took for the image to be recognized by a server and the result to be sent back to the client. This information could be useful for understanding the performance of the system and identifying any potential bottlenecks or issues. One possible analysis of this dataset could be to look at the relationship between the size of the image and the time it took to be recognized and sent back. A scatter plot could be used to visualize this relationship, with the image size on the x-axis and the recognition time on the y-axis. This could show if there is a correlation between the two variables, and if larger images tend to take longer to be recognized and sent back. <a href="https://ibb.co/FzsHG3y"><img src="https://i.ibb.co/nj3PhmY/Screenshot-2022-12-08-at-10-40-23-PM.png" alt="Screenshot-2022-12-08-at-10-40-23-PM" border="0"></a> ## Conclusion In this project, we implemented a system for routing traffic from a client to one of three servers, where the servers use ImageNet to recognize images and send the results back to the client. The system was tested using a variety of images with different sizes, and the results showed that the system was able to accurately recognize images and send the results back to the client in a timely manner. The result was as expected - larger images required more time. We ranked on basis on dimensions and size both, but since dimension didn't give us useful result, we focused on byte size of the file. Overall, the system performed well and met the project's goals of providing efficient image recognition capabilities. The use of multiple servers and a router allowed for efficient routing of traffic and distributed processing, which helped to improve the overall performance of the system. In the future, there are several potential areas for improvement and further development. For example, the system could be expanded to support more servers and handle a larger volume of traffic. Additionally, the recognition algorithms used by the servers could be refined and optimized to improve the accuracy and speed of image recognition. A lot of inspiration for the project came from recent OpenAI's attempt to scale being met with incredible traffic while developing GPT systems. Overall, this project has demonstrated the feasibility and effectiveness of using ImageNet, multiple servers, and a router to provide efficient image recognition capabilities. ## Division of Labor Finn handled the creation of the imagenet as well as the server that the imagenet is hosted on that can be reached both interally from GENI or externally. The Server uses Flask as the imagenet is written in python and keeping both in the same langauge reduced the workload. Abhinav handled the router side of things and loadbalancers. He also contributed to the overall backend and helped create the client.

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully