Thursday, March 24, 2016

STEM Team 2: Machine Learning Seminar Presentation

Adnan Khan
3/24/16

Click "LINK" below for to see the Machine Learning Seminar presentation from March, 24th, 2016:

LINK


Sunday, March 13, 2016

Coursera: Machine Learning Course: Notes #1

Coursera: Machine Learning Course: Notes


Sections:


Why you should learn machine learning with us:

  - Learn about: Applications of machine learning, how to build machine learning systems, how the algorithms behind machine learning work and how to build these algorithms.
  - Old view of ML (Machine Learning):
    - Start with data sets
    - Feed data to ML algorithms
    - Show data relationships
    - Publish results
  - Many intelligent applications are using ML: successful companies such as Google, Amazon, Netflix all use machine learning for at least one aspect of their functions. These are disruptive companies: These companies change the established market.
    - Examples:
    - Product recommendations used by Amazon. This disrupts the retail market.
    - Movie recommendations used by Netflix. This disrupts movie theater business.
    - Smart advertisement choice used by Google.
  - ML helps disrupt the markets: This disruption is positive for the consumer as it helps the consumer acquire the product more efficiently.
  - ML pipeline:
    - Data set   --->   Algorithm ----> Intelligent output

 1 - Predicting house pricing:
    - Try to find the value of house with an unknown value (off the market).
    - House value derived from data: Look at other house sales and the associated data and apply this information to the house of unknown value.
    - Data sets based on different features of the house.
    - ML Method: Create a relationship, such as a linear regression: Relate the house attributes to sales price. Then use relationship to predict price for house of unknown value.


     - ML Method = Regression


 2 - Sentiment analysis: Restaurant review:
    - Acquire review with both positive and negative feedback.
    - Use previous data sets of reviews that have been categorized based on positive and negative feedback.
    - ML Method: Compare positive and negative feedback to get an overall conclusion on the unknown review.


    - ML Method = Classification


 3 - Document retrieval:
    - Select an article or book that would be of interest to the reader or consumer.
    - Data set is large collection of all possible books that could be recommended for reader.
    - ML Method: Distinguish data by finding structure in data: Divide data into groups of related articles: genres. Infer genre of article or book that is to be recommended.


    - ML Method = Clustering


  4 - Product recommendation:
    - Select a product that is to be recommended to the consumer or buyer.
    - Data set includes past purchases. Use past purchases to infer future purchases.
    - ML Method: Find relationship between what consumer bought before and what consumer is likely to buy in the future. Use other consumer's purchase histories to infer another buyer's recommended products.
    - Customers compared to products matrix created. Shows which products were actually purchased from previous recommendations: Learn features of the consumer and features of the product: Compare interests.


    - ML Method = Matrix Factorization


 5 - Visual product recommender
    - Data set: inputted images to search from. From original images, new images are found with visual similarities.
    - To find new images, distinguishable features must be found in the images so they can separated.
    - ML Method: Look at neural-networks to find more and more features with increasing precision in differences.


    - ML Method = Deep Learning


Monday, February 29, 2016

Camera Field of View Calculator

Progress Report #11
Adnan Khan
2/29/16


Below is the link to the field of view calculator for the camera used in the initial tests.
The camera used is that of the Samsung Galaxy S4:

Calculator File

Download the file from Google Drive to get the original Excel file.

Guide:
- The calculator is divided into the vertical and horizontal components of the camera's field of view:
- Vertical Theta = vertical field of view angle.
- Vertical Distance = Distance between camera and edge of compound eye frame. One image is taken with the camera facing up on top of the octagon face and the other is slanted on one of the trapezoid faces.
- Vertical Distance X = Distance until the field of view of the two spot image capture locations meet vertically.
- Horizontal Theta = horizontal field of view angle.
- Horizontal Distance = Distance between camera and edge of compound eye frame. One image is taken while slanted on one of the trapezoid faces and the other is taken while slanted on an adjacent trapezoid face.
- Horizontal Distance X = Distance until the field of view of the two spot image capture locations meet horizontally.

Analysis:
- The results given by the calculator make much more sense than my calculations by hand. The calculator's results match the images taken in the initial tests.
- By creating the calculator, I was able to realize the mistake I had made when solving for the Distance X by hand. My conversions between degrees and radians had produced an incorrect result originally. The calculator, however, is able to deliver the correct resulting Vertical and Horizontal Distance X.

Tuesday, February 9, 2016

Progress Report #10

Progress Report #10
Adnan Khan
2/9/16

Progress:
- Completed construction of compound eye frame:


