1 Introduction

The agreement among researchers and relevant stakeholders about the importance of Artificial Intelligence (AI) lessons within the compulsory level of education (Long & Magerko, 2020; Touretzky et al., 2019) has heightened the need for several initiatives to further popularize the subject in schools. Introducing young students early to AI concepts and practices is essential to build their competencies and serves as the foundation for future learning and careers (Touretzky et al., 2022; Kim et al., 2023). Yau et al., (2022a, b) defined AI as machines that demonstrate human intelligence to perform tasks and can iteratively improve themselves by using the data they collect and store. AI applications such as voice assistants, grading software and intelligent tutoring systems (ITS) are increasingly used in education to facilitate intelligent automation. Studies have suggested that students who understand how AI works and the potential impact of the problems it can solve will be better at curating the tools that they use in their own life (Ma et al., 2023). Increasingly, significant efforts are being made to develop curriculum frameworks, guidelines and standards to propagate AI concepts effectively for young learners. Consequently, there is an increase in the creation of new AI learning tools (e.g., Carney et al., 2020; Mahipal et al., 2023), curriculum content and teaching approaches (e.g., Chiu, 2021; Ma et al., 2023) to promote AI concepts across grade levels. However, there needs to be more initiative in professional learning opportunities (Sanusi et al., 2022a, b).

With the push to integrate AI from kindergarten to twelfth-grade levels comes a need for teachers who are equipped to do so. While a few studies (Lee & Perret, 2022; Lin & Van Brummelen, 2021) have begun to provide professional development (PD) for teachers on AI, more effort is required to ensure teachers learn the AI content they will be teaching. In order to design an effective PD, understanding teachers' existing knowledge and interest is valuable (Ayanwale et al., 2023). In addition, exploring the psychological factors that affect teachers' acceptance of emerging technologies is essential to devise strategies that could best support the teachers. Limited work has, however, considered the interrelationship of some psychological factors between teachers and AI. Previous studies focus on students (Chai et al., 2021, 2022; Dai et al., 2020), investigating their intention to learn AI with the interplay of different factors. An exemption (Ayanwale et al., 2022) that was found focusing on teachers centers on a particular context which limits the generalizability of their findings to other regions. To extend Ayanwale et al.'s (2022) work to a different population, we explored teachers' perceptions about teaching AI from the perspectives of planned behaviour theory (TBP). In several studies, TPB has been applied to understand varying participants' intentions to learn or teach AI (Dai et al., 2020; Chai et al., 2021, 2022; 2023; Ayanwale & Sanusi, 2023). It has been established that intention is strongly linked to actual behavior (Ajzen, 2002, 2012), specifically in the context of AI education (Li et al., 2022), which further makes discerning teachers' behavioral intention to teach AI vital.

This research is necessary because of the dearth of evidence on Africa's representation in the discussions regarding AI literacy in schools (Sanusi, 2021a, b). Although studies have begun to showcase how African school-aged learners and educators can engage with AI and machine learning (Ayanwale et al., 2022; Sanusi & Olaleye, 2022; Sanusi et al., 2022c, 2023), it is crucial to recognise that these studies were primarily conducted in Nigeria, a Western African region. Given the diversity of Africa as a continent, comprising multiple countries with distinct AI needs (Sanusi & Olaleye, 2022), it becomes imperative to explore various contexts and subject areas to gain insights into how teachers in other regions, specifically Southern Africa and Namibia in this case, perceive AI. Examining perspectives from different geographical regions allows for a more comprehensive understanding of how the distinct social contexts can be harnessed to introduce AI effectively to students and support educators (Sanusi, 2021b). This research builds upon an expanding body of literature that explores teachers’ perspectives on teaching AI in schools (e.g., Ayanwale & Sanusi, 2023; Ayanwale et al., 2022) and seeks to investigate how educators across different grade levels within the compulsory education system in a Southern African nation envision the integration of AI into the school curriculum.

This paper reports the findings of a quantitative study that investigated 159 Namibian schools' in-service teachers' perceptions of teaching AI in schools. We adopted a structural equation modeling approach to understand the relationship among seven constructs of AI Anxiety, AI Readiness, AI Relevance, Attitude towards using AI, AI for Social Good, Confidence in AI and Behavioral Intention. We generated a research question based on our research aim to guide the study. The question is:

RQ. What relationship exists among the seven psychological factors to the teaching of AI?

This paper is ordered as follows. First, we introduced the focus of the study and the need to carry out the investigation, followed by a literature review section on the study context and highlighting reasons why teaching AI should be a topic of focus in the developing world. The third section presents the methodology adopted in the research, including participant description, data collection procedure and analytical process. Section four showcases quantitative and qualitative feedback findings, followed by a discussion. Then, we concluded by identifying the study's limitations and suggesting future research directions.

