1. Homepage
  2. Programming
  3. COMP3411/9814 24T3 Artificial Intelligence - Assignment 1: Artificial neural networks

COMP3411/9814 24T3 Artificial Intelligence - Assignment 1: Artificial neural networks

Engage in a Conversation
UNSWCOMP3411COMP9814Artificial IntelligenceArtificial neural networksPython

COMP3411/9814 24T3 Artificial Intelligence CourseNana.COM

Assignment 1 - Artificial neural networks CourseNana.COM

Due: Week 5, Friday, 11 October 2024, 5pm. CourseNana.COM

1 Problem overview CourseNana.COM

In this assignment, you will use artificial neural networks for drought modelling in the Murray-Darling Basin. You will conduct two tasks: CourseNana.COM

(a) A classification task to predict whether there is ‘a drought’ or ‘no drought’ based on the climate conditions. CourseNana.COM

(b) A regression task to predict the intensity of a drought based on the climate conditions. CourseNana.COM

The Murray-Darling Basin is a very important agricultural region in Australia that produces a large portion of the nation’s food and fibre (see Fig. 1). It is a big river system that supports many different types of crops and live- stock, making it essential for Australia’s food production. However, the basin is very prone to droughts, which can greatly affect water availability and agricultural productivity, threatening the stability of the food system. Because of this, there is a lot of interest in monitoring drought conditions in the Murray-Darling Basin to manage water resources effectively. CourseNana.COM

Figure 1: Location of the Murray-Darling Basin and illustration of grid cells within the basin. CourseNana.COM

2 Dataset CourseNana.COM

The climate data used in this assignment is derived from the ERA5 cli- mate dataset. ERA5 data covers the globe and combines surface observa- tions, satellite measurements, and weather balloons, using advanced numeri- cal weather prediction models and data assimilation methods. The data you will use has been extracted from the ERA5 global dataset for the Murray- Darling Basin in Australia. The data has been processed to provide monthly values of several climate variables associated with droughts and covering the years from 1979 to 2020. The original ERA5 dataset is publicly available and consists of more than 200 terabytes. However, the datafile provided for this assignment in Climate SPI.csv has been specifically derived and cannot be downloaded from anywhere else. CourseNana.COM

Climate predictors and additional attributes CourseNana.COM

Table 1: List of variables included in data file Climate SPI.csv. CourseNana.COM

Variable Description CourseNana.COM

mn2t msl mx2t q CourseNana.COM

t
t2
tcc
u
u10
v
v10
z month year grid ID SPI
CourseNana.COM

Minimum temperature at 2 meters (°K) Mean sea level pressure in (Pa) Maximum temperature at 2 meters (°K) specific humidity (kg kg-1) CourseNana.COM

Average temperature at Pressure level 850 hPa in (°K) Average temperature at 2 m in (°K)
Total cloud cover (0-1)
U wind component at pressure level 850 hPa (ms-1)
CourseNana.COM

U wind component at 10 m (ms-1)
V wind component at Pressure level 850 hPa (ms-1) V wind component at 10 m (ms-1)
Geopotential (m2s-2)
1 to 12
1979 to 2020
The ID of the grid cell
Standardised Precipitation Index (unitless)
CourseNana.COM

The data file Climate SPI.csv contains climate data for 30 grid cells. Each grid cell is represented as a single square within the boundaries of the basin, as shown in Fig. 1. In the data file, each row, or sample, corresponds to a grid cell identified by grid ID, and contains: CourseNana.COM

  • Time information: year, month. CourseNana.COM

  • A set of climate variables represented by acronyms: mn2t, msl, mx2t, q, t, t2, tcc, u, u10, v, v10, and z. The description and unit of measurement for each of these variables are provided in Table 1. A time series plot of each of these variables for a single grid is shown in Fig. 2 to help you visualise these variables. CourseNana.COM

A drought index: SPI. CourseNana.COM

Figure 2: Time series of the climate variables for a single grid cell. CourseNana.COM

2.2 Target variable CourseNana.COM

The drought index SPI (Standardised Precipitation Index) is used here as a proxy to characterise the intensity of drought caused by precipitation defi- ciency. Very low SPI values suggest intense drought, while very high values indicate very wet conditions. In the regression task, SPI is your target vari- able, and you need to predict it based on the climate variables. In the classi- fication task, you will calculate a binary target variable ’Drought’ from SPI. The ’Drought’ variable will be 1 to indicate the occurrence of drought and 0 to indicate no drought. You will apply a threshold of -1 to SPI, where values below or equal to this threshold indicate drought conditions (i.e. Drought = 1); otherwise, there is no drought (i.e. Drought = 0). A time series plot of SPI for a single grid cell is shown in Fig. 3. Periods where SPI falls below or is equal to -1 indicate periods of drought. CourseNana.COM

