## 1 Introduction  
Wireless sensor networks (WSNs) are a type of distributed network that use spatially distributed autonomous sensors to monitor physical or environmental conditions [1], such as temperature, pressure, and humidity, and transmit the data wirelessly to a central location [2]. WSNs are widely used in many areas, including environmental monitoring, industrial automation, and military surveillance [3]. Meanwhile, it is increasingly being combined with artificial intelligence (AI) to provide automatic intelligent decision-making for various medical applications. For example, in the medical field of ophthalmic disease diagnosis and treatment, [PERSON] et al. [4] claimed that the cost-effective applications by the remote assessment of the diabetic eye using portable retinal cameras can be an useful tool to support the proactive prevention of diabetes. [PERSON] et al. [5] proposed a scalable cloud-based teleophthalmology architecture using the Internet of Medical Things (IoMT) for diagnosing age-related macular degeneration. The studies mentioned above demonstrate the potential of using wearable sensors and wireless networks to support the clinical diagnosis and treatment of ophthalmiclic disease. Diabetic retinopathy (DR), the most common and serious diabetes complication [6], is the first blindness-causing eye disease in working-age people [7]. About 30% of people with diabetes suffer from DR [7]. By 2030, 191.0 million people will have DR in the world, leading to an exponential growth in the prevalence of the disease [8]. However, due to the lack of qualified ophthalmologists in many regions, some patients cannot receive timely diagnosis and treatment for their condition, which eventually leads to blindness [9]. The WSNs-aided application for DR diagnosis and treatment provide a promising way to utilize the efficacy of medical resources. DR is mainly caused by high blood sugar and damage to the retinal blood vessels [10]. Fundoscopic examination reveals local pathological changes such as micro angiomas, haemorrhages, exudates, and cotton wool spots, and overall pathological changes such as vascular abnormalities, retinal oedema and atrophy, and neovascularization [11; 12]. DR is categorized into five stages by the degree of its pathology [13]: no DR, mild non-proliferative diabetic retinopathy (NPDR), moderate NPDR, severe NPDR, and proliferative diabetic retinopathy (PDR). Figure 1 shows the subfigures (a)-(e) with no DR, mild NPDR, moderate NPDR, severe NPDR, and PDR, respectively. No DR means people with diabetes do not show any signs of DR. Mild NPDR refers to an early stage of DR characterized by micro-aneurysms, small haemorrhages, or hard exudates in the retina, but without the development of new blood vessels or structural changes in the retina. Moderate NPDR is characterized by micro-aneurysms, retinal haemorrhages, cotton wool spots, tiny yellow deposits [14], venous beading, intraretinal microvascular abnormalities (IRMA), or moderately severe intra-retinal haemorrhages in at least one of the four quadrants. Severe NPDR is characterized by numerous and prominent intra-retinal haemorrhages in at least four quadrants of the retina, cotton-wood spots, venous beading, and IRMA. PDR is a more severe form of DR, characterized by the growth of abnormal blood vessels in the retina [15], which can cause vision loss and even blindness if left untreated. Early, rapid, and automatic grading of DR severity and timely treatment are vital to prevent or slow down the progression of DR [16]. Fundus photography is a common ophthalmic screening method for DR [17; 18]. Direct observation of the fundus camera results is more dependent on the examiner's experience, has problems of limited diagnostic accuracy, and is time-consuming [19]. In recent years, DR grading systems based on machine and deep learning have been widely developed and applied [20; 21]. Convolutional neural networks (CNNs) are deep learning models that detect and segment objects from medical images.