2 Literature review

This section reviewed related literature. We specifically discussed the growth of AI, its application, and its implementation in Namibian, including the African context. We also identify the need for more research in the developing world.

2.1 Artificial intelligence in Namibia

Recently, AI has become of interest to Namibia and its education sector. This development has led to the formation of a cost-free AI offering courses such as the Okalai project (Okalai, n.d.), the AI plug-in campus and the hosting of the UNESCO Southern Africa sub-Regional Forum on AI. Okalai project provides AI education to diverse segments of the Namibia population and students from other African countries such as Zimbabwe, Kenya, Zambia, Malawi, Angola and Mozambique. Okalai's project follows Kandlhofer et al.'s (2016) proposed approach to teaching AI concepts to people of different ages and students at varying levels of education. Thus, the project provides AI education to students from diverse backgrounds to contribute to a globally competitive AI-literate workforce (Siririka, 2022). Their AI courses seek to foster interactive learning by enabling students to take ownership of AI systems and to make such systems work for their needs and those of their communities. The Okalai project produces a globally competitive STEM (Science, Technology, Engineering and Mathematics) and AI-literate workforce.

A Finnish university plug-in campus was established at a Namibian university to offer software engineering education and coding courses (Ntinda et al., 2020). An AI course embedded in the Future Technology Lab (FTL) was also arranged and offered at this Finnish plug-in campus in Namibia, focusing on AI in education and farming (Shipepe et al., 2021). A plug-in campus is a physical extension of a base university within the premises of a host university; it makes use of the host's infrastructure to integrate the local knowledge and innovation ecosystem by emphasizing contextual innovation, collaboration and mutual interaction between the base and host university (Ntinda et al., 2020; Shipepe et al., 2021). At the FTL, students did not only learn regular AI courses. However, they learned AI applicability within the African context. Their AI topics were overtly related to the Fourth Industrial Revolution real-life opportunities such as smart countryside, IoT-controlled gardening, self-driving cars for disabled people and enhancing education by robotics (Shipepe et al., 2021).

Furthermore, in collaboration with the United Nations Educational, Scientific and Cultural Organization (UNESCO), the Government of the Republic of Namibia hosted the UNESCO Southern Africa sub-Regional Forum on AI. The forum took place on 7–9 September 2022 in Windhoek, Namibia, under the theme 'Towards a sustainable development-oriented and ethical use of AI '. Amongst other things, AI and STEM education formed part of the discussion at the forum (Sarfai, n.d.).

2.2 Snapshot of AI education at the compulsory education level in Africa

The inclusion of Africa in the discourse of AI within early childhood education through to the high school level will affirm that AI education is a global initiative. This initiative is based on the premise that Africa accounts for 16.72% of the world's population (Worldometers, 2022). The continent also accounts for the second most populous continent in the world and records the highest growth rate worldwide. A continent with the highest youth population must prepare its citizens and provide the teeming youth with opportunities to learn and develop cutting-edge technologies. In addition, as the world continues to be revolutionized with AI technologies and applications, developing countries are plagued with myriad challenges, such as uneven modernization and inequalities and the unavailability of reliable technological infrastructure. As a result, these countries must adopt innovative approaches to address the apparent challenges. A way to address this would be to equip their young citizens with the skills to meet the demands of future needs, such as teaching them AI skills and literacy. Developing countries deal with challenges in public service deliveries. Teaching AI to young generations of these countries could enable them to utilize AI to transform productivity and service delivery across the public sectors of healthcare, agriculture, education, transportation, and governance (Aly, 2020).

While there are ongoing calls for AI applications developed by Africans for Africans and research about teaching AI within the compulsory level of education (Oyelere et al., 2022), initiatives have begun to explore the learning of AI among youths in African settings. These initiatives include the work of non-governmental organizations (NGOs) and researchers. The NGOs provide platforms where young learners are introduced to the basics of AI and ML through boot camps, data camps and other enabling forums (DSN, n.d.). Researchers are exploring conceptions and perceptions of teachers (Ayanwale et al., 2022; Sanusi et al., 2022a) and students (Sanusi & Olaleye, 2022; Sanusi et al., 2022c) regarding teaching and learning of AI, respectively. More effort is required to investigate how AI knowledge can be democratized, including factors to be considered and approaches to ensure AI education in K-12 will indeed be a global initiative.

3 Hypothesis development

This section gives an overview of the hypothesis's development. Our framework was built on the theory of planned behavior. We specifically focus on AI Anxiety, Readiness, Relevance, Attitude towards using AI, AI for Social Good, Confidence in AI and Behavioural Intention.

