Prev: HW3, Next: HW5 

# Warning: auto-grading is not working at the moment, please wait for an announcement on Canvas.


# A4 Project Submission Checklist

📗 Regular component (out of 5) should be submitted using the "Grade" and "Submit" buttons at the bottom of the page.
➩ Submission of the text file generated by the auto-grader to Canvas Assignment A4 is optional.
➩ Due date: August 9, no submission after that will be accepted.
📗 Competition component (out of 5) text file generated using Question 9 "Generate" button should be submitted to the Canvas Assignment A4C: Link
➩ Submission of an incorrectly formatted text file and any additional files to A4C will result in a competition score of \(-\infty\).
➩ Due date: July 7, no submission after that will be accepted under any circumstances.
📗 Note: Canvas A4 and A4C due date is the recommended due date, early submissions of competitions before the recommended due date will participate in trial competitions with the option to keep the score (not ranking).
📗 Hint: example submissions, discussion session schedules, and group recommendations (very different for different assignments) can be found on Piazza: Link.

# A4 Project Instruction

📗 Enter your ID (the wisc email ID without @wisc.edu) here: and click (or hit the "Enter" key)
📗 You can also load from your saved file
and click .
📗 If the questions are not generated correctly, try refresh the page using the button at the top left corner.
📗 The same ID should generate the same set of questions. Your answers are not saved when you close the browser. You could either copy and paste or load your program outputs into the text boxes for individual questions or print all your outputs to a single text file and load it using the button at the bottom of the page.
📗 Please do not refresh the page: your answers will not be saved.
📗 You can write the code in any programming language and using any large language models. You do not have to submit your code.
📗 Please report any bugs on Piazza.

# Warning: please enter your ID before you start!


CP


📗 (Introduction) In this project, you will activate a simple convolutional neural network to classify hand-written digits of an alien language (base 8). You will then use the networks will figure out what the digits in their language looks like by using gradient descent on the network.

📗 (Part 1) Implement the activation of a simple convolutional neural network with 1 convolution layer, 1 pooling layer, and 1 fully connected layer.

