Model Information

MediMind uses a combination of machine learning (ML) and large language models (LLMs) for symptom analysis and recommendation generation:

1. RNN Model (.pth)

  • Purpose: Initial disease prediction.

  • Type: Pre-trained Recurrent Neural Network (RNN).

  • Architecture: [RNN architecture details, e.g., Single-layer RNN with 240 hidden units, ReLU activation]

  • Weights: Stored in models/pretrained_symtom_to_disease_model.pth.

Example code snippet for loading the RNN model (PyTorch)
rnn_model = RNN_model(input_size, 240, output_size)
rnn_model.load_state_dict(torch.load(model_path, map_location=torch.device('cpu')))
rnn_model.eval()

2. LLM (Large Language Model)

  • Purpose: Generates follow-up questions, refines diagnosis, and provides recommendations.

  • Model: https://huggingface.co/meta-llama/Llama-3.2-1B-Instruct

  • Capabilities: Contextual understanding and human-like text generation. Suitable for interactive medical question-answering.

Example code snippet for using the LLM (Hugging Face Transformers)
llm = pipeline("text-generation", model="meta-llama/Llama-3.2-1B-Instruct", device_map="auto")
response = llm(prompt, max_new_tokens=150, temperature=0.5)[0]['generated_text']