3.1 AI anxiety

Artificial intelligence has permeated almost all facets of human life, and with this rapid development, it is appropriate to research to understand several issues that emerge along with it. AI anxiety is one of the critical issues that the proliferation of this technology brings (Ayanwale et al., 2022). It is unsurprising to see how research on AI anxiety is gaining attention nowadays (Li & Huang, 2020) because previous studies have shown how recent technological disruption has generated anxiety. For example, internet anxiety (Chou, 2003), mobile computing anxiety (Wang, 2007), and robot anxiety (Wu et al., 2014) are part of the research agenda among scholars. Indeed, AI anxiety is not peculiar to teachers alone; other stakeholders, including AI experts, have expressed how super AI may negatively impact humans (FLI, 2016; Geist, 2016). As Li and Huang (2020) revealed, AI generates several anxieties, including job replacement, which can be a common phenomenon among the working class in any context, including teachers.

Consequently, it will make sense to investigate the relationship between AI anxiety and other relevant indicators connected to users' attitudes, which may impact their technology adoption (Van der Heijden, 2004). For example, a recent study examined human resources (HR) AI anxiety and their change readiness for AI adoption (Suseno et al., 2022). Similarly, Almaiah et al. (2022) investigate the impact of AI anxiety on university students' learning in E-learning settings. While these previous studies showcased the relevance of understanding AI anxieties from different perspectives, we speculate that AI anxiety may influence teachers' readiness to adopt and use AI or integrate AI into their instruction. Specifically, this study examines the relationship between AI anxiety and AI readiness among teachers in Namibia, where AI integration in the education sector seems to witness growth recently. Therefore, we hypothesize that.

  • H1: AI anxiety significantly predicts teachers' AI readiness.

3.2 Behavioural intention

Behavioural Intention refers to a person's desire to perform or not to perform an action, that is, an intent to adopt specific behaviour in a certain way (Hidayanto et al., 2015). Studies have shown the relationship between AI anxiety and behavioural intention (Ayanwale et al., 2022; Chai et al., 2021). Notably, the study by Ayanwale et al. (2022) and Chai et al. (2021) both indicated that AI anxiety did not significantly predict behavioural intention. However, while Chai and colleagues' study was conducted in the context of secondary school students, Ayanwale et al. examined teachers' intentions in the Nigerian context. Therefore, this study examines similar phenomena to understand whether AI anxiety significantly impacts teachers' behavioural intention in Namibia. Thus, we hypothesized that.

  • H2: AI Anxiety significantly predicts teachers' behavioural intention.

3.3 AI readiness

AI readiness has been defined as the preparedness of an individual employer or organization to implement changes related to the introduction of AI technology (Frick et al., 2021). Studies to understand factors that influence the adoption of AI is growing, and AI readiness is one of the critical factors (Kelly et al., 2023). Similarly, readiness to adopt AI is increasingly studied among diverse groups such as students (Chai et al., 2020, 2021), professionals (Damerji & Salimi, 2021; Hradecky et al., 2022), and educators (Ayanwale et al., 2022). From the perspective of an organization's readiness to adopt AI was viewed from several standpoints, such as available resources, strategic plan, and users' perception (Hradecky et al., 2022). On the other hand, AI readiness has been studied among teachers and was found to be a significant factor that influences their intentions in several ways (Ayanwale et al., 2022). While the research to further understand how AI readiness influences users in a different context is growing, this study investigates the same variable on Namibian teachers' behavioural intention to teach or integrate AI in their classrooms. Therefore, this study hypothesizes that.

  • H3: AI Readiness significantly predict teachers' behavioural intention.

3.4 AI relevance

Artificial intelligence's importance is growing daily, creating a demand for knowledge even in schools in this digital era. Indeed, there is an ongoing effort to understand how different stakeholders, including teachers, understand several topics about AI (Lindner & Romeike, 2019). One of the goals of investigating AI relevance among teachers is to unravel their perception of whether to use and integrate AI in their teaching. Chai et al. (2020) articulated that AI literacy can influence students' perceived confidence and relevance of learning AI topics. Dai et al. (2020) 's study confirms that learners' AI literacy influences their readiness for AI learning. However, this study examines the teachers' perspective by examining how AI relevance influences their attitude and behavioural intention to use and integrate AI literacy in their teaching. Therefore, the hypotheses are as follows:

  • H4: AI relevance significantly predicts teachers' attitudes toward using AI.

  • H5: AI relevance significantly predicts teachers' behavioural intention.

3.5 AI for social good

