<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Aanshsavla on Medium]]></title>
        <description><![CDATA[Stories by Aanshsavla on Medium]]></description>
        <link>https://medium.com/@aanshsavla2453?source=rss-e07202247867------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*XyxFWJJDftcMuijDv1W5mg.jpeg</url>
            <title>Stories by Aanshsavla on Medium</title>
            <link>https://medium.com/@aanshsavla2453?source=rss-e07202247867------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 10:44:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aanshsavla2453/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[VirusTotal : Checks malicious files, URLs and IPs]]></title>
            <link>https://medium.com/@aanshsavla2453/virustotal-check-malicious-files-urls-and-ips-84525ebf5ccd?source=rss-e07202247867------2</link>
            <guid isPermaLink="false">https://medium.com/p/84525ebf5ccd</guid>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[cyber-security-awareness]]></category>
            <dc:creator><![CDATA[Aanshsavla]]></dc:creator>
            <pubDate>Sun, 09 Aug 2026 13:24:16 GMT</pubDate>
            <atom:updated>2026-08-12T11:04:31.440Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, I came across a tool called VirusTotal where it collects results from over 70 antivirus engines and website scanners into a single interface. We need to submit a file, a URL, a domain, or a file hash. VirusTotal will tell you whether any of those engines have flagged it as malicious or not. Let’s test it:</p><p>Check for the URL : <a href="http://www.openai.com/"><em>www.openai.com</em></a><em> </em>and click on search.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VtagZUA3Gn62t7HulMXIfQ.png" /></figure><p>It generates the report as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u_gvovAhy3kzrtCiRDtrUg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a1HdkZAXHFSJNAcoAxQeTg.png" /></figure><p>So we can see here that no vendor has marked the above url as malicious. So if you have any suspicious file, URL or IP address you can check it for malware or threat using VirusTotal. While it is not foolproof you can get an initial check.</p><p>But there is a catch!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jutRsOCEWvfxk8mhJoywaQ.png" /></figure><p>It says that the URL or file submitted will be shared across the community i.e. the URL or file will be stored in the VirusTotal database and can be downloaded by the paid users of the software. If the file or URL has some private data then this may cause data leakage. To resolve this issue, one needs to get a paid subscription of this software. Because the paid users will get a feature called as ʼ<em>Private Scanning’ </em>i.e. you can submit the file or URL without submitting it to the community.</p><p>Hence if you want to use this software it is recommended that you get a paid subscription and use private scanning option in it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84525ebf5ccd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Shodan : Search engine for Internet connected devices]]></title>
            <link>https://medium.com/@aanshsavla2453/shodan-search-engine-for-internet-connected-devices-c9143e31405b?source=rss-e07202247867------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9143e31405b</guid>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[cybersecurity-awareness]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Aanshsavla]]></dc:creator>
            <pubDate>Thu, 06 Aug 2026 13:02:06 GMT</pubDate>
            <atom:updated>2026-08-06T13:06:15.008Z</atom:updated>
            <content:encoded><![CDATA[<p>I came across this tool recently while doing a TryHackMe classroom in Cybersecurity-101 learning path. Initially when I read it, I didn’t understand what it meant. It says a ‘Search engine for Internet-of-things’. It scans the whole internet for networking equipments, industrial control systems, traffic cameras etc with a public network connection to see what’s running and where. I tried to explore more about it to get a proper explaination of what it does.</p><p>If we want to get a Wikipedia page we use Google as our search engine. Similarly if we want to search any connected device on the internet we use Shodan. For e.g. How hackers find vulnerable CCTV cameras for hacking? <br>They search for <em>webcamxp</em> on shodan. This will show you all unsecured web-cam connected to the internet. It could be CCTV cameras, smart gadgets, web-cam or any device which leaks some information on the internet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Os9oti2pCO_mk1BRamQeLw.png" /></figure><p>Another example is if we want to know which websites still run on http then type <em>http </em>in shodan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H1Nk6Jzs_0fJXH9IKHLOoA.png" /></figure><p>Let’s jump to the TryHackMe exercise:</p><p>Cybersecurity SEC 101</p><p><strong>Module :</strong> Start your cybersecurity journey <br><strong>Classroom : </strong>Search Skills<br><strong>Task-2</strong></p><p>This task involves a shodan simulation made by tryhackme. The task is to retrieve a list of web servers running Apache HTTP server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H9JDdgyXiyT65wW1c79v3g.png" /></figure><p>Now what is the domain name of the IP address 185.243.115.47?<br>We can see that the domain name is ‘<em>tryhackme.thm‘</em>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9143e31405b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Network Micro-segmentation in short: A weapon against lateral movement]]></title>
            <link>https://medium.com/@aanshsavla2453/network-micro-segmentation-in-short-a-weapon-against-lateral-movement-f4697dd8824d?source=rss-e07202247867------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4697dd8824d</guid>
            <category><![CDATA[microsegmentation]]></category>
            <category><![CDATA[network-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[zero-trust-architecture]]></category>
            <dc:creator><![CDATA[Aanshsavla]]></dc:creator>
            <pubDate>Mon, 02 Mar 2026 11:19:08 GMT</pubDate>
            <atom:updated>2026-03-02T11:19:08.634Z</atom:updated>
            <content:encoded><![CDATA[<p>Micro-segmentation is one of the key component of <strong>Zero Day Architecture</strong>. It helps in preventing lateral movement. Wait! But how?<br>First of all what is lateral movement?<br>Whenever an attacker penetrates a network either through a gateway or a firewall it needs to move through various end devices in the network laterally to reach its target. This is called as the lateral movement. This happens when the end devices in the network trust the attacker blindly and give him/her the access to move laterally. This can also lead to privilege escalation.</p><p>Micro-segmentation comes as a saviour for such lateral movements since it depends on 2 important network security strategies. First is the ‘Least Privilege Access’ and second is the ‘Zero trust’ i.e. ‘Never trust, always verify!’. If a firewall protects the entire network, then microsegmentation protects every device by creating granular policies for such devices.</p><p>This contains the lateral movement and restrains the privilege escalation of the attacker. Companies use softwares like Illumio, VMWare NSX, Akamai Guardicore Segmentation etc for Microsegmentation in hybrid environments.</p><p>Automated microsegmentation is a necessity, since size of the networks is increasing day by day with IoT devices being used by common people. Machine Learning especially clustering algorithms are used for this task.</p><p>For further information, you can read research articles and research papers on microsegmentation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4697dd8824d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Brute Force Attack on Caesar Cipher in Python.]]></title>
            <link>https://medium.com/@aanshsavla2453/brute-force-attack-on-caesar-cipher-in-python-5972cdcff5b6?source=rss-e07202247867------2</link>
            <guid isPermaLink="false">https://medium.com/p/5972cdcff5b6</guid>
            <category><![CDATA[cyber-security-awareness]]></category>
            <category><![CDATA[brute-force-attack]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[cyberattack]]></category>
            <dc:creator><![CDATA[Aanshsavla]]></dc:creator>
            <pubDate>Thu, 22 Aug 2024 17:47:59 GMT</pubDate>
            <atom:updated>2024-08-22T18:05:01.852Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tMBLEz5ba0Fs8vvszJWncg.jpeg" /></figure><p>The <strong>Caesar Cipher</strong> is a simple encryption technique that was used by Julius Caesar to send secret messages to his allies. It works by shifting the letters in the plaintext message by a certain number of positions, known as the “shift” or “key”. The Caesar Cipher technique is one of the earliest and simplest methods of encryption techniques.</p><p>To know more about Caesar Cipher follow this link:</p><p><a href="https://medium.com/@aanshsavla2453/caesar-cipher-a-classical-cryptography-technique-c393cadc8da2">https://medium.com/@aanshsavla2453/caesar-cipher-a-classical-cryptography-technique-c393cadc8da2</a></p><p><strong>If we have an encrypted message is it possible to decrypt message without knowing key?</strong></p><p>It is trivial since an immediate problem with caesar cipher is that the method is fixed and there are only 26 possible keys. Thus, anyone learning how Caesar encrypted his messages would be able to decrypt effortlessly. Thus we can hack the Caesar cipher by using a cryptanalytic technique called “brute-force”.</p><p><strong>What is brute-force attack?</strong></p><p>Nothing can stop a cryptanalyst from guessing one key, decrypting the ciphertext with that key, looking at the output, and if it is not the correct key then moving on to the next key. The technique of trying every possible decryption key is called a <strong>brute-force attack</strong>. It isn’t a very sophisticated hack, but through sheer effort the Caesar cipher can be broken.</p><p>Ideally, the ciphertext would never fall into anyone’s hands.</p><p>But according to cryptographer <strong>Auguste Kerckhoffs</strong>:</p><p><em>“A cryptosystem should be secure even if everything about the system, except the key, is public knowledge.”</em> This is known as <strong>Kerckhoff’s Principle.</strong></p><p>It was restated by Claude Shannon as <strong>Shannon’s Maxim</strong>:</p><p><em>“The enemy knows the system.”</em></p><p><strong>What is a key space?</strong></p><p>A keyspace, is the set of all valid, possible, distinct keys of a given cryptosystem. Brute force attack is about using all the keys in the key space one by one to decrypt the encrypted message and deriving some useful information out of it.</p><p>This brings us to a trivial, yet important, principle called the “ <em>sufficient key space principle</em> “:</p><p><em>“Any secure encryption scheme must have a key space that is not vulnerable to exhaustive search</em>.”</p><p><strong>Key length vs Key Space:</strong></p><p>Length of a key is the number of bits in the key and Key Space is the set of all the possible keys using a particular length of key.</p><p>e.g. <strong>Length of a key</strong> : 20 bits &amp; <strong>Key Space</strong> : 1,048,576</p><p>With a key of length n bits, there are 2^n possible keys.</p><p>If an exhaustive brute-force key search is the only possible attack. At a trillion attempts per second, it would take tens of thousands of years to carry out a brute-force attack against an 80-bit key. There are 1,208,925,819,614,629,174,706,176 possible keys.</p><p>But in Caesar Cipher the key space has only 26 possible keys. Now a python code will generate 26 possible decrypted messages. The probability of 2 messages being meaningful is very less. As the size of the encrypted message increases, this probability tends to 0.</p><p>Thus we can derive a meaningful message manually by checking each possible outcome. But if we want to make computer to know the meaningful message then we declare a constant variable which consists of repeated English Words. It can be as follows : <strong>{‘the’,’a’,’an’,’am’,’it’,’he’,’she’,’or’,’and’,….}.</strong> We can put as many words as much we want to.</p><p><strong>Consider an encrypted text:</strong> <strong>“Udg bhv xc Tcvaxhw iwtgt pgt iltcin hxm ztnh, xu ndj peean dct puitg pcdiwtg dc tcrgneits bhv pcs dqhtgkt imi dct du iwt igpchudgbts imi xh gtpspqat.”</strong></p><p>Decrypt following message using exhaustive key attack:</p><p><strong>Code:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Id_IHL9FtHIqfw01" /></figure><ul><li>cipher: Stores the cipher text</li><li>word_dict: Pre-defined dictionary to check for meaningfulness of decrypted statement.</li><li>give_point: Points are given to each decrypted text according to the pre-defined dictionary</li><li>max_point: Gives decrypted text with max_point</li><li>final_text : Stored final text</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FpZiRmUjAwkg0BG4" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7sVsz-F65Ok4LJ_1" /></figure><p><strong>Output:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TMAFMNNqgmvhuQUC" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WKNjageKQZfZQasB" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SOTAzylIgmlePe4c" /></figure><p><strong>Conclusion:</strong></p><p>Though Brute-Force Attack is a powerful technique to break Caesar-Cipher due to small key space but as the length of key increases the key space grows exponentially. Hence very powerful supercomputers or thousands of PCs are needed for brute force attack. Having large key size is a necessary condition for security but not a sufficient condition.</p><p>This approach underscores the importance of using more complex encryption methods in modern cryptography. While Caesar cipher and similar algorithms serve as important historical examples, they demonstrate why today’s secure communication requires stronger, more sophisticated encryption mechanisms to withstand brute force attacks and other cryptographic threats.</p><p><em>Originally published at </em><a href="https://aanshsavla.hashnode.dev/brute-force-attack-on-caesar-cipher-in-python"><em>https://aanshsavla.hashnode.dev</em></a><em> on August 22, 2024.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5972cdcff5b6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Caesar Cipher :A Classical Cryptography technique.]]></title>
            <link>https://medium.com/@aanshsavla2453/caesar-cipher-a-classical-cryptography-technique-c393cadc8da2?source=rss-e07202247867------2</link>
            <guid isPermaLink="false">https://medium.com/p/c393cadc8da2</guid>
            <category><![CDATA[cyber-security-awareness]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[cryptography]]></category>
            <dc:creator><![CDATA[Aanshsavla]]></dc:creator>
            <pubDate>Sat, 17 Aug 2024 17:20:20 GMT</pubDate>
            <atom:updated>2024-08-17T17:35:03.363Z</atom:updated>
            <content:encoded><![CDATA[<h3>Caesar Cipher :A Classical Cryptography technique.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E4dzYxDD_BMoEzw6cr1R5g.jpeg" /></figure><p>Cryptography has been a cornerstone of secure communication for centuries, allowing individuals to encode their messages in a way that only the intended recipients can understand. From all the cryptographic techniques, the most easy is the <strong>Caesar Cipher.</strong> It is named after a Roman general ‘ <strong>Julius Caesar</strong>’. It is a type of substitution cipher where each letter in a plain text is shifted a certain number of places up or down the alphabet. Despite its simplicity it laid the groundwork for many complex cryptographic methods.</p><p>For encryption and decryption we should convert all characters to equivalent numbers and the easiest way is to use the ASCII value of the alphabet to give them a number.</p><p>e.g. ASCII value of ‘a’ is 97. Hence the mapping is done as follows:</p><ul><li>a -&gt; ASCII(a) — ASCII(a) -&gt; 97–97 = 0</li><li>b -&gt; ASCII(b) — ASCII(a) -&gt; 98–97 = 1</li><li>c -&gt; ASCII(c) — ASCII(a) -&gt; 99–97 = 2</li><li>d -&gt;ASCII(d) — ASCII(a) -&gt; 100–97 = 3</li><li>……….</li><li>z -&gt; ASCII(z) — ASCII(a) -&gt; 122–97 = 25</li></ul><p>Similarly ASCII value of ‘A’ is 65. Hence the mapping is done as follows:</p><ul><li>A -&gt; ASCII(A) — ASCII(A) -&gt; 65–65 = 0</li><li>B -&gt; ASCII(B) — ASCII(A) -&gt; 66–65 = 1</li><li>C -&gt; ASCII(C) — ASCII(A) -&gt; 67–65 = 2</li><li>D -&gt; ASCII(D) — ASCII(A) -&gt; 68–65 = 3</li><li>……….</li><li>Z -&gt; ASCII(Z) — ASCII(A) -&gt; 90–65 = 25</li></ul><p><strong>Encryption Process:</strong></p><p>Let’s say we want to encrypt a message: “ <strong>Hello Z World!</strong>” with a shift of 3. Here we say that key = 3.</p><p>For encryption of a letter c we use enc(c) = (NumberMap(c) + 3)%26. Modulo(%) is used to rotate encryption of ‘Z’ back to ‘C’ if key = 3.</p><p>enc stands for encryption.</p><p><strong>1)Shift Letters by key = 3:</strong></p><ul><li>enc(H) -&gt;(7+3)%26 = 10 -&gt; K</li><li>enc(e) -&gt; (4+3)%26 = 7 -&gt; h</li><li>enc(l) -&gt; (11+3)%26 = 14 -&gt; o</li><li>enc(l) -&gt; (11+3)%26 = 14 -&gt; o</li><li>enc(o) -&gt; (14+3)%26 = 17 -&gt; r</li><li>enc(Z) -&gt; (25+3)%26 = 2 -&gt; C</li><li>enc(W) -&gt; (22+3)%26 = 25 -&gt; Z</li><li>enc(o) -&gt; (14+3)%26 = 17 -&gt; r</li><li>enc(r) -&gt; (17+3)%26 = 20 -&gt; u</li><li>enc(l) -&gt; (11+3)%26 = 14 -&gt; o</li><li>enc(d) -&gt; (3+3)%26 = 6 -&gt; g</li><li>! -&gt; !</li></ul><p><strong>2)Resulting Cipher Text:</strong></p><p>The message <strong>“Hello Z World!”</strong> is encrypted to <strong>“Khoor C Zruog!”.</strong></p><p><strong>Decryption Process:</strong></p><p>Now we decrypt the message “ <strong>Khoor C Zruog!</strong>” using the same key.</p><p>For decryption of a letter c we use dec(c) = (NumberMap(c) — 3)%26. Modulo(%) is used to rotate decryption of ‘C’ back to ‘Z’ if key = 3.</p><p><strong>1)Shift letters back by key = 3:</strong></p><ul><li>dec(K) -&gt; (10–3)%26 = 7 -&gt; H</li><li>dec(h) -&gt; (7–3)%26 = 4 -&gt; e</li><li>dec(o) -&gt; (14–3)%26 = 11 -&gt; l</li><li>dec(o) -&gt; (14–3)%26 = 11 -&gt; l</li><li>dec(r) -&gt; (17–3)%26 = 14 -&gt; o</li><li>dec(C) -&gt; (2–3)%26 = 25 -&gt; Z</li><li>dec(Z) -&gt; (25–3)%26 = 22 -&gt; W</li><li>dec(r) -&gt; (17–3)%26 = 14 -&gt; o</li><li>dec(u) -&gt; (20–3)%26 = 17 -&gt; r</li><li>dec(o) -&gt; (14–3)%26 = 11 -&gt; l</li><li>dec(g) -&gt; (6–3)%26 = 3 -&gt; d</li><li>! -&gt; !</li></ul><p><strong>2)Resulting Plain Text:</strong></p><p>The cipher text “ <strong>Khoor C Zruog!</strong>” is decrypted back to “ <strong>Hello World!</strong>”.</p><p>Let’s implement the code in python!</p><p>1)Code for encryption:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vEZepAn2dD7Qhruk" /></figure><p>ord() gives ASCII value of character and chr() gives character to a corresponding ASCII value.</p><p>Output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*o8NbZBJGRSwh58Zu" /></figure><p>2) Code for decryption:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UYiPP-RYQCmRsx_G" /></figure><p>Output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u5JQ5wN6LbgXoj7m" /></figure><p><strong>Advantage:</strong></p><ul><li>It is the simplest cryptographic technique making it easy to understand and implement.</li></ul><p><strong>Disadvantage:</strong></p><ul><li>It is extremely vulnerable to brute force attacks since there are 25 possible shifts.</li><li>Since it is a simple substitution cipher, hence the patterns in the plain text are preserved in the cipher text making it susceptible to frequency analysis.</li></ul><p><strong>Applications:</strong></p><p>Caesar Cipher is no longer used for serious encryption but its principles help illustrate fundamental concepts such as substitution and key-based encryption, which are foundational to understanding more advanced methods like the Vigenère cipher and modern-day algorithms like AES.</p><p><strong>Conclusion:</strong></p><p>By understanding the Caesar Cipher, we gain insights into the evolution of cryptography and the basic principles that underlie more complex encryption methods.</p><p><em>Originally published at </em><a href="https://aanshsavla.hashnode.dev/caesar-cipher-a-classical-cryptography-technique"><em>https://aanshsavla.hashnode.dev</em></a><em> on August 17, 2024.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c393cadc8da2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pneumonia Detection using Quantum Transfer Learning]]></title>
            <link>https://medium.com/@aanshsavla2453/pneumonia-detection-using-quantum-transfer-learning-3cec9c215b6e?source=rss-e07202247867------2</link>
            <guid isPermaLink="false">https://medium.com/p/3cec9c215b6e</guid>
            <category><![CDATA[image-processing]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[convolutional-network]]></category>
            <category><![CDATA[quantum-machine-learning]]></category>
            <dc:creator><![CDATA[Aanshsavla]]></dc:creator>
            <pubDate>Fri, 23 Feb 2024 11:41:53 GMT</pubDate>
            <atom:updated>2024-02-23T11:52:40.500Z</atom:updated>
            <content:encoded><![CDATA[<h4>Quantum Machine Learning for Medical and HealthCare</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*wFrlCTrtmvOeTG71-h7jlw.jpeg" /></figure><p>In this blog, we leverage transfer learning, a powerful machine learning technique, to enhance the performance of an image classifier. Classical and quantum networks are merged to create a hybrid architecture that gives practical usefulness of Quantum Machine Learning.</p><p>Transfer learning in a CNN is a machine learning technique that uses a pre-trained model to train a new model on a different task. Transfer learning is like borrowing knowledge from a smart friend. If they’re good at solving one problem, they can help you solve a similar problem too, with just a little extra guidance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/0*mOSeAcVWZdgZ-q6o" /></figure><ul><li>Network ‘A’ is trained on a dataset Da for a given task Ta.</li><li>Remove some final layers of the network. Now the remaining network A’ becomes a feature extractor.</li><li>We connect a trainable network B at the end of A’. This trainable network B can be classical or a variational quantum circuit. For this blog we use network B as a Variational Quantum Circuit.</li><li>We keep the weights or the trainable parameters of A’ as constant and only train the network B with a dataset Db for a new task Tb.</li></ul><p><strong>About the Model:</strong></p><p>The Quantum Circuit used is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IzESqtN4_Xo3XCQK" /></figure><p>A graphical representation of the full data processing pipeline:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5cICGLDqOFvlgGYw" /></figure><ul><li>As pre-trained network A we use ResNet18, a deep residual neural network which is pre-trained on the <em>ImageNet</em> dataset.</li><li>After removing its final layer we obtain A’. This will act as a pre-processing block which maps any input high-resolution image into 512 abstract features.</li><li>These features are classified by a 4-qubit “ <strong>dressed quantum circuit</strong> “ B. A variational quantum circuit sandwiched between two classical layers.</li><li>The hybrid model is trained, keeping A’ constant, on the <em>Pneumonia</em> dataset containing images of chest X-Rays of Pneumonia and Normal patients.</li></ul><p><strong>About the DataSet:</strong></p><p>The dataset used is named as ‘ <strong>Chest XRay Images (Pneumonia)’</strong> on Kaggle. The dataset is organized into 3 folders (train, test, val) and contains subfolders for each image category (Pneumonia/Normal). There are 5,863 X-Ray images (JPEG) and 2 categories (Pneumonia/Normal). For further detail refer the below link:</p><p><a href="https://www.kaggle.com/datasets/paultimothymooney/chest-xray-pneumonia?select=chest_xray">https://www.kaggle.com/datasets/paultimothymooney/chest-xray-pneumonia?select=chest_xray</a> <strong>Code:</strong></p><p>Let’s see the code for the above model.</p><ul><li>Importing the libraries:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zixeGrY52GoI7mY_" /></figure><ul><li>Initializing the hyperparameters:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*54an83rkItg26z98" /></figure><ul><li>Setting up the device on which the neural network is to be trained. Here we use only CPU. Also setting up the device for Quantum Node in Pennylane QML.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*85q559BTFLTG80FW" /></figure><ul><li>We resize each image to a specific size since all the images in the dataset are of different sizes which is not suitable for a neural network.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UUi62BJSFNJBOtNr" /></figure><ul><li>Importing dataset:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*m19xUgwPDYdrxE-C" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vLDY9AprZcMA-6Ku" /></figure><ul><li>Get the class names:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PWwBYyadIXc3PLi7" /></figure><ul><li>Loading the data:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vVZaun1nxRPSEZ-Q" /></figure><p>The torch.utils.data.DataLoader class is used in the PyTorch library to create a Python iterable over a dataset. It provides features such as batching, shuffling, and parallel loading of data, making it convenient for training and evaluating models with large datasets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*r4LmdWQNwR8ukEee" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nm_8sx8zDM9xBysI" /></figure><ul><li>Creating Quantum Variational Circuit</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8jBkdhbg_i1d7m7M" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9_vuBH56ut1XuPAm" /></figure><ul><li>Defining Dressed Quantum Circuit (Quantum Circuit sandwiched between 2 classical layers):</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6kJqSKpFHvBhrNoy" /></figure><p>We can now define a custom torch.nn.Module representing a <em>dressed</em> quantum circuit.</p><p>This is a concatenation of:</p><ul><li>A classical pre-processing layer ( nn.Linear).</li><li>A classical activation function ( torch.tanh).</li><li>A constant np.pi/2.0 scaling.</li><li>The previously defined quantum circuit ( quantum_net).</li><li>A classical post-processing layer ( nn.Linear).</li></ul><p>Build the Classical-Quantum Network:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6_c7d67ERrPTShFz" /></figure><p>Setting up the Loss function and Optimizer:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VU8Z35Tya0BlkR_v" /></figure><p>Define the Training function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Rlvc5-_-2fAcHxzS" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mIIVw7tr-HVHHpvL" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*W7KRPT8dw7GjwwIZ" /></figure><p>Train the Model:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9NBVLNnRcgXBTuFq" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cHhjASYYK3u1jNhf" /></figure><p>Tuning few other hyperparameters like quantum circuit depth, image size, number of epochs just gave the same accuracy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XYJZXOqprvYjRgXPWXPD3w.png" /></figure><p>However other classical CNN models and classical transfer learning methods gives better accuracy in less training time on the same dataset. Hence proving a quantum advantage over classical model will need a lot of research and time.</p><p><strong>Credit for the above blog:</strong> <strong>I have gained the information of the above blog from article written by Andrea Mari on Pennylane Website. Link to the article:</strong> <a href="https://pennylane.ai/qml/demos/tutorial_quantum_transfer_learning/">https://pennylane.ai/qml/demos/tutorial_quantum_transfer_learning/</a></p><p><em>Originally published at </em><a href="https://aanshsavla.hashnode.dev/pneumonia-detection-using-quantum-transfer-learning"><em>https://aanshsavla.hashnode.dev</em></a><em> on February 23, 2024.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3cec9c215b6e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Entanglement,Bell States and Ricochet Property(Transpose Trick) in Qiskit]]></title>
            <link>https://medium.com/@aanshsavla2453/entanglement-bell-states-and-ricochet-property-transpose-trick-in-qiskit-a42bd0a8c57e?source=rss-e07202247867------2</link>
            <guid isPermaLink="false">https://medium.com/p/a42bd0a8c57e</guid>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[quantum-mechanics]]></category>
            <category><![CDATA[entanglement]]></category>
            <category><![CDATA[quantum-physics]]></category>
            <category><![CDATA[quantum]]></category>
            <dc:creator><![CDATA[Aanshsavla]]></dc:creator>
            <pubDate>Mon, 11 Dec 2023 14:16:56 GMT</pubDate>
            <atom:updated>2023-12-11T14:23:06.678Z</atom:updated>
            <content:encoded><![CDATA[<h4>Qubits Intertwined</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*qt-J1EhDvMFiF0M6NLtvHg.jpeg" /></figure><p>Consider a circuit that has a Hadamard Gate followed by a CNOT gate:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/0*9nTY9keljTjQRDVY" /></figure><p>After applying the Hadamard Gate the quantum state of the circuit at L1 becomes(Using right-to-left ordering):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/0*MGEfDJuWexrSgF__.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/0*I31YkAa1pJ2xi5Cq" /></figure><p>Then apply the CNOT gate where the control qubit is q0 and and target gate is q1. So quantum state at L2:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/0*E4xzvmFy53DThmz4" /></figure><p>This is a special kind of quantum state where the state of one qubit determines the state of another. This is the mathematical definition of entanglement. Quantum entanglement is the phenomenon that occurs when a group of particles are generated, interact, or share spatial proximity in such a way that the quantum state of each particle of the group cannot be described independently of the state of the others, including when the particles are separated by a large distance.</p><p>The above state has some special notations which we will discuss later in this blog.</p><p><strong>Any entangled quantum state cannot be described as a tensor product of two quantum states OR Any entangled quantum state cannot be factorized.</strong></p><p><strong>Proof:</strong></p><p>Let’s say that the above-entangled state can be factorized into two quantum states</p><p>|Ψ⟩=a|0⟩+b|1⟩ and |φ⟩=c|0⟩+d|1⟩.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vgpxU7rE1HDAMCmA" /></figure><p>Now</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ezBxxZRukA2ZcXet.jpeg" /></figure><p>Hence any entangled quantum state cannot be expressed as a tensor product of two quantum states.</p><p>Any entangled quantum state is also called a Bell pair or an EPR pair(Einstein-Podolsky-Rosen) pair. John Bell, Albert Einstein, Boris Podolsky and Nathan Rosen pointed out some strange properties of entangled states.</p><p>The above-entangled state has the following mnemonic notation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HPJrOxylTQCRUrcv" /></figure><p>There are 3 more Bell-pairs or EPR pairs as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uHOes6J47qkChvsd" /></figure><p>Let’s analyze the circuit for these 3 Bell-pairs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gGt0JVVIfYdEtUMZ" /></figure><p>Upto L2 the quantum circuit is the same as the first bell pair quantum circuit. Hence at L2, the quantum state is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/0*aLAvElOWOBoL_xZx" /></figure><p>Now applying X gate at q0. Pauli-X gate inverts the qubits i.e. X|0⟩=|1⟩ and X|1⟩=|0⟩.</p><p>Hence the quantum state at L3:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/0*xmeVYf5v2mmbwjX2.jpeg" /></figure><p>This creates the bell state:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jGtMJLqBS-16RPEO" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J-vmbYs17mlQLDcM" /></figure><p>Upto L2 the quantum circuit is the same as the first bell pair quantum circuit. Hence at L2, the quantum state is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/0*aUFIOptNiwSYiKV3.jpeg" /></figure><p>Now applying Z gate at q0. Pauli-Z gate changes the phase of the qubit i.e. Z|0⟩=|0⟩ and Z|1⟩=-|1⟩. When q0=|0⟩ , Z(q0) = |0⟩ and when q0=|1⟩, Z(q0) = -|1⟩. Hence the quantum state at L3 is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/0*_KTnHOiStf7XcINp" /></figure><p>This creates the bell state:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*X79Fax_AAyTYLZXy.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qvXOtgcI51A4Bb-o.jpeg" /></figure><p>Upto L3 the quantum circuit is the same as the third bell pair quantum circuit. Hence at L3, the quantum state is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/0*KX1P_WkgUVTX583p.jpeg" /></figure><p>Now applying X gate at q0. Pauli-X gate inverts the qubits i.e. X|0⟩=|1⟩ and X|1⟩=|0⟩. Hence the quantum state at L4:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/0*wbLMgzjuG4ytY9HS.jpeg" /></figure><p>This creates the bell state:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GM-Gf7D_6QlVWHx3.jpeg" /></figure><p><strong>Generalized formula for Bell States:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/0*7uYS-d9pjaZ5us0p.jpeg" /></figure><p>Now entanglement is purely a quantum phenomenon. It is used in cryptography, superdense coding, and quantum teleportation. Consider the state:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/0*sDJUgc3Kkt5jf9AN" /></figure><p>At first glance, it looks like a bell pair or an entangled pair. Even this state cannot be expressed as a tensor product of two quantum states. It is not factorizable. However, this state is not entangled. This state is not even a quantum state.</p><p>The basic criteria for a state to be a quantum state is that</p><p>The above state is given by the vector:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/0*dG7HuUv63XohxxeP" /></figure><p>Entries in the vector are real numbers and real numbers are a subset of complex numbers. Hence the first criterion is satisfied.</p><p>Let’s calculate the norm of the vector:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YCVUUZNi36Mn47N7.jpeg" /></figure><p>Here the norm of the vector is not equal to 1. Hence it is not a quantum state. Since entanglement is purely a quantum phenomenon, the above state is not entangled.</p><p><strong>Ricochet Property or Transpose Trick:</strong></p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>Prerequisites:</strong></p><p>1)Linear Operators on the space: V⊗W (Tensor product between V and W)</p><p>Suppose |v⟩ and |w⟩ are vectors in V and W, and A and B are linear operators on V and W then we can define a linear operator A⊗B on V⊗W by the equation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7FBX7u0n7PsU67j9.jpeg" /></figure><p>The definition of A⊗B is then extended to all elements of the space V⊗W naturally to ensure the linearity of A⊗B, that is,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3ygMs-rxk25kbB4n" /></figure><p>2)Unit Impulse Function or Delta function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TGBBidJ4M-PxbrRO.jpeg" /></figure><p>3)The inner product of vectors as delta function:</p><p>|0⟩ and |1⟩ are two orthogonal vectors in the Z-basis.</p><ul><li>⟨0|0⟩=1</li><li>⟨1|1⟩=1</li><li>⟨0|1⟩=0</li><li>⟨1|0⟩=0</li></ul><p>If |j⟩ ∈ {|0⟩,|1⟩} and |k⟩ ∈ {|0⟩,|1⟩} then</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/0*OhlFHUOgWAa29duj" /></figure><p>The above inner product has a structure of delta function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/0*Ee8l4ZPqnYsKT94T.jpeg" /></figure><p>4)Outer Product: A ket vector multiplied by a bra vector.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xHkTBdGF3HP4zLcS.jpeg" /></figure><p>5)Matrix as Sum of Outer Products:</p><p>Consider the matrix:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5Q41JHzXN9Gd4WA_" /></figure><p>The above matrix ‘A’ can be expressed as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v-oKRBUoibyS5QGS" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fWMz1-8_0mLmnKZs.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pS5qFa2EMZd0_pIs.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/0*wTxEMNiypI9t4gkZ.jpeg" /></figure><p>Now consider the transpose of the matrix ‘A’:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/0*-9_PlrzHeVKzjsxO" /></figure><p>Expanding it as the sum of outer product:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*99_i4m_umnb-cD6g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6PTj9mrKrZ_SpPzv.jpeg" /></figure><p>According to the original matrix A the coefficient will be replaced as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CEy1A-xnuUafM09V" /></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>Ricochet Property:</strong></p><p>The ricochet property states that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BiDpcqqrbZRtpQz2.jpeg" /></figure><p>for any matrix (including non-unitary) A acting on any EPR state.</p><p><strong>Proof:</strong></p><p>We will express the EPR state as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vCyYmmMz-H9VIAYk" /></figure><p>A matrix can be written as the sum of the outer products as mentioned in prerequisite (4). Hence the matrix ‘A’ will be defined as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LfjIzmkLeqxOSZsz" /></figure><p>Considering LHS and Prerequisite (1):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*F8dDgQ6bRP4suk8S" /></figure><p>Substituting</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jlOoTkjQ6QU0Kv-T" /></figure><p>Since k ∈ {0,1} and j ∈ {0,1} the underlined inner product will be a delta function as mentioned in prerequisite (2)&amp;(3).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*x0t_o3ec-haowxuI.jpeg" /></figure><p>Since summation runs from 1 to n where ’n’ is the dimension of the ket vector or the dimension of the operator we can replace i and j.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eIJVhm7vItsOvl6-.jpeg" /></figure><p>Introducing the delta function to the equation again:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*k6KmWLi6Jnwg31w2.jpeg" /></figure><p>The bracket part is given as the transpose of the matrix A as given in prerequisite (5).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FbnaXIn-10QAY8do.jpeg" /></figure><p>Introducting Identity(I) matrix:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9v96O3GKP10EUpI-.jpeg" /></figure><p>Using prerequisite (1) in reverse order:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ddq0XiPAFb_XpI1J.jpeg" /></figure><p>Hence we have proved the ricochet property.</p><p>Let’s consider an example to see how it works:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ybAg1sAH7dqXRUFP" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yUMvkQ6HYb6xljbd.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_L3VzuSbcXp9bxB1.jpeg" /></figure><p>Now</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZBxBYGxFDPgKwAmM.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ukkrTIN_eWTYTUv1.jpeg" /></figure><p>Hence</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6zomKF3TESXGiOVp" /></figure><p><strong>Qiskit Code For Ricochet Property:</strong></p><p>Initial Import Statements: These are auto generated when you start a new notebook on the IBM qiskit lab. We can add few import statements if necessary.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lXJXgumw95ly97vO" /></figure><p>Let’s define ‘A’ as a random unitary matrix:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/0*t_AfT5OqoM0M0tXS" /></figure><p>This ‘A_op’ is a custom gate. Whenever we want to use such custom gates, we convert the ‘random_unitary’ into an ‘Instruction’ using the ‘.to_instruction()’ function. This allows you to use the gate as a building block and insert it into a quantum circuit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*7dI650b0OoQYqEct.png" /></figure><p>For ricochet property, we also need the transpose of the matrix ‘A’:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/0*0HkG9x9XfQ-Hro0T.png" /></figure><p>In qiskit, any unitary operator is defined as (Operator at q1) <strong>⊗</strong> (Operator at q0)</p><p>Consider circuit:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/0*WdNX1bwGie4eQzqO.png" /></figure><p>There is no operator at q0, hence the operator at q0 will be considered as an Identity(I) matrix. Hence the unitary operator of the circuit is (H <strong>⊗</strong> I).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZA-BSG1WVh19v43h.png" /></figure><p>Now consider circuit:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/0*3BXosh0tnB9WNOE9.png" /></figure><p>There is no operator at q1, hence the operator at q1 will be considered as an Identity(I) matrix. Hence the unitary operator of the circuit is (I <strong>⊗</strong> H).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4w_x9-WvnYzoo-hZ.png" /></figure><p>Now we will prepare the circuit:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/0*9fz0YnXGMZHpPrBP.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/0*3mLVe6GSNEn1jnh5.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JteppOYoxUEE62dF.png" /></figure><p>The circuit before the first barrier is the bell state. After the first barrier we have the operator:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/0*7rDJ-cVT49XO1pIZ.png" /></figure><p>Now we will prepare the circuit:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/0*P1rNMyP336NXjNwL.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0ZNWT_UeVZJx5Z4f.png" /></figure><p>The circuit before the first barrier is the bell state. After the first barrier we have the operator:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/0*DwgG0_1StQs0CmUV" /></figure><p>Now append these two circuits in a variable qc_list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/0*RxxehNo-qPiRiA1i.png" /></figure><p>AerSimulator: Aer is a high performance simulator for quantum circuits that includes noise models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*40i4i_Ckc-WieMX2.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*t7pWNq7JPGZUYIqh.png" /></figure><p>The quasi-probability distribution is a more flexible framework than the classical distribution. If we see the probability distribution, it seems that both the circuit gives the same probability distribution. Hence it satisfies the Ricochet property.</p><p><strong>Credit for the above blog:</strong> <strong>I have gained the information for the above blog from the book “Quantum Computing and Quantum Information” by Michael A. Nielsen and Isaac L. Chuang, IBM Quantum Explorer’s Program, Quantum Information Theory Notes by Nilanjana Datta at University of Cambridge.</strong></p><p><strong>Link to Quantum Information Theory Notes : </strong><a href="https://lim.physics.ucdavis.edu/teaching/files/qi-notes-partiii.pdf">https://lim.physics.ucdavis.edu/teaching/files/qi-notes-partiii.pdf</a></p><p><em>Originally published at </em><a href="https://aanshsavla.hashnode.dev/entanglementbell-states-and-ricochet-propertytranspose-trick-in-qiskit"><em>https://aanshsavla.hashnode.dev</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a42bd0a8c57e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[No-Cloning Theorem in Quantum Computing]]></title>
            <link>https://medium.com/@aanshsavla2453/no-cloning-theorem-in-quantum-computing-923f8015e89c?source=rss-e07202247867------2</link>
            <guid isPermaLink="false">https://medium.com/p/923f8015e89c</guid>
            <category><![CDATA[quantum-physics]]></category>
            <category><![CDATA[quantum-mechanics]]></category>
            <category><![CDATA[no-cloning-theorem]]></category>
            <category><![CDATA[quantum-computer]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <dc:creator><![CDATA[Aanshsavla]]></dc:creator>
            <pubDate>Wed, 06 Dec 2023 09:00:20 GMT</pubDate>
            <atom:updated>2023-12-23T17:18:55.761Z</atom:updated>
            <content:encoded><![CDATA[<h4>Is it possible to copy qubits?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*Lr66-da6t-zhKJtEb7YlfA.jpeg" /></figure><p>In the intricate realm of quantum mechanics, where particles are analyzed using probability and uncertainty, there exists a fundamental principle that challenges our classical intuition — the No Cloning Theorem. As we delve into the mysterious world of subatomic particles and the laws that govern their behavior, we are confronted with the profound notion that copying quantum information is not as straightforward as photocopying a document in the classical world.</p><p>At the heart of comprehending the No-Cloning Theorem lies a crucial gateway: the CNOT gate. In the classical realm, the act of copying a classical bit is facilitated by a classical CNOT gate. This gate, depicted in the figure below, operates by taking an input bit in an unknown state ‘x’ and a ‘scratchpad’ bit initialized to zero. The outcome of this process yields two bits, both residing in the identical state ‘x’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/0*9Tkv6f1wIBPaqT2d" /></figure><p>Suppose a qubit is in an unknown state given by:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VSZMmNZHjzkYJR6-" /></figure><p>We try to copy the qubit in the same manner by using a CNOT gate. The input state of the two qubits may be written as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*OjEpI53TwMx9Fm_LSWH1XA.png" /></figure><p>Applying the CNOT gate to the input state:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nOm3tQM83hyhF-ef" /></figure><p>The function of CNOT is to negate the second qubit(target qubit) when the first qubit(control qubit) is 1, and thus the output is simply:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cSOQr9KVrVP7ibE8" /></figure><p>Have we successfully copied the state |Ψ⟩? i.e.</p><p>Have we created the state |Ψ⟩ Ψ⟩ ?</p><p>It is possible to use quantum circuits to copy classical information i.e. |Ψ⟩=|0⟩ or |Ψ⟩=|1⟩. However, for a general state(classical and quantum), we see that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IL1wM6PWmZ_1XE70" /></figure><p>Equating the output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*glIWnrNSC_uaqZXS" /></figure><p>Unless ab=0 the ‘copying circuit’ above does not copy the quantum state. It turns out to be ‘impossible’ to make a copy of an unknown quantum state. This property, that qubits cannot be copied, is known as the <strong>No-Cloning theorem</strong> and it is one of the chief differences between quantum and classical information.</p><p><strong>Understanding the intuition of the No-Cloning theorem in terms of measurement:</strong></p><p>There is another way of looking at the failure of the circuit based on the intuition that the qubit somehow contains ‘hidden’ information not directly accessible to measurement. If we measure one of the qubits of the state a|00⟩+b|11⟩ we obtain either 0 or 1 with probabilities</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/0*XspWQ4Li9Y5a6IFK" /></figure><p>However, once one qubit is measured, the state of the other one is completely determined, and no additional information can be gained about a and b. In this case, the extra hidden information carried in the original qubit |Ψ⟩ was lost in the first measurement and cannot be regained. If, however, the qubit had been copied, then the state of the other qubit should still contain some of that hidden information. Therefore a copy cannot be created.</p><p><strong>Proof of No-Cloning Theorem:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/0*M5xc4Q8HhkDSFg82" /></figure><p>Suppose, we have a quantum machine with two slots A and B. Slot A is the <strong>data slot</strong> and it starts in an unknown but pure quantum state |Ψ⟩. This is the state which is to be copied into slot B which is the target slot. Thus the initial state of the copying machine is given as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/0*pfcJxu84nABBnUBs" /></figure><p>Some unitary evolution U now affects the copying procedure, ideally,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DpNgub2Aj3WWp4pjeFZtrw.jpeg" /></figure><p>Suppose this copying procedure works for two particular pure states |Ψ⟩ and |φ⟩. Then we have:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_WGJf4-5824Q9R3I" /></figure><p>Taking the transpose-conjugate of the first equation we get:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K2-1eKOYvMR9DmkZ" /></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>Note:</strong></p><p>1)The inner product of two tensor products is given as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QJJ9h_HSUDNu0wfV" /></figure><p>2)If |i⟩ and |j⟩ are two orthogonal vectors then the following are the inner product values:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FZBm3CdgJbEpskEx" /></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>Now taking the inner product of equations (2) and (3):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TR7MfMrNNIj4cq_W" /></figure><p>Now the above equation is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/0*GBxckxfp3rG-ODfg" /></figure><p>It has the following two solutions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/0*x2cdt3Zuiv9BOj1o" /></figure><p>Hence:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ByMQ-yIgOdSj24bP4PVo4g.jpeg" /></figure><p>Thus a cloning device can only clone states, which are orthogonal to one another, and therefore a general quantum cloning device is impossible. Hence it is impossible to clone the following quantum states with the same cloning device:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UgvXentPAE1voFeP" /></figure><p>Hence we have shown that it is impossible to perfectly clone an unknown quantum state using unitary evolution. The cloning of non-orthogonal pure states remains impossible unless one is willing to tolerate a finite loss of fidelity in the copied states.</p><p><strong>Credit for the above blog:</strong> <strong>I have gained the information for the above blog from the book “Quantum Computing and Quantum Information” by Michael A. Nielsen and Isaac L. Chuang.</strong></p><p><em>Originally published at </em><a href="https://hashnode.com/post/clpsi1ueo000007ju0vit5pb0"><em>https://aanshsavla.hashnode.dev</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=923f8015e89c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is data in Artificial Intelligence?]]></title>
            <link>https://medium.com/@aanshsavla2453/what-is-data-in-artificial-intelligence-5957703cc510?source=rss-e07202247867------2</link>
            <guid isPermaLink="false">https://medium.com/p/5957703cc510</guid>
            <category><![CDATA[machine-learning-ai]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Aanshsavla]]></dc:creator>
            <pubDate>Mon, 27 Nov 2023 13:01:12 GMT</pubDate>
            <atom:updated>2023-11-27T13:01:12.589Z</atom:updated>
            <content:encoded><![CDATA[<h4>‘AI for Everyone’ by DeepLearning.ai</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HPW8VLu0nIRFWh6m3RpwCQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YfYM3UZPEDILTUo6Yerzlg.jpeg" /></figure><p><em>“Data is really important for building AI systems. But what data is?”</em></p><p><strong>Introduction</strong></p><p>A table of data is often called a dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*r7Q7jr1KevW_i4ZU" /></figure><p>If we aim to determine the pricing of houses for buying or selling, we can gather a dataset in the format mentioned. This dataset may be organized in an MS Excel spreadsheet, where one column represents the size of the house in square feet or square meters, and another column represents the corresponding house prices. In the process of developing an AI or Machine Learning system to assist in setting house prices or assessing appropriate pricing, we can designate the house size as A and the house price as B. The objective is to train the AI system to learn the mapping from input (A) to output (B).</p><p>Now, rather than just pricing a house based on its size, we might also collect data on the number of bedrooms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c8sRFxmgfu_1l0Ck" /></figure><p>In that case, A can be both of these first two columns, and B can be just the price of the house. So, given the dataset, it is up to the business use case to decide what is A and what is B. If we have a certain budget and if we want to decide what is the size of the house in square feet then that would be a different choice of A and B.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Oos9wbstaJrWlpfb" /></figure><p>A: How much does someone spend?</p><p>B: Size of the house in square feet</p><p>Let’s see another dataset:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/0*8qMPHiwmVPWc9Jvz" /><figcaption><em>The above image is taken from the slides created by </em><a href="http://deeplearning.ai/"><em>Deeplearning.ai</em></a></figcaption></figure><p>If we want to build an AI system that detects cats then we collect a dataset as above where input A is a set of different images and output B is are labels. 1st row and 3rd row are cats whereas 2nd row and 4th row are not cats.</p><p><strong>How do we acquire data?</strong></p><ul><li><strong>By manual labeling:</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KCI0k7Ln2EsFdm_P" /><figcaption><em>The above image is taken from the slides created by </em><a href="http://deeplearning.ai/"><em>Deeplearning.ai</em></a></figcaption></figure><p>We could gather a series of images, like the ones shown here, and proceed to label each of them. For instance, we determine that the first and third images depict cats, while the second and fourth do not. This manual labeling process establishes a dataset for training a cat detector. Creating such datasets typically requires more than just four pictures; it often involves collecting hundreds or even thousands. While manual labeling can be a meticulous task, it remains a reliable and established method for generating datasets.</p><ul><li><strong>By observing user behavior:</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EZR1II-Uk2C7ME4F" /><figcaption><em>The above image is taken from the slides created by </em><a href="http://deeplearning.ai/"><em>Deeplearning.ai</em></a></figcaption></figure><p>If we operate an online retail website, we can simply observe user interactions to determine whether they make a purchase or not. By capturing this buying behavior, we can generate a dataset that includes details such as user ID, the time of the user’s website visit, the offered product price, and whether the user completed a purchase.</p><ul><li><strong>By observing machine behavior:</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-itJVJsfHSZy0HF_" /><figcaption><em>The above image is taken from the slides created by </em><a href="http://deeplearning.ai/"><em>Deeplearning.ai</em></a></figcaption></figure><p>If we run a large machine in a factory and we want to predict if a machine is about to fail or have a fault, then just by observing the behavior of a machine, we can then record a dataset like this. There’s a machine ID, there’s a temperature of the machine, there’s a pressure within the machine, and then did the machine fail or not. In this case, we can consider (machine, temperature, pressure) as A and machine fault as B and map A-&gt;B. By this, we can do preventative maintenance on the machine.</p><ul><li><strong>Download from Websites or Partnerships</strong></li></ul><p>Open internet helps in downloading data ranging from computer vision or image datasets to self-driving car datasets, speech recognition datasets, medical imaging data sets to many many more keeping in mind the licensing and copyright. We can also collect the data from a partner or a factory we work with.</p><p><strong>Use and Mis-use of data:</strong></p><p>The mishandling of data doesn’t necessarily imply malicious intent; it can also result from inefficient utilization of data.</p><ul><li>Some companies delay leveraging their data for AI until they collect a substantial amount, deeming it ‘perfect.’ However, a more effective approach is to provide the AI team with data as soon as a reasonable quantity is accumulated. This enables the AI team to offer insights to the IT team regarding the types of data needed and the required IT infrastructure.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/0*QMFppWhZxa3JznhD" /></figure><p>Illustrating the aforementioned concept, the IT team initially supplies the AI team with data from a factory machine at 10-minute intervals. Nevertheless, the AI team provides feedback to the IT team, recommending more frequent data feeds, such as every minute, for improved preventive maintenance systems.</p><p>Hence seek feedback from AI at an early stage, as it can assist in steering the development of the IT infrastructure.</p><ul><li>Some company CEOs understand the significance of staying abreast of current trends. They believe that accumulating substantial data makes it valuable for the AI team. However, this assumption doesn’t consistently hold true. While having more data is often advantageous, merely collecting terabytes or gigabytes isn’t sufficient to render it valuable for an AI team. The strategy of overinvesting in data acquisition without active involvement from the AI team is not advisable. Instead, it is recommended to consult the AI team to determine which data holds value for them.</li></ul><p><strong>Data is Messy:</strong></p><ul><li>Data Problems:</li></ul><p>You might be familiar with the saying ‘garbage in, garbage out.’ In the context of AI, having poor-quality data can lead to the system learning inaccuracies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AqXfMtHY1cw8B0kq" /><figcaption><em>The above image is taken from the slides created by </em><a href="http://deeplearning.ai/"><em>Deeplearning.ai</em></a></figcaption></figure><p>Consider the above data set of sizes of houses, number of bedrooms, and the price.</p><ol><li>We can have incorrect labels or incorrect data. In the second row, the house is priced at $0.001 multiplied by 1000, resulting in $1. However, it is implausible for any house to be sold for just $1, indicating that this data is inaccurate.</li><li>In the 3rd, 4th, 5th, and 6th rows, there are values marked as unknown, commonly referred to as missing values. Various techniques exist to address and manage such instances of missing values.</li></ol><p>So, the AI team will need to figure out how to clean up the data or how to deal with these incorrect labels and all missing values.</p><ul><li>Multiple types of data.</li></ul><p>Different types of data exist, such as images, audio, and text, which humans can interpret effortlessly. This falls under the category known as <strong>unstructured data</strong>. Specialized AI techniques can process unstructured data, enabling tasks like image recognition, speech understanding, or spam detection in emails. On the other hand, there is <strong>structured data</strong>, exemplified by datasets formatted like a spreadsheet. Dealing with unstructured and structured data involves distinct AI techniques, but both types can be effectively addressed by AI methodologies.</p><p>In this blog, we discovered what data is and learned to avoid its misuse, such as over-investing in IT infrastructure without ensuring its relevance to future AI applications. We emphasized that data can be messy, but a proficient AI team can assist in navigating these challenges.</p><p><strong>Credit for the above blog: I have gained the knowledge for the above blog from a course ‘AI for everyone’ by Andrew Ng. Thank you </strong><a href="http://deeplearning.ai/"><strong>Deeplearning.ai</strong></a><strong> for such a wonderful course.</strong></p><p><em>Originally published at </em><a href="https://aanshsavla.hashnode.dev/what-is-data-in-artificial-intelligence"><em>https://aanshsavla.hashnode.dev</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5957703cc510" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning (Supervised Learning)]]></title>
            <link>https://medium.com/@aanshsavla2453/machine-learning-supervised-learning-ad9e7de88a24?source=rss-e07202247867------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad9e7de88a24</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning-ai]]></category>
            <category><![CDATA[supervised-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-neural-network]]></category>
            <dc:creator><![CDATA[Aanshsavla]]></dc:creator>
            <pubDate>Fri, 24 Nov 2023 13:05:43 GMT</pubDate>
            <atom:updated>2023-11-24T13:33:54.246Z</atom:updated>
            <content:encoded><![CDATA[<h4>‘AI for Everyone’ by DeepLearning.ai</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dtq3c2tJTAqOaX4csBE7-w.jpeg" /></figure><p>The rise of AI has been largely driven by one tool in AI called machine learning. The most commonly used type of machine learning is a type of AI that learns A-to-B or input-to-output mappings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*273bCw8ftvn-ELXx" /></figure><p>This is called Supervised Learning.</p><p>Let’s discuss some examples of supervised learning.</p><p><strong>1) Spam Filter:</strong> Spam filters are designed to identify emails that attackers or marketers use to send unwanted or dangerous content. It needs some knowledge of Natural Language Processing(NLP).</p><p>Read the article: “<a href="https://towardsdatascience.com/email-spam-detection-1-2-b0e06a5c0472"><strong>How To Design A Spam Filtering System with Machine Learning Algorithm</strong></a>”</p><ul><li>Input: Email</li><li>Output: If it is spam then output is 1 or else output is 0.</li></ul><p><strong>2) Speech Recognition:</strong> Speech recognition is a machine’s ability to listen to spoken words and identify them. E.g. Google Home, Amazon Echo, Apple Siri. It also needs some knowledge of NLP.</p><p>Read the article: “<a href="https://towardsdatascience.com/audio-deep-learning-made-simple-automatic-speech-recognition-asr-how-it-works-716cfce4c706"><strong>Audio Deep Learning Made Simple: Automatic Speech Recognition (ASR), How it Works</strong></a>”</p><ul><li>Input: Audio Clip</li><li>Output: Text Transcript</li></ul><p><strong>3) Machine Translation:</strong> Machine translation is the process of using artificial intelligence to automatically translate text from one language to another without human involvement.</p><p>Read the article: “<a href="https://towardsdatascience.com/language-translation-with-rnns-d84d43b40571"><strong>Language Translation with RNNs</strong></a>”</p><ul><li>Input: Text in English Language</li><li>Output: Text in any different language like Spanish, Chinese etc</li></ul><p><strong>4) Online Advertising:</strong> It is the most lucrative form of supervised learning. It helps target ads to specific audiences based on their behavior, interests or demographics. AI system predicts whether users will click on the ad or not.</p><p>Read the article: “<a href="https://appen.com/blog/machine-learning-in-advertising/"><strong>Machine Learning in Advertising — Predictive Targeting and Moderation</strong></a>”</p><ul><li>Input: Some information about the user and some information about the ad.</li><li>Output: If the user clicks then the output is 1 or else the output is 0.</li></ul><p>This type of application has a huge impact on the economy.</p><p><strong>5) Self-Driving Car:</strong> Driverless cars can identify objects, interpret situations, and make decisions based on object detection and object classification algorithms.</p><p>Read the article: “<a href="https://mindy-support.com/news-post/how-machine-learning-in-automotive-makes-self-driving-cars-a-reality/"><strong>How Machine Learning in Automotive Makes Self-Driving Cars a Reality</strong></a>”</p><ul><li>Input: Images captured or some information from the radar or the sensors</li><li>Output: Position of the cars and obstacles</li></ul><p>This can help to avoid other cars and obstacles while driving.</p><p><strong>6) Visual Inspection: </strong>Visual inspection using machine learning is a process that uses AI to analyze image and video data to automatically verify product quality. It can help manufacturers detect product defects, improve quality control.</p><p>Read the article: “<a href="https://marutitech.com/ai-visual-inspection-for-defect-detection/"><strong>What is AI Visual Inspection for Defect Detection?: A Deep Dive</strong></a>”</p><ul><li>Input: Image of a product e.g. cell phone</li><li>Output: If the device has some scratch or dent then the output is 1 or 0.</li></ul><p>The idea of supervised learning has been through many decades but it has taken off recently. Consider the below graph:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*X_bExWOaPXRKbtth" /></figure><p>On the horizontal axis, we plot the amount of data we have for the task. So for the speech recognition system, it can be the audio data. Over the last few decades, the amount of data we have access to has grown due to the rise of the computers and rise of the internet.</p><p>On the vertical axis, we plot the performance of the AI system. If we use a traditional AI system, then the performance of that system is given by the red curve. Initially, the performance of the system increases, but as we feed more and more data the performance remains constant and does not improve further. So the speech recognition system won’t be accurate in giving the exact transcripts or the online advertisement system won’t be very accurate in showing the most relevant ads though we feed on more data.</p><p>However, AI has recently taken off due to the rise of neural networks and deep learning. If we train a small neural network then the performance is given in blue curve. The performance is better than the traditional AI system. If we increase the size of the neural network then the performance of the AI system becomes better and better with an increase in the amount of the data.</p><p>At any particular point, performance is given as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*chL0d7qk8xA_Q8WM" /></figure><p>For complicated applications like self-driving cars or speech recognition products where having a highly accurate performance is important, we need a much larger neural network to make speech recognition products much more acceptable to users and much more valuable for companies.</p><p>Consider the following graph:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6p8QXacgtE8V5aes" /></figure><p>For the best possible levels of performance, we need 2 things:</p><p>Due to the requirement of huge amounts of data for high performance, we hear the term Big Data.</p><p><strong>Big Data:</strong> The definition of big data is data that contains greater variety, arriving in increasing volumes and with more velocity.</p><p>Another thing is that we must be able to train large neural networks. So the rise of fast computers and specialized processors including graphical processing units (GPUs) has enabled many companies to train large neural nets on a large enough amount of data to get very good performance and drive business value.</p><p>Hence, the most important idea in AI is machine learning(ML) and for any AI system to have high performance needs a large neural network and a huge amount of data.</p><p><strong>Credit for the above blog: I have gained the knowledge for the above blog from a course ‘AI for everyone’ by Andrew Ng. Thank you </strong><a href="http://deeplearning.ai/"><strong>Deeplearning.ai</strong></a><strong> for such a wonderful course.</strong></p><p><em>Originally published at </em><a href="https://aanshsavla.hashnode.dev/machine-learning-supervised-learning"><em>https://aanshsavla.hashnode.dev</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad9e7de88a24" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>