Skip to main content

The Python package provides tools for classifying the specified brain slices based on the Cholinergic Pathways HyperIntensities Scale.

Project description

Brain Slice Classifier

The Python package provides tools for classifying the specified brain slices based on the Cholinergic Pathways HyperIntensities Scale.

If you are interested in specific explanations of brain slices, please refer to this link for further details.

Installation

You can install BrainSliceClassifier via pip:

pip install BrainSliceClassifier
Note: It is recommended to use BrainSliceClassifier on Python 3.8 and above.

Notice:

Remember to create a directory named dataset and four separate subdirectories within it.

- dataset
|-- class 1 (./dataset/class 1/)
|-- class 2 (./dataset/class 2/)
|-- class 3 (./dataset/class 3/)
|-- class 4 (./dataset/class 4/)

Remember to create a directory named bsc_model to save the BrainSliceClassifier deep learning-based model.

Usage

Call BrainSliceClassifier directly from Python

from BrainSliceClassifier import Trainer
Trainer(batch_size=batch_size, n_epochs=num_epochs, learning_rate=learning_rate, k_fold=k_fold)
  • batch_size: Batch Size refers to the number of data samples (images in this case) that are processed together in one iteration during training. It's a hyperparameter that determines how many samples are used to compute the gradient and update the model's parameters in each training step. Choosing an appropriate batch size can affect the training dynamics, memory consumption, and computational efficiency of the training process. (default: 32)

  • num_epochs: Num Epochs stands for the number of times the entire dataset is passed forward and backward through the neural network during the training process. Each pass constitutes one epoch. Training for multiple epochs allows the model to learn from the entire dataset multiple times, refining its parameters with each iteration. The choice of the number of epochs depends on factors like the complexity of the dataset, convergence behavior, and computational resources. Too few epochs may result in underfitting, while too many epochs may lead to overfitting. (default: 20)

  • learning_rate: Learning Rate is a hyperparameter that controls the size of the steps taken during the optimization process of training a neural network. It determines the magnitude of updates to the model's parameters (weights) in each iteration of the optimization algorithm, such as stochastic gradient descent (SGD) or Adam. A higher learning rate means larger steps and faster convergence, but it may risk overshooting the optimal solution or causing instability. Conversely, a lower learning rate leads to slower convergence but more stable training. Finding an appropriate learning rate is crucial for achieving good performance during training. (default: 0.001)

  • k_fold: K-fold cross-validation is a technique used to evaluate the performance of a machine learning model. In this technique, the original dataset is divided into K equal-sized folds. The model is trained and evaluated K times, each time using a different fold as the validation set and the remaining folds as the training set. This process allows for a more robust estimation of the model's performance because it ensures that each data point is used for both training and validation exactly once. The final performance metric is usually averaged over the K iterations to obtain a more reliable estimate. K-fold cross-validation is commonly used to assess the generalization ability of a model and to tune hyperparameters. (default: 8)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

BrainSliceClassifier-1.2.2.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

BrainSliceClassifier-1.2.2-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file BrainSliceClassifier-1.2.2.tar.gz.

File metadata

  • Download URL: BrainSliceClassifier-1.2.2.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.19

File hashes

Hashes for BrainSliceClassifier-1.2.2.tar.gz
Algorithm Hash digest
SHA256 5fb76c8c231772da07ade3f757b6e33632df15c50b1155a848f7d0cb6d3959e4
MD5 5271d5a30e04fa909e096ed035c21a0e
BLAKE2b-256 051177dbafdeece16fe8d774a3ee7f7a12ee69d603f155bb2e6de3b86c29a031

See more details on using hashes here.

File details

Details for the file BrainSliceClassifier-1.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for BrainSliceClassifier-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b13ceda4b9c3ff7ae03a61f92c6cd1dc61de248d2454d5a53667bb6025da35f1
MD5 994aa121cb053bb4256ddede980db1a4
BLAKE2b-256 17d25e67dd717ce383f574bea4965ead30ebf3c7694fc064540f2b5be67e6514

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page