Canadian National Railway Co. says it's investing $10 million in a special program to enhance its ability to detect equipment defects, such as hot wheels and bearings in its rolling stock.

The Montreal-based company, one of North America's largest railway operators, said it's part of CN's efforts to improve the safety of its system.

The Canadian railway sector has come under increased scrutiny this year following a string of high-profile derailments in several provinces.

CN wasn't involved in the worst incident — a deadly disaster last summer that devastated the Quebec community of Lac-Mégantic — but its reputation has been tarnished by a number of other mishaps.

The fiery derailment of a CN freight train transporting propane and crude oil in late October forced residents of Gainford, Alta., from their homes for up to four days until firefighters could control the blaze.

Canadian National has argued that its safety record is good despite the recent spate of accidents and adds that the investment in safety announced Thursday will keep it ahead of the industry.

Among other things, CN says it will acquire and install 30 new wayside units that detect hot bearings, hot wheels and dragging equipment.

It will also acquire a new test car to monitor the position, curvature and alignment of track and an optical track inspection system to identify defects. There will also be more equipment to notify train crews of problems.

Transport Canada has introduced new labelling requirements for shipping oil by rail in the wake of the Lac-Mégantic tragedy, but there is concern that shippers are not doing the testing required.

The recent derailments have angered many communities and helped build opposition to plans to increase rail traffic. 

At the same time, the demand to ship oil by rail has risen as oil producers struggle to get crude to refineries and to market.

In a report earlier this week, the auditor general said he found "significant weaknesses"  in Transport Canada's oversight of rail safety.

There were issues of "trespassing, grade crossings, concerns about the environment, the collection of data on safety performance from federal railways, and the implementation and oversight of safety management systems," auditor general Michael Ferguson's report found.

With files from CBC News