File size: 1,940 Bytes
c19ff11
 
 
 
 
 
 
 
 
 
 
09c74ec
f6f3f93
09c74ec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93c2dc6
09c74ec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
---
title: Pneumonia Detection System
emoji: 🩺
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: "3.1.4"
app_file: app.py
pinned: false
---

# Pneumonia Detection System

A Flask-based web application that uses a fine-tuned VGG19 model to detect pneumonia from chest X-ray images.

## Model Links
- [CNN Model](https://drive.google.com/file/d/1-4L-8HJ79W5k-0l8FchG4HH1SI2dLi2W/view?usp=sharing)

## Setup Instructions

### Prerequisites
- Python 3.8 or higher

### Installation

1. Clone the repository:

```bash
git clone https://github.com/yourusername/Pneumono_Detect.git
cd Pneumono_Detect
```

2. Set up the environment:

#### Windows:

```bash
./setup.bat
```

#### Linux/Mac:

```bash
chmod +x setup.sh
./setup.sh
```

### Activating the Environment

#### Windows:

```bash
tf_test_env\Scripts\activate
```

#### Linux/Mac:

```bash
source tf_test_env/bin/activate
```

## Running the Application

1. Ensure your virtual environment is activated
2. Run the Flask application:

```bash
python app.py
```
3. Open a web browser and navigate to `http://localhost:5000`

## Usage

1. Upload a chest X-ray image through the web interface
2. Click "Predict" to get the classification result
3. View the prediction result and confidence score

## Project Structure
```
Pneumono_Detect/
β”œβ”€β”€ app.py                  # Flask application
β”œβ”€β”€ requirements.txt        # Python dependencies
β”œβ”€β”€ setup.bat              # Windows setup script
β”œβ”€β”€ setup.sh               # Linux/Mac setup script
β”œβ”€β”€ static/
β”‚   └── uploads/           # Folder for uploaded images
└── templates/
    β”œβ”€β”€ index.html         # Upload page
    └── result.html        # Results page
```

## Model Information
- Architecture: VGG19 (fine-tuned)
- Input Size: 128x128x3
- Classes: NORMAL, PNEUMONIA
- Confidence Threshold: 0.7

## Dependencies
- Flask 3.1.0
- TensorFlow 2.12.0
- Pillow 10.2.0
- NumPy 1.23.5