All frame pieces created and ready to be combined

Side view of completed frame:
Red annotations show 120° dihedral angle between the trapezoid sides and the octagon face.


Angled view of completed frame

- Initial images taken using the compound eye frame. The images were captured with a Samsung Galaxy S4 cellphone. The eight images taken via the trapezoidal sides were then combined to display a single image that would simulate the image captured from a eye. The image captured from the top octagon face is shown at the bottom and is detached from the other images.


There are large blind spots between the octagon face image and the trapezoid frame images.
The blind spots are due to the 120° dihedral angle: The trapezoidal frame images are angled downward too greatly.

Problems:
- At first, the trapezoidal frames were too large. The trapezoid edges would overlap. I was able to fix this by trimming the trapezoidal sides so that they fit nicely.
- The stress of the nails and VEX Robotics metal pieces was sometimes too great for the cardboard. The nail would end up piercing all the way through the cardboard from the opposite side. I was able to fix this by attaching small VEX plates on the side where the nail enters the cardboard. With a plate on this side, the nail is unable to pierce through.

Plan:
- The webcam that is to be used with the compound eye frame has been purchased and will take a couple weeks to arrive. In the meantime, the Samsung Galaxy S4 cellphone camera will be used to capture images.
- A small holder for the webcam will be designed. This holder will be made of VEX metal pieces and will be angled so the webcam can capture images at the same angle at which the trapezoids are angled.
- Potential plan to create a new compound eye frame with a new dihedral angle. The compound eye frame with the 120° dihedral angle is too tall, thus the images captured on the trapezoidal sides do not meet with the top image taken from the octagon face:
   - A larger dihedral angle would meant the blind spots of the trapezoid faces would be covered. Yet, this angle must not be too large, as then the blind spots would be at the bottom of the images. Nevertheless, in the project's scenario, a drone is more likely to be seen at the higher angle rather than at a low angle.




Friday, January 15, 2016

STEM Team 2: Progress Report #2 Presentation

Adnan Khan
1/12/16

Click "LINK" below to see the Progress Report #2 presentation from January 12th, 2016:



Sunday, January 3, 2016

Weekly Progress Report #9

Weekly Progress Report #9
Adnan Khan
1/3/16

*Noah Borel is no longer working with STEM Team 2 on the Drone Defense System: Vision System. Noah is now working with STEM Team 11 on Machine Learning - Deep Learning.


Progress:

- Completed calculations, adjustments, and measurements for compound eye simulation frame. The cardboard frame will have holes to allow for an external webcam to be installed into frame to capture images at different angles.
   - Real model is to be two times larger than the scale depicted in the model diagram drawings.
- Solved previous problems with diagram involving angle of trapezoidal sides:


   - Began with cross-section sketch of a portion of the three-dimensional compound eye frame.
      - Yellow: Interior trapezoid from center of octagons to edge of octagons. Edge of octagons is in center of exterior trapezoid face.
      - Green: Interior trapezoid from center of octagons to edge of octagons. Edge of octagons is at the end of exterior trapezoid face.
      - Dark Blue: Right triangle face representing 1/16th of upper octagon. Upper octagon is octagon represented in other diagrams and is an actual piece of the frame.
      - Light Blue: Right triangle face representing 1/16th of lower octagon. Lower octagon is octagon formed when whole frame is put together. Lower octagon is not a piece of the frame but is just its base.
      - Red: 1/2 of exterior trapezoid. Is 1/2 of actual frame trapezoids that are to be constructed.



   - Calculations begin with the given information that the obtuse angle of the yellow trapezoid is 121°. From there, the desired angle is the obtuse angle of the red trapezoid. Desired angle then allows for the width of the red trapezoid to be calculated.
      - Desired angle = 102°

- Completed final diagram drawing for compound eye simulation frame:



   - Top-Down View:


 - View of compound eye frame from a bird's eye view. View is if the frame is all complete and the three-dimensional model was looked at from the top.
   - The height of the trapezoid is not 3 inches, but when looking down at the frame the x-axis distance between the sides of the trapezoids is 3 inches.
   - Once the frame is formed, all the edges of the trapezoids will touch. Thus, when looking down at the model, the trapezoids' obtuse angles will appear to be 112.5°.

- Top-Down View is used so that when frame pieces are assembled and the trapezoids are angled, the model is as depicted in the diagram.




   - Flattened View:

