Performance evaluation of AkidaNet converted to spiking domain for the classification of weeds in cotton fields Authors: Mrudula Jeeva, Santhosh Miriala Published: 2026 ABSTRACT AbstractThe infestation of weeds in cotton fields poses a serious threat to the production of lint. Weeds are eliminated either by spraying weed kill sprays, or removal by hand, or by automated machinery. Machine learning (ML) and deep learning (DL) models are used in these machines for weed classification and detection. Compared with machine learning models, DL models based on neural networks have greater ability to extract features. A spiking neural network (SNN) is used in this paper for the classification of weed images commonly found in cotton fields. The classification of the 6 classes of weeds is accomplished via transfer learning on the AkidaNet Convolutional Neural Network (CNN) model, which is converted to an SNN via software tools from BrainChip. The process includes quantization of the parameters to achieve compatibility for conversion and eventual deployment on neuromorphic devices. The classification accuracy and loss metrics are presented for the training and validation data. The accuracy and loss values achieved during training were 96.26% and 26.67% for the training data and 93.58% and 31.16% for the validation data respectively. Prior to conversion to the SNN, during quantization, the accuracy achieved is 87.96%. With the inclusion of Quantization Aware Training (QAT), the accuracy improved to 90.74%. After conversion from the CNN to the SNN, the model accuracy obtained for the testing data was 94.44%. The results demonstrate that SNN-based models can achieve good classification accuracy with reduced computational cost, making them suitable for deployment on energy-efficient neuromorphic systems. This approach holds strong potential for real-time automated weed detection in precision cotton agriculture.Keywords: Cotton weeds, Image classification, Deep learning, Spiking neural networkSubject terms: Computational biology and bioinformatics, Engineering, Mathematics and computing Introduction Among the various factors that affect crop yield, infestations of weeds in the field cause significant losses, as they compete with the utilization of water and mineral resources meant for the main crop. In addition, they cause a decrease in the quality of lint, and become home to insects and diseases1. According to the International Cotton Advisory Committee (ICAC)2, the cost of controlling weeds rose from 9 cents per kilogram of lint to 31 cents between 2000 and 2013. Specifically, in cotton fields, owing to the amount of space between plants (approximately 1 m), weeds have ample space to grow3. Classifying the weeds commonly found in cotton fields is necessary to identify different types of weeds and enable automated devices to eliminate them by removing the weeds or by the precise spraying of weed killer sprays. To accomplish the elimination of weeds precisely via automated machines, the deployment of machine learning and deep learning models in equipment has proven promising in recent years. Deep learning neural networks can extract features automatically from images4. The power consumption and latency issues associated with the equipment are worth addressing. Handling large amounts of data for training DL models is one of the major issues in image processing. Various solutions have been presented in the literature to overcome these challenges. Background The classification and detection of weeds via deep learning (DL) techniques have been reported in the literature5,6. Weed detection was improved by using depthwise separable convolution (DSC) structure to replace the backbone of the YOLOv8n model, as reported in Wang et al.7. By introducing a bidirectional feature pyramid network (BiFPN), the feature extraction ability was further optimized. The number of parameters is 1.09 M, and the accuracy is 93.1%. Dong et al.8 presented the F1-score accuracy on the CottonWeedID15 dataset for 27 DL models. The test accuracy ranged from 95% to 99%, with ResNet101 yielding the highest accuracy. Abdur et al.9 reported the evaluation of 13 DL models for cotton weed detection. ResNet achieved a high accuracy of 79.98% but a longer inference time, and YOLOv5n converged in a shorter time of 17 ms with 76.58% accuracy. In recent years, edge devices have gained prominence over cloud-based devices because of their reduced power consumption and increased speed of operation in addition to other advantages. According to the International Data Corporation (IDC), global spending on edge technologies increased by 14 percent between 2023 and 202410. In agricultural applications, systems do not depend on the internet, as the fields are remotely located. Edge systems optimize the training and reasoning of the data and resources of end devices and edge nodes and wean them from cloud centers for the same task. This increases the demand of edge systems with less power consumption, high accuracy, low latency and improved data privacy11. The third generation of neural networks, known as SNNs, are preferred in edge/AI technology because of their lower power consumption and low latency12. The performance of SNNs, in terms of power consumption and operational speed, depends on the extent to which they represent the spiking behavior of neurons in the human brain. The biological neuron generates an impulse only when the membrane potential reaches a threshold value. Similarly, in an SNN, for an image processing use case, the spikes are generated only when the pixel magnitude reaches a threshold value, resulting in the system not utilizing much power13. There are two ways in which the SNN model is adapted in these systems. In the first method of indirect training, a pretrained artificial neural network (ANN) model is converted into an SNN, where the weights and biases are converted into spikes and processed. The ANN is generally modeled in TensorFlow and the Keras framework. In the second method, the pixel information from the images is directly represented by a spike train, and the neurons process the information across layers14. This method is generally developed in the PyTorch environment. In this paper, the first method, i.e., conversion from a CNN to an SNN, as mentioned in BrainChip Akida user guide15, is used. The CNN architecture used is AkidaNet, which is a model pretrained on the ImageNet dataset. After training the model on a dataset, the weights and parameters are quantized, and the resulting quantized model is converted to an SNN. The converted AkidaNet model can be deployed on BrainChip’s AKD1000, a neuromorphic system on a chip, hereafter referred to as NSoC. The layers in the model are based on MobileNetV216, where the weight of the model is substantially reduced by implementing depthwise convolution and pointwise convolution (PWC), which are jointly termed depthwise separable convolution (DWC). Hao et al.17 presented an encoder-decoder architecture, namely, SResNet, including DWC, to compress the model and increase the number of network layers at one instance, which resulted in the extraction of more abundant pixel category information. Yunhui et al.18 presented an architecture based on DSC for image datasets belonging to different domains, and the implementation required only 50% of the parameters in comparison to conventional approaches.A model was developed and tested on an embedded platform by Lan et al.19 to identify weeds in rice fields via DSC, which enabled MobileNetV2 to reduce the number of network parameters and improve the U-Net semantic segmentation model. For hyperspectral images, which involve many training parameters and increased computational cost20, the residual connection with the DSC is combined to reduce the number of parameters. In the work reported by Vi et al.21, AkidaNet architecture, which includes DSC, was used to detect wild radish weeds in canola crops, resulting in an energy-efficient model with reduced latency. To optimize the performance of DWC, Zheng et al.22 employed a row data reuse technique to reduce redundant data loading and minimize memory access overhead. For pointwise convolution, a dynamic tiling approach is adapted to optimize hardware usage by evenly distributing resources across blocks and threads. The arithmetic intensity is boosted with an additional channel distribution method. In the literature, the classification of weeds in cotton fields via SNN has not been reported; thus, this work contributes to further exploration of the tasks of weed classification and the construction of NSoC-based weed management hardware for cotton plantations in the future. Materials and methods Dataset The CottonWeedID15 dataset used in this work was extracted from the work of Dong et al.8, that consists of weed species found in cotton fields in the United States. The dataset contains 5187 images of the weeds of 15 classes. A few sample images are shown in Fig. 1. The images were manually labeled by trained personnel for weed identification. The dataset is arranged in 15 folders in the main directory, and the names of the folders are the class names of the weeds. The size of the dataset is 11.35 GB. Sample images from the cotton weedID15 dataset. Data preprocessing In this paper, the performance of AkidaNet is analyzed for cottonweed classification on the CottonWeedID15 dataset, which has red, green, and blue (RGB) images of weeds that are commonly found in cotton fields. The dataset has 5187 images of size 11.35 GB, with 15 classes of weeds commonly found in cotton fields, causing a heavy load on the system memory. Therefore, in this work, only 6 classes of weeds were considered for implementation due to memory constraints. The weeds considered are Palmer Amaranth (Amaranthus palmeri), Morning Glory (Ipomoea hederacea), Goose grass (Eleusine indica), Eclipta (Eclipta prostrata), Carpet weeds (Mollugo Verticillata), and Crab grass (Digitaria sanguinalis). The structure of the dataset is arranged with a main folder containing subfolders named after the class names. Each subfolder has the image files of that particular class. A total of 1088 files belonging to 6 classes were included, with 871 files used for training and 109 files used for validation. Furthermore, 108 images were separated for testing. The images are divided approximately 80%, 10% and 10% of the total images for training, validation and testing respectively. The weed classes in the dataset had to be divided into training and test data, as this split is not available in the original data. The images have different pixel sizes, so they were resized to 224x224x3 pixels, ensuring that all the images will have the same size at the input with three color channels: red, green and blue. Apart from resizing the images, we did not include any augmentation of images, such as flipping or contrast variations, due to memory limitations. Architecture The AkidaNet architecture employed in this work is shown in Fig. 2. The input images, rescaled to a pixel size of 224×224×3, are provided at the input of the model. Initially, there are 4 regular convolution layers (2D convolution), followed by 9 DSC layers. Each of these layers has DWC and PWC stages, followed by a batch normalization (BN) layer and a rectified linear unit (ReLU). At this point, a DWC and PWC stage connects the model to a global average pooling layer followed by a fully connected (FC) dense layer, BN, ReLU and dropout layers. For transfer learning with the AkidaNet architecture, the final stage of the architecture is modified to classify 6 classes of cotton weeds. This stage has a prediction layer, a Softmax activation layer and a reshaping layer, to classify the input image by indicating one of the 6 classes. This model ensures reduced usage of memory and efficiently utilizes NSoC hardware. AkidaNet architecture. Depthwise separable convolution Unlike standard convolution, in DWC, the same filter is not applied to all the input channels. Each channel is convolved with a separate filter. The PWC follows DWC, where a 1x1 convolution process combines all the filters from the previous stage. The model is lightweight and is compatible with efficient deployment on BrainChip’s AKD1000 NSoC. The depthwise separable blocks in AkidaNet compared with standard convolution are shown in Fig. 3. The number of computations involved in DSC compared with standard convolution using a color image of shape 3×224×224, kernel size 3×3, and 28 output channels as an example, is shown below Comparison between the standard CNN and AkidaNet. Standard Convolution: DSC: where, H is the height of the image, W is the width, I is the number of input channels, O is the number of output channels and k is the kernel size. CSC, CSD, CSP, and CD specifies the number of computations for standard convolution, DWC, PWC and DSC, respectively. The example demonstrates a significant reduction in the number of computations for DSC, enhancing the model’s energy efficiency. Quantization using Akida tools The execution of AkidaNet on the AKD1000 NSoC is implemented by first quantizing the model using 8-4-4, i.e., input layer weights to 8-bit, other layer weights and activations to 4-bit. This uses quantize API present in the CNN2SNN toolkit. Conversion from CNN to SNN The BrainChip CNN2SNN toolkit was used to convert the quantized CNN model into an Akida-compatible spiking neural network representation within the software simulation environment. The toolkit maps supported quantized layers and operations into Akida-compatible event-driven neural constructs while preserving the trained network parameters and quantization configuration. CNN2SNN.convert API is used to convert quantized CNN model to SNN model. This maps continuous-valued activations into spike-based representations suitable for neuromorphic hardware. A generic quantization process and the corresponding mapping into the spiking domain are detailed in Appendix 1. Implementation and evaluation The architecture was implemented via Python 3.11.11 using the TensorFlow and Keras frameworks in the Google Colab environment. The dataset was arranged with a main folder having subfolders named with the class names. Each subfolder has the image files of that particular class. The TensorFlow and MetaTF frameworks were customized to process the dataset distribution hyperparameters defined for the execution of the model. The Keras model was modified and trained for 6 classes of cotton weed images. The images were resized to 224x224x3 and trained with the Nesterov-accelerated Adaptive Moment Estimation (Nadam) optimizer23. This is a combination of the Adam optimizer and the Nesterov-accelerated gradient (NAG) method, which has the advantages of increased convergence speed and stability while training the neural network. The learning rate was set to 0.001 for the first 10 epochs and then decreased to 0.00001 with exponential decay. Quantization was performed with 8 bits for weights in the input layer and 4 bits for weights and activations in the subsequent layers. During quantization, the 32-bit float-type parameters were converted into 4 bits. This process may affect the accuracy of the model. To compensate for the loss in accuracy, an additional QAT24. was included during training, with a learning rate of 0.0001. After quantization, the Keras model was converted to an SNN using the CNN2SNN conversion method of BrainChip15. This converts the model to a file format that is compatible with deployment on the AKD1000 NSoC. The parameters considered to analyze the performance of the model are as follows: 1. Accuracy (A): This gives a measure of how many true predictions are made out of all the predictions: where ‘tp’ is true positive, ‘tn’ is true negative, ‘fp’ is false positive, and ‘fn’ is false negative. 2. Cross-entropy loss (L): multiclass classification where L(t,p) is the categorical cross-entropy loss t is the true class label p is the predicted class label n is the number of classes. 3. Trainable parameters: These are the weights and biases in the neural network, which are updated during training, on the basis of the gradients calculated from the loss function. According to the optimization algorithm, the model optimizes the parameters for accurate predictions of unseen data. To synchronize the continuous CNN activations with the discrete SNN spikes, we implemented QAT. This process adjusted the network weights to accommodate 4-bit precision, effectively acting as a synchronization layer that bridges the gap between traditional DL and neuromorphic execution. Results Table 1 indicates the accuracy of the AkidaNet model in three phases: before quantization, after quantization and after conversion. The CNN model was initially trained for 30 epochs, and an accuracy of 96.26% was achieved. The model stabilized after 10 epochs for a batch size of 32. The graphs for accuracy and Cross Entropy Loss of AkidaNet before conversion are shown in Fig. 4 for training and validation data. The results show that the model performed well for the unseen data. The performance of the model in terms of the confusion matrix is depicted in Fig. 5 , which represents the correctness of the prediction of classes in both the training and testing datasets. The total number of trainable parameters was 1 139 638 (4.35 MB) for the CNN model. For 30 epochs, the training time is approximately 30 minutes, and for 10 epochs, the training time is 16 minutes for Google Colab on an Intel i3 system with 8 GB of RAM. With a graphical processing unit-enabled system, the execution time can be drastically reduced. After quantization, the accuracy achieved without the QAT is 87.96%, and with the QAT included, the accuracy is 90.74%, training with 2 epochs. The number of parameters is reduced to 1128 614 due to quantization. Table 1Accuracy, loss, and number of parameters.ModelNo. of epochsLearning rateAccuracy /%Loss /%No. of parametersSize /MBAkidaNet CNN30Initial=0.001Final = 0.00001 with exponential decay96.26% (Training)93.58% (Validation)26.67% (Training)31.16% (Validation)1 139 6384.35 MBQuantizationNA-Test: 87.96% (Testing in Keras)-1 128 6144.31 MBQAT20.000190.74% (Testing in Keras)--After CNN2SNNNA-94.44% (Testing in Akida)-- Accuracy, loss, and number of parameters. Initial=0.001 Final = 0.00001 with exponential decay 26.67% (Training) 31.16% (Validation) Plots for model accuracy and loss and for training and validation of the dataset. Confusion matrix for classifying the 6 classes of the training and testing datasets. Finally, the model is simulated in software by conversion to an SNN, and an accuracy of 94.44% is achieved for the test data with 108 samples. The results revealed that the deployment of the AkidaNet architecture performed well for the classification of weeds in cotton fields in terms of accuracy and computational cost. Our work contributes to the development of automated equipment for weed elimination enabled with neuromorphic devices. Discussion The proposed AkidaNet-based model demonstrated efficient classification of cotton weed images using a hybrid deep learning and neuromorphic approach. The training process, implemented in TensorFlow and Keras, showed a high initial accuracy of 96.26% before quantization, indicating strong model generalization and robustness. The gradual learning rate decay and the use of the Nadam optimizer enhanced convergence stability and speed. Quantization significantly reduced the model’s memory footprint and computational cost, which is crucial for deployment on neuromorphic hardware such as the AKD1000 NSoC. However, as expected, quantization introduced an accuracy drop due to the reduction of 32-bit floating-point parameters to low-bit representations. The inclusion of QAT effectively mitigated this issue, improving accuracy from 87.96% to 90.74%. After conversion to an SNN, the model achieved a test accuracy of 94.44%, demonstrating the viability of SNNs for real-time image classification tasks in precision agriculture. The overall reduction in trainable parameters and computational load highlights the model’s suitability for low-power embedded systems. These results validate that neuromorphic deployment of CNN architectures can achieve high performance with reduced resource consumption, supporting the development of intelligent, automated weed detection systems. The existing studies on cotton weed classification and detection primarily focus on classification accuracy, with limited emphasis on computational efficiency metrics such as inference time, number of operations, or energy consumption. Although some detection-based approaches report latency, these models are computationally intensive and not suitable for real-time edge deployment. Table 2 shows the comparison of different existing models in terms of their accuracy and number of parameters involved for image classification. The comparative analysis highlights the trade-off between classification accuracy and computational complexity in weed classification. Conventional Deep Neural Network (DNN)s such as VGG-16, ResNet-101, and DenseNet-121 achieve classification accuracies ranging from 90.38% to 93.88%. However, the number of parameters ranging from 8M to 138M, indicate high computational and memory requirements. Such large models are not suitable for deployment in resource-constrained environments due to their high memory footprint. DenseNet-121 offers relatively a smaller number of parameters. But still relies on dense computations and require substantial processing power. The proposed AkidaNet-based SNN achieved an accuracy of 94.4% with a significantly lower number of parameters (1.13M) enabling lower memory usage and improved computational efficiency. Furthermore, the model operates using event-driven synaptic operations, where computations occur only when spikes are generated. This makes the model highly suitable for edge deployment. Table 2Comparison of different existing models in terms of their accuracy and number of parameters.ModelParameters (Approx.)AccuracyReferenceVGG-16~138M90.38%25ResNet-101~44M93.56%25DenseNet-121~8M93.88%26AkidaNet~1.13M94.44%This work Comparison of different existing models in terms of their accuracy and number of parameters. The inference time and throughput in Frames Per Second (FPS) comparisons in Table 3 depict the trade-off between performance of the models on different hardware platforms. The ResNet-50 model achieves an inference time of 53.4ms (18.7 FPS) on desktop GPU while MobileNetV2 attained 137ms (40.8 FPS) on an edge device. In contrast, the AkidaNet-based SNN simulator records inference time of 135ms (8.2 FPS). The simulation time (Executed on Google Colab on an Intel i3 system with 8 GB of RAM) for 108 images in test dataset was 14.62 seconds. The relatively higher values are due to the spike-based processing which requires multiple temporal steps to accurately encode and propagate information. The practical agricultural applications such as weed classification using slow-moving robotic systems with inference speed of 5-10 FPS is generally sufficient27. Overall, the proposed SNN approach offers a favorable balance between accuracy, computational efficiency and latency for edge-based precision agriculture. Table 3Inference time and throughput on different hardware.ModelDeviceDatasetInference time per single imageThroughputReferenceResNet-50Desktop GPUDeepWeeds53.4 ms18.7 FPS28MobileNetV2Embedded hardware platformImageNet137ms7.3 FPS29 Inference time and throughput on different hardware. Conclusion In this work, the performance of BrainChip’s AkidaNet neural network is evaluated for the classification of weeds commonly found in cotton fields. The accuracy values are 96.26%, 90.74%, and 94.44% for the CNN model, the quantized model with an additional QAT and the SNN model, respectively. The conversion of the CNN to the SNN is accomplished using CNN2SNN conversion method of AkidaNet. The model achieved high accuracy before quantization and maintained satisfactory performance even after applying quantization. The use of Nadam optimizer and inclusion of QAT compensated for the reduction in precision due to quantization. This work demonstrates the potential of neuromorphic architectures for real-time agricultural applications, providing a foundation for developing energy-efficient, automated weed detection and management systems in precision farming. Future work includes exploring strategies to increase accuracy and achieve performance comparable to that of state-of-the-art CNN models in deep learning. We also plan to deploy the model on the AKD1000 NSoC and testing its performance in terms of power consumption on hardware. The current work focuses on the classification of isolated weed species to establish a performance baseline for SNNs in cotton farming. Future iterations of this work will explore SNN-based object detection in images containing both crops and weeds to handle complex and multi-target scenarios in real-time. Acknowledgment We express our sincere gratitude to the staff at Brainchip Systems India Private Limited for their invaluable support and guidance since the inception of this project. Their generous contribution in sharing their expertise at different stages of execution has been immensely helpful and has enabled us to achieve better results. Abbreviations Machine learning Deep learning Spiking neural network Convolutional neural network Deep neural network Quantization-aware training You only look once version 8n Depthwise separable convolution Bidirectional feature pyramid network International data corporation Artificial intelligence Artificial neural network Neuromorphic system on chip Depthwise convolution Pointwise convolution Red, Green, Blue Rectified linear unit Fully connected Batch normalization Nesterov-ccelerated adaptive moment estimation Nesterov accelerated gradient Appendix 1 Generally, in the quantization process, the floating-point weights and parameters are converted to a 4-bit format, which is suitable for SNN implementation. Each floating-point value v is mapped into a discrete integer value m using the equation (1),30. Where, b is the number of bits (4 bits for 16 levels). vmin and vmax are the minimum and maximum values of the tensor. The discrete values are dequantized into integer values using the equation (2) In this model, the number of bits used for quantizing is 4 which significantly reduces computational and memory requirements31. The quantized model is converted to an SNN. This maps continuous-valued activations into spike-based representations suitable for neuromorphic hardware. In CNN the neuron outputs are continuous values from the activation functions such as ReLU given by the equation 3. Where x is the input to the neuron, W is the weight, b is the bias and y is the output of the neuron. In SNNs this is replaced by spike trains over time using rate coding, where, the firing rate of the neuron is proportional to the CNN activation. Each spiking neuron integrates the incoming spikes over time following equation 4. Where, V(t): membrane potentialwi: synaptic weightssi​(t): incoming spike (0 or 1) which essentially works with spikes generated when the incoming impulses to the neuron increase its potential beyond a threshold level Vth as shown in Fig. 6. No spike is generated when the input is not available or if the available input does not sufficiently increase the membrane potential. This feature in the SNN is the reason for less power consumption, as the neuron processes a spike only when valid input is available. Leaky integrate and fire neuron model32. Author contributions J. M. carried out the analysis, interpreted the data, performed the experiments and drafted the manuscript. M. S. critically reviewed the results and manuscript. Data availability The dataset analyzed during the current study is CottonWeedID15, which is available at https://www.kaggle.com/datasets/yuzhenlu/cottonweedid15. Code availability The code supporting the findings of this study is available from the corresponding author upon request. Declarations Competing interests The authors declare no competing interests. Footnotes Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. References Associated Data Data Availability Statement The dataset analyzed during the current study is CottonWeedID15, which is available at https://www.kaggle.com/datasets/yuzhenlu/cottonweedid15. The code supporting the findings of this study is available from the corresponding author upon request.