Social good is an umbrella term described as "services or products that promote human well-being on a large scale" (Mor Barak, 2020, p. 139). Indeed, the social benefits of AI technology are enormous. However, several concerns about AI technology's disruption of digital space have been stressed (Huffman, 2013). Notwithstanding, it is believed that social relationships and emotional states can affect the learning process and the learner's behaviour (Dai et al., 2020). Similarly, research has shown that AI for social good predicts teachers' intention to teach AI in the classroom (Ayanwale et al., 2022). Therefore, we hypothesize that.

  • H6: AI for social good significantly predict teachers' behavioural intention.

3.6 Attitude toward using AI

Attitude refers to the degree of someone's behaviour of interest, whether favourable or unfavourable (Brezavšček et al., 2016). It remains a critical facilitating condition for humans to adopt and use technology. As a rapidly advancing technology, the attitude of educators toward using AI either for teaching or to integrate it into their curriculum is crucial and requires rigorous research (Kuleto et al., 2022; Nazaretsky et al., 2021). There is a recent move for AI in education (AIED). However, Nazaretsky et al. (2021) assert that teachers are slow in accepting to use and deploy AI in their teaching. This situation suggests that teachers' attitudes toward AI can greatly influence the successful integration of AI literacy into the school curriculum. Regardless of users' perceptions of AI, it is necessary to investigate their attitude on intention to use AI. For example, Kuleto et al., 2022 studied teachers' attitudes toward using AI and found that they perceived that AI might automate several activities and educational processes that may affect their relationship with the students. Similarly, this study examines whether teachers' attitudes towards using AI influence their behavioural intention. Thus, the hypothesis is:

  • H7: Attitude towards using AI significantly predict behavioural intention.

3.7 Confidence in teaching AI

Confidence refers to people's perceived capability to handle certain challenges. Teachers' confidence in teaching science is arguably one of the critical outcomes of teachers' professional development process. In this digital era, teachers' education must continuously integrate technology into their teaching and learning process to build more confidence required to integrate topics such as AI literacy in their classrooms (Lawless & Pellegrino, 2007). A recent study has identified teachers' lack of confidence as one major factor that limits the adoption and integration of AI in the classroom (Wang & Cheng, 2021). According to Ayanwale et al. (2022), attitude toward using AI and confidence in teaching AI are strong predictors of behavioural intention. This study examined the relationships between confidence in teaching AI and teachers' behavioural intention to investigate this phenomenon further. Thus, the study hypothesizes the following.

  • H8: Confidence in teaching AI significantly predicts teachers' attitudes toward using AI.

  • H9: Confidence in teaching AI significantly predicts teachers' behavioural intentions.

4 Methodology

4.1 Participants

Table 1 below presents the demographic information to give an overview of the kind of teachers who formed the 159 participants. The majority, 60%, were female, 38% were male, 3% preferred not to indicate their gender, and 1% were gender fluid. Most, 39% of the participants were between 21 and 30 years old, and 37% were aged between the age of 31 and 40. Ages between 41 and 50 formed 18% of the participants, while ages below 20 and above 50 formed 1% and 5%, respectively. Most, 62% of the teachers who participated holds bachelor’s degree, while 19% holds master’s degree. Diploma holders were 17.6%, and PhD holders formed the least of the participating teachers. Only less than 1% of the participants were teaching without a qualification in education. Most, 39%, were senior primary school teachers, while 21% were teaching in the senior secondary phase. Junior primary teachers formed the third highest number of participants, 18%, followed by junior secondary 15%. Advanced subsidiaries made up the least 6% of the participating teachers. Half 50% of the participants teach mathematics and science-related subjects, followed by class teaching teachers 18% and languages teachers 17%. Teachers from social sciences and commence fields formed the same, and the least 8% of the participants. Over 95% of the participants were teaching in public schools, while less than 5% of the participants were teachers in private schools. More than half, 69%, of the teachers were from urban schools, while 31% were teaching in rural schools.

Table 1 Demographic characteristics of the respondents

4.2 Instrument

The instrument employed in this study was adapted from previous research. The seven factors considered were AI Anxiety, AI Readiness, AI Relevance, Attitude towards using AI, AI for Social Good, Confidence in AI and Behavioural Intention. The items used to elicit information from the participants were scored on a Likert scale of 6- points, one being strongly disagreed and six rated strongly agree. While the items were drawn from previous TPB-supported studies on students’ learning of AI (Chai et al., 2020, 2021) and teachers' readiness in E-learning (Keramati et al., 2011), we adopted an instrument duly validated (Ayanwale & Sanusi, 2023; Ayanwale et al., 2022) and utilised to gather the perspectives of teachers on teaching AI in a context similar to our study area. Our survey had three sections which included the demography details section, the close-ended part gathering information about the teachers' disposition toward AI, and an open-ended question about teachers’ views about AI. The demography section elicits information about gender, age, the current level of education, the field of study teachers belong and the area in their school is located. The close-ended section asked the teachers to tick the 6-point-based options based on their agreement with the statements under each of the seven factors (See Appendix).

