/

May 27, 2020

AI in forestry: Tree counting from drone images

AI in forestry: Tree counting from drone images

Thanks to geospatial machine learning, what used to take foresters many hours of work – like counting trees in drone images – can now be achieved in minutes or a few hours. This is the case of the count of trees in tens of thousands of hectares of forest of eucalyptus and other species in Uruguay. One of the two most important forestry companies there has recently incorporated AI techniques through local suppliers, to perform this task in record time and cost. ICA, a leading GIS company in Uruguay, is one of these providers. It has recently done a tree counting work using Picterra software. The detection was made from three-band images: RGB (true color) as well as Near Infrared, Red and Green images (False Infrared color) based on the training of two detectors; one that locates and extracts the treetops individual and a second detector, which identifies the polygons of the plantation lines. These polygons are subsequently used to select only the trees located on the plantation lines and identify those located outside, which is considered a failure in forestry.

This double detection allows generating a more precise and refined product, giving forest operators the ability to accurately calculate the percentages of effective forestry and its failures, in order to improve their production processes and decision-making. Thanks to this new AI technology, the hours invested in counting trees from drone images are very productive. Users no longer spend long hours digitizing trees on the image as traditionally done, but they train detectors to infer and extract information from images.  

Example of selecting trees detected on plantation lines (cyan) and trees off lines (red)
Example of polygons generated by the Detector (red) and the points corresponding to the centroids of the detections (yellow)

Same users, new tasks, increased productivity

Users perform this new, more specialized task in a more productive way. The repetitive task of traditional mechanisms is then transformed into a more strategic one that provides important results in the face of small variations. Picterra software has a lot to do with this, thanks to its friendly, easy-to-use interface. Users are more motivated by learning something new that allows them to get better results. It opens a new area of knowledge and application, new horizons. It even feels great to see the excellent results of applying a detector on a new image. – said Pablo Rebufello, Technology & Innovation Manager at ICA.  

The tests and processes carried out

ICA has tried two different approaches to extract the information from the images. The first gave rise to the second, as a natural evolution of this one. The requested minimum accuracy on the information extraction was 95%. The plants to be extracted were between 6 and 12 months old, located in rows with a separation of 1.5 meters. The initial strategy considered training just one detector. If it did not reach 95%, it would be compensated with manual work by digitizing trees (points) on the image. As a result, points and polygon layers would be obtained. As it’s usually impossible to avoid some difficulties in counting trees from drone images, especially in the early stage of the project, they also appeared here. Some areas containing trees were clearly visible without the interference of any kind (in size range corresponding to the extraction age). However, others were not that ideal, for example:

  • Plants outside the age range due to belonging to neighboring plantations were not located within the set indicated. That’s why it was necessary to carry out a prior filter.
  • Different weeds between the rows of the plantation were mixed with the trees. Visually identical, they were only differentiated by being located in the wrong place. They needed to be removed.
  • Areas with less fertile land or adverse weather conditions caused the reduction of the development of the trees. Because of that, such trees were confused with plants younger than 6 months.
  • Similarly to the abovementioned case, it was necessary to include plants that were slightly outside the equivalent size-range due to abnormal growth, but which also corresponded to plants within the age range of planting. This situation was resolved through plantation polygons granted by the client.

It is also important to note that the size of a eucalyptus plant, which is between 6 and 12 months old, is usually about 1.0-2.0 meters in diameter.  

The first extraction method of counting trees from drone images

The first method applied for extraction reached 95% precision. At first, ICA combined the Picterra platform to train the detector with traditional manual work until they reached the desired percentage. Depending on the image, manual work varied in precision, ensuring a much lower average dedication of hours than if it were a completely manual digitizing job. Visually, polygons were digitized to delimit those forests within the areas of interest of the rest. Among those of interest, regions were differentiated where the plant situation was more precise or ideal, to train one detector without so many different cases, and another in more complicated regions. The reason for this is that in some tests carried out where very disparate regions were integrated, the detector’s result was not so good, so it was resolved to separate to facilitate the learning of different situations. A detector was then trained for “clean” regions, taking samples that covered the variety of cases seen in this area, and another for the rest of the most varied regions. The following figure shows some examples of these types of forests.