Figure 3: Time series of the drought index SPI for a single grid cell. Periods where SPI falls below or is equal to -1 indicate periods of drought. CourseNana.COM

2.3 Data cleansing CourseNana.COM

Next is the description of the classification and regression tasks. You can treat each task separately. Do not use ’year’ and ’Grid ID’ for either task. Additionally, you cannot use ‘Drought’ and ‘SPI’ as predictors for either task. For both tasks, you will need to create your artificial neural network using Keras and TensorFlow packages. Before you start solving the tasks, please carefully read the entire assignment description, including how to submit your assignment. CourseNana.COM

3 Classification task CourseNana.COM

In this classification task, the goal is for the neural network to predict whether there is a drought or no drought based on climate data predictors. A complete script should include all the steps below, along with any additional necessary steps: CourseNana.COM

(a) Calculate ‘Drought’ from ‘SPI’ by setting a threshold of -1 for the ‘SPI’ values. CourseNana.COM

(b) Split your data into training, validation and test sets. 5 CourseNana.COM

(c) Pre-processing: Apply any necessary transformation to the training set, then apply the same transformation to the validation and test sets. Keep record of all applied transformations. CourseNana.COM

  1. (d)  Build your model by defining its architecture, and hyperparameters. This includes: loss function, optimiser, batch size, learning rate, and number of epochs. It is recommended that your network has fewer parameters than the number of samples divided by 10. CourseNana.COM

  2. (e)  Train the neural network and monitor the evolution of the loss values. CourseNana.COM

3.1 Evaluate model performance on validation set CourseNana.COM

(f) Createaplotshowingtheaccuracy(y-axis)versusthenumberofepochs (x-axis) for both the training and validation sets. CourseNana.COM

3.2 Optimise your neural network CourseNana.COM

  1. (g)  Repeat steps d), e), and f) to find the best neural network configuration. CourseNana.COM

  2. (h)  Build and train your model on different subsets of climate predictors. Use the subset of climate predictors that achieve the best outcome based on the validation set. CourseNana.COM

3.3 Evaluate your classification model on test set CourseNana.COM

  1. (i)  Applythesametransformationstothetestsetasyoudidtothetraining set. CourseNana.COM

  2. (j)  Use your model to predict the class on the test set. CourseNana.COM

  3. (k)  Evaluate the performance of your model using sklearn and/or creating your own functions: CourseNana.COM

    Compute and plot a confusion matrix. Note that your positive class is 1, i.e. ‘Drought’. CourseNana.COM

    Calculate and print “Balanced Accuracy” and “Precision”.  CourseNana.COM

Additional notes (apply to both tasks) CourseNana.COM

You need to set the random seed to ensure that your results are repro- ducible. CourseNana.COM

You must save your model. CourseNana.COM

In step f), you only need to show the plot(s) for the best neural network configuration and the chosen predictors. CourseNana.COM

If you choose to use ‘month’ as a predictor, encode it using cyclic en- coding to ensure that your neural network understands the relationship between December and January. To achieve this: CourseNana.COM

Normalise the month to the range [0, 2π] using: month normalised = 2π× (month - 1)/12. CourseNana.COM

Replace ’month’ with two new predictors: ‘cos(month normalised)’ and ‘sin(month normalised)’. CourseNana.COM

Regression task CourseNana.COM

In this regression task, the goal is for the neural network to predict the inten- sity of the drought, represented by ‘SPI’, based on climate data predictors. A complete script should include all the steps below, along with any additional necessary steps. CourseNana.COM

  1. (a)  Split your data into training, validation and test sets. CourseNana.COM

  2. (b)  Pre-processing: Apply any necessary transformation to the training set, then apply the same transformation to the validation and test sets. Keep record of all applied transformations. CourseNana.COM

  3. (c)  Build your model by defining its architecture, and hyperparameters. This includes: loss function, optimiser, batch size, learning rate, and number of epochs. it is recommended that your network has fewer parameters than the number of samples divided by 10. CourseNana.COM

  4. (d)  Train the neural network and monitor the evolution of the loss values. CourseNana.COM

4.1 Evaluate model performance on validation set CourseNana.COM

