Approximately 9 hours 45 minutes after departure, the "FLIGHT FIRE CARGO FWD" warning message illuminated with associated warning bell. Although the non-normal checklist items were carried out, which included discharging both fire bottles, the message remained illuminated together with a status message "CARGO FWD-2 LOOP A AND B". An emergency was declared and the aircraft diverted to Stockholm, the nearest suitable airport. The warning message and fire bell recurred several times during final approach and landing. Investigation revealed that a quantity of fresh vegetables being carried in the forward cargo bay had elevated the humidity to a level sufficient to cause condensation on the "cold soaked" smoke sensors, thus activating the fire warning system. The manufacturer is aware of the problem and intends to issue a modification, which will involve fitting an insulation blanket to the sensing units. The operator of this aircraft has obtained the details of the service bulletin and will be modifying its B747-400 aircraft as soon as is practicable.