The specific items employed to gather data from the close-ended section of the survey are highlighted as follows. AI Anxiety was measured by three items with a reliability of 0.90. The items were: "I feel my heart sinking when I hear about AI advancement," "When I consider the capabilities of AI, I think about how difficult my future will be," and "I have an uneasy, upset feeling when I think about AI."

AI Readiness was measured by five items with a reliability of 0.95. The items were: "I have the relevant knowledge to teach AI in my class," "I have access to appropriate hardware to teach AI in my class," "I have access to appropriate software to teach AI in my class," "I have access to relevant content to teach AI in my class," "My school administration will support the teaching of AI in my class."

AI Relevance was measured by four items with a reliability of 0.94. The items were: "Learning AI in class will be useful," "AI content will be related to things I have seen, done or thought about in my own life," and "It is clear to me how the content of AI is related to my lifestyle," "The content of AI will be useful to me in terms of learning the concept effectively."

Attitude towards using AI was measured by three items with a reliability of 0.92. The items were: "Using AI technology is pleasant," "I find using AI technology to be enjoyable," and "I have fun using AI technology."

AI for Social Good was measured by four items with a reliability of 0.92. The items were: "AI can be used to help disadvantaged people," "AI can promote human well-being," "I wish to use AI knowledge to serve others," and "The use of AI should aim to achieve the common good."

Confidence in AI was measured by four items with a reliability of 0.94. The items were: "I am confident I can introduce the most complex material about AI in class," "I believe that I can succeed in demystifying AI for the student if I try hard enough," "I feel confident that I will support students learning of AI in my class," "I am confident I can teach the basic concepts about AI in class."

Behavioural Intention was measured by three items with a reliability of 0.95. The items were: "I will continue to learn about AI knowledge," "I will keep myself updated with the latest AI applications," and "I intend to use AI to assist my teaching."

4.3 Data collection procedure

Data were collected across Namibia’s 14 educational regions. Participants were schoolteachers irrespective of grade levels from junior primary through to advanced subsidiary. We used a convenience, non-probability sampling method to select the participated schoolteachers. Researchers presented the research ideas to the schoolteachers and subsequently shared the survey link with them via social media platforms like email, Facebook and WhatsApp. Some of the participants were approached by one of the researchers face to face and thereafter they provided their most convenient way of receiving the survey link. The rest of the participated schoolteachers were identified through their participation in previous research, schools WhatsApp groups for teachers’ continuous professional development and colleagues’ referrals identifications. This method of survey distribution presents researchers with ease of issuing the survey to participants in situations where researchers cannot meet face to face with the participants (Castro-Martín et al., 2022). A total of 159 teachers completed the survey, of which 69% are from schools in rural areas, while 31% are from schools in urban areas. The data has a representation of both public and private school teachers’ views. The participants included in our study voluntarily participated through an online survey. The instructions accompanying the survey explicitly outlined that participant, upon their consent to participate, should complete the survey with the understanding that their personal information would be handled in a strictly confidential manner. This research followed the guidelines for conducting responsible research provided by the Finnish National Board on Research Integrity (TENK, n.d.). Data was collected between April and June 2022.

4.4 Data analysis

Structural Equation Modelling and various Multigroup Analysis techniques were used with SmartPLS to analyze the data. Following the data cleansing process, we utilized SmartPLS for the data analysis in a manner that involved three separate steps. The initial test consisted of carrying out a Confirmatory Factor Analysis (CFA) by utilizing the SmartPLS algorithm to determine the items' and factors' reliability and validity. At this point in the process, we investigated the consistency of the outer loading, the cross-loading, Cronbach's Alpha, Composite Reliability, Average Variance Extracted, and the Variance Inflation Factor (VIF). In the second step of the process, we tested the model hypotheses by using bootstrapping and performing structural equation modelling through SmartPLS to examine the structural relationship between the latent variables. Ultimately, we employed multigroup analysis with SmartPLS to examine the statistical differences between male, female, rural and urban schools.

5 Results

This section presents the study findings. We specifically showed the convergent and discriminant validity of the items, including the reliability of the scale, the relationship among the construct in the model in Figs. 1 and 2 and multiple group analysis of gender and location dichotomy.

Fig. 1
figure 1

