File size: 2,331 Bytes
3d708b1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---

title: PulmoScanAI
emoji: 🫁
colorFrom: blue
colorTo: green
sdk: docker
app_file: app.py
pinned: false
---


# PulmoScanAI - AI Lung Cancer Detection System

An advanced web-based application for detecting lung cancer from histopathology images using a deep learning CNN model with feature-based analysis.

## Features

- **Real-time AI Analysis**: Uses TensorFlow/Keras deep learning model
- **Feature-based Detection**: Analyzes darkness, purple staining, and edge density
- **Beautiful UI**: Modern, responsive design with animated backgrounds
- **Drag & Drop Upload**: Easy image upload with preview
- **Confidence Score**: Displays detection confidence percentage
- **CORS Enabled**: Seamless frontend-backend communication

## How It Works

1. **Upload Image**: Drag & drop a histopathology image
2. **CNN Processing**: Model analyzes tissue patterns
3. **Feature Analysis**: Evaluates darkness, staining, and texture
4. **Result**: Shows diagnosis with confidence score
   - **Green**: Normal tissue detected
   - **Red**: Cancer detected

## API Endpoints

### Health Check
```

GET /api/health

```

### Prediction
```

POST /api/predict

Content-Type: multipart/form-data

```

**Request**: Image file in multipart form data
**Response**:
```json

{

  "is_cancer": false,

  "confidence": 0.92,

  "diagnosis": "No Cancer Found",

  "confidence_percentage": 92.0

}

```

## Model Information

- **Architecture**: Convolutional Neural Network (CNN)
- **Input**: 150Γ—150 RGB images
- **Output**: 3-class classification (Adenocarcinoma, Normal, Squamous Cell Carcinoma)
- **Framework**: TensorFlow 2.13.0 / Keras

## Technical Stack

- **Frontend**: HTML5, CSS3, JavaScript (Vanilla)
- **Backend**: Python Flask with Flask-CORS
- **ML Framework**: TensorFlow 2.x / Keras
- **Image Processing**: OpenCV, Pillow, NumPy

## Project Structure

```

β”œβ”€β”€ app.py                    # Flask backend server

β”œβ”€β”€ best_lung_model.h5       # Trained CNN model

β”œβ”€β”€ PulmoScanAI.html         # Web frontend

β”œβ”€β”€ requirements.txt         # Python dependencies

β”œβ”€β”€ Dockerfile               # Container configuration

└── README.md               # This file

```

## License

Β© 2025 PulmoScanAI β€’ Next-Gen AI Pathology Platform