This is a simple pneumonia classifier built with Rust and the tch-rs crate (Rust bindings for PyTorch). It uses a pretrained VGG19 model and fine-tunes it on the "Chest X-Ray Images (Pneumonia)" dataset.
The model achieves around 89% accuracy on the test set. Please note that this project is for educational and demonstration purposes and is not intended for real-world medical use. The model is not optimized for clinical accuracy.
To train the model, run the following command:
cargo run -- --trainThis will train the model and save the weights to pneumonia_model_weights.ot.
To test a single image, use the --test_single flag followed by the path to the image:
cargo run -- --test_single path/to/your/image.jpegFor example:
cargo run -- --test_single dataset/test/NORMAL/IM-0001-0001.jpegTo run the model on the entire test set, use the --test flag:
cargo run -- --test