Tree logo

Tree wilt detection

By Sergio Sanchez, Artelnics.

Through image analysis with neural networks we can detect diseased trees, thus anticipating the imminent fall of them. The analysis of high-resolution photos can help us in order to remove and replant new ones.

This example uses remote sensing data for detecting diseased trees.

There are few training samples for the 'diseased trees' class (74) and many for 'other land cover' class (4265). Please see the reference below for more information on the data set, and please cite the reference if you use this data set. Enjoy!


  1. Data set
  2. Neural network
  3. Loss index
  4. Training strategy
  5. Testing analysis
  6. Model deployment

1. Data set

The data set consists of image segments, generated by segmenting the pan-sharpened image. The segments contain spectral information from the Quickbird multispectral image bands and texture information from the panchromatic (Pan) image band.

Forest quickbird image
Forest quickbird.

The data set contains the information for creating the model. It comprises a data matrix in which columns represent variables and rows represent instances.

The next table shows a preview of the data matrix contained in the file wilt_data_set. Here, the number of variables is 6, and the number of instances is 574.

  • class: Diseased trees or all other land cover.
  • glcm: Mean gray level co-occurrence matrix (GLCM) texture index.
  • green: Mean green (G) value.
  • red: Mean red (R) value.
  • nir: Mean near infrared (NIR) value.
  • pan_band: Standard deviation.
Tree wilt detection dataset picture
Tree wilt detection dataset.

The next figure shows the data set tab in Neural Designer.

Data table
Data table.

The data set is divided into training, generalization and testing subsets. The following pie chart details the uses of all the instances in the data set. The total number of instances is 574. The number of training instances is 346 (60.3%), the number of selection instances is 114 (19.9%), the number of testing instances is 114 (19.9%), and the number of unused instances is 0 (0%).

Pie chart
Pie chart.

2. Neural network

Now we have to choose a neural network architecture to represent the classification function. Depending on the number of inputs, neurons in the hidden layer, and outputs, the architecture and the result of the neural network will be different.

The following picture shows a graph of the neural network for this example.

Neural network graph
Neural network graph.

The number of inputs is 5, and the number of outputs is 1. The complexity, represented by the numbers of hidden perceptrons is 5. The probabilistic layer allows the outputs to be interpreted as probabilities, i.e., all outputs are between 0 and 1 and their sum is 1.

3. Loss index

UPDATE: The last version of the program now includes this section into Training Strategy.

The loss index defines the task that the neural network is required to accomplish. The normalized squared error is used here as error term.

The learning problem can be stated as to find a neural network which minimizes the loss index, i.e., a neural network that fits the data set (objective) without undesired oscillations (regularization).

4. Training strategy

The procedure used to carry out the learning process is called training strategy. The training strategy is applied to the neural network in order to obtain the best possible performance. The type of training is determined by the way in which the adjustment of the parameters in the neural network takes place.

The quasi-Newton method is used here as main algorithm in the training strategy.

The following chart shows how the performance decreases with the iterations during the training process. The initial value is 1.00124, and the final value after 160 iterations is 0.274963.

Training plot
Training plot.

The next shows the training results by the quasi-Newton method. They include some final states from the neural network, the loss index and the training algorithm.

Performance training
Performance training.

The parameters norm is not very big, the performance and generalization performance are small and the gradient norm is almost zero.

5. Testing analysis

The last step is to test the generalization performance of the trained neural network. In the confusion matrix the rows represent the target classes and the columns the output classes for the testing target data set.

The diagonal cells in each table show the number of cases that were correctly classified, and the off-diagonal cells show the misclassified cases. The next table shows the confusion elements for this application.

Confusion matrix
Confusion matrix.

The number of correctly classified instances is 106, and the number of misclassified instances is 8.

The classification accuracy, error rate, sensitivity and specificity are parameters for testing the performance of a classification problem with two classes. The classification accuracy is the ratio of instances correctly classified. The error rate is the ratio of instances misclassified. The sensitivity, or true positive rate, is the proportion of actual positive which are predicted positive. The specificity, or true negative rate, is the proportion of actual negative which are predicted negative.

The next table lists the binary classification tests for this application.

Binary classification tests table
Binary classification test.

6. Model deployment

The neural network is now ready to predict outputs for inputs that it has never seen.


The next table shows the input values and their corresponding output values. The input variables are GLCM_pan, mean_G, mean_R, mean_NIR and SD_pan; and the output variables are class.

Outputs results
Outputs results.

The results from that task are written in the viewer. For this particular case, the output that these inputs have been produced is almost 1, which means that the area where the image was taken contains diseased trees.

The mathematical expression represented by the neural network is written below.

		(Class) = Probability(non_probabilistic_Class);

			return 1/(1+exp(-x))

			if x < 0
				return 0
			else if x > 1
				return 1
				return x



  • The data for this problem has been taken from the UCI Machine Learning Repository. Johnson, B., Tateishi, R., Hoan, N., 2013. A hybrid pansharpening approach and multiscale object-based image analysis for mapping diseased pine and oak trees. International Journal of Remote Sensing, 34 (20), 6969-6982.