Assess the model’s performance over the epochs by creating a plot showing the loss value (y-axis) versus the number of epochs (x-axis) for both the training and validation sets. CourseNana.COM

4.2 Optimise your neural network CourseNana.COM

Repeat steps c), d), and e) to find the best neural network configura- tion. CourseNana.COM

Build and train your model on different subsets of climate predictors. You may start with the same set of predictors that achieved the best outcome in the regression task. CourseNana.COM

4.3 Evaluate your regression model on test set CourseNana.COM

Applythesametransformationstothetestsetasyoudidtothetraining set. CourseNana.COM

Use your model to predict SPI on the test set. CourseNana.COM

Evaluate the performance of your model using sklearn and/or scipy metrics: CourseNana.COM

  • Create a scatter plot showing predicted SPI (y-axis) versus true SPI (x-axis). CourseNana.COM

  • Calculate and print “Mean Absolute Error (MAE)” and the “Pear- son Correlation Coefficient” between the true and predicted SPI. CourseNana.COM

    Evaluating your work on a new dataset CourseNana.COM

In addition to the scripts you wrote for the classification and regression tasks, you need to prepare a script to evaluate your model on new data. The new data will be formatted exactly like Climate SPI.csv, so you can assume Climate SPI.csv is the new data for now. Your script should include all the steps below, along with any additional necessary steps. CourseNana.COM

5.1 Evaluating your classification model on a new dataset CourseNana.COM

  1. (a)  Load Climate SPI.csv. CourseNana.COM

  2. (b)  Calculate ‘Drought’ from ‘SPI’ by setting a threshold of -1 for the ‘SPI’ values, where values below or equal to this threshold indicate drought conditions (i.e. Drought = 1); otherwise, there is no drought (i.e. Drought = 0). CourseNana.COM

  3. (c)  Apply the same transformations to the new data as you did to the training set in the classification task. CourseNana.COM

  4. (d)  Load your classification model. CourseNana.COM

  5. (e)  Use your model to predict the class ‘Drought’ on the new data. CourseNana.COM

  6. (f)  Compute and plot a confusion matrix. CourseNana.COM

  7. (g)  Calculate and print “Balanced Accuracy” and “Precision”. CourseNana.COM

  8. (h)  Print the number of samples and your model’s predictors set. CourseNana.COM

You must demonstrate a complete understanding of the code and analysis during the discussion. CourseNana.COM

5.2 Evaluating your regression model on a new dataset CourseNana.COM

  1. (a)  Load Climate SPI.csv. CourseNana.COM

  2. (b)  Apply the same transformations to the new data as you did to the CourseNana.COM

    training set in the regression task. CourseNana.COM

  3. (c)  Load your regression model. CourseNana.COM

  4. (d)  Use your model to predict ‘SPI’ on the new data. CourseNana.COM

  5. (e)  Create a scatter plot to show predicted SPI (y-axis) versus true SPI (x-axis). CourseNana.COM

  6. (f)  Calculate and print “Mean Absolute Error” and the “Pearson Correla- tion Coefficient” between the true and predicted SPI. CourseNana.COM

(g) Print the number of samples and your model’s predictors set. CourseNana.COM

You must demonstrate a complete understanding of the code and anal- ysis during the discussion. CourseNana.COM

6 Testing and discussing your code CourseNana.COM

As part of the assignment evaluation, your code will be tested by tutors along with you in a discussion session carried out in the tutorial session. The assignment has a total of 25 marks. The discussion is mandatory and, therefore, we will not mark any assignment not discussed with tutors. CourseNana.COM

You are expected to propose and build neural models for classification and regression tasks. You will receive marks for each section as shown in Table 2. For marking your results, you should be prepared to simulate your neural model with a generalisation set we have saved apart for that purpose. CourseNana.COM

You will receive 1 mark for code readability, and your tutor will also give you a maximum of 8 marks for each task depending on the level of code understanding as follows: 8. Outstanding, 6. Great, 4. Fair, 2. Low, 0. Deficient or No answer. CourseNana.COM

7 Submitting your assignment CourseNana.COM

The assignment must be done individually. You need to submit your solution on Moodle. Your submission must include: CourseNana.COM

  • A single Jupyter notebook (.ipynb). CourseNana.COM

  • The trained models for both the classification task and the regression CourseNana.COM

    task. CourseNana.COM

    The first line of your Jupyter notebook should display your full name and your zID as a comment. The notebook should contain all the necessary code for reading files, data preprocessing, network architecture, and result evaluations. Additionally, your file should include short text descriptions to help markers better understand your code. Please be mindful that providing clean and easy-to-read code is a part of your assignment. CourseNana.COM

    You can submit as many times as you like before the deadline – later submissions overwrite earlier ones. After submitting your file a good practice is to take a screenshot of it for future reference. CourseNana.COM

