cytologick

(WIP) PyTorch/TensorFlow powered semantic segmentation software for cytological slides

https://github.com/akaiko1/cytologick

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.9%) to scientific vocabulary

Keywords

cervical-cancer cytology deep-learning digital-pathology healthcare image-segmentation medical-ai medical-diagnosis medical-imaging pap-smear pathology python tensorflow unet
Last synced: 6 months ago · JSON representation ·

Repository

(WIP) PyTorch/TensorFlow powered semantic segmentation software for cytological slides

Basic Info
  • Host: GitHub
  • Owner: Akaiko1
  • License: other
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 1.03 MB
Statistics
  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
cervical-cancer cytology deep-learning digital-pathology healthcare image-segmentation medical-ai medical-diagnosis medical-imaging pap-smear pathology python tensorflow unet
Created over 3 years ago · Last pushed 7 months ago
Metadata Files
Readme Contributing License Citation

README.md

Cytologick - Research Tool for Pap Smear Analysis

What is Cytologick?

Cytologick is a Python-based research tool for analyzing Pap smear slides using artificial intelligence. This software is designed for research and educational purposes to explore automated detection of cellular abnormalities like LSIL, HSIL, and ASCUS in cytological samples.

Features

  • Experimental Cell Detection - AI-based research into abnormal cervical cell identification
  • MRXS Format Support - Reads digital pathology slide formats for research
  • ASAP Integration - Compatible with ASAP annotation files for dataset creation
  • Desktop Interface - PyQt5-based application for slide analysis
  • Model Training - Train custom U-Net models on annotated datasets
  • Research Focus - Experimental detection of LSIL, HSIL, ASCUS, and ASCH patterns

Cytologick Example

Installation

Prerequisites

Step 1: Create Python Environment

bash conda create -n cytologick python=3.10 conda activate cytologick

Step 2: Install OpenSlide

Windows: ```bash

Download from https://openslide.org/download/

Extract to a folder and note the path

```

Linux/macOS: ```bash

Follow OS-specific instructions at https://openslide.org/download/

```

Step 3: Install ASAP (Optional - for training only)

Download and install ASAP if you plan to create training datasets from annotated slides.

Step 4: Install Dependencies

```bash

Install Python packages

pip install -r requirements.txt

Install additional packages via conda

conda install tensorflow conda install openslide-python ```

Step 5: Download Web Dependencies

Download and place these files in __web/static/: - jquery.js - openseadragon.js - openseadragon-scalebar.js

Step 6: Configure Settings

Edit config.py or create config.ini to set your paths:

Required Settings: python OPENSLIDE_PATH = "C:/path/to/openslide/bin" # Windows SLIDE_DIR = "./current" # Folder containing your MRXS files

Optional Settings: python IP_EXPOSED = "127.0.0.1" # Web interface IP UNET_PRED_MODE = "remote" # Use cloud models

What You Need

  • Slide Files: MRXS format Pap smear slides
  • Python Environment: Python 3.10.6 or later with Conda
  • OpenSlide: For reading medical slide files
  • ASAP: For slide annotation (optional, for training)
  • Internet Connection: For cloud-based AI analysis (recommended)

Quick Start

1. Run Desktop Application (Recommended)

```bash

Activate your environment

conda activate cytologick

Run the application

python run.py ``` Opens a desktop research application for experimental slide analysis.

2. Web Interface (Experimental)

bash python run_web.py ⚠️ Note: Web interface is experimental and under development.

Getting Started

1. Prepare Your Files

  • Place your MRXS slide files in the current/ folder
  • Make sure OpenSlide path is configured in config.py

2. Start Analysis

```bash

Activate your environment

conda activate cytologick

Run desktop application (recommended)

python run.py ```

3. Using the Interface

  1. Load Slide: Select your MRXS file from the file browser
  2. Run Analysis: Click analyze to run experimental detection
  3. View Results: Areas of interest will be highlighted with annotations
  4. Export Results: Save analysis results for research purposes

Advanced: Training Your Own Models

Step 1: Prepare Your Annotated Data

  1. Annotate slides in ASAP

    • Draw rectangles around abnormal cells
    • Label each rectangle (LSIL, HSIL, ASCUS, etc.)
    • Save annotation files as XML
  2. Organize your files: your_data_folder/ ├── slide1.mrxs ├── slide1.xml ├── slide2.mrxs ├── slide2.xml └── ...