Test network (one convolution layer with 3 activation maps and 5 by 5 filters, one average pooling layer with 4 by 4 filters, and one hidden fully connected layers with 100 units, then softmax output layer with 8 units for digits (0 to 7):




📗 (Part 2) Start with a random image, use projected gradient descent on the image to find an image that represents a typical image of every digit. In adversarial machine learning, this is called projected gradient descent attack.

Test images for Part 1 and Part 2:



Item: out of 0

📗 (Competition) Submit your decoded images, and your score will be based on how close your decoded images are from the original images used to train the network and your contribution to your group (you will get bonus scores for each digit you decode correctly of 1 over the number of students in your group that decoded the same digit correctly). The group will get a bonus for digits being decoded correctly by any member.

Suppose \(x_{k}\) is your submission for digit \(k\) and \(x^\star_{k}\) is the true image of the digit \(k\). Let \(f_{i}\) be the convolutional neural network for group \(i\), and \(n_{i k}\) is the number of students in group \(i\) who decoded digit \(k\) correctly, i.e. \(\left\|\text{round} \left(x_{k}\right) - x^\star_{k}\right\|_{\infty} \leq 50\) (less than 50 pixels are predicted incorrectly). Then your score is given by the following,
➩ \(-\displaystyle\sum_{k=0}^{9} \left\|f_{i}\left(x_{k}\right) - I_{k}\right\|_{2} + \displaystyle\sum_{k=0}^{9} \dfrac{k}{n_{i k}} 1_{\left\{\left\|\text{round} \left(x_{k}\right) - x^\star_{k}\right\|_{\infty} \leq 50\right\}} + 10 \displaystyle\sum_{k=0}^{9} 1_{\left\{n_{i k} > 0\right\}}\)
that is,
➩ Your score is higher if your images indeed are classified as \(\left\{0, 1, 2, ..., 9\right\}\) with higher certainty.
➩ You get a bonus if at least one of your group members guesses each digit perfectly. If there are multiple possible ways to write a certain digit, you should consider coordinating submitting different images.
➩ You get a bonus if you are among the few people who guess each digit perfectly.

You can join one of three groups to decode three alien languages.
➩ Group 0 [Easy]:

➩ Group 1 [Medium]:

➩ Group 2 [Hard]:


Your project grade is based on your submission to this assignment (out of 5) plus your ranking in the class (out of 5):
Top 20% gets 5/5.
Next 20% gets 4/5.
Next 20% gets 3/5.
Next 20% gets 2/5.
Next 20% gets 1/5.
(The students who do not participate in the competition will be given scores of negative infinities when computing the rankings).

# Competition Simulator [DO NOT USE FOR TESTING]


Ground truth:



Submissions:


Leader board:
Digit:
Team:

# Question 1 (Part 1)

📗 [5 points] For the test images, compute the convolution with the first filter (\(n\) lines and \(m_{0} \times m_{0}\) numbers on each line, rounded to 4 decimal places). Ignore the activation function and the bias term for this question.
The first filter is this one: .
Hint




# Question 2 (Part 1)

📗 [5 points] For the test images, compute the first activation map after the average pooling layer (\(n\) lines and \(m_{1} \times m_{1}\) numbers on each line, comma separated, rounded to 4 decimal places). Ignore the activation function and the bias term in the previous layer for this question.
Hint




# Question 3 (Part 1)

📗 [10 points] For the test images, compute all activation units after the pooling layer (\(n\) lines and \(m_{2}\) numbers on each line, comma separated, rounded to 4 decimal places). For the remaining questions, please use the correct activation functions and biases for the convolution layer.
Hint




# Question 4 (Part 1)

📗 [10 points] For the test images, compute all the output unit values (\(n\) lines and \(k\) numbers on each line, comma separated, rounded to 4 decimal places).
Hint




# Question 5 (Part 1)

📗 [1 points] For the test images, find the digit (\(0\) to \(k - 1\)) they are the closest to (\(n\) integers between \(0\) and \(k - 1\) in one line, comma separated).
Hint




You can use the following tool to activate and visualize the test network:
Network:
Image:

Activation:

# Question 6 (Part 2)

📗 [5 points] Write down the derivatives (approximate or exact) of the probability that the images are classified as digit 0 with respect to every pixel (\(n\) lines and \(m_{0} \times m_{0}\) numbers on each line, comma separated, rounded to 2 decimal places).
Hint




# Question 7 (Part 2)

📗 [1 points] For the test images, increase or decrease every pixel by \(\varepsilon\) = 0.1 depending on the sign of the derivatives. Remember to clamp the pixel values between \(0\) and \(1\) after the update. (\(n\) lines and \(m_{0} \times m_{0}\) integers (either 0 or 1) on each line, comma separated).
Hint




# Question 8 (Part 2)

📗 [5 points] For the images from the previous question, compute all the output unit values (\(n\) lines and \(k\) numbers on each line, comma separated, rounded to 4 decimal places).
Hint




If you are interested in how the three CNNs are generated, you can try the following demo:
➩ Generate eight random images ( cubic Bezier curves connecting random points).


➩ Add Gaussian noise with \(\sigma\) = to these images to get a training set of \(n\) = images.
➩ Train the network on these images
Trained CNN:

Output on original images:


# Question 9 (Competition)

📗 [1 points] Please use the following form to generate a text file:
➩ Wisc Net ID (the ??? in ???@wisc.edu):
➩ Group:
➩ Player Icon (text from this icon):
➩ Player ID (a number between 0 and 9999):
➩ Images First Guess (10 lines, 1024 numbers per line):

➩ Images Second Guess (0-10 lines, 1024 numbers per line):


➩ Output file:

📗 Every student must perform training independently and submit different trained networks.
📗 Submit this file on Canvas to Assignment A?C.
📗 To get the point to this question, please check this box if you submitted the file on Canvas or decided not to participate in the competition:

# Question 10

📗 [1 points] Please list the AI tools and references you used and the names of other students and course staff you discussed the assignment or competition with. Please also enter any comments and suggestions including possible mistakes and bugs with the questions and the auto-grading. If you completed the assignment without any help (not recommended), please enter "None" and do not leave this question blank.
📗 Answer: .

# Grade


 * * * *

 * * * * *
📗 Grading may take around 5 to 10 seconds. Please be patient and do not click "Grade" multiple times.

# Submission

 
📗 Please do not modify the content in the above text field: use the "Grade" button to update.


📗 You could submit multiple times (but please do not submit too often): only the latest submission will be counted. 
📗 Please also save the text in the above text box to a file using the button or copy and paste it into a file yourself .
📗 You could load your answers from the text (or txt file) in the text box below using the button . The first two lines should be "##a: 4" and "##id: your id", and the format of the remaining lines should be "##1: your answer to question 1" newline "##2: your answer to question 2", etc. Please make sure that your answers are loaded correctly before submitting them.



📗 Saving and loading may take around 5 to 10 seconds. Please be patient and do not click "Load" multiple times.

# Presentations and Interviews

📗 Presentations and interviews are optional for the competitions.
📗 If your competition grade is 2, 3, or 4, you can book an interview with the TA for 15 to 30 minutes.
📗 Interviews can only be booked during discussion sessions on Zoom (either during the current discussion session or for a future date and time): Link. Please do not email/spam the TA.
📗 A maximum of 3 interviews can be booked per person, and in the case you need 1 point for the next letter grade, we will allow a 4th one after the final exam.
📗 During the interviews, you will give a 5 to 10 minutes presentation to explain anything you did on the project that is creative or technically challenging. Then you will answer three technical questions about your presentation or any materials related to the assignment.
➩ If you answer any one of the three questions incorrectly, you will get \(-1\).
➩ If you answer all questions correctly, and if your presentation ideas are correct, interesting, consistent with your submissions, and not done by many other students (we will make the decision after all interviews are done), you will get \(+1\). 
➩ Otherwise, your grade will not change.





Last Updated: June 26, 2026 at 3:06 AM