Research model

Fig. 2
figure 2

Tested hypothesis result

During the measurement process, a number of evaluations of the measurement model have been conducted, including the convergent and discriminant validity of the questionnaire, as well as the reliability of the scale, based on the criteria of Fornell and Larcker (1981); Hair et al. (2017). Accordingly, the study conducted the following preliminary test to determine whether there was an issue of multicollinearity among the variables or not, and it found that there were 1.718 to 4.863 variance inflation factors (VIF), which is less than the recommended by (Kim, 2019; Kock, 2015; Lavery et al., 2019; Marcoulides & Raykov, 2019) to be in the range of five. Second, the study examined the reliability, convergent validity, as well as discriminant validity of the model. Based on the suggestion by Hair et al., (2014, 2016, 2022); Henseler et al. (2015), this study adopted this suggestion. Essentially, convergence validity refers to the degree to which different measures of a given construct must be strongly correlated with one another, while discriminant validity refers to the extent to which two different factors are statistically distinct from each other (Anderson & Engellant et al., 2016; Henseler et al., 2009, 2015). By measuring Average Variance Extracted (AVE) values and Composite Reliability (CR) values, the convergent validity of the method was evaluated. It can be seen from Tables 2 and 3 that all factor loadings exceed 0.70, thereby satisfying the requirement recommended by Bagozzi (1981); Hair et al. (2017) that factor loadings must exceed 0.70 at all times. Additionally, the range of values of the AVE was in the region of 0.761 and 0.870. The AVE value is, therefore, acceptable, and the AVE value of all items exceeded 0.50, indicating that all items meet AVE requirements (Chin, 1998). According to Taber (2018); Hair et al. (2022), Cronbach's alpha values must be greater than 0.70; therefore, 0.845 to 0.938 is a reasonable range. Moreover, all items have good composite reliability (CR), which is measured as the degree to which items are free of arbitrary error and have predictable results, exceeding 0.70, which is the recommended level by Henseler et al., (2009, 2016); Hair et al. (2016), ranges between 0.905 and 0.953.

Table 2 Standardized loading of latent variables
Table 3 Construct reliability among latent variables

As documented in Tables 4 and 5, discriminant validity is measured according to the Fornell-Larcker criterion (FLC) and the Heterotrait-Monotrait Ratio (HTMT). For FLC to be valid, AVE must have a square root greater than the correlation between reflective constructs and all other constructs. As a result, in recent years, the HTMT has emerged as the primary criterion by which to assess discriminant validity since it provides superior performance to the Fornell-Larcker criterion assessment (Henseler et al., 2015). Accordingly, the HTMT values should not exceed 0.85 for reflective measurement models to establish discriminant validity (Henseler et al., 2015). About Table 3, the constructs in the model have been assessed for discriminant validity by the HTMT. As shown in Table 4, the AVE values of each construct are above the correlations between the constructs.

Table 4 Discriminant validity-Fornel Lackers
Table 5 Discriminant validity- Heterotrait-Monotrait Ratio (HTMT)

In contrast, the HTMT ratio values fall below the benchmark of 0.85, thus confirming the discriminant validity of the model. In general, the variables in the model are both convergent and discriminant, as well as reliable. Consequently, a structural model assessment was conducted to establish the relationship between the variables.

As shown in Table 6, among the factors influencing behavioral intention to teach AI in Namibia, AI relevance shows a positive impact on attitude towards using AI and behavioral intention (β = 0.327, t = 3.454, p < 0.05 and β = 0.182, t = 2.026, p < 0.05); AI for social good shows a positive impact on behavioral intention (β = 0.246, t = 3.123, p < 0.05); attitude towards using AI shows a positive impact on behavioral intention (β = 0.238, t = 3.409, p < 0.05); confidence in teaching AI shows positive influence on attitude towards using AI (β = 0.485, t = 4.968, p < 0.05) and confidence in teaching AI shows a positive impact on behavioral intention (β = 0.355, t = 3.788, p < 0.05). Thus, H4 through H9 are empirically supported. However, AI Anxiety and AI readiness (β = 0.060, t = 0.570, p > 0.05), AI anxiety and behavioral intention (β = -0.023, t = 0.594, p > 0.05), and AI readiness and behavioral intention (β = -0.084, t = 0.218, p > 0.05). In this regard, H1, H2, and H3 show no significant effects. Structural model analysis shows that all direct relationships are significant except H1, H2, and H3. Based on the guidelines suggested by Henseler et al. (2016), we used two-tailed p-values for statistical inferences. Thus, Fig. 1 illustrates the result of all hypotheses. The exogenous constructs' relative effect sizes (f2) showed that only confidence in teaching AI moderately impacted attitude towards using AI (Cohen & Howe, 1988), while other constructs had small effect sizes.

