Spaces:
Sleeping
Sleeping
Delete README.md
Browse files
README.md
DELETED
|
@@ -1,145 +0,0 @@
|
|
| 1 |
-
# PulmoScanAI - AI Lung Cancer Detection System
|
| 2 |
-
|
| 3 |
-
An advanced web-based application for detecting lung cancer from histopathology images using a deep learning model trained on 100,000+ samples.
|
| 4 |
-
|
| 5 |
-
## Features
|
| 6 |
-
|
| 7 |
-
- **Real-time AI Analysis**: Uses TensorFlow/Keras deep learning model for accurate cancer detection
|
| 8 |
-
- **Beautiful UI**: Modern, responsive design with animated backgrounds
|
| 9 |
-
- **Drag & Drop Upload**: Easy image upload with preview
|
| 10 |
-
- **Confidence Score**: Displays detection confidence percentage
|
| 11 |
-
- **CORS Enabled**: Seamless frontend-backend communication
|
| 12 |
-
|
| 13 |
-
## Setup & Installation
|
| 14 |
-
|
| 15 |
-
### Prerequisites
|
| 16 |
-
- Python 3.8 or higher
|
| 17 |
-
- pip (Python package manager)
|
| 18 |
-
|
| 19 |
-
### Step 1: Install Dependencies
|
| 20 |
-
|
| 21 |
-
```bash
|
| 22 |
-
pip install -r requirements.txt
|
| 23 |
-
```
|
| 24 |
-
|
| 25 |
-
### Step 2: Verify Model File
|
| 26 |
-
|
| 27 |
-
Ensure `best_lung_model.h5` is in the same directory as `app.py`.
|
| 28 |
-
|
| 29 |
-
```
|
| 30 |
-
c:\Users\debja\Desktop\ayushman\
|
| 31 |
-
βββ app.py
|
| 32 |
-
βββ PulmoScanAI.html
|
| 33 |
-
βββ best_lung_model.h5
|
| 34 |
-
βββ requirements.txt
|
| 35 |
-
βββ README.md
|
| 36 |
-
```
|
| 37 |
-
|
| 38 |
-
### Step 3: Run the Backend Server
|
| 39 |
-
|
| 40 |
-
```bash
|
| 41 |
-
python app.py
|
| 42 |
-
```
|
| 43 |
-
|
| 44 |
-
You'll see output:
|
| 45 |
-
```
|
| 46 |
-
Starting PulmoScanAI server on http://127.0.0.1:5000
|
| 47 |
-
```
|
| 48 |
-
|
| 49 |
-
### Step 4: Access the Frontend
|
| 50 |
-
|
| 51 |
-
Open your browser and navigate to:
|
| 52 |
-
```
|
| 53 |
-
http://127.0.0.1:5000
|
| 54 |
-
```
|
| 55 |
-
|
| 56 |
-
Or open `PulmoScanAI.html` directly in your browser and the page will communicate with the backend at `http://127.0.0.1:5000/api/predict`.
|
| 57 |
-
|
| 58 |
-
## API Endpoints
|
| 59 |
-
|
| 60 |
-
### Health Check
|
| 61 |
-
```
|
| 62 |
-
GET http://127.0.0.1:5000/api/health
|
| 63 |
-
```
|
| 64 |
-
|
| 65 |
-
Response:
|
| 66 |
-
```json
|
| 67 |
-
{
|
| 68 |
-
"status": "ok",
|
| 69 |
-
"model_loaded": true
|
| 70 |
-
}
|
| 71 |
-
```
|
| 72 |
-
|
| 73 |
-
### Prediction
|
| 74 |
-
```
|
| 75 |
-
POST http://127.0.0.1:5000/api/predict
|
| 76 |
-
```
|
| 77 |
-
|
| 78 |
-
**Request**: Multipart form data with `image` file
|
| 79 |
-
**Response**:
|
| 80 |
-
```json
|
| 81 |
-
{
|
| 82 |
-
"is_cancer": false,
|
| 83 |
-
"confidence": 0.92,
|
| 84 |
-
"diagnosis": "No Cancer Found",
|
| 85 |
-
"confidence_percentage": 92.0
|
| 86 |
-
}
|
| 87 |
-
```
|
| 88 |
-
|
| 89 |
-
## How It Works
|
| 90 |
-
|
| 91 |
-
1. **Frontend**: User uploads a histopathology image via the web interface
|
| 92 |
-
2. **Preprocessing**: Image is resized to 256Γ256 and normalized
|
| 93 |
-
3. **Model Inference**: TensorFlow model processes the image
|
| 94 |
-
4. **Result**: Confidence score and diagnosis displayed with color-coded box:
|
| 95 |
-
- **Green border**: Normal (no cancer detected)
|
| 96 |
-
- **Red border**: Cancer detected
|
| 97 |
-
|
| 98 |
-
## Customization
|
| 99 |
-
|
| 100 |
-
### Adjust Model Input Size
|
| 101 |
-
If your model expects a different input size, edit `app.py`:
|
| 102 |
-
```python
|
| 103 |
-
image = image.resize((224, 224)) # Change 256, 256 to your model's size
|
| 104 |
-
```
|
| 105 |
-
|
| 106 |
-
### Modify Classification Threshold
|
| 107 |
-
To change the cancer/normal threshold:
|
| 108 |
-
```python
|
| 109 |
-
is_cancer = cancer_prob > 0.5 # Change 0.5 to your preferred threshold
|
| 110 |
-
```
|
| 111 |
-
|
| 112 |
-
## Troubleshooting
|
| 113 |
-
|
| 114 |
-
**Error: Model not loaded**
|
| 115 |
-
- Ensure `best_lung_model.h5` exists in the same directory
|
| 116 |
-
- Check TensorFlow installation: `pip install --upgrade tensorflow`
|
| 117 |
-
|
| 118 |
-
**CORS errors**
|
| 119 |
-
- Flask-CORS is enabled. If issues persist, check browser console for details
|
| 120 |
-
|
| 121 |
-
**Image processing fails**
|
| 122 |
-
- Ensure uploaded image is JPG, PNG, or TIFF format
|
| 123 |
-
- File size should be under 20MB
|
| 124 |
-
|
| 125 |
-
## Model Information
|
| 126 |
-
|
| 127 |
-
- **Architecture**: Deep Convolutional Neural Network
|
| 128 |
-
- **Training Data**: 100,000+ histopathology samples
|
| 129 |
-
- **Input**: 256Γ256 RGB images
|
| 130 |
-
- **Output**: Binary classification (Cancer/Normal) with confidence score
|
| 131 |
-
|
| 132 |
-
## Technical Stack
|
| 133 |
-
|
| 134 |
-
- **Frontend**: HTML5, CSS3, JavaScript (Vanilla)
|
| 135 |
-
- **Backend**: Python Flask with Flask-CORS
|
| 136 |
-
- **ML Framework**: TensorFlow 2.x / Keras
|
| 137 |
-
- **Image Processing**: OpenCV, Pillow
|
| 138 |
-
|
| 139 |
-
## License
|
| 140 |
-
|
| 141 |
-
Β© 2025 PulmoScanAI β’ Next-Gen AI Pathology Platform
|
| 142 |
-
|
| 143 |
-
## Support
|
| 144 |
-
|
| 145 |
-
For issues or questions, please review the error messages in the browser console (F12) and Flask terminal output.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|