The number 50 sounded small to Dr. Zhuoyan Shen at first. It was just a percentage — a calculation that popped out of a computer program. But what it represented was enormous: a 50 percent drop in the risk of dying from rectal cancer for some patients who received an extra chemotherapy drug.

Dr. Shen, a researcher at University College London, and her team had built an artificial intelligence tool that could look at microscopic images of tumors and sort patients into two groups — those with lots of cancer cells packed into their tumors, and those with fewer. What they found surprised them. The patients with densely packed tumors lived significantly longer when doctors added a drug called irinotecan to their standard treatment.

Rectal cancer affects the final few inches of the large intestine. In its advanced stages, it can spread to nearby tissues and comes back, or recurs, at high rates. In the United Kingdom, it is the fourth-most deadly cancer. Standard treatment usually involves chemotherapy with a drug called capecitabine combined with radiation therapy. Adding irinotecan, another chemotherapy drug often used for bowel cancer, had been tried before but never clearly helped patients. So doctors stopped pursuing it — until now.

Dr. Shen's AI looked at 414 tumor samples collected from patients at 75 hospitals across the United Kingdom as part of a large clinical trial called ARISTOTLE. The machine counted millions of individual cells in each sample, something that would take a human pathologist dozens of hours to do. It sorted patients into high- and low-density groups in seconds. The results were striking.

For patients whose tumors had a high density of cancer cells, adding irinotecan to standard treatment cut their risk of the cancer coming back by about 43 percent and their risk of dying by about 50 percent, compared to patients who received standard treatment alone. Patients with low tumor cell density saw no benefit at all.

"While the original trial showed little benefit from adding irinotecan, by using artificial intelligence we found that we could distinguish patients who actually benefited from those who did not," Dr. Shen said.

The team published its findings in the journal eBioMedicine and created a free online tool called Octopath, where doctors can upload pictures of tumor biopsies and receive an analysis. The hope is that clinicians could someday use this tool before treatment begins, identifying which patients should receive the more intensive drug combination and which ones should not. That matters because the stronger treatment also brings harsher side effects — diarrhea and dangerously low white blood cell counts among them. No patient should face those extra burdens without good reason.

Professor Maria Hawkins, a senior author on the study and a clinician at University College London Hospitals, said intensifying cancer treatment adds real strain to patients who are already suffering. "Clinicians need reliable ways to identify who is most likely to benefit before such treatments begin so potential side effects are avoided," she said.

The tool is still being developed and evaluated, but the researchers believe this is just the beginning. They hope artificial intelligence can uncover other hidden patterns in tumors — clues that could point toward even more effective treatments in the future.