Table 6 Relationship between the constructs in the model

Multiple-group analysis results are presented in Table 7 for school location (rural versus urban) and gender (male versus female). AI relevance significantly impacted attitudes toward using AI differently between rural and urban (t = 1.693, 3.935, p < 0.05), as well as between males and females (t = 1.865, 2.145, p < 0.05). It also affected behavioral intention differently in rural than in urban (t = 2.519, 0.300, p < 0.05). There is a significant difference in the relationship between AI for the social good and behavioral intention in the rural and urban (t = 1.997, 2.378, p < 0.05) and male and female (t = 1.353, 3.007, p < 0.05). These findings support the alternative hypotheses. In addition, Table 6 revealed that there was a significant difference in the impact of attitude towards using AI on behavioral intention between rural and urban (t = 3.961, 1.183, p < 0.05) and male and female (t = 0.376, 3.012, p < 0.05); confidence in teaching AI impacts attitude towards using AI between rural and urban (t = 4.626, 1.425, p < 0.05) and male and female (t = 4.130, 2.936, p < 0.05) and confidence in teaching AI shows significant relationship on behavioral intention between rural and urban (t = 2.788, 1.359, p < 0.05) and male and female (t = 4.433, 2.412, p < 0.05). However, there is no significant relationship between AI anxiety on AI readiness and behavioral intention and AI readiness on behavioral intention between rural and urban (t = 1.203, 0.293, p > 0.05) and males and females (t = 0.776, 0.334, p > 0.05).

Table 7 Multiple group analysis of the variables in the model

6 Discussion and implication

Democratizing AI to include young learners has been increasingly generating interest among researchers in recent times. However, limited studies focus on the fascinating research area in the African context regarding this phenomenon. Hence the need to explore Namibian teachers’ perspectives on how they regard the teaching of AI in their schools. Further in this section, we discuss our findings following the research question guiding the study: What relationship exists among the seven psychological factors to the teaching of AI?

This study aims to identify factors that affect teachers’ disposition towards AI education and how these factors influence their intention to integrate or teach AI in the classroom. This study found that teachers’ behavioral intention to teach AI depends on a combination of factors, including the relevance of AI, attitude towards using AI, the use of AI for social good and confidence. Our TPB-supported model accounts for 73 per cent of the variance in behavioral intention to teach AI. This study’s findings align with earlier TPB-inspired research about AI learning (Dai et al., 2020; Chai et al., 2021, 2022; 2023) and AI teaching as well (Ayanwale et al., 2022). This study confirms the influence of relevance and confidence on the attitude towards AI and behavioral intention to teach AI, respectively. Thus, this result suggests that if the teachers perceive AI to be relevant to their teaching practices and have confidence in their knowledge of AI, it could positively influence their thinking about AI and motivate them to promote AI in the classroom. Consistent with past research (Ayanwale et al., 2022), AI for social good predicts intention to teach AI in school. The finding indicates that the awareness of using AI to address societal challenges and meaningfully improve people’s lives can motivate teachers to support AI teaching in schools. This move implies how AI can be used for social impact. Even their teaching practices should be made conspicuous through educational content and engagement in, for example, co-design activities.

In contrast to the finding of Ayanwale et al.’s (2022) research in the Nigerian context, AI readiness is not an antecedent of intention to teach AI. This finding connotes that even with teachers’ enthusiasm about AI in school, it does not translate to promoting the subjects in classrooms. While this finding may be surprising, it could be linked to several factors. For example, Namibian teachers are skeptical about the content knowledge, professional learning opportunities, and resources, including facilitating conditions to implement teaching and learning of AI in schools. The non-significant effect of AI anxiety on intention to teach AI agrees with earlier studies (Ayanwale et al., 2022). This scenario indicates that fear and feelings about AI are insufficient to demotivate teachers from interacting with AI (Johnson & Verdicchio, 2017) or promote AI in schools. While this is a positive finding, future studies must validate this result with different populations and further explore why anxiety does not affect intention. Further, it is unsurprising that AI anxiety could not predict AI readiness. It shows that fear of AI sophistication may lead to the unwillingness of teachers to pursue tasks related to AI learning in schools.

