Artificial Intelligence in Criminal Investigations: Legal Challenges and Safeguards