Criteria CourseNana.COM

Table 2: Marking scheme for the assignment. CourseNana.COM

Classification Task CourseNana.COM

Marks CourseNana.COM

1 mark 1 marks CourseNana.COM

1 mark 1 marks CourseNana.COM

Plot of the accuracy (y-axis) versus the number of epochs (x- axis) for both the training and validation sets.
Performance metrics “Balanced Accuracy” and “Precision” cal- culated on the test set.
CourseNana.COM

Confusion matrix on the unseen data.
“Balanced Accuracy” and “Precision” on the unseen data. Demonstrate complete understanding of the code and analysis during discussion.
CourseNana.COM

Regression Task CourseNana.COM

A plot showing the loss value (y-axis) versus the number of epochs (x-axis) for both the training and validation sets. Create a scatter plot showing predicted SPI (y-axis) versus true SPI (x-axis) based on the test set. CourseNana.COM

“Mean Absolute Error (MAE)” and the “Pearson Correlation Coefficient” between the true and predicted SPI.
A scatter plot showing predicted SPI (y-axis) versus true SPI (x-axis) based on the unseen dataset.
CourseNana.COM

Demonstrate complete understanding of the code and analysis during discussion. CourseNana.COM

Code understanding and discussion CourseNana.COM

Overall code readability including tidy and well-commented script CourseNana.COM

Total marks CourseNana.COM

25 marks CourseNana.COM

Late submission penalty: UNSW has a standard late submission penalty of 5% per day from your mark, capped at five days from the as- sessment deadline, after that students cannot submit the assignment. CourseNana.COM

8 Deadline and questions
Deadline: Week 5, Friday 11 October 2024, 5pm. Please use the forum CourseNana.COM

on Moodle to ask questions related to the assignment. We will prioritise 11 CourseNana.COM

8 marks CourseNana.COM

1 marks CourseNana.COM

8 marks CourseNana.COM

CourseNana.COM

questions asked in the forum. However, you should not share your code to avoid making it public and possible plagiarism. If that’s the case, use the course email cs3411@cse.unsw.edu.au as alternative. CourseNana.COM

Although we try to answer questions as quickly as possible, we might take up to 1 or 2 business days to reply, therefore, last-moment questions might not be answered timely. CourseNana.COM

For any questions regarding the discussion sessions, please contact directly your tutor. You can have access to your tutor email address through Table 3. CourseNana.COM


Table 3: COMP3411/9814 24T2 Tutorials CourseNana.COM

Your program must be entirely your own work. Plagiarism detection software might be used to compare submissions pairwise (including submissions for any similar projects from previous years) and serious penalties will be applied, particularly in the case of repeat offences. CourseNana.COM

Do not copy from others. Do not allow anyone to see your code. CourseNana.COM

Please refer to the UNSW Policy on Academic Honesty and Plagiarism if you require further clarification on this matter. CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
UNSW代写,COMP3411代写,COMP9814代写,Artificial Intelligence代写,Artificial neural networks代写,Python代写,UNSW代编,COMP3411代编,COMP9814代编,Artificial Intelligence代编,Artificial neural networks代编,Python代编,UNSW代考,COMP3411代考,COMP9814代考,Artificial Intelligence代考,Artificial neural networks代考,Python代考,UNSWhelp,COMP3411help,COMP9814help,Artificial Intelligencehelp,Artificial neural networkshelp,Pythonhelp,UNSW作业代写,COMP3411作业代写,COMP9814作业代写,Artificial Intelligence作业代写,Artificial neural networks作业代写,Python作业代写,UNSW编程代写,COMP3411编程代写,COMP9814编程代写,Artificial Intelligence编程代写,Artificial neural networks编程代写,Python编程代写,UNSWprogramming help,COMP3411programming help,COMP9814programming help,Artificial Intelligenceprogramming help,Artificial neural networksprogramming help,Pythonprogramming help,UNSWassignment help,COMP3411assignment help,COMP9814assignment help,Artificial Intelligenceassignment help,Artificial neural networksassignment help,Pythonassignment help,UNSWsolution,COMP3411solution,COMP9814solution,Artificial Intelligencesolution,Artificial neural networkssolution,Pythonsolution,