Concerning teachers’ perspectives along gender lines, the multigroup analysis found that pre-service teachers’ perceptions of AI relevance and attitudes toward AI are significantly influenced by gender. Specifically, the results suggest that females have a more positive attitude towards AI than males and that the impact of AI relevance on attitude is stronger for females than males. As a result of their receptivity to new technologies, females may be more open to new technologies and AI’s potential benefits. Furthermore, after studying and working, females may gain greater comfort and familiarity with AI. This finding can impact AI education and training programs, especially for teachers. To be effective in their classrooms, educators must be aware of gender differences in attitudes toward AI. In addition, the results show that gender plays a significant role in the relationship between AI for social good and behavioral intention to teach AI. A higher mean score was found among female pre-service teachers, suggesting they may have a positive attitude towards AI for social good and a stronger intention to teach it than their male counterparts. A possible explanation might be that females are more interested in AI’s potential to solve real-world problems and its social impact. This direction may lead to a greater appreciation for AI for social good and a stronger intention to teach AI to contribute to positive social change. In contrast, males may be more focused on the technical aspects of AI and its potential for innovation, which may be less related to social impact.

Additionally, it was revealed that there is a significant impact of gender on the relationship between attitude toward using AI and behavioral intention to teach AI among pre-service teachers. Specifically, the results suggest that female pre-service teachers had a higher mean score in this regard than their male counterparts. This comparison might be because female pre-service teachers may be more open to using innovative technologies in their teaching practices than males. This finding aligns with Alvarez et al. (2022), whose study revealed that female participants possess a significantly higher increase in AI teaching content and are more confident with computer science than males. Various factors may contribute to this study outcome, such as greater comfort with technology or greater awareness of its potential benefits. The findings have significance for integrating AI into student programs and teacher training programs, regardless of the reasons behind the gender difference. Furthermore, pre-service teachers’ gender plays a significant role in the relationship between confidence and attitude toward teaching AI, with males scoring higher. Compared to female pre-service teachers, male counterparts are more confident about their ability to teach AI and are more enthusiastic about using AI. Social norms and gender stereotypes exist in artificial intelligence that explains this difference. Male pre-service teachers may feel more confident and comfortable teaching AI because AI has traditionally been viewed as male dominated (Cernadas and Calvo-Iglesias, 2020). Despite this, pre-service teachers should be provided with the necessary knowledge and skills to teach AI, regardless of gender. A more inclusive and diverse learning environment could also be created by addressing gender bias and stereotypes related to artificial intelligence. Regarding the location dichotomy, consistent with the study of Sanusi and Olaleye (2022), which focused on students learning AI, this study established the difference between teachers in urban vs rural areas.

Our findings have implications for practice and policy. This study identified the relevance of AI, attitude towards the use of AI, AI for social good and confident as important factors to be considered in integrating AI into Namibian compulsory education curriculum and schools. How do we then address these factors in the implementation process? These factors could be considered by establishing links with the relevance of AI to teachers’ teaching practices and their value for their students. Professional learning programs designed with hands-on and engaging approaches, including contextualized materials, could be a way to achieve this. Introducing teachers to AI content and engaging them with related activities, which helps to increase their knowledge of the subject, may positively affect their attitude towards AI, boost their confidence and increase their awareness of using AI for social good. Teachers should be co-designers of AI curricula since they drive the AI teaching and learning process and they are core implementers of educational curricula (Ayanwale et al., 2022; Yau et al., 2022a, b). Teachers place a slightly higher value on educational stakeholders' socio-cultural and technical knowledge about AI than on pure application-oriented competencies (Lindner & Romeike, 2019). As such, it is imperative to identify the psychological support the educators need to successfully implement AI in classrooms. Terzi (2020) argues that AI offers powerful pedagogical tools that can help enhance instructional quality which contributes to why teachers need to be onboard with learning and using AI. Teachers’ readiness to teach and facilitate AI-related learning could determine AI integration in classroom education. To this end, we believe that the findings of this research will be helpful to program designers and policymaker to understand the factors that would contribute to the implementation of AI education in Namibian schools.

7 Limitations and future research

Like any other research, this study has limitations on which we based the recommendations for future research. First, the 159 participating teachers are very few compared to the estimated 30 995 teachers Namibia had in 2022 (Beukes, 2022). Thus, the findings represented in this research may only partially reveal the views of some Namibian teachers. Similar research may be conducted with a high population of teachers to give a broader view of the topic. Second, we only relied on teachers’ self-reported responses to our measuring scale to examine teachers’ perceptions of AI. Future research should collect qualitative data to provide more understanding of how teachers perceive AI. Third, this study needed to assess the teacher’s perspective towards AI more specifically. Future research may assess this topic, such as teachers’ perspective on AI as a teaching and learning tool that supports and enhances education. Others may research AI as a school subject or a cross-curricular topic targeted for learning. Future research may further focus on integrating AI in professional learning initiatives and teacher training curricula to ensure teachers learn the AI content they will teach.