Since the age of 10 I'd wanted to be an explorer. My dad was a test pilot flying Vulcan bombers and I wished I could be an adventurer like him. So in 1982, I saved up and planned my first trip across the north-eastern Brazilian rainforest.

After five months of trekking, being passed from one indigenous tribe to another, not really knowing what I was doing, I came across some goldminers who attacked me in the night. I was only 22, naive and very scared.

In the darkness I fled towards my canoe. With me was a dog I'd found in a village a few months before; I'd healed its paw, and it had become my companion. But in the chaos, the canoe capsized and I lost everything. I ended up walking on my own, lost in the rainforest with only the dog for company.

As we walked we got steadily weaker and, after about three weeks, I was starving to death; I had malaria and I was delirious. But the dog had become incredibly important to me in terms of keeping my hopes up. We were both suffering, but we were in it together.

I couldn't see myself, but I knew how bad the dog looked. I drew a little jokey cartoon in my diary of us both fantasising about eating one other; I knew it was becoming a very real proposition. I started thinking more about what I might have to do if I ever wanted to see my mum and dad again.

I remember lying on my back one day and thinking I wouldn't get up again if I didn't eat something; the only thing left was to eat the dog. I managed to cook a few bits using a survival kit. It gave me a little strength to keep going but, in a way, I was even more terrified, as knew I'd played my last card.

Some days later, miraculously, I saw a chink of daylight; I'd been in a dark tangle for as long as I could recall, but soon I was standing in a farmer's crop. He treated me with an anti-malarial drink and I was taken to hospital.

When I got back to Britain I was too ashamed to tell my parents how badly things had gone. Then the local paper asked me about the trip. I let slip about the dog and before I knew it the nationals were on to it; my sorry tale became a two-page spread in the Daily Mail. The RSPCA came round with a sack of hate mail.

I often wonder whether what happened was a mistake or not; obviously it kept me alive but it has also haunted me. In a way it has driven me in my career, fuelling my desire to understand why I had survived. But it has always been something I've wanted to rectify.

Benedict Allen is speaking at deafblind charity Sense's annual lecture on 15 November (email lecture@sense.org.uk).