- View of compound eye frame before trapezoid pieces are angled downward. View is of flat trapezoid piece attached to the octagon.
   - The actual height of the trapezoids is 5.83 inches. The trapezoids' side lengths are 5.96 inches.
   - The actual obtuse angles of the trapezoids measure 102°. This is the same desired angle from the previous calculations. This angle then dictates the measure of the 2.07 inch side.
   - The dashed lines represent the sides of the trapezoids if the trapezoids' obtuse angles measured 112.5°. Since the trapezoid sides meet when they are angled downward, the obtuse angles have to be less than the 112.5° when flat.

- Flattened View is used in the construction of the frame pieces, as it directly gives their dimensions.




External Webcams:
- External webcam to be used to capture images at different angles. The frame is designed to both show the areas that the webcam is to capture and also to hold the webcam in place at the specific angles.
   - Cheap webcam is usable: Images captured will ultimately be blurred to mock the natural compound eye's behavior.
   - Webcam must be a common shape so that it can be easily held in place in the frame.
1. niceEshop Rotatable 5.0 Megapixel HD PC Laptop USB webcam camera
   - Shape: Spherical camera
   - Price: $5.59

Link:
http://www.amazon.com/niceEshop-Rotatable-Laptop-Microphone-Meeting/dp/B00NSAXYUW/ref=sr_1_1?s=pc&ie=UTF8&qid=1451871387&sr=1-1&keywords=external+webcam+without+stand

2. Kobwa High Resolution 5.0 Megapixel USB 2.0 Webcam PC Laptop HD Camera
   - Shape: Rectangular camera
   - Price: $4.19
Link:
http://www.amazon.com/Kobwa-Resolution-Webcam-Meeting-Keyring/dp/B010DE5J08/ref=sr_1_4?s=pc&ie=UTF8&qid=1451878579&sr=1-4&keywords=external+webcam+without+stand


Problems:
- Still working on actual frame. Cardboard was hard to obtain, as pieces have to be of specific sizes. Lack of available time has also led to the delay of the actual construction of the frame. Nevertheless, it will be completed in the next few days.

Plan:
- Create formula for calculating desired angle of trapezoids' obtuse angle with any measurement for the vertical trapezoid tilt angle. This will be useful if any angle measure adjustments need to be made later on.
- Complete construction of compound eye simulation frame.


Sunday, December 20, 2015

Weekly Progress Report #8

Weekly Progress Report #8
Adnan Khan and Noah Borel
12/20/15


Progress:
- Calculations, adjustments, and measurements made for compound eye simulation. The cardboard frame will have holes to allow an external webcam to be installed into frame to capture images at the different angles. **Real model is to be twice the scale of the model diagram drawings.**
   - Width = 10 inches.
   - Height = 5 inches.
   - Octagon top:
      - Width = 4 inches.
      - Side length  = 1.657 inches.
      - Longest length from center to edge of octagon = 2.165 inches.

   - Trapezoid sides:
      - Width when angled = 3 inches.
      - Height when angled = 5 inches.
      - Length = 5.83 inches.
      - Trapezoid extended from triangle with vertex at center of octagon:

      - Angle between octagon and angled trapezoid = 121°:


- Materials acquired for construction of frame for compound eye simulation:
   - Cardboard pieces
   - Scissors
   - Tape


Problems:
- The angle between the trapezoids is still uncertain. The trapezoids on the 2D plane would not be able to touch, as then the fold downward would make the trapezoids overlap.

   - A comparison was made between if the trapezoids were touching or if the trapezoids were thinner. The thinner trapezoid is what is needed, so that when folded downward, the trapezoid sides will meet.

   - Horizontal angle is sought for. This angle was unable to be found through comparison with the larger trapezoid.

   - Instead, angle is approximated by looking at boundary angles. On one end, if a rectangle is used, the horizontal angle is 90°, thus the vertical angle after folding is also 90°. On the other end, if the largest trapezoid is used, the horizontal angle is 112.5°, thus the vertical angle after folding is 180° because the fold would not be able to happen.
   - Approximation made with assumption that horizontal to vertical angle increase is linear. Based on rates of increase, every 1° increase of the horizontal angle means a 4° increase of the vertical angle: At 98°, the vertical angle is 122° which is a good approximation for the 121° desired angle.

   - Unsure if 98° is able to be used, as linear relationship between angles is uncertain.
- The length of the end of the trapezoid is still unknown. End length of trapezoid to be found once angle measurement is verified.


Plan:
- Begin physical construction of compound eye simulation frame:
   - Use VEX Robotics parts to give further strength to the cardboard pieces. Metal pieces are also bendable and can be fixed to be at certain angles.
- Further investigate issue with trapezoid angles and end length.