Step 2: Configure Training Paths

Edit config.py to point to your data: python HDD_SLIDES = "/path/to/your_data_folder" DATASET_FOLDER = "dataset"

Step 3: Run Training Pipeline

```bash

Extract annotations from ASAP XML files

python get_xmls.py

Create training dataset from extracted annotations

python get_dataset.py

Define neural network architecture

python model_new.py

Train the model (this will take several hours)

python model_train.py ```

Step 4: Use Your Trained Model

After training completes, copy the trained model to use locally: ```bash

Copy trained model to local folder

cp -r trainedmodeloutput/ _main/ ```

Your custom model will now be used automatically when you run python run.py.

Getting AI Models

Option 1: Local Models (Recommended)

For best performance and offline analysis:

  1. Create model folder: bash mkdir _main

  2. Place your trained model:

    • Copy your TensorFlow model files to the _main/ folder
    • The application will automatically detect and load local models
  3. Model requirements:

    • TensorFlow SavedModel format
    • Input shape: (128, 128, 3)
    • Output: Segmentation mask for cell classification

Benefits of local models: - No internet connection required - Faster inference (no network latency) - Full privacy - data stays on your machine - Better for research reproducibility

Option 2: Cloud-Based Models

Remote models hosted on TensorFlow Serving infrastructure. Requires internet connection.

To use custom cloud models: 1. Edit clogic/inference.py 2. Modify the apply_remote function parameters: - endpoint_url: Your TensorFlow Serving endpoint - model_name: Your model's name on the server

Note: Remote models use TensorFlow Serving backend for scalable inference.

Understanding Annotations

ASAP Annotation Format

Cytologick uses ASAP annotation format for training data. See annotation_example.xml for a sample annotation file.

Key elements: - Rectangles: Define regions of interest around abnormal cells - Coordinates: Precise pixel locations for each annotation - Labels: Cell type classifications (LSIL, HSIL, ASCUS, etc.)

Creating annotations: 1. Open slide in ASAP 2. Draw rectangles around abnormal cells 3. Label each rectangle with appropriate cell type 4. Save as XML annotation file

Cell Types (Research Focus)

Cytologick research focuses on these cervical cell patterns: - LSIL - Low-grade Squamous Intraepithelial Lesion - HSIL - High-grade Squamous Intraepithelial Lesion
- ASCUS - Atypical Squamous Cells of Undetermined Significance - ASCH - Atypical Squamous Cells, Cannot Exclude HSIL

Keywords

Pap smear research, cytology AI, medical image analysis research, LSIL detection research, HSIL detection research, ASCUS detection research, digital pathology research, deep learning, U-Net segmentation, TensorFlow, computer vision research

Contributing

If you're interested in contributing to Cytologick, please read our contributing guidelines. We welcome issues and pull requests!

Owner

  • Name: Akaiko
  • Login: Akaiko1
  • Kind: user

Citation (CITATION.md)

# How to Cite Cytologick

If you use Cytologick in your research, please cite this software:

## BibTeX Citation

```bibtex
@software{cytologick2024,
  title={Cytologick: Automated Pap Smear Analysis Software},
  author={Cytologick Development Team},
  year={2024},
  url={https://github.com/Akaiko1/Cytologick},
  note={AI-powered cytology screening tool for cervical cancer detection},
  version={1.0}
}
```

## APA Citation

Cytologick Development Team. (2024). *Cytologick: Automated Pap Smear Analysis Software* (Version 1.0) [Computer software]. https://github.com/Akaiko1/Cytologick

## IEEE Citation

Cytologick Development Team, "Cytologick: Automated Pap Smear Analysis Software," 2024. [Online]. Available: https://github.com/Akaiko1/Cytologick

## Related Publications

If you have published research using Cytologick, please let us know so we can include it here:

- [Your Paper Title] - Journal/Conference Year
- [Dataset Paper] - Medical Journal Year

## Acknowledgments

Please acknowledge the use of Cytologick in your research papers, presentations, and reports. This helps us track the impact of our work and secure continued development funding.

## Contact

For questions about citing Cytologick or collaboration opportunities, please open an issue on GitHub or contact the development team.

GitHub Events

Total
  • Push event: 5
  • Create event: 1
Last Year
  • Push event: 5
  • Create event: 1