Example of zones with ideal detection conditions (left) and problematic detection zones (right)

For the first group of regions with clearer or ideal situations, the detection, without manual digitization improvements, reached an accuracy of 85-92%. The rest of the work was completed with manual work of digitizing the plants on the image. The following figures show examples of the above.

Example of polygons generated by the Detector (red) and the points corresponding to the centroids of the detections (yellow)
Comparison of points generated by the Detector (red triangles) and endpoints with manual processing (green points).

Similarly, ICA trained the detector for the rest of the regions that were in not so ideal conditions and not so clear to interpret given the characteristics of the plantation. As mentioned before, several elements can affect plants’ growth, such as changes in temperature and humidity of the floor due to variations in the type of soil and slopes, vegetation outcrop among the trees that complicate detection, etc. In this case, the automatic detection reached an accuracy between 80 and 89%.  

Example of detection of polygons and points (red) of trees in a no ideal area with the RGB image
Comparison of points generated by the Detector (red triangles) and endpoints with manual processing (green points) in the RGB image.

Although the accuracy reached 95% with about 5 times less manual labor than the traditional method would take, ICA decided that it was necessary to reduce manual labor further and improve the dependency status of detectors on regions. The purpose was to make counting trees from drone images even more effortless by having a single detector applied to the entire image (without region differentiation) and then improve the result with other similar automatic processes. Hence the second strategy or method arises.  

The second extraction method of counting trees from drone images

As there is always room for improvement in counting trees from drone images, ICA determined a new strategy. It considered the natural way in which a person would more easily detect cases that could not be automatically detected in the previous strategy. It quickly became evident that, if the planting lines were available, many of the problems found in the detectors used up to that point would be solved. It would be a simple way to filter out many undesirable plants by selecting only those that fall within the polygons that these “lines” represented. In this type of plantation, it is normal to find plants that look like trees between the planting lines. These plants were the ones that complicated the detectors used in the previous method the most. They were throwing many false positives, or simply complicating the training by including wrong patterns. So, a single detector was trained for massive tree extraction in all regions after initial selection only to consider plants of range or size of interest. This detector was used to obtain points in each detected tree.  

Detected tree plants, Picterra software.

Then another detector was trained to extract the plantation line in the same areas where the previous detector was applied, which allowed to obtain polygons that delimited the area given by the plantation lines (succession of aligned trees, of a certain diameter), as shown in the following figure.

Detection of plantation lines (blue polygons)

Only the points obtained from the first detector included in the polygons of the plantation lines were selected. The ArcGIS Pro software was used to make that selection. The following figure shows the obtained result.

The precision obtained was 98%, without the need to carry out traditional manual digitizing work on the image, investing only the training time of the two detectors. The time was similar to the training of the detectors from the first strategy. However, because no manual digitizing work was performed, the total task time was significantly less than the first strategy. Human work of counting trees from drone images, in this case, included detectors training, inferring to extract patterns, final review, and sampling to calculate the precision.  

Future motivation

From the results obtained, ICA carried out some tests to detect forest waste generated once the trees fell. The obtained results were very satisfactory, and they can be used for other fundamental tasks in the forest area.  

Conclusion

The obtained results were excellent not only in precision, reduction of working hours, and costs. They also offered users more productive ways and the possibility of expanding knowledge to favor the use of new techniques and thus provide better solutions that used to be hard to reach. – said Pablo Rebufello, Technology & Innovation Manager at ICA. AI is experiencing an unprecedented moment of development. Its use is increasing in all areas, and forestry is no different. Undoubtedly it offers new challenges, but also much more powerful capabilities and tools, making people able to perform high-level tasks, being more productive.   Written in cooperation with ICA, a leading GIS company in Uruguay.

Pablo Rebufello, Technology & Innovation Manager Eduardo Vasquez, Remote Sensing Technology and GIS Specialist     

Picterra_product updates_blog image copy 2

Want to learn more?

sign up to our newsletter